Specifications

Revision 2.4 WebRelay-Quadâ„¢
Users Manual
Protocol identifier (2 Bytes): 0x0000
Length (2 Bytes): 0x0004
Unit identifier (1 Byte): 0xff
Modbus:
Function code (1 Byte): 0x01 (Read coils)
Byte count (1 Byte): 0x01
Coil status (1 Byte): 0x00 to 0x0F (see chart below)
Data Byte
(hex)
LS Data Bits
(binary)
Relay 4 State Relay 3 State Relay 2 State Relay1 State
0x00 0000 off off off off
0x01 0001 off off off on
0x02 0010 off off on off
0x03 0011 off off on on
0x04 0100 off on off off
0x05 0101 off on off on
0x06 0110 off on on off
0x07 0111 off on on on
0x08 1000 on off off off
0x009 1001 on off off on
0x0A 1010 on off on off
0x0B 1011 on off on on
0x0C 1100 on on off off
0x0D 1101 on on off on
0x0E 1110 on on on off
0x0F 1111 on on on on
Modbus Error:
Function code (1 Byte): 0x81
Exception code (1 Byte): 0x01 or 0x02
Exception codes:
0x01 - Function code not supported
0x02 - Incorrect starting address / quantity of outputs combination
Character String Example:
char read_coils_mb_response[] =
{0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0xff, 0x01, 0x01, 0x01};
Xytronix Research & Design, Inc. page 33