User manual
COMMUNICATION PROTOCOL
C
107
The Formula terminal can use two different Block check characters (BCC). These
can be set by using the serial command "S" described in Appendix C:
− LRCC = Longitudinal Redundancy Check Character
− Checksum 256
The use of any type or other is completely arbitrary. The only existing limitation
regards the specifications of the management program residing in the host computer.
Depending on the BBC used, the calculating method of the two characters that
compose it varies:
− If LRCC is used, it is necessary to calculate the xor operation of all characters
preceding the LRCC (including any Start of Block and <etb> or etx> characters).
The ASCII character corresponding to the value thus obtained must be inserted
in the communications frame.
− If Checksum 256 is used, it will be necessary to calculate the sum of all the
characters preceding the Block Check Characters (including any “Start of Block”
and <etb> or <etx> characters) and subtract from the result 256 dec.
The value obtained must be broken down into the two nibbles that its composed of
(groups of 4 bits) and the two ASCII characters corresponding to the values obtained
must be inserted in the communications frame.
EXAMPLE
Let us imagine that you have to send the command <ESC>5<ESC><CR> using BBC
= LRCC. The value of the Block Check Characters must be calculated as follows:
ASCII Hexadecimal Binary
ESC = 1B
16
= 00011011 xor
"5" = 35
16
= 00110101 xor
<ESC> = 1B
16
= 00011011 xor
<CR> = 0D
16
= 00001101 =
"8" 38
16
= 00111000
If you carry out the xor operation with hexadecimal values, the result will be 38
16
.
If you carry out the xor operation with binary values, the result will be 00111000.
The ASCII character "8" must be inserted into the communication frame.