4 examples of bcc-calculation – EUCHNER HBLS 072725 Benutzerhandbuch

Seite 34

Advertising
background image

EUCHNER Pendant station HBLS 072725

067018-08-01/06

Subject to technical modifications

page 12 / 22

8.4 Examples of BCC-Calculation


example 1, LED 7 switching ON:

Byte 1

Byte

2

LEDBYTE

(37H

=

LED

7

ON)

Byte 3

DLE

(10H)

Byte

4

ETX

(03H)

Byte 5

BCC


37

XOR

10

= 27

27 XOR

03

= 24

BCC = 24


simplified variation:
Data Block, existing of 1 character: 37 XOR 13 = 24


example 2, display text

Euchner:


Example of a data block, which displays the text

Euchner at the actual cursor position:

0x6C 0xA5 0xD5 0xC3 0xC8 0xCE 0xC5 0xD2

Byte 1

Byte 2

LCD mode byte (6CH)

Byte 3 ... 9

A5H, D5H, C3H, C8H, CEH, C5H, D2H

Byte

10 DLE

(10H)

Byte

11 ETX

(03H)

Byte 12

BCC

(created by bytes 1 to 11)

6C

XOR A5 = C9

C9 XOR D5= 1C

1C XOR C3 = DF

DF XOR C8 = 17

17 XOR CE = D9

D9 XOR C5 = 1C

1C XOR D2 =CE
CE XOR 10 = DE
DE XOR 03 = DD


BCC = DD

simplified variation:
Data Block existing of

6CH, XOR A5H, XOR D5H, XOR C3H, XOR C8H, XOR CEH, XOR C5H, XOR D2H = CE

CE XOR 13 = DD

Advertising