Host Commands
Polycold Cryochiller
Command Format
Installation and Operation Manual
Brooks Automation
7-4
214072 Revision B
Checksum Calculation
Each command must end in a valid checksum. For heavy usage, it s recommended that the checksum
be calculated using a program/script/macro.
The checksum algorithm is defined as follows:
Perform the 8 bit sum of all the ASCII characters sent in the data field (with the most significant bit
cleared to 0, ignore parity). This is performed on the first character following the ‘$’ up to the last
data character before the checksum and Carriage Return (CR)
C Language example for checksum calculation:
///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function: CtiChkSum
// Purpose: Calculate the checksum for a given NULL terminated
// command.
unsigned char CtiChkSum (unsigned char * pCommand)
{
unsigned char checkSum = 0;
unsigned char
= 0;
do
{
checkSum = ch (pCommand[charNum] & 0x7f);
+;
} while ( pCommand[charNum] != 0 );
checkSum = 0x3f & (checkSum ^ (checkSum >> 6) );
checkSum = (0x30 + checkSum) & 0x7f;
return checkSum;
}// End Function CtiChkSum
Decimal Value
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Hex Bit
Hex Digit 8
Hex Digit 7
Hex Digit 6
Hex Digit 5
Hex Value
0
0
0
5
Binary Value
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Decimal Value
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
Table 7-2: Hexadecimal Bit Field Decoding
Hex Bit
Hex Digit 4
Hex Digit 3
Hex Digit 2
Hex Digit 1