Chengdu Ebyte Electronic Technology Co.,Ltd.
E831-RTU(8080T-485) User
Manual
17
Copyright ©2012–2022
,
Chengdu Ebyte Electronic Technology Co.,Ltd.
Read the 8-channel digital output status, assuming the return value is 03, which corresponds to the binary bit 0000 0011,
which means that DO1 and DO2 are open. 8 bits represent the digital output status, which are DO8, DO7, DO6, DO5, DO4, DO3,
DO2, DO1.
Modbus RTU protocol to read digital outputs:
s
end
01
01
00 10
00 08
3C 09
Device
ModBus
address
fu
nction
code
Switch
start address
Number
of read
switches
CRC
check code
t
ake
over
01
01
01
03
11 89
Device
ModBus
address
fu
nction
code
returns
the number of
bytes
Digital
output value
CRC
check code
4.2.1.2 Control switch DO output
Function code: 05, write single coil status; 0F, write multiple coil status Address range: 00017(0x0010)~00023(0x0017)
example:
Function code 0x05 Write DO2 digital output, write value is FF 00; close D02 port, write value 00 00. Modbus RTU protocol
to write digital output:
sen
d
01
05
00 11
FF 00
DC 3F
Device
ModBus address
functi
on code
switch address
write value
CRC check
code
tak
e over
01
05
00 11
FF 00
DC 3F
Device
ModBus address
functi
on code
switch address
write value
CRC check
code
Function code 0x0F Write DO2, DO3 digital output, the write value should be 0x03, corresponding to binary bit 0000 0011,
(note that the starting address here starts from DO2)
Modbus RTU protocol to write digital output:
s
end
01
0F
00
11
00
02
0
1
0
3
62
95
Device
ModBus
address
fu
nction
code
swi
tch
address
Nu
mber of
write
switches
n
um
ber
of
byt
es
w
rite
val
ue
C
RC
check
code
t
ake
over
01
0F
00
11
00 02
84 0F
Device
ModBus
address
fu
nction
code
swi
tch
address
write value
CRC check
code
4.2.2 Read switch DI input
Function code: 02, read (switch value) input status
Address range: 10017(0x0010)~10023(0x0017)
Note: The device defaults to dry contact input. When DI and DIG are short-circuited, the read value should be 1; when DI and
DIG are not short-circuited, the read value should be 0. example:
Read 8 -channel digital input value , DI input terminal DI1 and DIG are short-circuited, DI2 and DIG are not short-circuited ,
DI3 and DIG are short-circuited , and DI4 and DIG are not short-circuited . The read digital input value is 0x05 , corresponding to