DOCA0105EN-09

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 without a communication error and can handle the request correctly, it will return a normal response.

  • If the slave (server) does not receive the request due to a communication error, it will not return any response. The master program will eventually process a timeout condition for the request.

  • If the slave (server) receives the request but detects a communication error, it will not return a response. The master program will eventually processes a timeout condition for the request.

  • If the slave (server) receives the request without a communication error, but cannot handle it correctly (for example, the request is to read a register that does not exist), the slave will return an exception response to inform the master of the nature of the error.

Exception Frame

The slave (server) sends an exception frame to the master (client) 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

  • 1–247: Unique destination

2

Exception function code

1 byte

Request function code + 128 (0x80)

3

Exception code

n bytes

See next paragraph

4

CRC error checking

2 bytes

CRC16 (to check the content of the entire transmission messages)

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 (server) 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

The guide describes the registers available for each IMU module with the latest firmware version. When a register described in the guide is not implemented in an IMU module that has an old firmware version, an exception response is returned with the exception code 02 (0x02), illegal data address.

You can update the firmware of the IMU modules by using the EcoStruxure Power Commission software.

QR Code is a registered trademark of DENSO WAVE INCORPORATED in Japan and other countries.

Was this helpful?