smartDEN
IP-16R-XX
User Manual
13 Apr 2021
-
47
-
Coils Status
bit 7
(MSB)
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0 (LSB)
0
0
0
0
0
1
(Relay 3)
0
(Relay 2)
1
(Relay 1)
In this example relays states are:
- Relay 1: ON
- Relay 2: OFF
- Relay 3: ON
Response example 2: Read Coil Status: Relays 4..16:
Table 10.11.
Read Coils response example 2
Field
Length
Data
Transaction Identifier
2 Bytes
0x0001
Protocol Identifier
2 Bytes
0x0000
Length
2 Bytes
0x0004
Unit Identifier
1 Byte
0x00
Function Code
1 Byte
0x01
Byte Count
1 Byte
0x02
Coil Status
2 Bytes
0x590B
Byte
Coils Status
bit 7
(MSB)
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
(LSB)
1
0
(Relay 11)
1
(Relay 10)
0
(Relay 9)
1
(Relay 8)
1
(Relay 7)
0
(Relay 6)
0
(Relay 5)
1
(Relay 4)
2
0
0
0
0
(Relay 16)
1
(Relay 15)
0
(Relay 14)
1
(Relay 13)
1
(Relay 12)
Error
The possible error responses for function code 0x01 are:
Function Code (1 byte): 0x81 (0x80 + 0x01)
Exception Codes (1 byte):
- 0x01
– Function code not supported.
- 0x02
– Incorrect combination of start address and coil quantity
Error response example:
Table 10.12.
Read Coils error response
Field
Length
Data
Transaction Identifier
2 Bytes
0x0001
Protocol Identifier
2 Bytes
0x0000
Length
2 Bytes
0x0003
Unit Identifier
1 Byte
0x00
Function Code
1 Byte
0x81
Exception Codes
1 Byte
0x01 or 0x02