17
APPROVED
April 18
Messaging
The protocol is intended foremost to be simple with a reasonable measure of reliability. It is based on
a synchronous master/slave model in which all communication occurs between the master and a single
rLine. Messages from the master to the rLine are categorized as either a
command to do something,
or a
query for data.
Message structure
The message structure for all messages between the master and rLine response messages are similar
in that they always have a preamble, rLine address, a message code, possibly some message data, a
checksum value, and is terminated by a postamble. As much as possible, 7-bit ASCII characters are
used to construct human-readable/printable message strings. The message format is as follows:
<PRE><ADR><CODE><DATA><LRC><POST>
The optional LRC (Longitudinal Redundancy Check) <LRC> value is used to validate the integrity of a
message packet. This value is formed from the exclusive OR all characters following the preamble
character and up to the LRC byte. Then, to avoid contention with the 7-bit ASCII character set, the
most significant bit is set, yielding a value in the range from 0x80 to 0xFF. Shown below is an example
LRC calculation for Run Zero (RZ) sent to a unit with address 1. Message string without pre- and
postamble: "1RZ"
LRC = '1' XOR 'R' XOR 'Z' OR 0x80
= 0x31 XOR 0x52 XOR 0x5A OR 0x80
= 0xB9
Unless excessive noise or other communication problems require its use, it is recommended to not
enable LRC. rLine will always calculate and include the LRC value for it’s replies.
The preamble byte <PRE> is the start-of-header character (^A, 0x01, SOH). It is a wakeup call to the rLine that the
character to follow is a device address. rLine reply preamble is always a tab character ( ^I, 0x09, HT).
The slave address character <ADR> is a single lowercase alphanumeric character, (1-9).
All message codes <CODE> will be 2 upper-case characters.
Optional message data <DATA> string of up to
N
characters.
LRC calculated value. Always included in rLine reply.
The message’s post amble character <POST> is a carriage return
(^M, 0x0D, CR).