
- 47 -
9.
DISPLAY AND KEYPAD LOCK
The PC transmits
the ASCII string:
$aaKDISckckCR
Possible instrument responses:
-
correct reception:
&&aa!\ckckCR
-
incorrect reception:
&&aa?\ckckCR
10.
CHECK-SUM CALCULATION
The two ASCII characters (
ckck
) are the representation of a hexadecimal digit in ASCII
characters. The check digit is calculated by executing the operation of XOR (exclusive OR) of 8-bit
ASCII codes of only the string underlined.
The procedure to perform the calculation of check-sum is the following:
-
Consider only the string characters highlighted with underlining
-
Calculate the exclusive OR (XOR) of 8-bit ASCII codes of the characters
Example:
character
decimal ASCII code
hexadecimal ASCII code
binary ASCII code
0
1
t
48
49
116
30
31
74
00110000
00110001
01110100
XOR =
117
75
01110101
-
The result of the XOR operation expressed in hexadecimal notation is made up of 2 hexadecimal
digit (that is, numbers from 0 to 9 and/or letters from A to F). In this case the hexadecimal code
is 0x75.
-
The checksum is made up of the 2 characters that represent the result of the XOR operation in
hexadecimal notation (in our example the character "7" and the character "5").