CRC Function
Generates a Cyclic Redundancy Character (CRC).
Syntax
CRC(char-string{,type})
Syntax Elements
char-string is the data being sent or received expressed as a variable or symbol to which the data string has been assigned, or can be a literal string enclosed in quotes.
type specifies the type of polynomial used to generate the CRC.
1 = CRC-CCITT (X.25 Standard)
0 = CRC16
The default value is 0.
Operation
The CRC function generates a Cyclic Redundancy Character by performing a polynomial function against all the data bytes in the data string.
If type is 0 (or not specified), a sixteen bit CRC is generated using the CRC16 polynomial:
X16 + X15 + X2 + 1
If type is 1, a sixteen bit CRC is generated using the CRC-CCITT (X.25 Standard) polynomial (also known as the ADCCP polynomial):
X16 + X12 + X5 + 1