Auxiliary Operations WebRelay Users Manual
5.3.5 Read Discrete Inputs – Modbus Function Code 02 (0x02)
This function returns the state of the digital input.
Request
Start Address: 0x0000 (always 0x0000)
Input Quantity: 0x0001 (always 0x0001)
Response
The input state is indicated by bit one of the status byte. A “1” indicates that the input is ON. A
“0” indicates that the input is OFF.
When reading the input, the following table shows the bit positions.
Discrete Input State Byte
Bit 7 6 5 4 3 2 1 Bit 0
x x x x x x x Input 1
Errors
Input Read Error Function Code (1 Byte): 0x82
Exception codes (1 Byte): 0x01 – Function not supported.
0x02 – Incorrect combination of start address and input quantity.
Page 66 Xytronix Research & Design, Inc.