Modbus protocol description and set-up, 1 function 01: read coils, 2 function 02: read discrete inputs – KROHNE ALTOSONIC V12 EN User Manual
Page 116

10
MODBUS PROTOCOL DESCRIPTION AND SET-UP
116
ALTOSONIC V12
www.krohne.com
04/2013 - 4002643502 - MA ALTOSONIC V12 R02 en
• Input Registers: data, for example originating from electrical inputs of the slave or results
from calculations in the slave, can be stored in "input registers". By nature the data in this
area is "readonly": the master has only access to read this data.
• Holding Registers: the master has access to this area to read the data but as well to set or
change the value of data (write).
As these register groups are located in apparently different memories, the addresses may
overlap: for example, an input register having address 100 can exist and at the same time a
holding register having address 100. These are not the same: which one will be selected for an
operation is implied from the function code, referring to an input register or to a holding
register, for example.
The ALTOSONIC V12 does not use Discrete Inputs or Coils, but only Input Registers and Holding
Registers.
Variables are grouped according to data type and dependant of being input registers (read-only
data) or being holding registers (read/write data). An address range is assigned to each variable
type, subdivided in input registers (read-only) and holding registers (read/write).
The ALTOSONIC V12’s address ranges of Input Registers and Holding Registers do not overlap.
Accessing a specific register address is therefore unambiguous. The functions “read register”
and “read input” could both be used to effectively access the same register/address. However, in
this application, functions shall still be used consistent with the type of memory they are
intended to be used for.
In the master and the slave register addresses are referenced (counted) starting from 1.
However, the address range used in the message during in the transmission starts from 0. As an
example, when referencing address 4001, the address actually present in the message will be
4000.
On an application level the user will not notice this, as during the coding and decoding of the
message this offset of 1 will be taken into account. However, when the message – as it is
transmitted – is analyzed and checked one has to be aware of this offset.
When functions which do not support broadcast requests, are accessed with a broadcast
address, the request will be ignored.
10.5.1 Function 01: READ COILS
Function 01 reads the status of 1 to 2000 contiguous logical (Boolean or ON/OFF) variables.
This function is not used, as in this application Boolean (or logical) variables are not used as
individual entities. Boolean variables are represented by means of specific bits packed in 32 bit
data word (type “Long”).
10.5.2 Function 02: READ DISCRETE INPUTS
Function 02 reads the status of 1 to 2000 contiguous logical (Boolean or ON/OFF) variables.
This function is not used, as in this application Boolean (or logical) variables are not used as
individual entities. Boolean or logical variables are represented by means of specific bits packed
in 32 bit data word (type “Long”).