Encompass 4 Reader System Guide
6-16
ECP Reliability
An undetected error is defined as a message having incorrect data or status but no par-
ity or CRC errors. An error transac
tion is defined as a message having either a parity
or CRC error. Laboratory testing indicates an undetected error rate of less than one
undetected error per 1,000,000 error transactions with parity enabled.
To ensure this error rate is not excee
ded, the host must enable parity and adhere
closely to the timing specifications discussed previously in this chapter in the “Timing
and Synchronization” section.
CRC Calculation
The CRC used by the ECP is based on a 16-bit algorithm. The algorithm, as imple-
mented, operates on eight-bit characters, for example, seven-bit
ASCII character plus
one optional parity bit. The 16-bit result is converted to four ASCII hex characters and
is appended to messages transmitted by the Encompass 4 Reader.
The Encompass 4 Reader accepts four ASCII < ` > chara
cters (60 hex) as a wild card
CRC value in lieu of a valid four-character CRC value to facilitate testing and diag-
nostic checkout.
The Encompass 4 Reader implements the algorithm with a 512-byte lookup
table to
reduce the processing overhead requirements.
To simplify the implementation of the CRC alg
orithm by host software developers,
several examples of the calculation are provided in C source code on the following
pages. The calculation may be performed with or without a lookup table, depending
on the trade-off between code memory and processing overhead.
Example 1 presents an example of a function (CALCCRC) that calculates the CRC
value through a call to a
separate function (UPDCRC).
unsigned short calccrc(char *message)
{
unsigned short crc = 0;
for ( ; *message != (char)0;message++)
crc = updcrc(*message & 0xff, crc);
return (crc)
}