文件名称:VBcrc16
介绍说明--下载内容均来自于网络,请自行研究使用
CRC-16是检测数据在发送过程中发生错误的常用校验方法,本文通过从工程应用的角度,讲述如何实现CRC-16的程序开发,并给出了Visual Basic和Visual C++程序代码,给从事工业控制的人员在写通信程序的时候提供一些有价值的参考。-1、 Load a 16-bit register with FFFF hex. Call this the CRC register.
2、 Exclusive OR the first 8-bit byte of the message with the low-order byte of the 16-bit CRC, putting the result in the CRC register.
3、 Shift the CRC register one bit to the right (toward the LSB), zero-filling the MSB. Extract and Examine.
4、 If the LSB was 1: Exclusive OR the CRC register with polynomial value A001 hex. If the LSB was 0: Repeat step 3 (another shift).
5、 Repeat step 3 and 4 until 8 shifts have been performed. When this is done, a complete 8-bit byte will have been processed.
6、 Repeat step 2 through 5 for the next 8-bit byte of them message.
7、 The final content of the CRC register is the CRC value.
2、 Exclusive OR the first 8-bit byte of the message with the low-order byte of the 16-bit CRC, putting the result in the CRC register.
3、 Shift the CRC register one bit to the right (toward the LSB), zero-filling the MSB. Extract and Examine.
4、 If the LSB was 1: Exclusive OR the CRC register with polynomial value A001 hex. If the LSB was 0: Repeat step 3 (another shift).
5、 Repeat step 3 and 4 until 8 shifts have been performed. When this is done, a complete 8-bit byte will have been processed.
6、 Repeat step 2 through 5 for the next 8-bit byte of them message.
7、 The final content of the CRC register is the CRC value.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
VBcrc16.txt