MODBUS RTU Electromagnetic Flowmeter Protocol
MODBUS RTU Electromagnetic Flowmeter Protocol
1. Suitable
2. Communication protocol
2.1 Communication connection RS485 or RS232, Baud rate range 600-9600, communication
2.3 Communication protocol conforms to MODBUS RTU protocol. In instruction table register
2.4 Composition of communication information: Address code - Function code - Data segment -
CRC, A message is sent and received continuously, and the character interval cannot be greater
than one character, otherwise it is regarded as the beginning of a new message or the end of the
2.5 Data definition: The cumulative amount is a 16-byte hexadecimal fixed point number, and the
instantaneous amount (including flow, velocity, etc.) is a 4-byte IEEE 754 single-precision floating
point number.
2.6 Communication command: Function code 03(or 04)- reading display data
Send Receive
01 Address 01 Address
(display address)
http://www.microsensorcorp.cn 1
Add: No.18,Yingda Road Baoji,P.R.China, 721006
Tel: +86 917 3600739/3600909 Fax:3609977
MODBUS RTU Communication Protocol
02 Register numbers low 80 Data 3
CRCL CRC Check code is low CRCH CRC Check code is high
For a multi-byte number transmission, use the BIG-ENDIAN format, that is, use the format with
high-weight bytes first and low-weight bytes after transmission. For example, a four-byte number
ABCDEF12H, the transfer order is: D0= ABH, D1=CDH, D2=EFH, D3=12H.
For floating-point numbers, the format is IEEE 754 single-precision, and the transmission order is
the high byte first and then the low byte. The high byte is the byte where the sign bit and exponent bit
in the floating-point number are located, and the low byte is the byte where the mantissa is located.
Above D0, D1, D2, and D3 respectively correspond to D0, D1, D2, and D3 in the transmission
According to the MODBUS RTU protocol specification, the maximum number of data bytes
http://www.microsensorcorp.cn 2
Add: No.18,Yingda Road Baoji,P.R.China, 721006
Tel: +86 917 3600739/3600909 Fax:3609977
MODBUS RTU Communication Protocol
10 Upper limit alarm SHORT 2
11 Lower limit alarm SHORT 2
12 Flow rate message FLOAT 4
14 Flow percentage FLOAT 4
16 Electrode resistance FLOAT 4
18 Instrument diameter FLOAT 4
1A Positive total integer high LONG 4
1C Reverse total integer high LONG 4
1E Two-way total cumulative Long Long 8
algebra and integers
22 Two-way total cumulative Float 4
algebra and decimal numbers
24 Two-way cumulative algebra Int 2
and symbols
For example:
1) Definition of instantaneous flow information(FLOAT)
Host sends: 01 03 00 00 00 02 C4 0B
Slave response: 01 03 04 D0 D1 D2 D3 CRCL CRCH
2)Definition of unit instantaneous flow information (SHORT/ List type)
Host sends: 01 03 00 02 00 01 25 CA
Slave response: 01 03 02 00 D0 CRCL CRCH
D0 Definition:
D0 0 1 2 3 4 5 6 7
Unit m3/s m3/min m3/h L/s L/min L/h g/m g/h
D0 8 9 10 11 12 13 14 15
Unit ig/m ig/h t/s t/min t/h kg/s kg/min kg/h
D0 16 17
Unit g/s ig/s
http://www.microsensorcorp.cn 3
Add: No.18,Yingda Road Baoji,P.R.China, 721006
Tel: +86 917 3600739/3600909 Fax:3609977
MODBUS RTU Communication Protocol
6)Reverse total integer low 4 byte message definition (LONG)
Host sends: 01 03 00 08 00 02 45 C9
Slave response: 01 03 04 D0 D1 D2 D3 CRCL CRCH
7)Reverse total decimal places message definition (FLOAT)
Host sends: 01 03 00 0A 00 02 E4 09
Slave response: 01 03 04 D0 D1 D2 D3 CRCL CRCH
8)Reverse total unit message definition (SHORT/ List type)
Host sends: 01 03 00 0C 00 01 44 09
Slave response: 01 03 04 D0 CRCL CRCH
D0 Definition:
D0 0 1 2 3 4 5
Unit m3 L t kg gal igal
9)Excitation alarm (SHORT)
Host sends: 01 03 00 0D 00 01 15 C9
Slave response: 01 03 02 00 T/F CRCL CRCH
10)Electrode alarm (SHORT)
Host sends: 01 03 00 0E 00 01 E5 C9
Slave response: 01 03 02 00 T/F CRCL CRCH
11)Empty pipe alarm (SHORT)
Host sends: 01 03 00 0F 00 01 B4 09
Slave response: 01 03 02 00 T/F CRCL CRCH
12)Upper limit alarm (SHORT)
Host sends: 01 03 00 10 00 01 85 CF
Slave response: 01 03 02 00 T/F CRCL CRCH
13)Lower limit alarm (SHORT)
Host sends: 01 03 00 11 00 01 D4 0F
Slave response: 01 03 02 00 T/F CRCL CRCH
14)Flow rate message definition (FLOAT)
Host sends: 01 03 00 12 00 02 64 0E
Slave response: 01 03 04 D0 D1 D2 D3 CRCL CRCH
Unit defult as m/s
15)Definition of flow percentage message(FLOAT)
Host sends: 01 03 00 14 00 02 84 0F
Slave response: 01 03 04 D0 D1 D2 D3 CRCL CRCH
The data are percentages, such as 100 for 100% and 1 for 1%
16)Electrode resistance message definition (FLOAT)
Host sends: 01 03 00 16 00 02 25 CF
Slave response: 01 03 04 D0 D1 D2 D3 CRCL CRCH
Electrode resistance unit defult as KΩ
17)Instrument diameter message definition(FLOAT)
Host sends: 01 03 00 18 00 02 44 C0
Slave response: 01 03 04 D0 D1 D2 D3 CRCL CRCH
18)Read total data
http://www.microsensorcorp.cn 4
Add: No.18,Yingda Road Baoji,P.R.China, 721006
Tel: +86 917 3600739/3600909 Fax:3609977
MODBUS RTU Communication Protocol
Host sends: 01 03 00 00 00 1A C4 01
19)Positive total integer high message definition (LONG)
Host sends: 01 03 00 1A 00 02 E5 CC
Slave response: 01 03 04 D0 D1 D2 D3 CRCL CRCH
20)Reverse total integer high message definition (LONG)
Host sends: 01 03 00 1C 00 02 05 CD
Slave response: 01 03 04 D0 D1 D2 D3 CRCL CRCH
http://www.microsensorcorp.cn 5
Add: No.18,Yingda Road Baoji,P.R.China, 721006
Tel: +86 917 3600739/3600909 Fax:3609977
MODBUS RTU Communication Protocol
The length of the single-precision floating-point number defined by the IEEE 754 standard is 32 bits,
and can be divided into: sign bit, order code bit and mantissa bit according to the bit field, as follows:
31--------------------------------22--------------------------------------------------------------------------------------0
| | |
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
| |-------------------------------| |-----------------------------------------------------------------------------------------|
Sign Code level Mantissa
The sign bit is 0 for positive numbers, and 1 for negative numbers.
Code level is 8. It should be noted that the exponent n of 2n cannot be directly treated as an order
code, it needs to be added to 127 (7FH) to get the order code representation of 2n.
The bit field length of the mantissa is 23 bits in the figure, but it is actually24 bits. This bit is ‘invisible’
and its value is fixed at 1, which means that the effective digits of floating-point numbers defined by the
In the process of data transmission, data is transmitted in the order from left (high byte) to right (low
http://www.microsensorcorp.cn 6
Add: No.18,Yingda Road Baoji,P.R.China, 721006
Tel: +86 917 3600739/3600909 Fax:3609977
MODBUS RTU Communication Protocol
The access base address of each setting parameter of the instrument is 200, and this base address
must be added to the address of the register when accessing.
That is, the access target register address is: 200 + access register address, such as the register
address of the flow unit is 1, and the access address is 201. Data transmission: High-weight bytes first,
low-weight bytes last.
Access Register
register address Explanation
address definition
Number 0 1 2 3 4 5 6 7 8 9
Diameter 3 6 8 10 15 20 25 32 40 50
Number 10 11 12 13 14 15 16 17 18 19
Diameter 65 80 100 12 150 200 250 30 350 400
Diamet 5 0
0 er Number 20 21 22 23 24 25 26 27 28 29
(mm) Diameter 450 500 600 70 800 900 1000 11 1200 1300
0 00
Number 30 31 32 33 34 35 36 37 38
Diameter 1400 1600 1800 20 220 2400 2600 28 3000
00 0 00
Number 0 1 2 3 4 5
Flow unit m3/s m3/mi m3/h L/s L/min L/h
n
1 Flow unit Number 6 7 8 9 10 11
Flow unit ig/s ig/min ig/h g/s g/min g/h
Number 12 13 14 15 16 17
Flow unit t/s t/min t/h kg/s kg/min kg/h
Number 0 1 2 3 4 5 6 7
Cumulant value m3 0.1m3 0. 0.001m L 0.1L 0.01L
0.00
unit 01 3
1L
m3
Cumulant Number 8 9 10 11 12 13 14 15
2
value unit Cumulant value t 0.1t 0. 0.001t kg 0.1k 0.01kg
0.00
unit 01 g
1kg
t
Number 16 17 18 19 20 21 22 23
Cumulant value gal 0.1ga 0. 0.001g igal 0.1i 0.01igal 0.00
7
http://www.microsensorcorp.cn
Add: No.18,Yingda Road Baoji,P.R.China, 721006
Tel: +86 917 3600739/3600909 Fax:3609977
MODBUS RTU Communication Protocol
unit l 01 al gal 1igal
ga
l
Small signal Number 0 1
3
excision Small signal excision No Yes
Damping 0—0.2s, 1—0.5s, 2—0.8s, 3—1s, 4—2s, 5—3s, 6—4s, 7—5s,
4
time(s) 8—6s, 9—8s, 10—10s, 11—20s, 12—30s, 13—50s, 14—100s
Pulse
5 output 0—Frequency output, 1—Equivalent output
mode
Pulse
0—0.001L, 1—0.01L, 2—0.1L, 3—1L, 4—2L, 5—5L, 6—10L, 7—100L,
6 equivalent
8—1m3, 9—10m3, 10—100m3, 11—1000m3, 12—1kg, 13—1t
value
10H—20mA/2000Hz,11H—10mA/1000Hz,12H—4.16mA/20Hz,13H—0mA/0H
z, other— exit test; After entering the test state, an exit test instruction needs to
7 Output test be issued, otherwise the system will remain in the test state. It is invalid in
multi-register transfer, and it is valid when only one register is written when
using single register access or multi-byte access.
Empty pipe
8 0—Yes , 1—No
test enable
Current
9 0—0~10mA, 1—4~20mA
mode
Flow
10 0—Positive, 1—Reverse
direction
Reverse
11 output 0—No , 1—Yes
enable
Excitation
12 0— Mode 1, 1— Mode 2, 2— Mode 3, 3— Mode 4, 4— Mode 5, 5— Mode 6
mode
Upper limit
13 alarm 0—No, 1—Yes
enable
Nonlinear
14 calibration 0—No, 1—Yes
enable
Number 0 1 2 3
Prohibit On/Off current On/Off External
External
external frequency output cumulate clear
15 input
Function input accumulatio
mode
control n
function
16 Baud rate Number 0 1 2 3 4 5
8
http://www.microsensorcorp.cn
Add: No.18,Yingda Road Baoji,P.R.China, 721006
Tel: +86 917 3600739/3600909 Fax:3609977
MODBUS RTU Communication Protocol
Baud rate bps 600 1200 2400 4800 9600 1440
0
Lower limit
17 alarm 0—Yes, 1—No
enable
Regist It is invalid in multi-register transfer, and it is valid
Test function er when only one register is written when using single
Excitation value register access or multi-byte access. After entering
18
test Excitation the test state, an exit test instruction needs to be
11H
enable issued, otherwise the system will remain in the test
Exit test Other state.
Excitation
19 Unused
interval
Diameter
arbitrary
20、21 Unused
value
setting
Instrument
22、23 Input floating-point numbers
calibration
Full scale
24、25 Input floating-point numbers
value
Current
26、27 zero Input floating-point numbers
calibration
Full scale
28、29 current Input floating-point numbers
adjust
30、31 Zero setting Input floating-point numbers, unit m/s
Import 8 byte long long integers. The cumulative value setting needs to
be executed separately, and cannot be set in the same communication with
other parameters. When written together with other registers, the data is
ignored.
Display cumulate m3 0.1 0.01 0.001m3 L 0.1 0.01L 0.001L
Positive value unit m3 m3 L
32、33、 cumulate Input data unit m3 L
34、35 value Display cumulate t 0.1 0.01t 0.001t k 0.1 0.01kg 0.001k
setting value unit t g kg g
Input data unit t kg
Display cumulate gal 0.1 0.01 0.001gal i 0.1i 0.01ig 0.001ig
value unit gal gal g gal al al
a
l
9
http://www.microsensorcorp.cn
Add: No.18,Yingda Road Baoji,P.R.China, 721006
Tel: +86 917 3600739/3600909 Fax:3609977
MODBUS RTU Communication Protocol
Input data unit gal igal
Reverse
36、37、 cumulate Input 8 byte long long integers, The data unit is the same as the positive
38、39 value accumulation setting.
setting
Small signal
40、41 Input floating-point numbers, input xx.xx as xx.xx%
excision
Full scale
42、43 output Input floating-point numbers, unit Hz
frequency
Empty Pipe
44、45 Input floating-point numbers, input xx.xx as xx.xx%
threshold
Converter
46、47 Input floating-point numbers
coefficient
Sensor
48、49 Input floating-point numbers
coefficient
Conductivity
50、51 Input floating-point numbers
coefficient
Additional
52、53 Input floating-point numbers
coefficient
Upper limit
54、55 Input floating-point numbers, input xx.xx as xx.xx%
alarm value
Lower limit
56、57 Input floating-point numbers, input xx.xx as xx.xx%
alarm value
Nonlinear
58、59 Input floating-point numbers, unit m/s
calibration 1
Nonlinear
60、61 Input floating-point numbers
coefficient 1
Nonlinear
62、63 Input floating-point numbers, unit m/s
calibration 2
Nonlinear
64、65 Input floating-point numbers
coefficient 2
Nonlinear
66、67 calibration Input floating-point numbers, unit m/s
point 3
Nonlinear
68、69 Input floating-point numbers
coefficient 3
Nonlinear
70、71 calibration Input floating-point numbers, unit m/s
point 4
Nonlinear
72、73 Input floating-point numbers
coefficient 4
10
http://www.microsensorcorp.cn
Add: No.18,Yingda Road Baoji,P.R.China, 721006
Tel: +86 917 3600739/3600909 Fax:3609977
MODBUS RTU Communication Protocol
Nonlinear
74、75 calibration Input floating-point numbers, unit m/s
point 5
Nonlinear
76、77 Input floating-point numbers
coefficient 5
Gradient
78、79 Input floating-point numbers, input xx.xx as xx.xx%
limit value
Insensitive
80、81 Input floating-point numbers
time
82、83 Density Input floating-point numbers
84 Density unit Unit defult as t/m3
Extension
85 communicat Input value: 0-99
ion address
Cumulate
86、87 Modify clear code ,long integers
clear code
Converter
88、89 Input long integers
code 1
Converter
90、91 Input long integers
code 2
Sensor
92、93 Input long integers
code
Sensor
94、95 Input long integers
code
96 Buffer size Input value:4-64
Electrode
97、98 Input floating-point numbers, input xx as xx%
threshold
Factory
99、100 calibration Input floating-point numbers, unused
factor
101 Language 0—中文, 1—English
Pulse Number 0 1 2 3 4 5 6 7 8
102 duration Pulse duration 10 20 50 100 150 200 300 500 2000
(ms) (ms)
Write
parameter
103 Input long integers
operation
code
1— Revise operation enable.
Access
104 0— Prohibit revise parameters of the operation, any parameters can be
code control
read.
11
http://www.microsensorcorp.cn
Add: No.18,Yingda Road Baoji,P.R.China, 721006
Tel: +86 917 3600739/3600909 Fax:3609977
MODBUS RTU Communication Protocol
Write permission control: When entering the write parameter operation, you
need to enter the correct system 4th level password first, and then write 1 to
the register.
Revise parameter method:
1 Enter the operation password, which is the fourth level password of the
system;
2 Write 1 to the write operation permission register, and write 1 only when
the password is correct;
3 Read and write other parameters;
4 After the operation is completed, clear the write permission register and
clear the operation password;
5 When there is no read or write operation for 30 minutes, the system will
clear the operation password and write permission register to zero;
Note: The password is set by the local keyboard operation, and the upper
computer cannot change the password.
12
http://www.microsensorcorp.cn
Add: No.18,Yingda Road Baoji,P.R.China, 721006
Tel: +86 917 3600739/3600909 Fax:3609977