GN-9289 User Manual
Page 35 of (70)
G-series GN-9289 Modbus TCP_UDP Rev. 1.01.docx
8.2.2.
2 (0x02) Read Discrete Inputs
This function code is used to read from 1 to 2000 contiguous status of discrete inputs in a remote device.
The Request PDU specifies the starting address, i.e. the address of the first input specified, and the number
of inputs. In the PDU Discrete Inputs are addressed starting at zero. Therefore Discrete inputs numbered 1-
16 are addressed as 0-15.
The discrete inputs in the response message are packed as one input per bit of the data field.
Status is indicated as 1= ON; 0= OFF.
Request
Field name
Example
Function Code
0x02
Starting Address Hi
0x00
Starting Address Lo
0x00
Quantity of Inputs Hi
0x00
Quantity of Inputs Lo
0x0A
Response
Field name
Example
Function Code
0x02
Byte Count
0x02
Input Status
0x80
Input Status
0x00
- In case of address 0x0015~0x0000 input bit value: 00000000_10000000.