3
Parameter MODBUS Hold Register Address (16-bit)
Real-time Temperature Value 0000H,float standard: A, B, C, D
Slave Address (Address) 002FH,unsigned integer representation, Default:123
Baud Rate 0030H, the default slave address is 9600, it is saved as 96
when saving, and so on (all to be divided by 100)
Keep the register list
Notes
Access to other addresses is not allowed.
Temperature, float representation IEEE754, single format, 32 bit
s e[8] f[23]
s e7 e6 e5 e4 e3 e2 e1 e0 f22 f21 f20 f19 f18 f17 f16 f15 f14 f12 f11 f10 f9 f8 f7 f6 f5 f4 f3 f2
f1 f0
Splitting into 4 bytes for Modbus encoding
A: [ s e7 e6 e5 e4 e3 e2 e1]
B: [e0 f22 f21 f20 f19 f18 f17 f16]
C: [f15 f14 f12 f11 f10 f9 f8]
D: [f7 f6 f5 f4 f3 f2 f1 f0]
Most masters do use the A, B, C, D representation.
MODBUS RTU Instruction
Supported MODBUS function codes: 0x03, 0x06
Example of 03H function code: Read the temperature measurement data of the sensor with slave
address 123.
Host Query Command
Slave Address 7BH Slave Address
Function 03H Function code
Byte Count 04H 4 bytes in length
Data Hi 42H The temperature at this time is: 92.5589 °C
Data Lo B9H The temperature at this time is: 92.5589 °C
Data Hi 1EH The temperature at this time is: 92.5589 °C
Data Lo 33H The temperature at this time is: 92.5589 °C
CRC Check Lo ADH CRC check code is 8 bits low
CRC Check Hi DCH CRC check code is 8 bits high
Slave Address 7BH Slave Address
Function 03H Function code
Starting Address Hi 00H Start register address is 8 bits high
Starting Address Lo 00H Start register address is 8 bits low
No. of Registers Hi 00H The upper 8 bits of the number of registers
No. of Registers Lo 02H The lower 8 bits of the number of registers
CRC Check Lo CFH CRC check code low 8 bits
CRC Check Hi 91H CRC check code high 8 bits
Response
Example of 06H function code: Modify the baud rate (this example is modified to 57600bps).