beautypg.com

6 read input status (0x02), 7 error handling, Table 4 exception response – Emerson MONITORING OpenComms User Manual

Page 29: Modbus packet formats, Read input status (0x02), Error handling, Table 4, Exception response

background image

Modbus Communications and Connectivity

23

5.4.6 Read Input Status (0x02)

The input status block contains read-only status accessible to the

users. It can be read by using function code 0x02 in the same as read-

ing coil status.

5.4.7 Error Handling

According to the Modbus specification, the OpenComms NIC composes

the following exception responses to the client if an exception or error

occurs.

Exception codes are:

• 01: Unsupported function code
• 02: Out-of-range data addresses
• 03: Out-of-range data value (write to holding registers)
• 04: There is currently no LMD device connected to the server
• 05: Server is composing response but cannot response to the client

within the time limit required by Modbus specification.

Modbus Packet Formats

Each Modbus packet consists of the following fields:

• Device Address
• Function Code
• Data Field(s)
• Error Check Field

Device Address
The address field immediately follows the beginning of the frame and

consists of 8-bits. These bits indicate the user assigned address of the

slave device that is to receive the message sent by the attached master

device.
Each slave OpenComms NIC must be assigned a unique address and

only the addressed slave will respond to a query that contains its

address.
Function Code
The function code field tells the addressed slaves what function to per-

form. Function codes are specifically designed invoke a specific action

by the slave device. The function code range is from 1 to 127. However,

Table 4

Exception response

Server

Address

Function Code

(0x80)

Exception

Code

16 Bit

CRC

1 byte

1 byte

1 bytes

2 bytes