
Uponor Smatrix Base PRO Controller X-147 Modbus RTU interface l Installation manual l 7
2.2 Frame format: Read Discrete Input
Request
Slave address
(0x01 – 0xF7)
Function code
(0x02)
Starting register address
(0x0000 – 0xFFFF)
Number of coils to read
(1 – 2000)
CRC
1 byte
1 byte
2 bytes
2 bytes
2 bytes
Response
Slave address
(0x01 – 0xF7)
Function code
(0x02)
Byte count
(N)
Coil status
(n = N, or n=N+1 if the number of coils to
read can be divided by 8 with a reminder
separated from 0)
CRC
1 byte
1 byte
1 byte
n bytes
2 bytes
Response in case of error
Slave address
(0x01 – 0xF7)
Error code
(0x82)
Exception code
(01, 02, 03, 04, or 06)
CRC
1 byte
1 byte
1 byte
2 bytes
Examples:
Request example:Read all discrete inputs
Slave address
(0x01)
Function code
(0x02)
Starting register
address HI
(0x00)
Starting register
address LO
(0x00)
Number of coils to
read HI
(0x00)
Number of coils to
read LO
14 bits (0x0E)
CRC
1 byte
1 byte
1 byte
1 byte
1 byte
1 byte
2 bytes
Response example: Read all discrete inputs
Slave address
(0x01)
Function code
(0x02)
Byte count
(0x02)
Coil status 1 to 8
(0xAA)
Coil status 9 to 16
(0x0A)
CRC
1 byte
1 byte
2 byte
1 bytes
1 bytes
2 bytes
Request example:Read actuator status, channel 12
Slave address
(0x01)
Function code
(0x02)
Starting register
address HI
(0x00)
Starting register
address LO
Register 12 (0x0B)
Number of coils to
read HI
(0x00)
Number of coils to
read LO
1 bit (0x01)
CRC
1 byte
1 byte
1 byte
1 byte
1 byte
1 byte
2 bytes
Response example: Read actuator status, channel 12
Slave address
(0x01)
Function code
(0x02)
Byte count
(0x01)
Coil status channel 12
ON (0x01)
CRC
1 byte
1 byte
1 byte
1 bytes
2 bytes
Request example:Read actuator status, all channels
Slave address
(0x01)
Function code
(0x02)
Starting register
address HI
(0x00)
Starting register
address LO
(0x00)
Number of coils to
read HI
(0x00)
Number of coils to
read LO
12 bits (0x0C)
CRC
1 byte
1 byte
1 byte
1 byte
1 byte
1 byte
2 bytes
Response example: Read actuator status, all channels
Slave address
(0x01)
Function code
(0x02)
Byte count
(0x02)
Coil status 1 to 8
(0xAA)
Coil status 9 to 12
(0x0A)
CRC
1 byte
1 byte
2 byte
1 bytes
1 bytes
2 bytes