User manual

Modbus
Modbus-Function 02, Read Input Status
Reads the ON/OFF status of discrete inputs (1X references) in the slave.
Broadcast is not supported.
Appendix B lists the maximum parameters supported by various controller
models.
Query
The query message specifies the starting input and quantity of inputs to be read.
Inputs are addressed starting at zero: inputs 1&endash;16 are addressed as
0&endash;15.
Here is an example of a request to read inputs 10197&endash;10218 from slave
device 17:
Field Name (Hex)
Slave Address 11
Function 02
Starting Address Hi 00
Starting Address Lo C4
No. of Points Hi 00
No. of Points Lo 16
Error Check (LRC or CRC) &endash;&endash;
Response
The input status in the response message is packed as one input per bit of the
data field. Status is indicated as: 1 = ON; 0 = OFF. The LSB of the first data
byte contains the input addressed in the query. The other inputs follow toward
the high order end of this byte, and from ’low order to high order’ in
subsequent bytes.
If the returned input quantity is not a multiple of eight, the remaining bits in the
final data byte will be padded with zeros (toward the high order end of the byte).
The Byte Count field specifies the quantity of complete bytes of data.
Here is an example of a response to the query on the opposite page:
Field Name (Hex)
Slave Address 11
Function 02
Byte Count 03
Data (Inputs 10204&endash;10197) AC
Data (Inputs 10212&endash;10205) DB
53