Part 1 specification – IAI America REXT User Manual

Page 146

Advertising
background image



Part 1 Specification

Chapter 3 Gateway R unit

122

Part 1 Specification

(5) Error Check

CRC check

Each message contains an error check field based on the CRC method.

The CRC field is used to check the content of the entire message. This check is independent of the parity check of

individual characters comprising the message.

The CRC field consists of two bytes of 16-bit binary data. The CRC value is calculated by the sender who appends the

CRC to the message. The recipient recalculates the CRC value while the message is being received, and compares the

calculated result against the actual value received in the CRC field. If the two values do not match, an error will be

recognized.

In CRC calculation, first the register is preloaded with all 16 bits set to “1.” Next, the successive 8-bit bytes are applied to

the current content of the register. Among the characters, only eight bits are used to generate a CRC. The start, stop and

parity bits are not used in CRC.

While a CRC is generated, each 8-bit character is compared against the register content based on the exclusive OR

gate.

The result is shifted toward the least significant digit, and zero is inserted in the most significant digit. Thereafter, the

least significant digit is taken out and checked. If the least significant digit is “1,” the register is again compared based on

the exclusive OR gate. If the least significant digit is “0,” the exclusive OR gate is not applied.

This process is repeated until the data is shifted eight times. After the last (eighth) shift, the next 8-bit byte is compared

against the current register value based on the exclusive OR gate. Then, this process is repeated eight times as

explained above. After the process has been applied to all message bytes, the last content of the register provides the

CRC value.

The generation polynomial is shown below (CRC-16 method)

x16 + x15 + x2 +1

When a CRC is appended to the message, the lower byte is appended first, followed by the upper byte.

(6) Send/Receive Buffers

With the RS485 SIO Gateway R unit, the sizes of send/receive buffers are 160 bytes, respectively. Calculate the

message size to make sure the receive buffer is not exceeded in the case of messages sent from the host, and the send

buffer is not exceeded in the case of data request messages.

-146-

Advertising
This manual is related to the following products: