LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CRC-16 CCITT Calculation

Solved!
Go to solution

crossrulz,

 

BINGO!! Problem solved!!!  Thanks SO much for your help!!!

 

Kudos have been given!!!

 

DavidBoyd,

 

You are RIGHT!!  It certainly didn't match ANYTHING standard that I could find.

 

I've attached another VI that shows both Hex Array and Sting input.  This is what I will be using in my microprocessor communication.

 

Thanks for all the help.  I'll mark this one as "Accept as Solution".

 

Paul.

 

0 Kudos
Message 11 of 30
(6,886 Views)

@DavidBoyd wrote:

Chiming in late here, but I've been following this thread with some interest.  I've coded a couple of different CRC implementations over the years in LabVIEW for different instruments, but none of my routines gave the results you quoted in your initial post.  When I saw Crossrulz's snippet, I first identified it as nearly identical in form to one I'd done - including the same polynomial mask - but on closer inspection his snippet (relative to my closest version) is missing an XOR operation outright, and doing an extra shift.


I have done many different CRC implementations as well.  And I said the same thing as you early on (not matching any of my standard CRC algorithms).  Then for some reason I decided to look closer into the C code and found the little difference (missing an XOR).  My spot for checking my CRCs is here:http://zorc.breitbandkatze.de/crc.html.  But I'll have to keep yours in mind next time as another resource.

 

Paul, not to be selfish or anything, but you really should mark my post here (message 5 of this thread) as the solution since it was the first one to do it correctly.


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 12 of 30
(6,880 Views)

crossrulz,

 

I am VERY sorry for that misstep on marking the solution.  I assumed the button was for the entire thread and only realized that immediately after I clicked it.  If there is a way to undo that, just let me know and I will be very happy to go back and give you credit!!

 

Paul.

 

 

0 Kudos
Message 13 of 30
(6,873 Views)

Go to the options menu to the upper right of the message that you already marked, and unmark that message as the solution.

0 Kudos
Message 14 of 30
(6,868 Views)

Ok.  Thanks for your patience.  I think I've got it now.

0 Kudos
Message 15 of 30
(6,863 Views)

Hi,

 

Can this be implemented on series of boolean bits to detect the errors and to correct them?

 
0 Kudos
Message 16 of 30
(6,704 Views)

You could convert Booleans to their equivalent numerical value and run them through the algorithms. You can than detect if there was an error.  But there is no way to correct an error.  It can only tell you that a boolean or a number changed.  It has no way of telling which boolean bit or number is the incorrect one.

0 Kudos
Message 17 of 30
(6,684 Views)
I agree. If you detect an error, you request that the frame to be transmitted.
0 Kudos
Message 18 of 30
(6,673 Views)

ysma wrote:

Can this be implemented on series of boolean bits to detect the errors and to correct them?


A CRC can only tell you if something was broken.

 

If you want a correction algorithm, you need to look into Hamming Code or Reed Solomon.


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 19 of 30
(6,650 Views)

Hi,

 

I am using the CRC with a packetisation and segmentation system to a stream of Data, would you please tell me how to reuse the CRC code that you generated to check whether the Data is write or wrong?

 

Thank you

0 Kudos
Message 20 of 30
(6,608 Views)