User Manual HTS801
Humidity and Temperature Sensor for High Humidity and Chemically Polluted Conditions | 45
6.3
Modbus RTU Example
The HTS801’s Modbus address is 230 [0xE6].
Please refer to
▪.
MODBUS APPLICATION PROTOCOL SPECIFICATION V1.1b3, chapter 6:
www.modbus.org/docs/Modbus_Application_Protocol_V1_1b3.pdf
▪.
E+E Application Note Modbus AN0103 (available at
Read the temperature (FLOAT32) T = 25.6787014007568359375 °C from register address 0x3EA
:
Master (e.g. PLC)
HTS801
Request [Hex]:
Modbus
address
Function
code
Starting
address Hi
Starting
address Lo
Qty. of
registers Hi
Qty. of
registers Lo
CRC
E6
03
03
EA
00
02
F2
6C
Response [Hex]:
Modbus
address
Function
code
Byte
count
Register 1
value Hi
Register 1
value Lo
Register 2
value Hi
Register 2
value Lo
CRC
E6
03
04
6D
FB
41
CD
53
AB
Fig. 40 Example temperature query
Decoding of floating point values:
Floating point values are stored according to IEEE754. The byte pairs 1, 2 and 3, 4 are transformed as follows
(numbers.taken.from.T.reading.Modbus.request/response.example.above):
Modbus response [Hex]
Register 1 Hi
Register 1 Lo
Register 2 Hi
Register 2 Lo
6D
FB
41
CD
MMMMMMMM
MMMMMMMM
SEEEEEEE
EMMMMMMM
Fig. 41 Modbus response
IEEE754
Register 2 Hi
Register 2 Lo
Register 1 Hi
Register 1 Lo
41
CD
6D
FB
0100 0001
1100 1101
0110 1101
1111 1011
SEEE EEEE
EMMM MMMM
MMMM MMMM
MMMM MMMM
Decimal value: 25.6787014007568359375
Fig. 42 Data representation according to IEEE754