Modbus Exception Codes
Exception Responses
Exception responses from either the master (client) or a slave (server) can result from data processing errors. One of the following events can occur after a request from the master (client):
-
If the slave (server) receives the request from the master (client) without a communication error and can handle the request correctly, it returns a normal response.
-
If the slave (server) does not receive the request from the master (client) due to a communication error, it does not return a response. The master program eventually processes a timeout condition for the request.
-
If the slave (server) receives the request from the master (client) but detects a communication error, it does not return a response. The master program eventually processes a timeout condition for the request.
-
If the slave (server) receives the request from the master (client) without a communication error, but cannot handle it (for example, the request is to read a register that does not exist), the slave returns an exception response to inform the master of the nature of the error.
Exception Frame
The slave sends an exception frame to the master to report an exception response. An exception frame is composed of 4 fields:
Field |
Definition |
Size |
Description |
---|---|---|---|
1 |
Slave number |
1 byte |
Destination of the request
|
2 |
Exception function code |
1 byte |
Request function code + 128 (0x80) |
3 |
Exception code |
n bytes |
See next paragraph |
4 |
Check |
2 bytes |
CRC16 (to check transmission errors) |
Exception Codes
The exception response frame has two fields that differentiate it from a normal response frame:
-
The exception function code of the exception response is equal to the function code of the original request plus 128 (0x80).
-
The exception code depends on the communication error that the slave encounters.
The following table describes the exception codes handled by the circuit breaker:
Exception Code |
Name |
Description |
---|---|---|
01 (0x01) |
Illegal function |
The function code received in the request is not an authorized action for the slave. The slave may be in the wrong state to process a specific request. |
02 (0x02) |
Illegal data address |
The data address received by the slave is not an authorized address for the slave. |
03 (0x03) |
Illegal data value |
The value in the request data field is not an authorized value for the slave. |
04 (0x04) |
Slave device failure |
The slave fails to perform a requested action because of an unrecoverable error. |
05 (0x05) |
Acknowledge |
The slave accepts the request but needs a long time to process it. |
06 (0x06) |
Slave device busy |
The slave is busy processing another command. The master must send the request once the slave is available. |
07 (0x07) |
Negative acknowledgment |
The slave cannot perform the programming request sent by the master. |
08 (0x08) |
Memory parity error |
The slave detects a parity error in the memory when attempting to read extended memory. |
10 (0x0A) |
Gateway path unavailable |
The gateway is overloaded or not correctly configured. |
11 (0x0B) |
Gateway target device failed to respond |
The slave is not present on the network. |
Illegal Data Address
This guide describes the registers available for each IMU module with the latest firmware revision. When a register described in the guide is not implemented in an IMU module that has an old firmware revision, an exception response is returned with the exception code 02 (0x02), illegal data address.
You can upgrade the firmware of the IMU modules by using the EcoStruxure Power Commission software.