beautypg.com

Modbus protocol description and set-up, 1 address field (device address), 2 function field – KROHNE ALTOSONIC V12 EN User Manual

Page 114: 3 data field, 4 error checking methods

background image

10

MODBUS PROTOCOL DESCRIPTION AND SET-UP

114

ALTOSONIC V12

www.krohne.com

04/2013 - 4002643502 - MA ALTOSONIC V12 R02 en

10.4.1 Address Field (Device Address)

The address field of a message frame contains:

Valid slave addresses are 1...247.
Address 0 is used for a broadcast to address all slaves.

10.4.2 Function Field

The function field of a message frame contains:

Valid function codes are 1...127.
The function code tells the slave which kind of action to perform.
For information on the supported functions, refer to

Supported functions

on page 115.

A slave response always contains the function code of the request. If a function is not applicable,
the slave sends an exception response. An exception is indicated by a returned function code
with bit 8 (most significant bit) set.

10.4.3 Data Field

The data field contains 8 bit values (bytes) in the range of 0 to FF hexadecimal.
In ASCII mode each 8 bit value is represented by 2 ASCII characters.

The data field of messages contains information which both master and slave use to perform an
action. This includes the register address, quantity of registers, and the necessary data.

10.4.4 Error checking methods

Two error checking methods are defined for the Modbus protocol:

• Optional: an additional bit (parity bit) is appended to each character (or byte) for detecting

errors during the transmission of individual characters (or bytes).

• Obligatory: two bytes (or characters) are appended to the message for detecting errors

during the transmission of the message.

As an even number of bit errors in one character (or byte) will not be detected using a parity bit,
the second method is used to check the contents of the entire message.

Both character check and message check are generated in the transmitting device and
appended to the message before transmission. The slave checks each character and the entire
message frame during receipt.

ASCII mode

2 characters

RTU mode

8 bits

ASCII mode

2 characters

RTU mode

8 bits