56
CCR
TM8100/TM8200 Computer-Controlled Data Interface (CCDI) Protocol Manual
© Tait Electronics Limited
April 2007
Where:
General characteristics of the message format worth noting are as follows:
■
All characters in a message are printable ASCII
■
Where numeric values are represented in ASCII-hex notation (two
characters per byte), digits A...F are upper case
■
The minimum length of a command packet is 5 characters; i.e. when
[SIZE] = 00. For example, c003D is the CANCEL command which is
5 characters.
■
The maximum length of the [PARAMETERS] field is 32 characters, so
that the maximum length of the command packet is therefore
37 ([SIZE]=“20”) characters
2.4.2
Calculating [CHECKSUM]
[CHECKSUM] is calculated by applying the following algorithm:
5.
Take the modulo-2 sum of all message bytes preceding
[CHECKSUM].
6.
Retain bits 0...7, discarding any higher order bits resulting from the
summation.
7.
Form the two's complement of the remainder.
8.
Convert the binary number into two ASCII-hex digits, MSD first.
Checksum Example
s0D050800TESTHi!DA
9.
Take the modulo-2 sum of all message bytes preceding
[CHECKSUM].
■
s = 73h, 0 = 30h, D = 44h etc. therefore the modulo-2 sum is:
73 + 30 + 44 + 30 + 35 + 30 + 38 + 30 + 30 + 54 + 45 + 53 + 54
+ 48 + 69 + 21 = 426h
Parameter
Value
[IDENT]
is the message identifier. Identifiers are single ASCII characters
which categorise the message type
[SIZE]
is the number of characters which make up the [PARAMETERS]
field. [SIZE] is an 8-bit number expressed in ASCII-hex notation
(two characters)
[PARAMETERS]
is an optional field, depending upon the command. Parameter
values are generally character strings unless explicitly stated
otherwise. Parameter type is dependent upon the command -
there is no explicit type definition.
[CHECKSUM]
s an 8-bit checksum of the [IDENT], [SIZE] and [PARAMETERS]
fields. It is expressed in ASCII-hex notation (two characters)
<CR>
is the packet terminator. It is the ASCII “carriage return”
character (0Dh).