KEYENCE BL-600 Series User Manual
Page 178

Appendices
168
Appendices
■ Checksum calculation method
Calculate the checksum (CC) using the read data of “ABC123” as an example.
Convert each character into the ASCII code as shown below, and express the
result as 8-bit binary numbers.
Calculate the “Exclusive-OR” of the binary numbers of each bit.
Convert the calculated hexadecimal number into an ASCII code in two digits. The
result obtained is the checksum.
Therefore, the checksum for the above example is “CC =70 (37h 30h).
Example
Reference 1: Exclusive OR calculation formula
Calculate the numbers of each bit, referring to the following formula:
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 0
* + : Operator of Exclusive OR
Reference 2: Conversion from hexadecimal number into binary number
To convert ASCII codes into binary numbers, refer to the following table.
A
➔ 41h ➔ 0100 0001
B
➔ 42h ➔ 0100 0010
C
➔ 43h ➔ 0100 0011
1
➔ 31h ➔ 0011 0001
2
➔ 32h ➔ 0011 0010
3
➔ 33h ➔ 0011 0011
+
0111
0000
70h
* Based on the “Exclusive OR” logic,
when an odd number of “1”s are
present, the calculation result is “1”,
and when an even number of “1”s
are present, the calculation result is
“0”.
Header ERROR
CC
Delimiter
Header KEYENCE
100 %
:
Delimiter
CC=74
CC=58
CC
Header ABC123
CC
Delimiter
ASCII code
Bit
Hexadecimal number
0
1
2
3
4
5
6
7
Binary number
0000 0001
0010 0011 0100 0101
0110 0111
Hexadecimal number
8
9
A
B
C
D
E
F
Binary number
1000 1001
1010 1011 1100 1101
1110 1111