DOCA0172EN-12

Modbus TCP/IP and Modbus-SL Exception Codes

Exception Responses

Exception responses issued by the client or a server can be the result of data processing errors. One of the following events can occur after a request from the client:

  • If the server receives the request from the client without a communication error and manages the request correctly, it sends back a normal response.

  • If the server does not receive the request from the client due to a communication error, it does not send back a response. The client program ends by applying a time delay condition to the request.

  • If the server receives the request from the client but detects a communication error, it does not send back a response. The client program ends by applying a time delay condition to the request.

  • If the server receives the request from the client without a communication error but cannot perform it (for example, the request consists of reading a register that does not exist), the server sends back an exception response to inform the client of the nature of the error.

Exception Frame

The server sends an exception frame to the client to indicate an exception response. An exception response consists of four fields:

Field

Definition

Size

1

Server number

1 byte

2

Exception function code

1 byte

3

Exception code

n bytes

4

Check

2 bytes

Managing Modbus Exceptions

The exception response frame consists of two fields that distinguish it from a normal response frame:

  • The exception function code is the same as the original request function code plus 128 (0x80).

  • The exception code depends on the communication error detected by the server.

The following table describes the exception codes managed by the wireless devices of the EcoStruxure Panel Server :

Exception Code

Name

Description

01

Illegal function

The function code received in the request is not a permitted action for the server. It is possible that the server is in an unsuitable state to process a specific request.

02

Illegal data address

The data address received by the server is not a permitted address for the server.

03

Illegal data value

The value of the request data field is not a permitted value for the server.

04

Server device failure

The server is unable to perform a required action due to an unrecoverable error.

06

Server device busy

The server is busy processing another command. The client should send the request when the server is free.

NOTE: For more information, a detailed description of the Modbus protocol is available on www.modbus.org.

Access to Variables

A Modbus variable can have the following attributes:

  • Read-only

  • Read/write

  • Write-only

NOTE: An attempt to write to a read-only variable generates an exception response.
QR Code is a registered trademark of DENSO WAVE INCORPORATED in Japan and other countries.

Was this helpful?