Chengdu Ebyte Electronic Technology Co.,Ltd.
【2DI + 2AI + 4DO】MA02-AACX2240 User Manual
Copyright ©2012–2021
,
Chengdu Ebyte Electronic Technology Co.,Ltd.
39
20
10
05 78
00 04
08
0001 0002
XX XX
Device ModBus
address
Function code
Register
start address
Number of
registers
The number
of bytes of
data written
Data written
CRC check
code
After sending the above command to the device via RS232, the device will return the following values:
20
10
05 78
00 04
XX XX
Device ModBus
address
Function code
Register address
Number of registers
CRC check
code
If the modification is successful, the values of four consecutive registers with 0x0578 as the starting address are 0x0001,
0x0002, 0x0003, and 0x0000, respectively.
7.3.5 Write the status of a single DO coil
Use 05 command to write a single command, for example: set the working mode of DO1 to pulse mode
20
05
00 00
FF 00
XX XX
Device ModBus
address
Function code
Register address
Data written
Coil action: conduction
CRC check code
After sending the above command to the device via RS232, the device will return the following values:
20
05
00 00
FF 00
XX XX
Device ModBus
address
Function code
Register address
Write value
CRC check code
The DO1 coil is turned on.
7.3.6 Write multiple DO coil states
Use 0F function code to write a single command, for example: set the working mode of DO1 to pulse mode
20
0F
00 00
00 04
01
06
XX XX
Device ModBus
Function
Starting
Number of coils
Number of
Control coil
CRC check