
Page 39 of 56
King Pigeon Hi-Tech. Co., Ltd.
Ver 2.3
Industrial Ethernet Remote I/O Module
IoT Data Acquisition Module
8.2.3 Write device holding coil
1) Write device single DO output
Master Send Data Format:
Content
Bytes
Data
(H: HEX)
Description
Device Address
1
01H
01H Device, Range: 1-247, according to setting address
Function Code
1
05H
Write a single holding coil,function code 05
DO register address
2
00 00H
Register starting address
Action performed
2
FF 00H
This value is: FF 00H or 00 00H, FF 00H means control
DO is closed, 00 00H means control DO is open.
16 CRC Verify
2
8C 3AH
CRC0 CRC1 low byte in front, high behind
Receiver Return Data Format:
Content
Bytes
Data
(H: HEX)
Description
Device Address
1
01H
01H Device, according to the data Master send
Function Code
1
05H
Write a single holding coil, use function code 05
DO register address
1
00 00H
Register starting address
Action performed
2
FF 00H
This value is: FF 00H or 00 00H, FF 00H means control
DO is closed, 00 00H means control DO is open.
16 CRC Verify
2
8C 3AH
CRC0 CRC1 low byte in front, high behind
Example: Control DO1 closed, then:
Server send:
01 05 00 00 FF 00 8C 3A
01= Device address;
05= Write a single holding coil;
00 00=DO1 register starting address;
FF 00 = Control DO1 closed;
8C 3A = 16 Bit CRC verify.
Device answer:
01 05 00 00 FF 00 8C 3A
01= Device address;
05= Write a single holding coil;
00 00= DO1 register starting address;
FF 00 = DO1 has been closed.
8C 3A = 16 Bit CRC verify.
If you need to control other DO outputs separately, you only need to change the "DO register starting
address" and the "action to be performed", and recalculate the CRC check value.