MODBUS Communication Setup
MODBUS Communication Setup
The information contained in this manual was current at the time of printing. The most current
versions of all Hydro Instruments’ manuals can be found on our website:
www.hydroinstruments.com
Table of Contents
I. Background ...................................................................................................... 2
TABLES............................................................................................................. 3-30
Table 1. Data Formats and Baud Rates Supported by Hydro Instruments .....3
Table 2. Wiring connections for Modbus RTU .............................................3
Table 3. Description of Function Codes for Hydro Instruments Equipment ....7
Table 4. Modbus OV-110 and OV-1000 Omni-valve ....................................8-9
Table 5. Modbus VPH-10000 Vaporizer ......................................................10
Table 6. Modbus GA-180 Gas Detector ......................................................11-12
Table 7. Modbus CS-110 Automatic Changeover Controller .........................12-13
Table 8. Modbus RAH-210 and RPH-250 Residual Analyzers ........................13-17
Table 9. Modbus TH-4000 Turbidimeter.....................................................17-18
Table 10. Modbus GA-171 Gas Detector ....................................................18-19
Table 11. Modbus HC-220 PID Controller ...................................................19-21
Table 12. Modbus WQM-100 Water Quality Monitor ....................................21-24
Table 13. Modbus RPH-260 Residual Analyzer ............................................24-27
Table 14. Modbus RAH-280 Residual Analyzer ............................................28-30
I. Background
Before setting up/installing the Modbus communication network onto Hydro Instruments
equipment, familiarize yourself with the information contained in this packet. If you have any
questions please contact Hydro Instruments.
Electrical W arning: Programming these devices does include electrical shock risk. Take care
to avoid electrical shocks and do not touch any part of the power line unless you are certain the
power has been disconnected.
II. Definitions
Physical Layer: The physical layer is the actual hardware and electrical termination set-up used
to connect the master and slaves together for Modbus communication. All Hydro Instruments
equipment outlined in this document supports “Modbus RTU” on a 2-wire RS-485 network.
Baud Rate: The baud rate is the modulation of the signal between devices.
Node: The node is the programmed number given to the slave so that the master can
communicate specifically with that unit when requested. Thus, each unit should have its own
unique node number.
Application Layer: This is the layer closest to the end user. It interacts with the software
application to display information in a human-recognizable format.
Master: The master is the main controller of the network (some programmers may be more
familiar with the “server”). There can only be one master per network which is the only device
that can read and write information to the other devices (or slaves). The master may be a
computer or any type of SCADA system.
Slave: The slave, or “client”, is any PLC connected to the master. Each slave will have a
specific node which will be used by the master to communicate to that specific PLC.
Function Code: The function code tells the slave what type of information is being requested
by the master. This information may either be to read or write bits, or to read or write
registers. The function code is an integer from 1 to 127 and that number is interpreted by the
slave as to what information is requested. Thus, the same function code may serve two
different purposes on two different instruments.
Data Quantity: The data quantity tells the slave how many bits or registers of data are going to
the data address.
1. R S-485
The RS-485 network is supported by Hydro Instruments equipment and is the most commonly
used physical layer. It allows for connection to multiple slaves (up to 247), has excellent noise
immunity, high speed (up to 35Mbps), and cables can be used up to 4,000 feet. The RS-485
version of Modbus is commonly referred to as Modbus RTU. Aside from the physical
connections, the user must define the baud rate and the data format so that both the master
and the slave have the same format. The data formats and baud rates that are supported can
be seen in Table 1.
2. Address Data Format - The published Modbus addresses are decimal addresses and
use the standard notation prefix for decimal (no prefix).
Hydro Instruments uses a half-duplex (2 wire) interface type. Hydro Instruments also
recommends that the slaves be “daisy chained” together so that only one connection to the
master is required. Cat 5 cable is the recommended cable to use and the wiring should be
installed according to Table 2.
3. TCP / IP
This network architectural model can be used to communicate through Ethernet or WiFi and has
the advantage of being able to control Modbus devices over the internet. This version is
referred to as Modbus TCP/IP. Hydro Instruments does not currently sell the devices for this
communication and recommends using an intermediate hub which can connect to the RS-485
terminal. The user can then communicate to the hub using the configuration outlined in
Section III.1, and then communicate to this hub over the internet. Contact your supplier for
installation information.
Programming Omni-valves (slaves) should be performed after the physical layer has been
installed (Section III). Omni-valves purchased after October 2013 will be standard equipped to
communicate with Modbus. If purchased before said date, contact Hydro Instruments.
I. Determine the baud rate and data format of the master controller.
II. From the main screen, press the “down” key until the password screen appears. Enter
the password, “110” (OV-110) or “1000” (OV-1000) using the “plus” and “minus” keys.
III. Once the correct password appears on the screen, continue to press the down key until
the text “ADCAL” is blinking, then press the plus key.
IV. Press the down key once so that “Yes” is blinking. Press and hold the “down” key for
approximately 5-10 seconds.
V. A new set of screens should appear. Go down two screens using the “down” key until
the “Modbus” screen appears.
VI. Use the “plus” key to select the baud rate.
VII. Press the “down” key once. Then enter the node number using the “plus” key. Save
this number to program the master controller and to ensure the same number is not
given to two units.
VIII. Press the “down” key once. Then enter the data format using the “plus” key.
IX. Cycle the power to save the information.
Programming Vaporizers should be performed after the physical layer has been installed
(Section III). Refer to the steps below to configure the VPH-10000 vaporizer baud rate, node
number and data format to communicate with the network.
I. Determine the baud rate and data format of the master controller.
II. From the main screen, press the “down” key until the password screen appears. Enter
the password “100” using the “plus” and “minus” keys.
III. Once the correct password is blinking continue to press the down key until the Modbus
screen appears.
IV. Using the “plus” and “minus” keys, enter the baud rate that matches the master/server.
V. Press the “down” key so that the node number is blinking and enter the node number
using the “plus” and “minus” keys. Save this number and make sure it does not match
with any other equipment on the network.
VI. Press the “down” key so that the data format is blinking. Enter the data format that
matches the master/server.
VII. Cycle the power to save the information.
Programming the GA-180 Gas Detectors should be performed after the physical layer has been
installed (Section III). Refer to steps below (and GA-180 O&M Manual Figure 8) to configure the
GA-180 baud rate, node number, and data format to communicate with the network.
I. Determine the baud rate and data format of the master controller.
II. From the main screen, press the “down” key until the password screen appears.
Enter the password “180” using the “plus” and “minus” keys.
III. Once the correct password is blinking press the down arrow key. Then with “Sensor”
blinking, press and hold the “minus” key until the Modbus setup screen appears.
IV. Using the “plus” and “minus” keys, enter the baud rate that matches the
master/server.
V. Press the “down” key so that the node number is blinking and enter the node
number using the “plus” and “minus” keys. Save this number and make sure it does
not match with any other equipment on the network.
VI. Press the “down” key so that the data format is blinking. Enter the data format that
matches the master/server.
VII. Cycle the power to save the information.
Programming the CS-110 Automatic Changeover controllers should be performed after the
physical layer has been installed (Section III). Refer to steps below (and CS-110 O&M Manual)
to configure the CS-110 baud rate, node number, and data format to communicate with the
network.
I. Determine the baud rate and data format of the master controller.
II. From the main screen, press the “down” key until the password screen appears.
Enter the password “110” using the “plus” and “minus” keys.
III. Once the correct password is blinking press the down arrow key. Then continue to
press the “down” key until the Modbus setup screen appears.
IV. Using the “plus” and “minus” keys, enter the baud rate that matches the
master/server.
V. Press the “down” key so that the node number is blinking and enter the node
number using the “plus” and “minus” keys. Save this number and make sure it does
not match with any other equipment on the network.
VI. Press the “down” key so that the data format is blinking. Enter the data format that
matches the master/server.
VII. Cycle the power to save the information.
Programming the Residual Analyzers should be performed after the physical layer has been
installed (Section III). Refer to steps below (and O&M Manuals) to configure the residual
analyzer baud rate, node number, and data format to communicate with the network.
I. Determine the baud rate and data format of the master controller.
II. From the main screen, press and hold the “down” key for at least 5 seconds until the
first hidden screen appears. Use the “down” key to navigate to the 12th hidden
screen which is the Modbus setup screen.
III. Using the “plus” and “minus” keys, enter the baud rate that matches the
master/server.
IV. Press the “down” key so that the node number is blinking and enter the node
number using the “plus” and “minus” keys. Save this number and make sure it does
not match with any other equipment on the network.
V. Press the “down” key so that the data format is blinking. Enter the data format that
matches the master/server.
VI. Cycle the power to save the information.
Programming the TH-4000 Turbidimeter, GA-171 Gas Detector, or HC-220 PID Controller should
be performed after the physical layer has been installed (Section III). Refer to steps below to
configure the baud rate, node number, and data format to communicate with the network.
I. Determine the baud rate and data format of the master controller.
II. From the main screen, press and hold the “down” key for at least 5 seconds until the
Modbus setup screen appears.
III. Using the “plus” and “minus” keys, enter the baud rate that matches the
master/server.
IV. Press the “down” key so that the node number is blinking and enter the node
number using the “plus” and “minus” keys. Save this number and make sure it does
not match with any other equipment on the network.
V. Press the “down” key so that the data format is blinking. Enter the data format that
matches the master/server.
VI. Cycle the power to save the information.
V. Programming Masters:
Be sure that the electrical terminations are complete and accurate. Also confirm that the baud
rate and data format are the same on the master as they are on the slaves. Different software
may have different ways of displaying and programming information on the device, however
the function code and addresses for the specified equipment will be the same regardless of the
software being used. Refer to the tables below for setting the equipment parameters on the
master/server.
The variable type defines whether or not the data stored in the register is a real time
value/number (float/floating point) or if the number will correspond to a feature or command
(integer). In the case of integers, values have been developed so that the Omni-valve can
change and display features like units, the control type, or control alarms and relays over the
Modbus network. The following definitions for integer type values can be seen in table 5.
The Omni-valve integer type values correspond to Modbus registers. The Omni-valve float
values correspond to two Modbus registers in which the float data is in the IEEE 754 format (32
bit). Using this format the first address reads/writes the most significant 16 bits, whereas the
second address reads/writes the least significant 16 bits.
Register
Name Type Address Feature
Value
0 Automatic
Run Mode Integer 0 1 Manual
2 Check Valve Position
0 Normal
1 Flow Signal Loss
2 Low Flow
3 Res/ORP Loss
Alarm Status Integer 1
4 Low Residual
5 High Residual
6 Flow + Resl Loss
7 Dose Signal Loss
0 Flow Pacing
1 Residual/ORP
Control Method Integer 2 2 Compound Loop
3 Step Feed
4 Dual Input Feed Fwd
0 %
1 GPM
2 MGD
Process Variable 1 Units Integer 3 3 LPM
4 MLD
5 GPD
6 m3/hr
0 ppm
Process Variable 2 Units Integer 4 1 mg/l
2 mV
Register
Name Type Address Feature
Value
*Gas Temperature Integer 1
*Gas Pressure Integer 2
Gas Pressure Span Integer 3
High Pressure Alarm Level Integer 4
*Superheat Temperature Integer 5
Superheat Alarm Set Point Integer 6
*Control Water Temperature Integer 7
Water Temperature Set Point Integer 8
High Temperature Alarm Set Point Integer 9
Low Temperature Alarm Set Point Integer 10
*Aux Water Temperature Integer 11
0 Normal
1 High
*Water Level Integer 12
2 Low
3 Low Low
*Heater Power Output (kW) Integer 13
*Heater Power Output (%) Integer 14
*Heater Element Temperature Integer 15
0 Celsius
Temperature Units Integer 16
1 Fahrenheit
0 PSI
Pressure Units Integer 17
1 Bar
0 Normal
2 Low Water Temperature
3 High Water Temperature
4 Heater Over Temperature
5 Superheat Alarm
*Alarm Status Integer 18 6 High Water Alarm
7 Low Water Alarm
8 PRV Burst Disc
EXP Burst Disc High
9
Pressure
10 High Pressure
*Values are read only and cannot be edited by the user.
0 0 0 0 = 0 Sensor Off
0 0 0 1 = 1 NH3 (Ammonia)
0 0 1 0 = 2 O2 (Oxygen)
0 0 1 1 = 3 O3 (Ozone)
0 1 0 0 = 4 SO2 (Sulfur dioxide)
0 1 0 1 = 5 Cl2 (Chlorine)
0 1 1 0 = 6 ClO2 (Chlorine dioxide)
0 1 1 1 = 7 CO (Carbon monoxide)
1 0 0 0 = 8 H2 (Hydrogen)
1 0 0 1 = 9 H2S (Hydrogen sulfide)
33
Array of Array holds all 16 For example
SensorSpan(1 through 16) through
Integers sensor span values 100 = 10.0ppm
48
Integer Value Status
0 Off
49 Array holds all
Array of 1 Normal
*SensorStatus(1 through 16) through 16 sensor
Integers 2 Danger
64 status values
3 Alarm
4 Error
65
Array of Array holds all 16 For example
LowAlarm(1 through 16) through
Integers sensor low alarm values 10 = 1.0ppm
80
HighAlarm(1 through 16) Array of 81 Array holds all 16 For example
Temp Units
For example
Temp manual
TempManual Integer 2 2555 = 255.5K, display
(Kelvin x 10)
still shows C or F
Integer Value Setting
TempMode Integer 3 Temp mode 0 Auto
1 Manual
Integer Value Setting
TempUnits Integer 4 Temp units 0 C (Celsius)
1 F (Fahrenheit)
pH live calibrated value For example
*Ph Integer 10
(pH x 100) 425 = 4.25 pH
Integer Value Setting
0 Auto
PhMode Integer 11 pH mode 1 Manual
2 Monitor
3 None
PhFilterTime Integer 12 pH average filter time in seconds
pH manual value For example
PhManual Integer 13
(pH x 100) 425 = 4.25 pH
pH low alarm value For example
PhLow Integer 14
(pH x 100) 425 = 4.25 pH
pH high alarm value For example
PhHigh Integer 15
(pH x 100) 425 = 4.25 pH
Hexadecimal Value Float Scale Factor
Flow 0x50 x1
**FlowDP Hex 20 decimal 0x31 x 10
position 0x22 x 100
0x13 x 1000
For example
Temperature
Temp Integer 70 2555 = 255.5K, display
(Kelvin x 10)
still shows C or F
Temp active sensor node
Temp Node Integer 71 1, 2, 3, or 4
number (where to read T)
Integer Value Setting
TempMode Integer 72 Temp mode 0 Auto
1 Manual
Integer Value Setting
TempUnits Integer 73 Temp units 0 C (Celsius)
1 F (Fahrenheit)
b0:DataLogAlm, b1:Pb1LowAlm,
b2:Pb1HighAlm, b3:Pb2LowAlm,
b4:Pb2HighAlm,
AlarmStatus Integer 104 Alarm Status b5:Pb3LowAlm,b6:Pb3HighAlm,
b7:Pb4LowAlm,b8:Pb4HighAlm,
b9:TempAlm, b10:FlowLowAlm,
b11:FlowLossAlm, b12:ComError
Relay1Mode Integer 110 Relay 1 mode 0=Ch1 Low, 1=Ch1 High, 2=Ch2 Low,
Relay2Mode Integer 111 Relay 2 mode 3=Ch2 High, 4=Ch3 Low, 5=Ch3 High,
Relay3Mode Integer 112 Relay 3 mode 6=Ch4 Low, 7=Ch4 High, 8=Flow Low,
9=Any Alarm
Relay4Mode Integer 113 Relay 4 mode
Relay1 Integer 114 Relay 1 State
Relay2 Integer 115 Relay 2 State
0 = OFF, 1 = ON
Relay3 Integer 116 Relay 3 State
Relay4 Integer 117 Relay 4 State
0=off, 1=auto,
pH1CompMode Integer 32 pH 1 Comp mode
2=manual
PH1FilterTime Integer 33 pH 1 average filter time in seconds
pH1Manual Integer 34 pH 1 manual value
pH1Low Integer 35 pH 1 low alarm value
pH1High Integer 36 pH 1 High Alarm Value
0=off, 1=auto,
pH2CompMode Integer 42 pH 2 Comp mode
2=manual
PH2FilterTime Integer 43 pH 2 average filter time in seconds
pH2Manual Integer 44 pH 2 manual value
pH2Low Integer 45 pH 2 low alarm value
pH2High Integer 46 pH 2 High Alarm Value
For example
Temperature 1
Temp1Show Integer 50 2555 = 255.5K, display
(Kelvin x 10)
still shows C or F
Integer Value Setting
0 Off
Temp1Mode Integer 51 Temp 1 mode
1 Auto
2 Manual
Temp1Units Integer 52 Temp 1 units Integer Value Setting
For example
Temperature 2
Temp2Show Integer 53 2555 = 255.5K, display
(Kelvin x 10)
still shows C or F
Integer Value Setting
0 Off
Temp2Mode Integer 54 Temp 2 mode
1 Auto
2 Manual
Integer Value Setting
Temp2Units Integer 55 Temp 2 units 0 C (Celsius)
1 F (Fahrenheit)
Relay1Mode Integer 80 Relay 1 mode 0=Res 1 Low Alm, 1=Res 1 High Alm,
2=Res 2 Low Alm, 3=Res 2 High Alm,
Relay2Mode Integer 81 Relay 2 mode 4=pH/ORP 1 Alarm,
Relay3Mode Integer 82 Relay 3 mode 5=pH/ORP 2 Alarm, 6=Any Alarm,
7=Flow 1 Stop Alarm, 8=Flow 2 Stop
Alarm, 9=Cond Low Alm,
Relay4Mode Integer 83 Relay 4 mode 10=Cond High Alm, 11=Press Low Alm,
12=Press High Alm
Relay1 Integer 84 Relay 1 State
Relay2 Integer 85 Relay 2 State
0 = OFF, 1 = ON
Relay3 Integer 86 Relay 3 State
Relay4 Integer 87 Relay 4 State
PID1CtrlMode Integer 130 PID1 Ctrl mode (0=Off, 1=Flow, 2=SP, 3=Compound)
PID1Channel Integer 131 PID1 Channel (0=Residual, 1=pH1, 2=ORP1, 3=Cond)
PID1SetPOint Integer 132 PID1 set point (Res or pH or ORP or Cond)
PID1DeadBand Integer 133 PID1 dead band (Res, pH, ORP, or Cond)
PID1 Integral Integer 134 PID1 integral value (%)
PID2CtrlMode Integer 135 PID2 Ctrl mode (0=Off, 1=Flow, 2=SP, 3=Compound)
PID2Channel Integer 136 PID2 Channel (0=Residual, 1=pH1, 2=ORP1, 3=Cond)
PID2SetPOint Integer 137 PID2 set point (Res or pH or ORP or Cond)
PID2DeadBand Integer 138 PID2 dead band (Res, pH, ORP, or Cond)
PID2 Integral Integer 139 PID2 integral value (%)
For example
Temperature
Temp Integer 70 2555 = 255.5K, display
(Kelvin x 10)
still shows C or F
Temp active sensor node
Temp Node Integer 71 1, 2, 3, or 4
number (where to read T)
Integer Value Setting
TempMode Integer 72 Temp mode 0 Auto
1 Manual
Integer Value Setting
TempUnits Integer 73 Temp units 0 C (Celsius)
1 F (Fahrenheit)
b0:DataLogAlm, b1:ReslLowAlm,
b2:ReslHighAlm, b3:PHLowAlm,
AlarmStatus Integer 104 Alarm Status
b4:PHHighAlm,
b5:ORPLowAlm,b6:ORPHighAlm,
Relay1Mode Integer 110 Relay 1 mode 0=Ch1 Low, 1=Ch1 High, 2=Ch2 Low,
Relay2Mode Integer 111 Relay 2 mode 3=Ch2 High, 4=Ch3 Low, 5=Ch3 High,
Relay3Mode Integer 112 Relay 3 mode 6=Ch4 Low, 7=Ch4 High, 8=Flow Low,
9=Any Alarm
Relay4Mode Integer 113 Relay 4 mode
Relay1 Integer 114 Relay 1 State
Relay2 Integer 115 Relay 2 State
0 = OFF, 1 = ON
Relay3 Integer 116 Relay 3 State
Relay4 Integer 117 Relay 4 State
1.) The master can request several addresses in one packet request, but the addresses have to be
sequential.
2.) When the master requests data the slave node may not respond instantly because its running
the program loop.
a. The SCADA has a parameter that can be set which is how long to wait for a response.
b. Another parameter is the polling interval- how often does the SCADA request data. If its
too fast the slave node may not be ready.
c. You could try to increase those times and also only request 1 address in the packet from
one of the addresses which is not working to see if the address can be read properly.
3.) Another issue is that there is very specific timing required for Modbus regarding the data packet
and the interval timing between packets which nodes on the network use to determine when a
packet ends and when a new packet begins.
a. Windows and Linux are not real time operating systems. So there is no way to ensure
this timing in a Windows or Linux application program.
b. The solution is the interface hardware between the computer and the RS-485 network
must handle this timing.
c. Good SCADA software accounts for this. Keep this in mind.