LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VXLAPI CRC calculation bug

The current version of the "Vector XL Driver - LabVIEW wrappers" - Vector XL LV2011 v2.zip (see here) - contains a bug in LIN CRC calculation.

 

If found it out, since I use this library in my application for communication with a real LIN slave, and sometimes I got a CRC error. It seems, that with certain byte combinations it calculates the wrong CRC. The bug is in the "byte addition with carry" part, ID parity calculation seems to be ok. I have checked the CRC calculation in LIN specification (attached) and implemented it according to that. Now it calculates the CRC correct.

 

Attached is the fixed "LIN parity checksum.vi" which still contains the original code in a disabled structure. Also attached is the LIN specification. In chapters 2.3.1.5 and 2.8.3 it is described how to calculate the CRC.

 

Here is an example LIN frame from a real slave which resulted in wrong CRC calculation: 3D | 12 06 E9 01 FF FF FF FF | FC. With ID 0x3D there's no ID parity calc., so this simplyfies this example). The original code in "LIN parity checksum.vi" calculated a CRC of FD instead of FC.


- Thomas -
Download All
Message 1 of 1
(2,883 Views)