LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CRC-6 for BiSS Communication

Hi, I am trying to implement a CRC-6 check for a Kubler encoder using LabVIEW. I've been there are 34 bits coming back from the sensor including multiturn bits, singleturn bits, status bits and CRC bits. These are used in the CRC calculation - see below. NOTE: There is no Lifecounter for my specific device so it can be ignored.

 

AJ232_0-1736182060683.png

The 6 bit CRC is also transmitted inversely, which I am assuming means that I will need to do a "Bitwise NOT" operator on them:

 

AJ232_1-1736182156861.png

 

I've taken the LabVIEW CRC calculation algorithm from the following post on this forum and modified so it fits a 6-bit CRC with initial value of 0x00 and a poly of 0x43: Solved: Re: Implementing CRC checksum CRC-8 with 0xFF initialization - Sensirion SHT85 - NI Communit...

 

I get the data from the sensor as a Boolean array which I then manipulate and convert into byte arrray to then feed into the algorithm - which if done correctly should output zero. Unfortunately, I don't seem to be getting zero when I do this. 

 

A snippet of my code is shown below:

 

AJ232_2-1736182638558.png

I have also attempted a Lookup Table implementation of the algorithm which uses the pre-computed LUT mentioned in the comment within the snippet. I have luck with neither implementation.

 

AJ232_5-1736183111527.png

 

 

I would be grateful if someone can help me troubleshooting the code.

 

The sample code which I have taken from my sensor is the boolean array as follows. Where the first (bit "0") can be ignored/disregarded for the calculation.

 

AJ232_4-1736182822772.png

 

Thanks 🙂

 

0 Kudos
Message 1 of 5
(125 Views)

@AJ232 wrote:

A snippet of my code is shown below:


This is not a snippet, just a simple image. We cannot run or debug pictures.

 

Please attach your VI (do a "save for previous", 2019 or below and make sure all controls have typical default values).

0 Kudos
Message 2 of 5
(118 Views)

Here is the actual snippet of the code attached below saved as LV 2019.

 

Thanks!

0 Kudos
Message 3 of 5
(77 Views)

Hi, I can provide more examples of the output from the sensor (in bits) if needs be.

0 Kudos
Message 4 of 5
(28 Views)

The exact specification for the BISS CRC calculation can be found in this document: https://biss-interface.com/download/biss-an-3/

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 5
(19 Views)