Ascon Tecnologic - TRH-MINI - ENGINEERING MANUAL - PAG. 3
Functional domain code in Modbus RTU protocol
Function code
Name
Description
03
Read holding
register
Reads the data measured
06
Preset single
register
Sets the communications
address and the baud rate
Function code 03 - Read holding register
Reads the measured data. Data start address: 0000... 0001.
Data length: 0001... 0002, out of range is invalid; data start ad-
dress + data length is not greather than 2, out of range is invalid.
Note:
The date that read is 16 bit data, high byte is in front, low
byte behind.
Data definition: See function code 03H and data comparison table
E.g. 1
Reading the Measured Data
Com-
mand
01
03
00 00
00 02
CRC
ADDR Function Start
address
# of
registers
CRC check
Response
01
03
04
00 EA 02 95 CRC 11 bytes
ADDR Function
Byte
count
Temp.
(°C)
RH
(%RH) CRC check
Calulation of the measured values: the output value is Data
number divided by 10 defines the Temperature in °C or the the
Relative Humidity in %RH.
In the example:
- The temperature masured value is: 00 EA (Hex.), the actual
value is 0 0EA/10 = 23.4°C. The negative values are repre-
sented by the complement;
- The Relative Humidity measured value is: 02 95 (Hex.) and its
actual value is 02 95/10 = 66.1%RH.
Function code 03H and data comparison table
Address Data content
Data description
0000
Temperature Temperature value: 2 bytes
(high byte is in front, low byte is behind)
0001
Humidity
Relative Humidity value: 2 bytes
(high byte is in front, low byte is behind)
Function code 06 - Preset single register
Sets the Communications Address and the baud rate.
Data start address: 00 00;
Data Length: 00 01, if not equal to 00 01 the communication
command is invalid.
E.g. 2
Preset the Communication address (changes from 1 to 2)
and the baud rate to 9600 bps).
Com-
mand
01
06
00 00
00 01
02 02 06 CRC
ADDR Function Start
address
# of
registers
Byte
count
Preset
data
CRC
check
Response
01
06
00 00
00 01 CRC
ADDR Function Start
address
# of
registers
CRC
check
Function code 03H and data comparison table
Address Data content
Data description
0000
Addr
The higher bits identify the sensor com-
munication Adress, the address range is
01... F7 (Hex.) = 1... 247
bps
The lower 8 bits are the communications
baud rate, the speed range is:
03... 07 (Hex.) = 1200... 19200 bps