LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cyclic-Redundancy Check

Solved!
Go to solution

Hi everyone

 

I'am trying to build a vi about (Cyclic-Redundancy Check) CRC-5 . I searched here but dont found nothing about CRC-5, just found about CRC-16.

Someone can help me? Thanks!

0 Kudos
Message 1 of 4
(3,604 Views)
Solution
Accepted by topic author marinajordao

Here is a paper that discusses CRC-5.  You'll probably have to do the "heavy lifting" yourself.

 

BS

0 Kudos
Message 2 of 4
(3,559 Views)
Solution
Accepted by topic author marinajordao

There is tons of data on the net on algorithms for calculating CRCs. The two defining factors for a CRC algorithm are (a) the number of bits and (b) the polynomial used to calculate the CRC. The Wikipedia page lists three different common polynomials for a CRC-5, so for starters you need to decide which of these you are talking about.

 

Then there are many algorithms. A basic algorithm just follows the bit-crunching long division described in most descriptions of what a CRC is, and this is perfectly valid and relatively easy to follow. By applying some mathematical tricks the amount of calculation can be reduced, but understanding what is going on is a bit harder if you are trying to code it. For more efficient calculations, look-up tables are often used where byte values for 256 values are pre-computed - however the look up table values depend on the polynomial chosen so you either need to find one that someone else has published or calculate it yourself (either at the start of the program, or pre-compute and hard code into an array constant).

 

The algorithms are not too complex and make for an interesting programming exercise. If you are looking for a ready-made drop in solution then you at least need to say what polynomial you are using and hope that someone has already been through the process. I have written 16 & 32 bit CRC functions with look up tables but neither would be of much use to you unless you already understand enough about the algorithm to adapt it (in which case you could probably write your own just as quick).

 

Good luck in your searching 🙂

0 Kudos
Message 3 of 4
(3,555 Views)

Nice! Thanks !

0 Kudos
Message 4 of 4
(3,534 Views)