User`s manual
Configuring the Camera
Basler sprint Mono Cameras 203
7.3.2.3 Calculating the Block Check Character
The use of a block check character (BCC) in camera commands is optional (see Section 7.3.1 on
page 197). If you choose to use a BCC, the BCC will be the exclusive-or sum (XOR sum) of the
bytes in the FTF field, the DataLen field, the Address field and the Data field of the command frame.
For the write command example shown in Section 7.3.2.2 on page 202, the block check character
is 0x18. Let’s consider how this block check character was calculated.
Calculating XOR sums is most easily understood when numbers are shown in their binary form, so
in the example calculations shown below, the hexadecimal digits in our command have been
converted to binary.
To find the XOR sum of two binary numbers, you add the two digits in each column using the
following rules:
If both digits are 0, the result is 0.
If both digits are 1, the result is 0.
If one of the digits is a 1 and the other is a 0, the result is 1.
With all of this in mind, here is how the check digit for the write command shown in Section 7.3.2.2
on page 202 would be calculated:
0 0 0 0 0 1 0 0 = the binary representation of 0x04 (FTF)
0 0 0 0 0 0 0 1
= the binary representation of 0x01 (DataLen)
0 0 0 0 0 1 0 1 = XOR sum
0 0 0 0 0 1 0 1 = Previous XOR Sum
0 0 0 0 0 0 0 1
= the binary representation of 0x01 (Address Byte 1)
0 0 0 0 0 1 0 0 = New XOR sum
0 0 0 0 0 1 0 0 = Previous XOR sum
0 0 0 1 1 0 0 0
= the binary representation of 0x18 (Address Byte 2)
0 0 0 1 1 1 0 0 = New XOR sum
0 0 0 1 1 1 0 0 = Previous XOR Sum
0 0 0 0 0 0 0 1
= the binary representation of 0x01 (Data)
0 0 0 1 1 1 0 1 = Final XOR sum
0 0 0 1 1 1 0 1 = 0x1D = the block check character