LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

16bit CRC IBM

Solved!
Go to solution

Hi,

 

I'm new to CRC calculation and currently having difficulty finding Labview VIs that I can use to do the calculation.  I was able to find and use an online CRC calculator to generate correct values however I couldn't find any Labview VI that generates values that match the online calculator. See link: http://www.lammertbies.nl/comm/info/crc-calculation.html

 

I'm using CRC-16-IBM. I found a VI that seem applicable but I'm not sure how to use it.  All my attempts thus far to perform a CRC calculation with the vi was not successful. Perhaps, it's not the right vi or I'm doing something wrong.   Please try to see if you can use the VI and generate matching values with the online CRC calculator. See attachment.

 

Thanks

Download All
0 Kudos
Message 1 of 7
(6,794 Views)

Do you have an example of input data and what the CRC should be?  It is really hard to verify anything without it.

 

And any more information you may have on the CRC calculation would be helpful, the polynomial used being the most important.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 7
(6,779 Views)

Hi Crossrulz,

 

An example is the number 13100521 as ASCII input. The correct output is 0x444E if you use the online calculator. Please give it a try.  I really don't know the actual polynomial but I belive it has the general form as

 X^16+X15+X^2 +1.

 

Thanks

 

 

0 Kudos
Message 3 of 7
(6,773 Views)

Your VI works for me.

make sure you typecast your ASCII string to Array of U8.

0 Kudos
Message 4 of 7
(6,764 Views)
Solution
Accepted by topic author SolPS

I had to do some digging to find what the real polynomial was (that site actually lied).  But then looking at the code, I came up with this.  Granted, the lookup table version will be faster since a lot of these calculations are predone.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 7
(6,736 Views)

Thanks Crossrulz. I tjink I can work with this.

0 Kudos
Message 6 of 7
(6,452 Views)

Just to muddy up the water a bit, here's a VI that I used for CRC16 about 15 years ago.

 

I don't know if it's "standard", but it worked with a set of hardware that the customer had.

 

It does NOT get the same answer as SolPS said above.

 

 

Anyway, it's fast and it's free.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 7 of 7
(6,430 Views)