MAGX2 Modbus RTU User Guide - 0-V1.3 12-11-2014
MAGX2 Modbus RTU User Guide - 0-V1.3 12-11-2014
3 12-11-2014
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.................................................................................................................................................... ..25
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
The module allows R/W access to the following standard Modbus data register blocks:
• Holding registers
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)
Below, the holding registers for the MAGX2 Modbus RTU module are described.
Modbus
Section
Start Register
2 Password
100 Real-time measurement
1000 Info
1500 Display
2000 User settings
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).
*) 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.
*) 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
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)
Power Frequency
1016 1015 4 Longint 0 - - R
[Hz]
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
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].
5.4 Display
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
Language,
1506 1505 4 Longint - 0 1 0 = ENG, R/W
1 = SPA
3
Unit Flow – actual flow unit (default m /h)
3
Unit Volume – totalizer unit (default m )
Measurement,
2000 1999 4 Longint - 0 1 0 = Run, R/W
1 = Stop
Datalogger Interval,
0 = OFF,
1 = 1min,
2 = 5min,
3 = 10min,
4 = 15min,
2002 2001 4 Longint - 0 10 R/W
5 = 30min,
6 = 1h,
7 = 2h,
8 = 6h,
9 = 12h,
10 = 24h
CSV Format,
2004 2003 4 Longint - 0 1 0 = Coma (,), R/W
1 = Semicolon (;)
Air Detector
2006 2005 4 Longint - 0 1 0 = OFF, R/W
1 = ON
Delete Auxiliary
2010 2009 4 Bool - 0 1 R/W
Volume?
Invert Flow,
2020 2019 4 Longint - 0 1 0 = No-invert, R/W
1 = Invert
Current Loop Setting -
Signal,
0 = Flow+,
2022 2021 4 Longint - 0 6 1 = Flow-, R/W
2 = Error,
3 = Air detector,
4 = Fixed,
Current Loop
2032 2031 4 Longint 0 4 20 Calibration point 1 R/W
[mA]
Current Loop
2034 2033 4 Longint 0 4 20 Calibration point 2 R/W
[mA]
Current Loop
2036 2035 4 Longint 4 0.5 1.5 R/W
Calibration const 1
Current Loop
2038 2037 4 Longint 4 0.5 1.5 R/W
Calibration const 2
Voltage Output
Setting - Signal,
0 = Flow+,
1 = Flow-,
2040 2039 4 Longint - 0 6 2 = Error, R/W
3 = Air detector,
4 = Fixed,
5 = Direct driving,
6 = OFF
Relay 1
Setting - Signal,
0 = OFF,
1 = Fixed,
2 = Flow+,
3 = Flow-,
2050 2049 4 Longint - 0 9 R/W
4 = Error,
5 = Air Detect,
6 = On In,
7 = On Out,
8 = On<F1,
9 = On>F1
Relay 2
Setting - Signal,
2052 2051 4 Longint - 0 9 0 = OFF, R/W
1 = Fixed,
2 = Flow+,
Relay 3
Setting – Signal,
0 = OFF,
1 = ON,
2 = Flow+,
2062 2061 4 Longint - 0 8 3 = Flow-, R/W
4 = Error,
5 = Air Detect,
6 = Pulse/Litre+,
7 = Pulse/Litre-,
8 = Dosing
Relay 4
Setting – Signal,
0 = OFF,
1 = ON,
2 = Flow+,
2064 2063 4 Longint - 0 8 3 = Flow-, R/W
4 = Error,
5 = Air Detect,
6 = Pulse/Litre+,
7 = Pulse/Litre-,
8 = Dosing
Frequency
Settings – Signal,
0 = OFF,
1 = Fixed,
2072 2071 4 Longint - 0 6 2 = Flow+, R/W
3 = Flow-,
4 = Error,
5 = Air Detect,
6 = Direct Driving
Modbus Slave
2092 2091 4 Longint 0 0 247 R/W
Address
Modbus Baudrate,
0 = 4800,
2094 2093 4 Longint 0 0 3 1 = 9600, R/W
2 = 19200,
3 = 38400
Parity,
0 = Even, 1stopbit,
2096 2095 4 Longint 0 0 3 1 = Odd,1stopbit, R/W
2 = None, 2stopbits,
3 = None, 1stopbit
Electrode Cleaning, 0
= OFF,
2098 2097 4 Longint 0 0 2 R/W
1 = ON,
2 = ON Start
Totalizer Cycling,
2104 2103 4 Longint 0 0 1 0 = ON, R/W
1 = OFF
GSM Data Interval
2106 2105 4 Longint 5 0 50000 R/W
[min]
Measurement – 0 = Stop – the unit shows actual flow, but the totalizers are stopped.
1 = Running – totalizers are active. Default Stop.
Datalogger Interval – this function selects how often data is written to the datalogger.
CSV Format – Set separator between each data. Set comma or semicolon.
Air Detector – this option allows selecting empty pipe check. Default OFF.
Air Constant – constant value to determine the Empty pipe detection limit. Default 188.
Delete Aux + Volume – write value different to zero for erasing the auxiliary flow totalizer.
Start Delay – Value represent how long is stabilize all component. (actual flow is “0” at this time).
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)
Low Flow Cutoff – this function serves to set the minimum flow the flowmeter will react on. Default
2%.
Invert Flow – this function serves to change the direction of the flow. Default No-invert.
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 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.
Volume minus - 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.
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)
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.
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].
Delete Volume
3006 3005 4 Bool - 0 1 R/W
(+)?
Delete Volume
3008 3007 4 Bool - 0 1 R/W
Total?
Flow simulation,
3010 3009 4 Longint 0 0 1 R/W
0=ON, 1=OFF
Simulated flow
3012 3011 4 Longint 3 0 36 000 000 R/W
[m3/h]
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.
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
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.
User Password
5000 4999 4 Longint 0 0 9 999 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)