![Ebyte ME31-XXXA0006 Скачать руководство пользователя страница 22](http://html1.mh-extra.com/html/ebyte/me31-xxxa0006/me31-xxxa0006_user-manual_3829153022.webp)
Chengdu Ebyte Electronic Technology Co.,Ltd.
ME31-XXXA0006_UserManual_EN
Copyright ©2012
–
2023, Chengdu Ebyte Electronic Technology Co.,Ltd.
21
The status data 01 returned above indicates that the output DO1 is turned on.
2. Control coil (DO) state
Support operation of single coil (05), operation of multiple coils (0F) function code operation.
Use the 05 command to write a single command, for example:
01
05
00 00
FF 00
8C 3A
Modbus address
Function code
Register first address
Continuity: FF 00
Close: 00 00
CRC check code
After sending the above command to the device through the 485 bus, the device will return the following values:
01
05
00 00
FF 00
8C 3A
Modbus address
Function code
Register first address
Operation method
CRC check code
The DO1 coil is turned on.
Use 0F function code as the command to write multiple coils, for example:
01
0F
00 00
00 04
01
0F
7E 92
Modbus
address
Function
code
Initial
address
Number of
coils
Bytes of data
Control coil data
CRC check
code
After sending the above command to the device through the 485 bus, the device will return the following values:
01
0F
00 00
OO O4
54 08
Modbus address
Function code
Register address
Number of coils
CRC check code
The coils are all on.
3. Read the holding register
Use 03 function code to read one or more register values, for example:
01
03
05 78
00 01
04 DF
Modbus address
Function code
Register first
address
Number of registers read
CRC check code
After sending the above command to the device through the 485 bus, the device will return the following values:
01
03
02
00 00
B8 44
Modbus address
Function code
Bytes of data
Returned data
CRC check code