Truflo MF-1000 In-Line Magnetic Flow Meter - MODBUS Protocol
Read the user's manual carefully before starting to use the unit. The producer reserves the right to implement changes without prior notice.
MODBUS Protocol
The MF1000 Magnetic Flow Meter supports the Modbus-RTU protocol, which can be customized according to user needs. When selecting bus control, choose the required protocol in the communication settings. In this document, the term "slave" refers to the Magnetic Flow Meter.
Types and Formats of Communication Data
Information is transmitted asynchronously in bytes. The communication information between the master station and the slave station uses a 10-bit word format:
- Start bit: 1 bit
- Data bit: 8 bits
- Parity bit: None
- Stop bit: 1 bit
Communication Data (Information Frame) Format
Data Format | Address Code | Function Code | Data Area | CRC Check |
---|---|---|---|---|
Data Length | 1 bit | 1 bit | N bit | 16-bit CRC code (redundant cyclic code) |
Communication Information Transmission Process
When a communication command is sent from the master device to the flow meter, the flow meter matching the address code receives the command. It reads the information based on the function code and related requirements. If the CRC check is correct, the command is executed, and the result (data) is returned to the host. The returned information includes the address code, function code, executed data, and CRC check code. If there is a CRC error, no information is returned.
1.1 Address Code
The address code is the first byte (8 bits) of each communication information frame, ranging from 0 to 255. This byte indicates the slave address that should receive the information sent by the master. Each slave must have a unique address code. When the slave sends back information, the returned data starts with its own address code. The address code sent by the master indicates the target slave address, and the address code returned by the slave indicates the source of the information.
1.2 Function Code
This is the second byte transmitted in each communication information frame. Modbus communication protocol defines function codes from 1 to 127. The smart electromagnetic flowmeter uses a subset of these function codes. The master sends a function code to instruct the slave on the action to perform. The slave returns the same function code in its response, indicating that it has responded and performed the related operations.
Function Code | Definition | Operation (binary) |
---|---|---|
03 | Read Register Data | Read data from one or more registers |
10 | Write multiple registers | Write multiple sets of binary data to multiple registers |
1.3 Data Area
The data area contains the information to be returned or the action to be performed by the slave. This can include data like instantaneous flow, flow rate, cumulative flow, or reference addresses. For example, using function code 03, the master can request register values, specifying the start address and length. The returned data includes the data length and content. Data addresses and information vary between different slaves.
The intelligent electromagnetic flowmeter uses the Modbus communication protocol. The host (PLC, RTU, PC, DCS, etc.) can read its data registers using communication commands. Variables stored in the data registers are 16-bit (2 bytes) binary data, with the high byte first. Up to 50 registers can be read at once. A single variable might consist of 4 bytes of data, requiring two reads for the high and low bytes (e.g., positive cumulative flow).
The slave response format includes the slave address, function code, data area, and CRC code. Data in the data area is two bytes, with the high byte preceding the low byte.
1.4 Standstill Time Requirements
Before sending data, a data bus static time is required. This means the time without data transmission should not exceed 50ms at a baud rate of 9600.
1.5 Timeout Requirements
After the host sends a command, the timeout time should be greater than 200ms at a baud rate of 9600.
2. Introduction to MODBUS Function Codes
2.1 Function Code "03": Read Multiple Register Input
Example: The master wants to read data from 3 slave registers (slave address 01, starting address 000E).
Register Address | Register Data (Hexadecimal) | Corresponding Variable |
---|---|---|
000E | 0180 | Variable 1 |
000F | 0180 | Variable 2 |
0010 | 0180 | Variable 3 |
Sent by Host | Number of Bytes | Information Sent | Remarks |
---|---|---|---|
Slave Address | 1 | 01 | Send to slave with address 01 |
Function Code | 1 | 03 | Read register |
Start Address | 2 | 000E | The start address is 0x000E |
Data Length | 2 | 0003 | Read 3 registers (6 bytes in total) |
CRC Code | 2 | 6408 | The CRC code is calculated by the host |
Slave Response | Bit No. | Message Return | Remarks |
---|---|---|---|
Slave Address | 1 | 01 | From slave 01 |
Function Code | 1 | 03 | Read register |
Returns the number of bytes | 2 | 06 | 3 registers total 6 bytes |
Register Data 1 | 2 | 0180 | Contents of memory at address 0x000E |
Register Data 2 | 2 | 0180 | Contents of memory at address 0x000F |
Register Data 3 | 2 | 0180 | Contents of memory at address 0x0010 |
CRC Code | 2 | 215E | The CRC code is calculated by the meter |
2.2 Function Code "10": Write Multiple Registers
The master uses this function code to save multiple data to the slave meter's data memory. A register is 16 bits (2 bytes), with the high bit first. The slave memory is two bytes. The Modbus protocol allows saving up to 60 registers at a time.
Example: The host wants to save 0003 and 00FF to slave registers 003A and 003B (slave address 01).
Sent by Host | Number of Bytes | Sending Information | Example |
---|---|---|---|
Slave Address | 1 | 01 | Send to slave 01 |
Function Code | 1 | 10 | Write multiple registers |
Start Address | 2 | 003A | The start address of the register to be written |
Number of Storage Registers | 2 | 0002 | Number of storage registers (2 in total) |
Save data byte length | 1 | 04 | Save data byte length (total 4 bytes) |
Save data 1 | 2 | 0003 | Data address 003A |
Save data 2 | 2 | 00FF | Data address 003B |
CRC Code | 2 | C084 | CRC code calculated by the host |
Slave Response | Number of Bytes | Message Return | Example |
---|---|---|---|
Slave Address | 1 | 01 | From slave 01 |
Function Code | 1 | 10 | Write multiple registers |
Start Address | 2 | 003A | The start address is 003A |
Save the Number of Registers | 2 | 0002 | Save the data of 2 registers |
CRC Code | 2 | 61C5 | CRC code calculated by the slave |
2.3 Error Check Code (CRC Check)
The CRC check code allows the host or slave to verify the correctness of received information. It helps detect errors caused by electronic noise or interference during transmission. The CRC in the Modbus protocol is a 2-byte (16-bit) binary number. The sending device calculates and appends it to the information frame. The receiving device recalculates the CRC and compares it with the received CRC. A mismatch indicates an error. The CRC calculation uses only the 8 data bits, excluding start, stop, and parity bits.
3. Communication Error Information and Data Processing
When the flowmeter detects an error other than a CRC error, it returns an error code to the master. The highest bit of the function code is set to 1 (function code + 128) to indicate an unexpected error. If the slave receives information with a CRC error, it ignores the message.
The format of the error code returned by the slave (excluding CRC) is:
- Address Code: 1 byte
- Function Code: 1 byte (highest bit is 1)
- Error Code: 1 byte
- CRC Code: 2 bytes
The slave responds with the following error codes:
- 81: Illegal function code. The received function code is not supported by the slave.
- 82: Read illegal data address. The specified data location is outside the readable address range of the slave.
- 83: Illegal data value. The received data value sent by the master exceeds the data range of the corresponding address of the slave.
4. Data Format Description
RO: Read-only parameter; RW: Readable and writable parameters; DW: 4-byte data (high 2 bytes and low 2 bytes transmitted separately); W: 2 bytes of data; B: Single-byte data (zero-filled to 2 bytes in Modbus, high byte is 0); SF: 4-byte data, floating-point format (transmitted as two 2-byte registers).
Data is presented in three formats: unsigned integer, signed integer, and floating-point.
- Unsigned integer data: Many values are unsigned integers. DW*1000 indicates data is magnified by 1000 (e.g., 0.001 is represented as 1).
- Signed integer data: Zero point correction data can be positive or negative. The highest bit indicates the sign (0 for positive, 1 for negative).
- Floating-point format: Uses IEEE754 32-bit format (4 bytes, two registers). Structure: S EEEEEEE E MMMMMMMM MMMMMMMM MMMMMMMM, where S is the sign bit, E is the exponent (difference from 127), and M is the mantissa (lower 23 bits). Conversion formula:
V=(-1)^S * 2^(E-127) * (1+M)
when E is not all 0s or all 1s.
4.1 Special Function Description
The protocol supports clearing cumulative amounts for batch control. Accumulator clearing corresponds to registers 96 and 97. To clear, write the accumulated amount clearing password to these registers. Contact the manufacturer for the reset password.
Alarm_Bits Description: Bit 1: Upper limit alarm, Bit 2: Lower limit alarm, Bit 3: Empty pipe alarm, Bit 4: Excitation alarm.
Flow_Unit | Unit |
---|---|
0 | L/H |
1 | L/M |
2 | L/S |
3 | M³/H |
4 | M³/M |
5 | M³/S |
6 | KG/H |
7 | KG/M |
8 | KG/S |
9 | T/H |
10 | T/M |
11 | T/S |
Throughput_Unit | Unit |
---|---|
0 | 0.001 L |
1 | 0.01 L |
2 | 0.1 L |
3 | 1 L |
4 | 0.001 M³ |
5 | 0.01 M³ |
6 | 0.1 M³ |
7 | 1 M³ |
8 | 1 KG |
9 | 1 T |
Excitation_Freq | Frequency |
---|---|
0 | 1/32 Power Frequency |
1 | 1/16 Power Frequency |
2 | 1/8 Power Frequency |
3 | 1/4 Power Frequency |
4 | 1/2 Power Frequency |
Excitation_Current | Current |
---|---|
0 | 100 % |
1 | 90 % |
2 | 80 % |
3 | 70 % |
4 | 55 % |
5 | 40 % |
6 | 20 % |
7 | 0 % |
Measure_Direction | Direction |
---|---|
0 | Reverse |
1 | Forward |
Output_Pulse | Type |
---|---|
0 | Frequency Output |
1 | Pulse Output |
Pulse_Unit | Unit |
---|---|
0 | 0.001 L |
1 | 0.01 L |
2 | 0.1 L |
3 | 1 L |
4 | 0.001 M³ |
5 | 0.01 M³ |
6 | 0.1 M³ |
7 | 1 M³ |
5. Flow Meter Register Address Definition
5.1 Definition of Common Register Address of Flow Meter
(SF: Single precision floating point format, DW: Double word format, W: Word format)
Register | PLC Memory Address | Unit | Number of Bytes | Attribute | Format | Register Definition |
---|---|---|---|---|---|---|
90 | 40091 | 4 | RO | SF | Forward Cumulative Flow - Float Format | |
92 | 40093 | 4 | RO | SF | Reverse Cumulative Flow - Float Format | |
94 | 40095 | 4 | RO | SF | Total Cumulative Flow - Float Format | |
96 | 40097 | 4 | RW | DW | Cumulative flow reset | |
98 | 40099 | Refer to Register 105 | 4 | RO | SF | Flow - float format |
100 | 40101 | m/s | 4 | RO | SF | Velocity - float format |
102 | 40103 | % | 4 | RO | SF | Flow Percent - Float Format |
104 | 40105 | % | 2 | RO | W | Empty Tube Percentage |
105 | 40106 | 2 | RO | W | Flow unit | |
106 | 40107 | 2 | RO | W | Empty pipe alarm | |
107 | 40108 | 2 | RO | W | Excitation alarm |
5.2 Definition of All Register Addresses of the Flow Meter
(SF: Single precision floating point format, DW: Double word format, W: Word format)
Variable Address | PLC Memory Address | Unit | Number of Bytes | Attribute | Format | Register Definition |
---|---|---|---|---|---|---|
0 | 40001 | m/s | 2 | R0 | DW*1000 | Flow Rate - High Byte |
1 | 40002 | m/s | 2 | R0 | DW*1000 | Flow Rate - Low Byte |
2 | 40003 | 2 | R0 | DW*100 | Instantaneous traffic - high byte | |
3 | 40004 | 2 | R0 | DW*100 | Instantaneous Traffic - Low Byte | |
4 | 40005 | % | 2 | R0 | B*100 | Flow percentage |
5 | 40006 | % | 2 | R0 | B*100 | Empty Tube Percentage |
6 | 40007 | 2 | R0 | DW*1 | Forward Cumulative Flow-High Byte | |
7 | 40008 | 2 | RO | DW*1 | Forward Cumulative Flow-Low Byte | |
8 | 40009 | 2 | RO | DW*1 | Reverse Cumulative Flow-High Byte | |
9 | 40010 | 2 | RO | DW*1 | Reverse Cumulative Flow-Low Byte | |
10 | 40011 | 2 | RO | DW*1 | reserved address | |
11 | 40012 | 2 | RO | DW*1 | reserved address | |
12 | 40013 | 2 | RO | B*1 | Alarm information | |
13 | 40014 | 2 | RO | B*1 | fluid flow | |
14 | 40015 | 2 | RO | DW | System Time - Year - High Byte | |
15 | 40016 | 2 | RO | DW | System Time - Year - Low Byte | |
16 | 40017 | 2 | RO | B | System Time-Month | |
17 | 40018 | 2 | RO | B | System Time-Day | |
18 | 40019 | 2 | RO | B | System time-hour | |
19 | 40020 | 2 | RO | B | System time-minute | |
20 | 40021 | 2 | RO | B | System time-seconds | |
21 | 40022 | mm | 2 | RW | W | pipe diameter |
22 | 40023 | 2 | RW | DW | Instantaneous flow range high byte | |
23 | 40024 | 2 | RW | DW | Instantaneous flow range low byte | |
24 | 40025 | 2 | RW | B | Instantaneous flow unit | |
25 | 40026 | 2 | RW | B | cumulative flow unit | |
26 | 40027 | S | 2 | RW | W*1 | Response time |
27 | 40028 | 2 | RW | W*10000 | Sensor parameters | |
28 | 40029 | HZ | 2 | RW | B | Excitation frequency |
29 | 40030 | % | 2 | RW | B | Excitation current |
30 | 40031 | 2 | RW | B | Measuring direction setting | |
31 | 40032 | mm/s | 2 | RW | W | Zero Point Correction |
32 | 40033 | % | 2 | RW | W*100 | small signal point cut-off |
33 | 40034 | 2 | RW | B | Allows for small signal cut-off | |
34 | 40035 | 2 | RW | B | Reverse output allows | |
35 | 40036 | 2 | RW | B | Empty Pipe Alarm Allowed | |
36 | 40037 | % | 2 | RW | B | Empty Pipe Alarm Threshold |
37 | 40038 | 2 | RW | B | Upper limit alarm allowed | |
38 | 40039 | % | 2 | RW | W*100 | Upper limit alarm threshold |
39 | 40040 | 2 | RW | B*1 | Lower limit alarm allowed | |
40 | 40041 | % | 2 | RW | W*100 | Lower limit alarm threshold |
41 | 40042 | 2 | RW | B | High temperature alarm allows | |
42 | 40043 | C | 2 | RW | W*100 | High temperature alarm threshold |
43 | 40044 | 2 | RW | B | Excitation alarm allows | |
44 | 40045 | 2 | RW | B | Pulse frequency output | |
45 | 40046 | 2 | RW | B | Pulse equivalent | |
46 | 40047 | HZ | 2 | RW | W | Frequency output range |
47 | 40048 | 2 | RW | W | reserved address | |
48 | 40049 | 2 | RW | B | reserved address | |
49 | 40050 | 2 | RW | B | reserved address | |
50 | 40051 | 2 | RW | W | reserved address | |
51 | 40052 | 2 | RW | B | reserved address | |
52 | 40053 | 2 | RW | B | reserved address | |
53 | 40054 | 2 | RW | W | reserved address | |
54 | 40055 | 2 | RW | B | reserved address | |
55 | 40056 | 2 | RW | B | reserved address | |
56 | 40057 | 2 | RW | W | reserved address | |
57 | 40058 | 2 | RW | B | reserved address | |
58 | 40059 | 2 | RW | B | reserved address | |
59 | 40060 | 2 | RW | DW*1000 0 | Meter Coefficient - High Byte | |
60 | 40061 | 2 | RW | DW*1000 0 | Meter Coefficient - Low Byte | |
61 | 40062 | 2 | RW | W | Empty Pipe Coefficient A | |
62 | 40063 | 2 | RW | W | Empty Pipe Coefficient B | |
63 | 40064 | 2 | RW | W | Empty Pipe Coefficient C | |
64 | 40065 | 2 | RW | W | Empty Pipe Coefficient D | |
65 | 40066 | 2 | RW | W*10000 | Converter Normalization Factor | |
66 | 40067 | 2 | RW | B | First state filtering allows | |
67 | 40068 | 2 | RW | W*10000 | First state filter factor | |
68 | 40069 | Min | 2 | RO | DW*60 | Cumulative Working Hours - High Byte |
69 | 40070 | Min | 2 | RO | DW*60 | Cumulative Operating Hours - Low Byte |
70 | 40071 | 2 | RW | DW | Flow Correction Point 1 -High Byte | |
71 | 40072 | 2 | RW | DW | Flow Correction Point 1-Low Byte | |
72 | 40073 | 2 | RW | DW | Flow Correction Point 2-High Byte | |
73 | 40074 | 2 | RW | DW | Flow Correction Point 2-Low Byte | |
74 | 40075 | 2 | RW | DW | Flow Correction Point 3-High Byte | |
75 | 40076 | 2 | RW | DW | Flow Correction Point 3-Low Byte | |
76 | 40077 | 2 | RW | DW | Flow Correction Point 4-High Byte | |
77 | 40078 | 2 | RW | DW | Flow Correction Point 4-Low Byte | |
78 | 40079 | 2 | RW | DW | Flow Correction Point 5-High Byte | |
79 | 40080 | 2 | RW | DW | Flow Correction Point 5-Low Byte | |
80 | 40081 | 2 | RW | DW | Flow Correction Factor 1-High Byte | |
81 | 40082 | 2 | RW | DW | Flow correction factor 1-low byte | |
82 | 40083 | 2 | RW | DW | Flow Correction Factor 2-High Byte | |
83 | 40084 | 2 | RW | DW | Flow correction factor 2-low byte | |
84 | 40085 | 2 | RW | DW | Flow Correction Factor 3-High Byte | |
85 | 40086 | 2 | RW | DW | Flow correction factor3-low byte | |
86 | 40087 | 2 | RW | DW | Flow Correction Factor 4-High Byte | |
87 | 40088 | 2 | RW | DW | Flow correction factor 4-low byte | |
88 | 40089 | 2 | RW | DW | Flow Correction Factor 5-High Byte | |
89 | 40090 | 2 | RW | DW | Flow correction factor 5-low byte | |
90 | 40091 | 2 | RO | SF | Forward cumulative flow floating point format-high byte | |
91 | 40092 | 2 | RO | SF | Forward cumulative flow floating point format-low byte | |
92 | 40093 | 2 | RO | SF | Reverse Cumulative Flow Float Format-High Byte | |
93 | 40094 | 2 | RO | SF | Reverse Cumulative Flow Float Format-Low Byte | |
94 | 40095 | 2 | RO | SF | Total cumulative flow floating point format-high byte | |
95 | 40096 | 2 | RO | SF | Total cumulative flow floating point format-low byte | |
96 | 40097 | 2 | RW | DW | Cumulative flow reset - high byte | |
97 | 40098 | 2 | RW | DW | Cumulated flow reset-low byte | |
98 | 40099 | refer to Register 105 | 2 | RO | SF | Flow - high byte |
99 | 40100 | 2 | RO | SF | Flow - low byte | |
100 | 40101 | m/s | 2 | RO | SF | Flow Rate - High Byte |
101 | 40102 | m/s | 2 | RO | SF | Flow Rate - Low Byte |
102 | 40103 | % | 2 | RO | SF | Flow Percentage-High Bytes |
103 | 40104 | % | 2 | RO | SF | Flow Percentage-Low Bytes |
104 | 40105 | % | 2 | RO | W | Empty Tube Percentage |
105 | 40106 | 2 | RO | W | flow unit | |
106 | 40107 | 2 | RO | W | Empty pipe alarm | |
107 | 40108 | 2 | RO | W | Excitation alarm | |
108 | 40109 | 2 | RO | W | reserved address | |
109 | 40110 | 2 | RO | W | reserved address | |
110 | 40111 | 2 | RO | W | reserved address | |
111 | 40112 | 2 | RO | W | reserved address | |
112 | 40113 | 2 | RO | W | reserved address | |
113 | 40114 | 2 | RO | W | protocol version | |
114 | 40115 | 2 | RO | W | Unit of flow range | |
115 | 40116 | 2 | RO | W | Reverse measurement allowed |
6. RS485 Flow Reset
Normal Type:
01 10 00 60 00 02 04 00 00 38 50 E6 7B
Byte | Description |
---|---|
01 | Table Address |
10 | Function Code |
0060 | Register Address |
0002 | Data Length |
04 | Digit |
00003850 | Password |
E6 7B | CRC Test |
Special Type:
01 10 00 60 00 02 04 00 01 86 9F 86 4F
Byte | Description |
---|---|
01 | Table Address |
10 | Function Code |
0060 | Register Address |
0002 | Data Length |
04 | Digit |
0001869F | Password |
864F | CRC Test |
Warranty, Returns and Limitations
Warranty
Icon Process Controls Ltd warrants its products to the original purchaser to be free from defects in material and workmanship under normal use for one year from the date of sale. Icon Process Controls Ltd's obligation is limited to the repair or replacement of defective products or components at its option. Claims must be made within thirty (30) days of the claimed defect. Repaired products are warranted for the remainder of the original warranty period, and replacement products are warranted for one year from the date of replacement.
Returns
Products cannot be returned without prior authorization from Icon Process Controls Ltd. To return a product, submit a customer return (MRA) request form via www.iconprocon.com. All returns must be shipped prepaid and insured. Icon Process Controls Ltd is not responsible for products lost or damaged in shipment.
Limitations
This warranty does not cover products that are:
- Beyond the warranty period or not returned following proper procedures.
- Damaged due to improper use, accidents, or negligence.
- Modified or altered.
- Repaired by unauthorized personnel.
- Involved in accidents or natural disasters.
- Damaged during return shipment.
Icon Process Controls Ltd reserves the right to waive this warranty and dispose of returned products if hazardous materials are present or if products remain unclaimed for more than 30 days after notification. This warranty is the sole express warranty provided by Icon Process Controls Ltd. All implied warranties, including merchantability and fitness for a particular purpose, are expressly disclaimed. Remedies are limited to repair or replacement. Icon Process Controls Ltd shall not be liable for incidental or consequential damages. This warranty is governed by the laws of the province of Ontario, Canada. If any provision is found invalid, the rest of the warranty remains in effect.
For additional product documentation and technical support, visit www.iconprocon.com, email sales@iconprocon.com or support@iconprocon.com, or call 905.469.9283.