LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hex String CRC with different polynomial equation

Solved!
Go to solution

Hello,

 

I am having trouble modifying a standard CRC16 (I assume) code to work with the equations I have.

 

The device I am using has the equation of x16 + x13 +x12 +x11 +x10+x8+x6+x5+x2+1, with an inital value of 0.

 

I have been trying to read up on CRC via wikipedia etc, but I am not following it right now.

 

I have looked at a lot of examples, but to be honest, I am not sure why it is being calculated as it is.

 

Thanks.

 

Here is one example I have been looking at: https://decibel.ni.com/content/docs/DOC-11072

Kenny

0 Kudos
Message 1 of 9
(3,425 Views)

Do you have any test data to try?  Here's a snippet of my standard CRC calculator, edited to make it simpler and put in the polynomial you have.

 

There are several variations of CRCs.  You so you really need to have data from the unit to make sure it is correct.


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 9
(3,400 Views)

I do have one example of the imputs and what the output should be.

 

Was there supposed to be something attached to your reply?  No images showed up on my computer if it was just a screen shot.

Kenny

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

@Kenny_K wrote:

I do have one example of the imputs and what the output should be.

 

Was there supposed to be something attached to your reply?  No images showed up on my computer if it was just a screen shot.


Yes, there was supposed to be a snippet.  Must have gotten distracted and forgot to attach it.

 

 

And you supply the test example to make sure this will work for you?


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
(3,385 Views)

Test 1: 2453 E61E 2143 6587 011E (hex string, no spaces, just used to make it easier to read)  CRC: 24E5

Test 2: B298 1000 00E6 1E01 0702 0000 0087 6543 (HEX STRING)  CRC:  F109

Test 3: 21B4 0341 02FA 2F2F 2F2F 2F2F 2F (HEX STRING) CRC: F17A

Kenny

0 Kudos
Message 5 of 9
(3,374 Views)
Solution
Accepted by topic author Kenny_K

This code works for the second two cases.  But not the first one.  Did you mistype something?

 


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 6 of 9
(3,349 Views)

First byte: 2653

 

Sorry about that

 

Anything special in your False case?

Kenny

0 Kudos
Message 7 of 9
(3,344 Views)

@Kenny_K wrote:

First byte: 2653

 

Sorry about that

 

Anything special in your False case?


Still something wrong...

 

The FALSE case just wires the shifted value straight through.


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 8 of 9
(3,339 Views)

Last Byte: 010E

 

Thanks for the help.

Kenny

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