80
6 Useful Functions
80
Useful Functions
Chapter
6
05 (0x05) Write Single Coil
The coils of slave devices are changed to ON or OFF.
When broadcast (0) is specified, coils of all slave devices with the same address will be rewritten.
The coil address and output value are specified in the request.
When ON...........0xFF, 0x00
When OFF ......... 0x00, 0x00
Data other than the above are treated as improper data and not modified.
* If rewriting a coil w
hich turns the signal to ON level or OFF level (0011 to 0015), be sure to change
the input selection so it does not overlap the signal to be rewritten.
Example) Turning ON the GROSS display (address 00001).
Note that the relative address is 0x00 when writing in GROSS display.
The response in the case of being written in normally is the same as request.
* Consider execution confirmation of the coil to be
something that is completed by a normal
response.
[Request]
Function 1 byte 0x05
Start address 2 bytes 0x0000 to 0xFFFF
Output data 2 bytes 0x0000 or 0xFF00
[Response]
Function 1 byte 0x05
Start address 2 bytes 0x0000 to 0xFFFF
Output data 2 bytes 0x0000 or 0xFF00
[Error response]
Error code 1 byte 0x85 (Function +0x80)
Exception code 1 byte 01 or 02 or 03
[Request]
Function 05
[Response]
Function 05
Start address (HI) 00 Start addr
ess (HI) 00
Start address (LO) 00 Start address (LO) 00
GROSS display (HI) FF GROSS display (HI) FF
GROSS display (LO) 00 GROSS display (LO) 00