Hardware manual

Chapter2 Connection to a PLC
2-252
FC5 Write coil
Writing to a single Coil (C)
(Request)
Byte 7 FC (Function code)=05
Byte 8-9 Reference No.
Byte 10 Write value (FF when write value is 1, and 00 when write value is 0)
Byte 11 Fixed value 00
(Normal response)
Byte 7 FC (Function code)=05
Byte 8-9 Reference No.
Byte 10 Write value (FF when write value is 1, and 00 when write value is 0)
Byte 11 Fixed value 00
(Abnormal response)
Byte 7 FC (Function code)=85 (HEX)
Byte 8 Exception code 01 or 02
(Example)
Writing of C1 (1 bit). The write value is 1.
05 00 00 FF 00 => 05 00 00 FF 00