6.2.5
Function code FC5 (Write Coil)
With the aid of this function a single output bit is written.
Request
The request determines the address of the output bit. Addressing starts with 0.
Example: The second output bit is set (address 1):
Byte
Byte 0, 1
Byte 2, 3
Byte 4, 5
Byte 6
Byte 7
Byte 8, 9
Byte 10
Byte 11
Response
Byte
.....
Byte 7
Byte 8, 9
Byte 10
Byte 11
Exception
Byte
.....
Byte 7
Byte 8
Modular I/O System
ETHERNET TCP/IP
Field name
Transaction identifier
protocol identifier
length field
unit identifier
MODBUS function code
reference number
ON/OFF
Field name
MODBUS function code
Reference number
Value
Field name
MODBUS function code
Exception code
Common MODBUS functions • 287
Function code FC5 (Write Coil)
Example
0x0000
0x0000
0x0006
0x01 not used
0x05
0x0001
0xFF
0x00
Example
0x05
0x0001
0xFF
0x00
Example
0x85
0x01, 0x02 or 0x03