LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CRC-CCITT (16bit). Initial Value of (0xFFFF or 0x1D0F) ?

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. 

  
  
  
0 Kudos
Message 1 of 8
(18,394 Views)
hello ...
0 Kudos
Message 2 of 8
(18,248 Views)
The vi you link to produces 0xE5CC, and the url result is also 0xE5CC. They match. What's your question?
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 3 of 8
(18,246 Views)

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 .. 

0 Kudos
Message 4 of 8
(18,243 Views)
Ah, now I see. My instinct would be to distrust the vi. It certainly seems to start from 0xFFFF yet achieve the result for an initial 0x1D0F. On the page to which you link, there is a comment from someone that it produces the wrong checksum result.
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 5 of 8
(18,241 Views)
but it has always producing the right answer for the initial value of 0x1D0F ... 
0 Kudos
Message 6 of 8
(18,219 Views)

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).

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 7 of 8
(18,215 Views)

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.

0 Kudos
Message 8 of 8
(18,206 Views)