User manual
EASYGEN™
C
108
EXAMPLE
Let us imagine that you have to send the message <ESC>7CKSUM<ESC><CR>
using BCC=Checksum module 256. The Block Check Characters value must be
calculated as follows:
ASCII Hexadecimal Binary
ESC = 1B
16
= 00011011 +
"7" = 37
16
= 00110111 +
"C" = 43
16
= 01000011 +
"K" = 4B
16
= 01001011 +
"S" = 53
16
= 01010011 +
"U" = 55
16
= 01010101 +
"M" = 4D
16
= 01001101 +
<ESC> = 1B
16
= 00011011 +
<CR> = 0D
16
= 00001101 =
1FD
16
111111101
If you calculate the sum with hexadecimal values, you obtain the result 1FD
16
; divide
it by 100
16
(256Dec) and you are left with FD
16
. In practice only the last two less
important digits of the hexadecimal sum are considered.
If you calculate the sum with binary values, you obtain 1.1111.1101; divide it by
1.0000.0000 Bin. (256Dec) and you are left with: 1111.1101, when that is changed
into hexadecimal form it is FD
16
. In practice only the last two less important nibbles of
the binary sum are considered.
The value obtained must be broken down into the two nibbles that make it up, thus
the characters to be inserted into the communication frame are the ASCII values “F”
and “D”.