5 modbus query, Modbus query -11 – YSI DIQ/S 182-MOD System 182 User Manual
Page 123

System 182
Modbus connection
7 - 11
ba76025e01
02/2012
7.5
Modbus query
With each query of sensor data via the Modbus protocol, a block of
consecutive registers is read (up to all of the 16 registers).
For a query of sensor data, determine the first register and the number
of registers to be read (1 ... 16).
Determining the first
register to be read
The first register to be read depends on the sensor number (Sxx) [1 or
2] and the number of the sensor register (R) [1 ... 8]:
(Sxx - 1)] * 8 + R.
Example: Determine the first register with data for the sensor S02:
[(2 - 1) * 8] + 1 = 9
Determining the number
of registers to be read
The number of registers to be read is maximum 16.
Example: Read all data of X sensors
Example of a
Modbus query
and Modbus response
Query of all sensor information of the sensor S02:
Number of sensors (X)
Number of registers
1
8
2
16
Modbus query
Byte
Value
Information
Meaning of the value
1
01h
Modbus address of
the DIQ/S 182-MOD
01h --> 1
2
04h
Function
04h --> 4
Read Input Register
(see section 7.4.1)
3
00h
Start address HI
0008h --> 8
Start with register 9
(Modbus counting method)
4
08h
Start address LO
5
00h
Number of HI registers
0008h --> 8
8 registers
6
08h
Number of LO
registers
7
70h
CRC (HI)
Checksum (CRC)
8
0Eh
CRC (LO)