3 modbus message framing – KROHNE ALTOSONIC V Modbus EN User Manual
Page 7
ALTOSONIC V
ModBus Manual 0300 rev07 E
7.30855.35.00
Page 7 of 64
3 MODBUS MESSAGE FRAMING
ASCII-mode
In ASCII-mode a message starts with a colon character (:) and ends with a carriage return–linefeed.
Intervals up to one second can elapse between characters within the message. If the interval is longer,
a timeout error occurs and the message is rejected.
RTU mode
In RTU-mode a message starts with a silent interval of at least 3.5 character times. The entire
message frame must be transmitted as a continuous stream. If a silent interval of more than 3.5
character times occurs before completion of the frame, the receiving device flushes the incoming
message and assumes that the next byte will be the address field for the new message.
See 9.1 Appendix A for the applied timeout values.
Example of a typical message frame:
START
ADDRESS
FUNCTION
DATA
DATA
CHECK
END
ASCII
Mode
‘:’
2 characters
2 characters
N*2
characters
LRC
2 characters
CR-LF
RTU
Mode
3.5
characters
silent interval
8 bits
8 bits
N*8 bits
CRC
16 bits
3.5 character
silent interval
3.1
The Address Field
The address field of a message frame contains:
•
2 characters
(ASCII-mode) or
•
8 bits
(RTU-mode).
Valid slave addresses are 1 to 247.
Address 0 is used for a broadcast to address all slaves.
3.2
The Function Field
The function field of a message frame contains:
•
2 characters
(ASCII-mode) or
•
8 bits
(RTU-mode).
Valid codes lie in a range of 1 to 127.
The function code tells the slave which kind of action to perform.
The supported functions are listed in chapter 5.
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 byte) set.
3.3
The Data Field
The data field contains 8 bit values in the range of 0 to FF hexadecimal.