2 Modbus protocol description
22
2.8 Error messages
2.8.1 Modbus error codes
Requirements for Modbus communication
The following conditions must be met for a slave to receive, process, and respond to queries:
• Baud rate and/or data format of master and slave must match.
• The correct slave address must be used in the query.
• Slave devices respond only after a successful checksum check of the query by the slave.
Otherwise, the query is rejected by the slave.
• The data query from the master must be complete and conform to the Modbus protocol.
• The number of words to be read must be greater than 0.
Error codes
If the data query from the master has been received by the slave without transmission errors
but cannot be processed, the slave responds with an error code. The following error codes may
occur:
• 01 = Invalid function; for the function codes that device type 703571 supports, see Chapter
2.4 "Function codes", page 11.
• 02 = Invalid address or too many words, or bit should be read or written
• 03 = Value is outside the admissible range
• 08 = Value is write-protected
Response to malfunction
The function code is ORed with 0x80. This sets the most significant byte (msb) to 1.
Example
Response with error code 02, because the address 0x2345 does not exist.
Slave address Function XX OR 80h Error code Checksum CRC
1 byte 1 byte 1 byte 2 bytes
Data query:
01 06 23 45 00 01 52 5B
Slave Write word Word address Word value CRC
Response (with error code 2):
01 86 02 C3 A1
Slave OR function Errors CRC