37
<CR
n,m
>
Cyclic Redundancy Check
System
Description
Command terminator with 16-bit checksum
Parameters
The parameters
n
and
m
are two 8 bit bytes of the 16 bit checksum of all the characters in the
preceding command string,
n
being the LSB, and
m
the MSB.
To calculate the value of the parameter, use the ASCII values of all the characters in the command
string up to but not including the <CR
nm
> command. See the section on CRC Generation (page 11) .
Modes
Operational Mode 4 only
Notes
This command is the signal to verify the checksum of the preceding command string and, if correct,
action the commands.
If the checksum is not correct, no commands are actioned and an error response is returned.
Uses
The <CR
n,m
> command allows:
•
Commands to be queued but not actioned until required
•
Rigorous message error checking
Example
Assume the text display is in operational mode 4.
To clear the screen the following command needs to be sent:
<CS><CRnm>
The parameters n and m are calculated by running the ASCII value of the characters “<”, “C”, “S”,
“>” through the CRC algorithm. When this is done the CRC code generated is 0x8040
Hence n = 40 hex (64 decimal), m = 80 hex (128 decimal).
The full command is then:
<CS><CR[64][128]>
Note! The square brackets are not sent, they are just there to emphasise
that n and m are single 8-bit bytes. The check bytes may not be
printable ASCII characters.
The CRC code for the message <WTHello World> is 0x721B
Hence n = 1B hex (27 decimal), m = 72 hex (114 decimal).
The full command is then:
<WTHello World> <CR[27][114]>
Gotchas!
Make sure that the section on CRC Generation (page 11) is read and understood!
See Also
CC
Check Code
CI
Command Implement