User manual

Automation Protocol Data Link Layer
Miranda Technologies Ltd Page 26
CRC Generation
The CRC (Cyclic Redundancy Check) bytes provide a means of verifying the
transmission and receipt of incoming packets.
A 16-bit CRC value should be generated (by Automation) using the contents
of the corresponding transmission packet. The resultant value is appended to
the data packet and transmitted to the Oxtel unit as two 8-bit bytes. Using the
same CRC algorithm at the receiving end, the Oxtel unit is able to verify the
integrity of the data transmitted.
The same CRC technique is used on the reverse channel by the Oxtel unit
when it returns transmission packets back to Automation.
The CRC is constructed from all characters that follow the STX. A software
coding example in Appendix C (page 271) shows how to generate and use
CRCs.