LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Another CRC16 Question...

DailyDose,

 

I am not the commentator from before, but I have a few questions for you. From my experimentation with the attached VI and an online calculator, it seems that the attached VI is not giving the same results, but an inverted result of the CRC-16 (Modbus). I changed the calculator input to take in HEX data.

 

How different are the results from your VI when compared to your client's VI? Are you both employing the same method? I would suggest that both of you compare the results of your code to an online CRC-16 calculator in order to have a valid comparison.

 

Regards,

Hannah L.

Applications Engineering 

National Instruments 

www.ni.com/support 

0 Kudos
Message 11 of 12
(671 Views)

So, as Crossrulz was saying, there are many different ways to do this.  And one thing that can be different is the initial value.  Another is whether or not the Polynomial is Reversed or Normal and then byte order of the result.  In attached VI, the original values are 8005 (normal) with an initial value of 0xFFFF.  I tried your link (thank you by the way) and yes, the results were not the same.  But changing the Polynomial to A001 and changing the initial value to 0x0000, I was able to get the same CRC16-ANSI as your calculator.... except for the byte order which is easily remedied.  So I get the feeling, then, that this code is correct.  It compares with an online calculator and it compares with another CRC16 VI that was posted elsewhere.  Just all comes down to getting all the little settings the same.

0 Kudos
Message 12 of 12
(660 Views)