From 11:00 PM CST Friday, May 9th - 3:00 PM CST Saturday, May 10th, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 11:00 PM CST Friday, May 9th - 3:00 PM CST Saturday, May 10th, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example generates a 16-bit error checking code that will efficiently confirm the correct retrieval of information.
Description
This code completes the complex calculation of taking the quotient of the input message and a known X value and passing that value as a Cyclic Redundancy Check (CRC). The message as well as the CRC are sent to their destination where the receiver will perform the same division this time with the message and the CRC. If there are no errors in the message, then the destination should get the X value as the quotient. In both of these calculations, any remainder generated is discarded.
The CRC- 16 bits code computes a 16-bit cyclical redundancy check (CRC) algorithm on an input serial data stream. The polynomial can be defined to implement CRC functions, such as the CRC-16 or CCITT algorithm. A seed value can be specified to initialize the starting data value.
For CRC_CCITT: Polynomial Register = X16+ X12 + X5 +1 (0x1021)
Seed Register: 0xFFFF
Requirements
LabVIEW 2012 (or compatible)
Steps to Implement or Execute Code
1. Open the VI "Cyclic Redundancy Check (16 bits)_LV2012_NI Verified"
2. Enter the message to be coded in the String
3. Run the VI
4. Check the code in CRC-CCITT correspondent to your message
Additional Information or References
CRC-16 General Circuit. (Reference: http://www.cypress.com/file/127146/download)
Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
help
jlkjdflsfj
incorrect CRC
http://www.joegeluso.com/software/articles/ccitt.htm
according to the link above you should get a CRC of E5CC for a string of 123456789 using the 1021 poly with initial value of FFFF
???? That is exactly the value this VI is returning for those conditions... Why are you saying "incorrect CRC" ? Am I missing something here?
I agree that something appears to be wrong with this code. The VI outputs the CRC-CCITT equal to that produced when using an initial value of 0x1D0F, not 0xFFFF (with poly 0x1021).
Cross check I/O with the site: https://www.lammertbies.nl/comm/info/crc-calculation.html
For an ASCII string 123456789, the CRC with 0xFFFF should be 29B1. This code outputs E5CC which is associated with 0x1D0F. This is incorrect. Without doing a deep dive into this code I don't know what is wrong exactly (even though it appears to use 0xFFFF as an initial condition). Has anyone solved this problem?
The error is related to the question of "augmended" zero bits at the end of the message.
More information here : http://srecord.sourceforge.net/crc16-ccitt.html