04-27-2009 06:05 AM
Hi,
By refer to http://decibel.ni.com/content/docs/DOC-1103
the VI calculate string (ASCII) "123456789" as E5CC, and from the link
http://www.lammertbies.nl/comm/info/crc-calculation.html?crc=123456789&method=ascii
The Answer is :
CRC-CCITT (XModem) | 0x31C3 |
CRC-CCITT (0xFFFF) | 0x29B1 |
CRC-CCITT (0x1D0F) | 0xE5CC |
Why the answer is E5CC but not 29B1 ? 0xFFFF is actually the initial value from the VI ..
Please help. Thanks.
05-18-2009 05:24 AM
05-18-2009 05:36 AM
05-18-2009 05:47 AM
my question is, what is the different between CRC-CCITT (0x1D0F) and CRC-CCITT (0xFFFF)
and the VI, how do you know that it is writing the code to implement CRC-CCITT (0x1D0F) but not CRC-CCITT (0xFFFF) ?
Thanks ..
05-18-2009 06:02 AM
05-18-2009 09:07 AM
05-18-2009 09:15 AM
The code appears to start from 0xFFFF, yet produce checksum results for an initial value of 0x1D0F. Therefore, it is clear that the vi does not work the way one would expect. It is perfectly possible that the code works as it should, but I'm afraid I haven't the time to study it's operation to determine whether it is functioning properly or just 'lucky' for this test case.
Clearly it works for "123456789", but as it's core code function isn't clear, I wouldn't simply "trust" that it works for all strings based on this one test case. Either dissect the code to be sure that it works as a checksum calculator ought to, or batch run many many cases to brute-force check it's functionality (although technically this still wouldn't prove it works unless you tested all possible string inputs that you care to create checksums for).
05-18-2009 10:17 AM
Hi Thoric,
Thanks a lot for your reply. Cause I am not the 1 who know these CRC stuff well, so am here to check what's going wrong with the code/webpage, about the initial code. Anyway, thanks.