Function code
:
01
,
Read coil status
Address range : 00017(0x0010)~00023(0x0017)
Example
:
Read 8 digital output status. Assuming the return value is 03, the corresponding binary bit is 0000
0011, which means that DO1 and DO2 are on. The 8 bits represent digital output status, which are DO8,
DO7, DO6, DO5, DO4, DO3, DO2, DO1 in order.
Modbus RTU protocol read digital output:
Transmis
sion
01
01
00 10
00 08
3C 09
Device ModBus
Address
Function
code
Switch value
initial address
Read switch value
numbers
CRC parity code
Receivin
g
01
01
01
03
11 89
Device ModBus
Address
Function
code
Return bytes
numbers
Digital output value
CRC parity
code
4.2.1.2. Control switch value DO output
Function code
:
05
,
Write single coil status; 0F, write multiple coil status
Address range
:
00017(0x0010)~00023(0x0017)
Example
:
Function code 0x05 writes DO2 digital output, the write value is FF 00; close D02 port, write the
value 00 00.
Modbus RTU protocol write digital output
:
Transmis
sion
01
05
00 11
FF 00
DC 3F
Device ModBus
Address
Function
code
Switch value
address
Write value
CRC parity code
Receivin
g
01
05
00 11
FF 00
DC 3F
Device ModBus
Address
Function
code
Switch value
address
Write value
CRC parity
code
Function code 0x0F writes DO2 and DO3 digital output. The write value should be 0x03,
corresponding to the binary bit 0000 0011. (Note that the initial address here starts from DO2.)
Содержание E831-RTU(8080T-485)
Страница 10: ...2 2 Size Interface description ...