55xGenComm1_29
14
Exception Responses
Any function may return an exception response if it does not complete successfully, as defined in
the Modbus protocol.
1. The Modbus Protocol Reference Guide defines the meanings of exception codes 1 to 8 and
the Open Modbus/TCP Specification defines error codes 10 and 11, but unfortunately these
meanings are ambiguous, so cannot convey accurate information about the error. This
standard, therefore, defines an extended exception code and exception address, which can be
read from the slave device at registers 0 and 1 respectively.
2. A slave device will only return exception code 1, 2 or 6 if a function fails, in the case of
exceptions 1 and 2 the extended exception code and address should then be read to find more
information about the exception.
3. The extended exception code will be set to the result of the last message, which implies that a
successful read of this register will clear it, this occurs after the read has been performed.
4. The extended exception address will be set to the address of the register that caused the
exception, or to 0 if inappropriate. This allows precise identification of the cause when reading
or writing multiple registers.
5. The extended exception code and address must both be read by a single message, reading
them individually would meaningless, as they would each refer to different messages.
6. Extended exception codes 1-255 can be generated by any slave device but codes above 256
can only be generated by a hub.
7. Exception code 6 (Slave device busy) will be returned whenever a slave device is completely
unable to reply to a query because it is occupied, in this case the extended exception codes
cannot necessarily be read. An example of this is when a slave device is serving a master of a
higher priority than the one that made the query.
8. In the case of a hub the extended exception registers contain the result of a query to the hub,
they are not changed by a query to a satellite. The corresponding registers in the satellite must
be read to obtain the result of such a query.
Exception response message
Byte Field name Notes
0 Slave address
1 Function code +128 Top bit is set
2 Exception code 1 - Illegal function code
2 - Illegal data address
6 - Slave device busy
3-4 Error check CRC