beautypg.com

5supported functions – KROHNE OPTISONIC V6 Modbus User Manual

Page 8

background image


2011-07-19

OPTISONIC_V6_Modbus_6.doc

8/29

K

R

O

H

N

E

C

T

P

ro

d

u

c

ts

5

SUPPORTED FUNCTIONS

A number of functions is available to perform operations on variables in the slave.

An operation can be a “read” operation to obtain the value of a variable or a “write” operation to assign a
value to a variable. Variables are identified by means of their register number (address).

Typically in a Modbus slave, data can be stored in multiple areas that can be seen as different memories:

Discrete Inputs: data from logical (also called binary, Boolean, or ON/OFF) inputs. By nature the data
in this area is “read-only”: the master has only access to read this data.

Coils: logical (also called binary, Boolean, or ON/OFF) outputs. The master device may read the
current state of an output, but may also set or change the state of an output.

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 “read-
only”: 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 OPTISONIC V6 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 OPTISONIC V6’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.

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”).

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”).