MAGX2 Modbus RTU User Guide - 0-V1.5 23-01-2018
MAGX2 Modbus RTU User Guide - 0-V1.5 23-01-2018
5 23-01-2018
List of Contents
1. INTRODUCTION ............................................................................................................................................ 2
1.1 DEFINITIONS AND ABBREVIATIONS ...................................................................................................................... 2
1.2 REFERENCES ........................................................................................................................................................ 2
3. COMMISSIONING ......................................................................................................................................... 5
4. MODBUS ADDRESSING MODULE ............................................................................................................ 6
4.1 MODBUS FUNCTION CODES................................................................................................................................... 6
6. CONTACT...................................................................................................................................................... 29
1.2 References
Reference 1 Modbus over Serial Line Specification & Implementation guide v. 1.0
Modbus.org 12/02/02
Reference 2 Modbus Application Protocol Specification v. 1.1 Modbus.org
12/06/02
Reference 3 MAGX2 manual
Reference 4 GSM SMS Module Specification
The module complies with the Modbus serial line protocol [Reference 1].
Among other things, this implies a master-slave protocol at level 2 of the OSI model. One
node, (the master), issues explicit commands to one of the „slave“-nodes and processes responses.
Slave nodes will not transmit data without request from the master node, and do not communicate with
other slaves. Modbus is a mono master system, which means that only one master can be
connected at any single point in time.
Two modes of communication are possible, Unicast and Broadcast. Unicast mode is where
the master sends a request to one slave device, and waits a specified time for a response. In
Broadcast mode the master sends out a request to address „0“, which means that the information is
for all slave devices on the network. In Broadcast mode there is no response from the slave
devices.
The Modbus frame is shown below, and is valid for both requests and responses.
Before communicating with the master, Baud rate, slave ID and Parity must be selected. This
can be done from the display. Please look at into the MAGX2 transmitter manual to locate the Modbus
menu. (see Reference 3.)
None, 1 stopbit
I.e. the module will not support the other standard data register blocks:
• Coils
• „Discrete input“
• „Input registers“
Function code 3 and 16 are used for accessing registers. Function code 17 (report slave ID)
will return a structure of identification information of the device. Below the different function code
exceptions are described.
Application exceptions:
• Application errors => Exception 2 (Illegal data address)
Holes/register alignment:
• The read command always returns data if no exception is given. Bad start/end alignment will
result in only parts of the data item being read.
• Holes in the holding register map return Exception 2 (Illegal data address)
Modbus
Section
Start Register
2 Password
100 Real-time measurement
150 Float real-time measurement
1000 Info
1500 Display
2000 User settings
2500 External measurements
3000 Service settings
4000 Factory settings
5000 Authorize
10000 Datalogger
When writing to the Holding registers, data validity is not checked. Writing incorrect values can
result in unexpected behaviour of the device. In any further explanations, the following data types are
used:
Bool – this item can be read, but its value has no meaning. Writing value 1 to this item will
cause an unspecified operation to be performed (erasing the Memory module, resetting the flow
totalizers, etc. Reference 3). It is necessary to write both Low and High Word of this item, the register
number always has to be an even number. Not meeting these requirements will cause an Exception 2
error (Illegal data address).
Float – IEEE 754-1985 single precistion (Approximately 7 decimal digits), number consisting of
32 bits, formed by 2 Modbus registers. It is necessary to write both Low and High Word of this item,
the register number always has to be an even number. Not meeting these requirements will cause an
−38 38
Exception 2 error (Illegal data address). Full range ±1.18×10 to ±3.4×10 .
Password(External
10 9 4 Longint 0 0 9999 R*/W
Measurements)
*) For safety purposes, it is not possible to read this item directly. In case a 0 is read from this
register, it means that no valid password was entered, and the given section is not accessible. In case
a 1 is read, a valid password was entered and hence the given section can be accessed freely. To
close the section, you write any possible invalid password to the password entry.
External
122 121 4 Longint 1 -10^7 10^7 R
Temperature
External
124 123 4 Longint 3 0 2^32 R
Pressure
*) The final number is given by the sum of the whole and the decimal. Example: Resulting
Total measurement = (TOTAL) + (TOTAL DEC*10^-3).
Flow
Unit: m3/h - it is not possible to change it. Real value = Actual value divided by 1000.
Temp
Actual error is represented in Hex format. For decode it has to be conversed to binary format, where
each bit represent specific error. (See MAGX2 manual, MAGX2 Error Code Table)
External Temperature
If external measurements module temperature is used then real temperature value = Actual value
divided by 10.
External Pressure
If external measurements module pressure is used then real pressure value = Actual value divided by
1000.
In case signed value for longint cannot be used, a absolute value of flow and its sign can be used.
Unit: m3/h - it is not possible to change it. Real ABS value = Actual value divided by 1000.
Float Flow
Float Temp
Temperature.
SD Card Present,
1018 1017 4 Longint 0 0 1 0=No, R
1=Yes
GSM Module
present,
1020 1019 4 Longint 0 0 1 R
0=No,
1=Yes
GPRS Module
Present,
1026 1025 4 Longint 0 0 1 R
0=No,
1=Yes
Wi-Fi Module
Present,
1028 1027 4 Longint 0 0 1 R
0=No,
1=Yes
Unit no. – unique number for each Flowmeter. If there are any problems, please refer to this number.
Error [min] – the number of minutes the device was measuring with some error.
Actual Error - Actual error is represented in Hex format. For decode it has to be converted to binary
format, where each bit represent each error. (See MAGX2 manual, MAGX2 Error Code Table).
GSM Module present - Value represent if GSM Module is present (0 = not, 1 = is present) [Reference
4].
GPRS Module present - Value represent if GSM Module is present (0 = not, 1 = is present)
Wi-fi Module present - Value represent if GSM Module is present (0 = not, 1 = is present)
Unit Flow,
0=UKG/min,
1500 1499 4 Longint - 0 4 1=USG/min, R/W
2=m3/h,
3=l/min, 4=l/s
Unit Volume,
0=UKG,
1502 1501 4 Longint - 0 3 1=USG, R/W
2=m3,
3=l
Unit
Temperature
1504 1503 4 Longint - 0 1 R/W
0 = °C,
1 = °F
Unit
Pressure
1506 1505 4 Longint - 0 1 R/W
0 = bar,
1 = psi
Language,
0 = ENG,
1 = SPA,
1508 1507 4 Longint - 0 4 R/W
2 = RUS,
3 = UKR,
4 = TUR
Backlight,
0 = 10 sec,
1512 1511 4 Longint - 0 1 R/W
1 = Always
on
3
Unit Flow – actual flow unit (default m /h).
3
Unit Volume – totalizer unit (default m ).
Unit Temperature – applies for both internal and external temperature sensors.
Current Loop
2020 2019 4 Longint 0 4 20 Calibration point 1 R/W
[mA]
Current Loop
2022 2021 4 Longint 0 4 20 Calibration point 2 R/W
[mA]
Current Loop
2024 2023 4 Longint 4 0.5 1.5 R/W
Calibration const 1
Relay 1
Setting - Signal,
0 = OFF,
1 = Fixed,
2 = Flow+,
3 = Flow-,
2038 2037 4 Longint - 0 9 4 = Error, R/W
5 = Air Detect,
6 = On In,
7 = On Out,
8 = On<F1,
9 = On>F1
Relay 2
Setting - Signal,
0 = OFF,
1 = Fixed,
2 = Flow+,
3 = Flow-,
2040 2039 4 Longint - 0 9 4 = Error, R/W
5 = Air Detect,
6 = On In,
7 = On Out,
8 = On<F1,
9 = On>F1
Frequency
Settings – Signal,
0 = OFF,
1 = Fixed,
2060 2059 4 Longint - 0 6 2 = Flow+, R/W
3 = Flow-,
4 = Error,
5 = Air Detect,
6 = Direct Driving
Modbus Slave
2076 2075 4 Longint 0 0 247 R/W
Address
CSV Format – Set separator between each data. Set comma or semicolon.
Air Detector – this option allows selecting empty pipe check. Default OFF.
Delete Aux + Volume – write value different to zero for erasing the auxiliary flow totalizer.
Samples per Avg. – the number of samples that the flowmeter will use for calculation of its displayed
average flow value. Default 15. (Maximal value for sensor v.8 and later is 120 and for sensor v.7 is 60)
Flow min - see chapter User Setting Menu - Current Loop in MAGX2 manual.
Flow max - see chapter User Setting Menu - Current Loop in MAGX2 manual.
Current min - see chapter User Setting Menu - Current Loop in MAGX2 manual.
Current max - see chapter User Setting Menu - Current Loop in MAGX2 manual.
Current Loop Calibration point 1 - see chapter User Setting Menu - Current Loop in MAGX2
manual.
Current Loop Calibration point 2 - see chapter User Setting Menu - Current Loop in MAGX2
manual.
Current Loop Calibration constant 1 - see chapter User Setting Menu - Current Loop in MAGX2
manual.
Current Loop Calibration constant 2 - see chapter User Setting Menu - Current Loop in MAGX2
manual.
Voltage output Setting – see chapter User Setting Menu – Voltage Output in MAGX2 manual.
Flow min - see chapter User Setting Menu – Voltage Output in MAGX2 manual.
Flow max - see chapter User Setting Menu – Voltage Output in MAGX2 manual.
Voltage min - see chapter User Setting Menu – Voltage Output in MAGX2 manual.
Voltage max - see chapter User Setting Menu – Voltage Output in MAGX2 manual.
Relay 1 setting – see chapter User Setting Menu – Pulse Output in MAGX2 manual.
Relay 2 setting – see chapter User Setting Menu – Pulse Output in MAGX2 manual.
Flow 1 - see chapter User Setting Menu – Pulse Output in MAGX2 manual.
Flow 2 - see chapter User Setting Menu – Pulse Output in MAGX2 manual.
Hysteresis 1 - see chapter User Setting Menu – Pulse Output in MAGX2 manual.
Hysteresis 2 - see chapter User Setting Menu – Pulse Output in MAGX2 manual.
Relay 3 setting – see chapter User Setting Menu – Pulse Output in MAGX2 manual.
Relay 4 setting – see chapter User Setting Menu – Pulse Output in MAGX2 manual.
Volume plus - see chapter User Setting Menu – Pulse Output in MAGX2 manual.
Dose (Batch) - see chapter User Setting Menu – Pulse Output in MAGX2 manual.
Frequency setting – see chapter User Setting Menu – Frequency Output in MAGX2 manual.
Flow 1 - see chapter User Setting Menu – Frequency Output in MAGX2 manual.
Flow 2 - see chapter User Setting Menu – Frequency Output in MAGX2 manual.
Frequency 1 - see chapter User Setting Menu – Frequency Output in MAGX2 manual.
Frequency 2 - see chapter User Setting Menu – Frequency Output in MAGX2 manual.
Duty cycle - see chapter User Setting Menu – Frequency Output in MAGX2 manual.
Load default settings – Load default factory setting or users changing setting on function Save
setting.
GSM Data Interval – For more info see GSM SMS Module Specification (chapter Set Sending
Interval) [Reference 4].
GSM Phone 1 H, GSM Phone 2 H, GSM Phone 3 H – High part of phone number (i.e. 4207 for
phone number +420777123456). Do not enter character +. The character + is added automatically. All
phone numbers must be in international format (i.e. +420123456789). For more info see GSM SMS
Module Specification [Reference 4].
GSM Phone 1 L, GSM Phone 2 L, GSM Phone 3 L – Low part of phone number (i.e. 77123456 for
phone number +420777123456) [Reference 4].
GSM Empty Pipe Event – For more info see GSM SMS Module Specification [Reference 4].
GSM Zero Flow Event – For more info see GSM SMS Module Specification [Reference 4].
GSM Error Detect Event – For more info see GSM SMS Module Specification [Reference 4].
GSM Empty Pipe Event Settings – For more info see GSM SMS Module Specification [Reference 4].
GSM Zero Flow Event Settings – For more info see GSM SMS Module Specification [Reference 4].
External
temperature
2500 2499 4 Longint 0 0 1 measurement state, R/W
0 = ON,
1 = OFF
Temperature
sensor type,
0 = PT100,
2502 2501 4 Longint 0 0 3 R/W
1 = PT200,
2 = PT500,
3 = PT1000
Temperature
sensor connection,
2504 2503 4 Longint 0 0 2 0 = 2-Wire, R/W
1 = 3-Wire,
2 = 4-Wire
Temperature
2506 2505 4 Longint 1 0 1000 sensor calibration, R/W
actual temperature
Temperature
2508 2507 4 Bool 0 0 1 sensor calibration, R/W
start now
External pressure
measurement state,
2510 2509 4 Longint 0 0 1 R/W
0 = ON,
1 = OFF
External temperature measurement state – Switches on/off the external temperature module.
Temperature sensor type and connection – defines which and how is the external temperature
sensor connected. For more information follow MAGX2 manual (Reference 3).
Temperature sensor calibration temperature and start now - set the known temperature * 10 to
actual temperature register and write 1 to start now.
External pressure measurement state – Switches on/off the external pressure module.
External pressure current loop calibration – defines input current span that is equal to measured
pressure.
Measurement,
3016 3015 4 Longint - 0 1 0 = Run, R/W
1 = Stop
Invert Flow,
3022 3021 4 Longint - 0 1 0 = No-invert, R/W
1 = Invert
Electrode Cleaning, 0 = OFF,
3024 3023 4 Longint 0 0 2 1 = ON, R/W
2 = ON Start
Delete Error (min) – write value different to zero for erasing the Error min counter.
Delete OK (min) – write value different to zero for erasing the OK min counter.
Delete Total – Volume – write value different to zero for erasing the Total – flow totalizer.
Delete Total + Volume – write value different to zero for erasing the Total + flow totalizer.
Delete Total Volume – write value different to zero for erasing the Total flow totalizer.
Flow Simulation – switch off/on the simulation flow function. Default OFF.
Service Mode – write value different to zero for turn ON the service mode. Default OFF.
Measurement – 0 = Stop – the unit shows actual flow, but the totalizers are stopped.
1 = Running – totalizers are active. Default Stop.
Air Constant – constant value to determine the Empty pipe detection limit. Default 188.
Start Delay – Value represent how long is stabilize all component. (actual flow is “0” at this time).
Invert Flow – this function serves to change the direction of the flow. Default No-invert.
Clean Time – number of seconds, how long run electrode cleaning, when select “On Start” or “Start
Now”
Start Now? – If set, start electrode cleaning now for Clean Time.
Low Flow Cutoff – this function serves to set the minimum flow the flowmeter will react on. Default
2%.
Date Settings - date write in BCD format YYYYMMDD (i.e. 25.03.2010 = (hex)0x20100325)
Time Settings - time write in BCD format HHMMSS (i.e. 08:33:15 = (hex)0x00083315)
Calibration
4004 4003 4 Longint 3 0.015 36 000 000 R/W
Point1
Calibration
4006 4005 4 Longint 3 0.015 36 000 000 R/W
Point2
Calibration
4008 4007 4 Longint 3 0.015 36 000 000 R/W
Point3
Calibration
4010 4009 4 Longint 0 -10000000 10000000 R/W *
Data1
Calibration
4012 4011 4 Longint 0 -10000000 10000000 R/W *
Data2
Calibration
4014 4013 4 Longint 0 -10000000 10000000 R/W *
Data3
Zero Flow
4018 4017 4 Longint 0 -10000000 10000000 R/W
Constant
Zero Flow
4020 4019 4 Bool - 0 1 R/W
Erase?
Excitation
frequency,
4022 4021 4 Longint - 0 1 R/W
0=3.125Hz,
1=6.250Hz
Excitation,
4024 4023 4 Longint - 0 1 R/W
0=ON, 1=OFF
Service Mode,
4026 4025 4 Longint - 0 1 R/W
0=ON, 1=OFF
Sensor
4030 4029 4 Longint 0 0 99999999 communication R/W
module SN
Optical Buttons
4048 4047 4 Longint 0 0 100 R/W
Down/Up Level
Optical Buttons
4050 4049 4 Longint 0 0 100 R/W
Left/Right Level
Optical Buttons
4052 4051 4 Longint 0 0 100 Enter/ESC R/W
Level
Zero Flow? – after activation this function, average value from ADC converter ( number of samples
for average is value of Samples per Average).
.
Zero Flow Constant – Set manually value for zero flow constant.
Excitation – write zero for turn OFF the excitation. Default ON.
Service Mode – write value different to zero for turn ON the service mode. Default OFF.
Save Settings? – Save setting to battery backed up RAM, next time will be load with Load Default
Settings function.
Sensor communication module SN – Serial number of connected sensor communication module v8,
9
Optical buttons x/x level – sets level of sensitivity 0-100%. Higher number less sensitive buttons.
User Password
5000 4999 4 Longint 0 0 9 9999999 R/W
Setup
Total + DEC – Positive totalizer decimal fraction (always 3 decimal numbers, i.e.: 25 = 0.025)
Total – DEC – Negative totalizer decimal fraction (always 3 decimal numbers, i.e.: 25 = 0.025)
Error min – the number of minutes the device was not measuring because of errors.
Office hours:
8:30 – 18:00 (GMT+1)