Page 43 of 51
9.3.2.2 MODBUS Protocol Function Code 0x03 Usage
The host sends out the read register information frame format:
Slave Address
Operation
Function Code
First Address Register
Register Number
Verify Code
1 byte
1 byte
2 bytes
2 bytes
2 bytes
0x01~0xF7
0x03
0x0000~0xFFFF
0x0000~0x7D
CRC(Verify)
The slave returns the data frame format:
Slave Address
Read Operation
Function Code
Number of Data
Bytes
Data Bytes
Verify Code
1 byte
1 byte
1 byte
N*x2 byte
2 bytes
0x01~0xF7
0x03
2xN*
N*x2
CRC(Verify)
N*
=
data register number
The range of flow meter addresses 1 to 247 (Hexadecimal: 0x01
~
0xF7 ), and can be checked in the Menu 46. For
example, decimal number "11" displayed on 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 X
16
+X
15
+X
2
+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
0x03
0x00 0x04
0x00 0x02
0x85 0xCA
Flowmeter Address
Function Code
Register Address Register Number
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 51 06 9E 3F.
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 in the RTU mode, the flowmeter
considers it to be invalid data, and sends the following command:
0x01
0x03
0x00 0x01
0x00 0x01
0xD5 0xCA
Flowmeter Address Function Code
Register Address Register Number
CRC Verify Code
Flowmeter returned error code:
0x01
0x83
0x02
0xC0 0xF1
Flowmeter Address
Error Code
Error Extended Code
CRC Verify Code
9.3.2.4 MODBUS Register Address List
The flowmeter MODBUS Register has a read register and a single write register.
Read Register Address List (use 0x03 performance code to read)
UFM-40
Ultrasonic transit-time flowmeter
Summary of Contents for UFM-40
Page 1: ......
Page 2: ......
Page 5: ......
Page 6: ......
Page 7: ......
Page 8: ......
Page 10: ......
Page 11: ......
Page 12: ......
Page 13: ......
Page 15: ......
Page 16: ......
Page 17: ......
Page 18: ......
Page 19: ......
Page 20: ......
Page 21: ......
Page 25: ......
Page 28: ......
Page 29: ......
Page 32: ......
Page 35: ......
Page 36: ......
Page 37: ......
Page 38: ......
Page 39: ......
Page 40: ......
Page 46: ......
Page 47: ......
Page 49: ......
Page 50: ......