Chapter 9 Appendix-Serial interface network use and communications protocol
www.supmea.com
- 62 -
Menu 46 means the address of the flow meter in the MODBUS protocol is 0x0B.
The CRC Verify Code adopts CRC-16-IBM (polynomial is X16+X15+X2+1, shield
character is 0xA001) which is gained by the cyclic redundancy algorithm method.
Low byte of the verify code is at the beginning while the high byte is at the end.
For example, to read the address 1 (0x01) in the RTU mode, if the instantaneous
flow rate uses hour as a unit(m3/h), namely reads 40005 and 40006 registers data,
the read command is as follows:
0x01
flowmeter
Address
0x03
Function
Code
0x00 0x04
Register
Address
0x00 0x02
Register
Number
0x85 0xCA
CRC Verify
Code
flowmeter returned data is (assuming the current flow=1.234567m3/h)
0x01
0x03
0x04
0x06 0x51 0x3F
0x9E
0x3B 0x32
flowmeter
Address
Function
Code
Data
Bytes
Data(1.2345678)
CRCVerify
Code
The four bytes 3F 9E 06 51 is in the IEEE754 format single precision floating point
form of 1.2345678.
Pay attention to the data storage order of the above example. Using C language to
explain the data, pointers can be used directly to input the required data in the
corresponding variable address, the low byte will be put at the beginning, such as
the above example 1.2345678 m/s, 3F 9E 06 51 data stored in order as
06 51 3F
9E
.
9.3.2.3. Error check
The flowmeter only returns one error code 0x02 which means data first address in
error. For example, to read address 1 (0x01) of the flowmeter 40002 register data