LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CRC16 calculator

"CRC16: defined by polynom x^16 + x^15 + x^2 + 1 with initial value 0xFFFF and conclusive inversion."

 

I am not able to find a code for above requirement. Could anyone give some input?  Any help would be greatly appreciated.

Thank you in advance.

0 Kudos
Message 1 of 9
(9,276 Views)
Do a search of the forum, there are dozens of posts with possible implementations. Do you have examples of what tou are supposed to get for specific inputs?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 9
(9,274 Views)

I got a piece of code. But my doubt is that which polynomial representaion - 8005 or A001 to be used for calculation when the requirement is mentioned as 'conclusive inversion'.

 

0 Kudos
Message 3 of 9
(9,260 Views)

I have seen a lot of weird variations on CRCs.  Do you have an example of input and output values for your specific CRC?


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 4 of 9
(9,249 Views)

Your polynomial is 0x8005. Just change the poly in your VI and see if that works.

 

I don't know what you mean by "conclusive inversion" either. Never encountered that term. Could it be pre- or post-inversion?? Do you have any test cases for your requirement??

0 Kudos
Message 5 of 9
(9,245 Views)

Try this snippet by crossrules to do a post-inversion

0 Kudos
Message 6 of 9
(9,235 Views)

Input data may vary each time. It is 256 byte data for the EEPROM. Please see below example.

I have a code in C++ from designer which have attached herewith. I am looking for a an equivalent vi.

 

0000 0000 0000 0000 FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 4400 0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 03FF FFFF FFFF FFFF 3031 3735 3032 3638 3430 3441 04F5 C30C 30C3 0C30 FFFF FF30 FFFF FFFF FFFF FFFF FFFF FFFF FFFF FF30 0000 0000 0000 FFFF FF30 3030 FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0204 0A00 10AB 0000 0000 0100 EE9B A000 0200 FC8D 1001 0300 24AB B401 0000 0000 2042 4542 0800 0200 5C00 0000 8101 0000 C101 0000 0400 0000 0300 0000 0900 0000 0800 0000 2000 0000 0101 0000 8001 0000 1800 0000 0A00 0000 0100 0100 D039 0000 0000 0000 2823 0000 FFFF FFFF 8601 0000 0800 0000 1000 1000 FFFF 0100 E901 0000 0400 0000 4000 4000 2044 4E45 0000 0000 5453 494C 0800 0200 9000 0000 9B01 0000 2042 4542 0800 0200 3400 0000 A800 0000 1600 0000 2800 0000 1000 0000 1000 0000 0A00 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 2042 4542 0900 0200 4000 0000 8200 0000 C115 8707 EA6B 4A5F 1223 1523 43AF AC73 C026 9F54 602D E6DF A98E A363 89C9 0257 7434 3477 23CF 927D 48E3 D9B7 0A93 8B83 7DFF 6D68 0E10 264D 5822 00D1 2044 4E45 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000

0 Kudos
Message 7 of 9
(9,217 Views)
So if you do a CRC on this data what are you supposed to get?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 8 of 9
(9,210 Views)

I have posted code here that calculates numerous variations of CRC.

 

http://forums.ni.com/t5/LabVIEW/Computing-CRC/m-p/825331#M375052

 

The problem is there is no "one" CRC-16.  And what's worse is that some programmers don't implement it correctly, so even a "standard" CRC-16 varies.  Even when I was doing my code, there are tons of examples online that don't agree with each other and cannot calculate each other's CRCs.  This one was based on code at http://www.zorc.breitbandkatze.de/crc.html and was flexible enough I could tweak it when necessary.

 

That code has some standard ones built in, but also allows you to play with the indiviudal settings and make a custom version.

 

It can be difficult if you don't have an example CRC from the vendor who implemented it to figure out exactly what they did, although your description is more complete than I typically see.

0 Kudos
Message 9 of 9
(9,199 Views)