beautypg.com

Modbus protocol description and set-up, 6 handling of large data types – KROHNE ALTOSONIC V12 EN User Manual

Page 121

background image

MODBUS PROTOCOL DESCRIPTION AND SET-UP

10

121

ALTOSONIC V12

www.krohne.com

04/2013 - 4002643502 - MA ALTOSONIC V12 R02 en

Exception codes (for example)

10.6 Handling of large data types

The standard Modbus specification does not explain how data types larger than 16 bits should be
handled. As larger data types are stored in a multiple of 16 bit registers, such data can be
accessed by means of “read” or “write” operation on a series of consecutive 16 bit registers.

Function 03 (read multiple holding registers), function 04 (read input registers), function 06
(write single holding register), and function 16 (write multiple holding registers) are used to read
or modify these data types.

Taking the data type into account, the addressing can be “optimized” accordingly, this is
implemented in an addressing mode not compatible with the original Modicon concept:

• In the original "Modicon compatible mode" one address is assigned and counted for each 16

bit register. To hold for example a 64-bit integer value, 4 addresses would be occupied.
Therefore, in order to address the next variable of this type, the address has to be
incremented by 4.

• In "not-Modicon compatible mode" addresses are incremented by 1 for each next variable.

For example, in order to read or write the next 64-bit variable, the register area to be read
will automatically be shifted by 4 16 bit registers

The ALTOSONIC V12 is by default configured for Modicon compatible addressing.

The supported data types are:

• Integer (16 bit)
• Long integer (32 bit)
• Float (single precision floating-point, 32 bit)
• Double (double precision floating-point, 64 bit)
• Long long (64 bit integer)

The register ranges for each data type:

Code

Name

Meaning

01

Illegal function

The function code in

the request is not an

allowable action for

the slave.

02

Illegal data address

The data address

received in the

request is not an

allowable address

for the slave.

Table 10-10: Exception codes