01-20-2014 02:28 AM
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
Solved! Go to Solution.
01-20-2014 08:01 AM
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.
01-20-2014 08:30 AM
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.
01-20-2014 08:48 AM - edited 01-20-2014 08:48 AM
@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?
01-20-2014 10:20 AM
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
01-20-2014 02:26 PM - edited 01-20-2014 02:26 PM
This code works for the second two cases. But not the first one. Did you mistype something?
01-20-2014 02:37 PM - edited 01-20-2014 02:37 PM
First byte: 2653
Sorry about that
Anything special in your False case?
01-20-2014 02:47 PM
@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.
01-20-2014 02:58 PM
Last Byte: 010E
Thanks for the help.