2 communication with modbus rtu, modbus tcp, 1 data transmission, 2 query format – YSI IQ S ENSOR N ET Field bus linking User Manual

Page 27: Communication with modbus rtu, modbus tcp, Data transmission, Query format, Section 4.2

Advertising
background image

IQ S

ENSOR

N

ET

Field bus linking

Communication with field buses

25

ba76148e01

06/2013

4.2

Communication with Modbus RTU, Modbus TCP

4.2.1 Data transmission

On each query of sensor data with the Modbus protocol, a block of con-
secutive registers is read.

Query and response

telegram

Data transmission takes place via query and response telegrams. The
form of the telegrams is determined by the Modbus RTU protocol.
The Modbus master transmits a query telegram with a Modbus com-
mand to the Modbus slave (here, the IQ S

ENSOR

N

ET

). The Modbus

slave transmits a response telegram with the requested data or an error
message.

4.2.2 Query format

Supported

Modbus commands

The IQ S

ENSOR

N

ET

provides the data block for read access only. Writ-

ing Modbus commands are not carried out.
The following commands are available:

For a query of sensor data, determine the first register and the number
of registers to be read.

Determining the first

register to be read

The first register to be read depends on the sensor number (Sxx):
R = [(Sxx - 1) * 8] + 1.

Example: Determine the first register with data block for the sensor
S02:
R = [(2 - 1) * 8] + 1 = 9

The number of registers to be read for one sensor data block is 8 reg-
isters.
With one Modbus query, up to 125 registers (15 data blocks) can be
read.

Modbus commands

Command code

Read Input Register

04h

Read Holding Register

03h

Advertising