Product manual

Protocol Level
65
Sequence Numbers, Escapes, and Checksums
Low Level Sequence Numbers (LLSEQ#)
The low level sequence number is one byte which is either 00 or FF hex. The Low Level
Sequence numbers are alternated between 00 and FF for each new packet sent. If a packet
needs to be resent because of an error, the same low level sequence number is used.
When a packet is received correctly, a Low Level ACK is returned with the same
sequence number as the received packet. If an error is detected, a Low Level ACK is
returned with the sequence number of the last correctly received packed.
The low level sequence numbers for transmit and receive are independent. The receive
low level sequence number should change only when packets are received and the
transmit low level sequence number should change only when packets are sent.
High Level Sequence Numbers (HLSEQ#)
The High Level Sequence Number included in the data of each of the Command packets
is incremented by the CAD each time it sends a new packet. The Model 26 then returns
that sequence number as part of the resultant status change message and in the High
Level ACK/NAK. It starts at 01 and increments up to FF (255) before rolling back to 1.
The Model 26 responses which are not associated with a specific CAD command will
always have the high level sequence number 00. Any commands generated at the Model
26 control panel that create a status message to CAD will use the 00 sequence number.
Escapes (DLE)
Since the data bytes being sent are binary rather than ASCII, it is possible that data bytes
may have the same value as control characters. To account for this, in that part of the
packet between the framing STX and ETX, a DLE (10 hex) character is inserted before
any data byte, which is equal to STX (02), ETX (03), or DLE (10). These DLE characters
are included in the checksum.
Checksums (CKSUM)
This is a one byte checksum value calculated by taking the 2’s complement of the sum,
modulo 256, of all the Bytes between (but not including) the framing STX and ETX. This
usually includes all of the Bytes from the LLSEQ# through the last Data Byte, and
includes any escape (DLE) characters which have been inserted.