CRC校验原理与程序设计——(RS485总线系统应用之1)
}
3.2.2用VB编写的程序
Function CRC16(Data() As Byte, No As Integer, CRC16Lo As Byte, CRC16Hi As Byte) As String
End Function
参考文献:
①GB/T 19582.1-2008《基于Modbus协议的工业自动化网络规范》
②《Modbus协议中文版》
附表:
CRC校验名 | 多 | 对应的16进制值或反值注:已去掉最高位的1 |
CRC-1 | x + 1 (most hardware; also known as parity bit) | 01或01 (01) |
CRC-4-ITU | x4+x+ 1 (ITU G.704, p. 12) | 03或0C (09) |
CRC-5-ITU | x5+x4+x2+ 1 (ITU G.704, p. 9) | 15或15 (1A) |
CRC-5-USB | x5+x2+ 1 (USB token packets) | 05或14 (12) |
CRC-6-ITU | x6+x+ 1 (ITU G.704, p. 3) | 03或30 (21) |
CRC-7 | x7+x3+ 1 (telecom systems, MMC,SD) | 09或48 (44) |
CRC-8-ATM | x8+x2+x+ 1 (ATM HEC) | 07或E0 (83) |
CRC-8-CCITT | x8+x7+x3+x2+ 1 (1-Wire bus) | 8D或B1 (C6) |
CRC-8-Dallas/Maxim | x8+x5+x4+ 1 (1-Wire bus) | 31或8C (98) |
CRC-8 | x8+x7+x6+x4+x2+ 1 | D5或AB (EA) |
CRC-8-SAE J1850 | x8+x4+x3+x2+ 1 | 1D或B8 (8E) |
CRC-10 | x10+x9+x5+x4+x+ 1 | 233或331 (319) |
CRC-11 | x11+x9+x8+x7+x+ 1 (FlexRay) | 385或50E (5C2) |
CRC-12 | x12+x11+x3+x2+x+ 1 (telecom systems ) | 80F或F01 (C07) |
CRC-15-CAN | x15+x14+x10+x8+x7+x4+x3+ 1 | 4599或4CD1 (62CC) |
CRC-16-Fletcher | Not a CRC; see Fletchers checksum | Used in Adler-32 A & B CRCs |
CRC-16-CCITT | x16+x12+x5+ 1 (CRC-CCITT, G.hn PHY headers, 802.15.4, X.25, V.41, CDMA, Bluetooth, XMODEM, HDLC,PPP, IrDA, BACnet, MMC,SD) | 1021或8408 (8810) |
CRC-16-DNP | x16+x13+x12+x11+x10+x8+x6+x5+x2+ 1 (DNP, IEC 870, M-Bus) | 3D65或A6BC (9EB2) |
CRC-16-IBM | x16+x15+x2+ 1 (CRC-16, SDLC, USB, many others) | 8005或A001 (C002) |
CRC-24-Radix-64 | x24+x23+x18+x17+x14+x11+x10+x7+x6+x5+x4+x3+x+ 1 (FlexRay) | 864CFB或DF3261 (C3267D) |
CRC-30 | x30+x29+x21+x20+x15+x13+x12+x11+x8+x7+x6+x2+x+ 1 (CDMA) | 2030B9C7或38E74301 (30185CE3) |
CRC-32-Adler | Not a CRC; see Adler-32 | See Adler-32 |
CRC-32-IEEE 802.3 | x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x+ 1 (V.42, MPEG-2, PNG [10], POSIX cksum) | 04C11DB7或EDB88320 (82608EDB) |
CRC-32C (Castagnoli) | x32+ x28+ x27+ x26+ x25+ x23+ x22+ x20+ x19+ x18+ x14+ x13+ x11+ x10+ x9+ x8+ x6+ 1 (G.hn payload) | 1EDC6F41或82F63B78 (8F6E37A0) |
CRC-32K (Koopman) | x32+x30+x29+x28+x26+x20+x19+x17+x16+x15+x11+x10+x7+x6+x4+x2+x+ 1 | 741B8CD7或EB31D82E (BA0DC66B) |
CRC-64-ISO | x64+x4+x3+ x + 1 (HDLC-ISO 3309) | 000000000000001B或D800000000000000 (800000000000000D) |
CRC-64-ECMA-182 | x64+ x62+ x57+ x55+ x54+ x53+ x52+ x47+ x46+ x45+ x40+ x39+ x38+ x37+ x35+ x33+ x32+ x31+ x29+ x27+ x24+ x23+ x22+ x21+ x19+ x17+ x13+ x12+ x10+ x9+ x7+ x4+ x + 1 (As described in ECMA-182 p.51) | 42F0E1EBA9EA3693或C96C5795D7870F42 (A17870F5D4F51B49) |
CRC校验RS485总 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)