User Manual EE212
Modular Humidity and Temperature Sensor | 18
5.4 Modbus RTU Example
The EE212’s Modbus address is 46 [0x2E].
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.087642669677734375 °C from register address 0x19
:
Master (e.g. PLC)
EE212
Request [Hex]:
Modbus
address
Function
code
Starting
address Hi
Starting
address Lo
Qty. of
registers Hi
Qty. of
registers Lo
CRC
2E
03
00
19
00
02
12
53
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
2E
03
04
B3
7E
41
C8
53
AB
Tab. 6
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]
Byte 3
Byte 4
Byte 1
Byte 2
B3
7E
41
C8
MMMMMMMM
MMMMMMMM
SEEEEEEE
EMMMMMMM
Tab. 7
Modbus response
IEEE754
Byte 1
Byte 2
Byte 3
Byte 4
41
C8
B3
7E
0100 0001
1100 1000
1011 0011
0111 1110
SEEE EEEE
EMMM MMMM
MMMM MMMM
MMMM MMMM
Decimal value: 25.087642669677734375
Tab. 8
Data representation according to IEEE754