E850-DTU(4440-GPRS) datasheet
Copyright ©2012–2018
,成都亿佰特电子科技有限公司
15
4.2 IO basic function
4.2.1 switch DO output
Read switch DO output
Function code: 01, Read coil state
Address range
:
00017(0x0010)~00020(0x0013)
Note: When the device relay is passively output, and the coil is not power on, the NC and COM of
the relay are normally closed, the NO and the COM are normally open, the value is 0; when the coil is
power on, the phenomenon is reversed, the relay NC and COM are disconnected, the NO and the
COM are closed, and the value is 1. The relay state can be queried by command.
For example:
When reading the 4-channel switch output state, assume that the return value is 03,
corresponding to the binary bit 0000 0011, the lower four bits represent the switch output state, which
in turn is DO4, DO3, DO2, DO1.
Modbus RTU protocol read switch output:
Send
01
01
00 10
00 04
3C 0C
Device
ModBus
address
Function
code
Start address
Read number of
switch quantity
CRC code
Receive
01
01
01
03
11 89
Device ModBus
address
Function
code
Bytes returned
Switch Output
Value
CRC code
Modbus TCP protocol read switch output:
Send
00 01
00 00
00 06
01
01
00 10
00 04
Transmi
ssion
identifie
r
Protocol
identifier
Length
Unit
identifie
r
Functi
on
code
Start address
Read number
of switch
quantity
Receive
00 01
00 00
00 04
01
01
01
03
Transmi
ssion
identifie
r
Protocol
identifier
Length
Unit
identifie
r
Functi
on
code
Bytes returned
Switch Output
Value