Xylem Expert 7060_7070_Modbus User Manual
Page 34

Communication protocol Serie30
Page 6/37
3.2
Format of a message
3.2.1 Format of the message sent by the master
Note on the presentation of messages: Each box presents 1 data byte consisting of 8 bits, unless otherwise stated.
Each message sent by the master possesses the following format:
DevAddr 0 Function
code
n byte parameters
(optional)
KELLER:CRC16_H
MODBUS:CRC16_L
KELLER:CRC16_L
MODBUS:CRC16_H
•
DevAddr: Address of the device.
Address 0 is reserved for broadcasting.
Addresses 1...249 can be used for bus mode.
Address 250 is transparent and reserved for non-bus mode. Every device can be contacted with this address.
Addresses 251...255 are reserved for subsequent developments.
•
Function code: Function number
A function is selected and executed by the device via the function number. The function number is encoded in 7 bits. Bit
7 is always 0. The functions are described further below.
•
Parameters: The parameters required by the function (n = 0 .. 6, according to function)
•
CRC16: 16-bit checksum
These two check bytes serve to verify the integrity of the received data. If an error is established, the entire message
will be discarded. The principle employed for CRC16 calculation is described in the appendix. The CRC16 standard is
applied here.
Note: The length of a message from the master is at least 4 bytes.
3.2.2 Format of the message sent by the slave
A message transmitted by the slave possesses the following format:
DevAddr X Function
code
n byte data
(optional)
KELLER:CRC16_H
MODBUS:CRC16_L
KELLER:CRC16_L
MODBUS:CRC16_H
•
DevAddr: Address of the device. This address corresponds to the address of the responding device.
•
Function code:
The function number is identical to the function number sent by the master. If the most significant bit is X = 0, this
indicates that the function has been executed correctly. If bit X = 1, an exception error has occurred.
•
Data: Any data requested via the function follow here.
•
CRC16: See above.
Note: A message from the slave has a minimum length of 5 bytes, and a maximum length of 10 bytes.