Modbus Rtu Examples - E+E Elektronik HTS201 User Manual

Humidity and temperature room sensor
Hide thumbs Also See for HTS201:
Table of Contents

Advertisement

5.2.8.

ModBus RTU Examples

The HTS201 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 www.epluse.com/hts201)
Read the temperature (FLOAT32) T = 23.4400005340576171875 °C from register address 0x3EA:
Master (e.g. PLC)
Request [Hex]:
Modbus
address
2D
Response [Hex]:
Modbus
address
2D
Fig. 3
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
85
MMMMMMMM
Tab. 8
Modbus response
IEEE754
Byte 1
41
0100 0001
SEEE EEEE
Decimal value: 23.4400005340576171875
Tab. 9
Data representation according to IEEE754
Read register from unconfigured custom modbus map address 0xBB8-0xBB9:
Master (e.g. PLC)
Request [Hex]:
Modbus
address
2D
Response [Hex]:
Modbus
address
2D
Fig. 4
Query of an unconfigured custom Modbus map
Function
Starting
Starting
code
address Hi
address Lo
03
03
Function
Byte
Register 1
code
count
value Hi
03
04
Byte 4
1F
MMMMMMMM
Byte 2
BB
1011 1011
EMMM MMMM
Function
Starting
Starting
code
address Hi
address Lo
03
0B
Function
Byte
Register 1
code
count
value Hi
03
04
Qty. of
Qty. of
registers Hi
registers Lo
EA
00
02
Register 1
Register 2
value Lo
value Hi
85
1F
41
Byte 1
41
SEEEEEEE
Byte 3
85
1000 0101
MMMM MMMM
Qty. of
Qty. of
registers Hi
registers Lo
BB
00
02
Register 1
Register 2
value Lo
value Hi
FF
FF
FF
User Manual HTS201
HTS201
CRC
12
53
Register 2
CRC
value Lo
BB
7F
18
Byte 2
BB
EMMMMMMM
Byte 4
1F
0001 1111
MMMM MMMM
HTS201
CRC
41
A6
Register 2
CRC
value Lo
FF
16
65
Humidity and Temperature Room Sensor | 16

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ee10

Table of Contents