Download PDT 1100 Terminal Programmer`s Guide

Transcript
PDT 1100 Terminal Programmer’s Guide
BCC$
Function Name: Block Check Character
Type: String Function
Description
Returns a block check character (BCC) of a data block.
Syntax
BCC$(datablock, checktype)
where:
datablock = A string expression.
checktype = A numeric expression which returns a value from 0 to 2.
Notes
BCC$ calculates a block check character (BCC) of datablock according to the block checking
method specified by checktype, and returns the BCC.
checktype is 0, 1, or 2 which specifies SUM, XOR, or CRC-16, respectively, as
described below.
!
Table 11-1. Block Checking Method and Description
checktype
Block
No. of
checking chars for
method
BCC
BCC
Generative
polynomial
0
SUM
1
Lowest one byte of the sum of all character
codes contained in a datablock.
1
XOR
1
One byte gained by XORing all character
codes contained in a datablock.
2
CRC-16
2
Two bytes gained from the cyclic redundancy X16 +X15 +X2 +1
check operation applied to bit series of all
characters in datablock with the bit order in
each byte inverted.
11-4