This Library implements the algorithms for CRC-8-CCITT, CRC-8-Maxim 1-Wire (DOW), CRC-16-CCITT (0xFFFF), CRC-16-CCITT (0x1D0F), CRC-16-CCITT xModem, and CRC-32 IEEE 802.3.
A cyclic redundancy check (CRC) is a hashing function used to detect unintentional changes to data. A CRC is also often called a polynomial code checksum or a Frame Check Sequence (FCS)
The CRC-32 IEEE 802.3 algorithm uses a lookup table to calculate the CRC using the polynomial x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1.
The CRC-16-CCITT algorithms all implement a simplified LabVIEW version of the polynomial x16 + x12 + x5 + 1. Each of the three versions use different initial values (0xFFF, 0x1D0F, and for xModem 0x0000).
The CRC-8-CCITT and CRC-8-Maxim algorithms use lookup tables to calculate the CRC for the polynomials x8 + x2 + x + 1 and x8 + x5 + x4 + 1 respectively.
Steps to Implement or Execute Code
1. Download the attached ogp file and double click on it.
2. This will launch the VI Package Manager and direct you to the library installation
3. Proceed with the installation then once done click on Show in Palettes. this will highlight the VIs in the functions Palettes in LabVIEW
LabVIEW 2009 (or compatible)
Additional Information or References
These functions can be used on Windows, Mac, Linux, RT, or FPGA (including inside of a Single Cycle Timed Loop) to calculate an inline CRC.
Each of these CRC algorithms have been validated using online CRC calculators, however, you should verify that these algorithms implement your exact CRC version (CRC-16-CCITT with intial value of 0xFFFF vs initial value of 0x1D0F) and that you receive the CRC value that is expected by your device or software.
This code is attached both as a zip file and a VI Package. The Zip file allows you to easily unzip and use this library on any platform.
The VI package (niaes_lib_inline_crc-1.0.0-6.ogp) is intended for use with VI Package Manager™ (VIPM). VI Package Manager is an installer for LabVIEW VIs and toolkits. It places VIs directly into the palettes, allows you to install VIs into multiple LabVIEW versions, and ensures that any dependency VIs and toolkits (provided in other VI packages) are also installed. VI Package Manager is a product and trademark of JKI Software.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.