HD2016 - 17 - V1.4
5 MODBUS-RTU PROTOCOL
For enabling the Modbus-RTU protocol, set on the electronic board, before powering the instrument, the DIP switch S1 to ON, toward the MODBUS indication, and the switch SW1 toward the RS485 indication (see the figure 3.1.2 on page 7).
I
n Modbus-RTU mode, the instrument sends the detected measurements only if specifically re-
quested by the PC, PLC or data logger.
The default communication parameters are:
• Baud Rate = 19200
• Data bits = 8
• Parity = Even (E)
• Stop bits = 1
• Flow control = None
The communication parameters can be changed by using the appropriate serial commands of
the ASCII proprietary protocol or, alternatively, directly with Modbus commands by changing
the value of the Holding Registers described later.
The function code 04h (Read Input Registers) allows reading the values measured by the instrument. The following table lists the Input Registers available.
Modbus Input Registers
Register
address
Datum
Format
0 Content of the status register 16-bit integer
1 Not used 16-bit integer
2,3 Partial rainfall, in µm, from the last reading command 16-bit integer
4,5 Total rainfall in µm 16-bit integer
6,7 Partial rainfall, in µm, from the last reset command 16-bit integer
8,9 Average rainfall rate, in µm/min, calculated in the last minute 16-bit integer
10,11 Average rainfall rate, in µm/h, calculated in the last hour 16-bit integer
12,13 Rain gauge internal temperature in °C 16-bit integer
14,15 Rainfall total weight (Pmg) in mg
(*)
16-bit integer
16,17 Rainfall total weight, in mg, considering the evaporation (Wmg)
(*)
16-bit integer
18,19 Weight, in mg, of the current reservoir content (Tmg)
(*)
16-bit integer
20,21 Partial rainfall, in mils, from the last reading command 16-bit integer
22,23 Total rainfall in mils 16-bit integer
24,25 Partial rainfall, in mils, from the last reset command 16-bit integer
26,27 Average rainfall rate, in mils/min, calculated in the last minute 16-bit integer
28,29 Average rainfall rate, in mils/h, calculated in the last hour 16-bit integer
30,31 Rain gauge internal temperature in °F 16-bit integer
(*)
For details on weight measurements, please see the paragraph “Notes on weight measurements”.
The measures are signed 32-bit integer values. Two consecutive 16-bit registers must be accessed to read a measure. The register with lower address (for example the register with address 12 for the temperature in °C) contains the most significant bits.
Some operating parameters of the instrument can be changed directly with Modbus commands
by setting the value of the Holding Registers with the function code 06h (Write Single Register)
or 10h (Write Multiple Registers). The following table lists the Holding Registers available.