20
CCDI
TM8100/TM8200 Computer-Controlled Data Interface (CCDI) Protocol Manual
© Tait Electronics Limited
April 2007
1.8.3
CCDI Command Format
All CCDI message packets take the general form:
[IDENT] [SIZE] [PARAMETERS] [CHECKSUM] <CR>
■
[IDENT] = The message identifier. Identifiers are single ASCII
characters (lower-case alphabetical) which categorise the message type.
■
[SIZE] = The number of characters which make up the
[PARAMETERS] field. [SIZE] is an 8-bit number expressed in ASCII
hex notation (two characters).
■
[PARAMETERS] = An optional field, depending upon the command.
Parameter values are generally character strings unless explicitly stated
otherwise. Parameter type is dependent upon the command, and often
has multiple parts.
■
[CHECKSUM] = An 8-bit checksum of the [IDENT], [SIZE] and
[PARAMETERS] fields. Expressed in two character ASCII hex
notation.
■
<CR> = The carriage return (0Dh) packet terminator.
1.8.4
Restrictions
■
All characters in a message are printable ASCII.
■
Where numeric values are represented in ASCII hex notation (two
characters per byte), characters A to F are upper case.
■
The minimum length of a command packet is 5 characters. For example
q002F is the QUERY command where [SIZE] = 00 as there is no
[PARAMETERS] field required.
■
The maximum length of the [PARAMETERS] field is 255 characters.
The maximum length of the command packet is therefore 260
characters.
1.8.5
Calculating the CCDI [CHECKSUM]
[CHECKSUM] is calculated by applying the following algorithm:
1.
Take the modulo-2 sum of all message bytes preceding
[CHECKSUM].
2.
Retain bits 0 to 7, discarding any higher order bits resulting from the
summation.
3.
Form the two’s complement of the remainder.
4.
Convert the binary number into two ASCII hex digits, MSD first.
Example
s0D050800TESTHi!DA
1.
Take the modulo-2 sum of all message bytes preceding
[CHECKSUM].