M Od Bus Instruction Operation Example - Ebyte ME31-XAAX0440 User Manual

I/o networking module
Hide thumbs Also See for ME31-XAAX0440:
Table of Contents

Advertisement

Chengdu Ebyte Electronic Technology Co., Ltd.
MODBUS address
filtering

4.8.5 M od bus instruction operation example

1. Read Coil (D O ) Status
Use the read coil state (01 ) function code to read the output coil state, for example:
01
Modbus address
After sending the above command to the device through the 485 bus, the device will return the following values:
01
M odbus address
The above returned status data 0 1 indicates that the output DO 1 is turned on .
2. Control Coil (D O ) Status
Support operation of single coil (0 5 ), operation of multiple coils ( 0F ) function code operation.
Use the 0 5 command to write a single command, for example :
01
Modbus address
After sending the above command to the device through the 485 bus, the device will return the following values:
01
M odbus address
The DO1 coil is turned on.
Use 0 F function code as the command to write multiple coils, for example:
Copyright © 2012–2023 , Chengdu Ebyte Electronic Technology Co., Ltd.
26
holding
0x08E9
register
01
00 00
register first
function code
address
01
function code
05
function code
05
function code
1
R W
Number of output coils read
01
bytes of data
returned status data
00 00
Conduction: F F 00
register first address
00 00
register first address
Operation method
ME31- XAAX0440 _User Manual
0: transparent
transmission, 1-255:
when the data is not
local, check the slave
address of the command
command, and it can be
passed when it is the set
value
00 0 4
0 1
CRC check code
FF 00
CRC check code
Off: 0 0 00
FF 00
CRC check code
R : 0x03
W : 0x06 , 0x10
3D C9
CRC check code
90 48
8C 3A
8C 3A

Advertisement

Table of Contents
loading

Table of Contents