Calculating The Block Check Character - Basler L800k User Manual

Table of Contents

Advertisement

4.3.2.3 Calculating the Block Check Character

The use of a block check character (BCC) in L800
4-54). 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 4.3.2.2, 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
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
BASLER L800
k
Draft
commands is optional (see pages
k
Configuring the Camera
4-53
and
4.3.2.2
4-59

Advertisement

Table of Contents
loading

Table of Contents