Modbus message framing
Modbus messages must be structured (or ‘framed’) so that the different Modbus
components can detect the start, content structure and end point of a message. It also
allows any errors to be detected.
The framing used depends on the transmission mode chosen – ASCII or RTU.
ASCII message framing
In ASCII mode, messages start with a ‘colon’ (:), which in hex is ‘3A’. The message
end is shown by ‘carriage return/line feed’ (CRLF) or ‘OD OA’ in hex .
The allowable characters for all other fields are hexadecimal 0-9. A-F. Networked
components monitor the bus continuously for the ‘colon’ character and when one is
received, they decode the next field (the address field) to find out if the address is for
that slave. If the address is for another slave, then no action is taken, and the slave
returns to monitoring for the ‘colon’ character. If the field following the colon is the
address of the slave in question, then the slave continues to read the message and to
act on it’s contents.
Intervals of up to one second can elapse between characters within the message, but
if an interval is greater than this, then the device assumes that an error has occurred.
If the delay occurs in the ‘query’ to a slave, then the addressed slave will discard the
message received up to that point and wait till the next message (marked by the colon
start character) is received.
Leave a comment
Your email address will not be published. Required fields are marked *