05-16-2023 03:59 AM
Hi LabVIEW Community,
Just to check if anyone did do a CRC15 VI calculation before using LabVIEW? Have been searching through the forums but didn't find any. I am currently tasked to develop a VI to calculate the Packet Error Code for the LTC6811 Chipset developed by Linear Technologies but I realize the Packet Error Code (PEC) is the same as the CAN bus for the first 15 bits, the only difference is the last bit which there is a 0 attached for the Final PEC. I have attached screenshots obtained from the datasheet below
Can any experts advise me on this situation, please?
Thanks!
Solved! Go to Solution.
05-16-2023 04:10 AM
Hi cyongjed,
@cyongjed wrote:
Can any experts advise me on this situation, please?
What have you tried and where are you stuck?
Why don't you attach your VI?
The manual is rather clear: you can handle boolean values in LabVIEW and there is a XOR function available…
05-16-2023 09:43 AM - edited 05-16-2023 09:52 AM
Hi Gerd,
Thank you for the response.
I have tried it out with a design of my own version of the VI, and have attached it in the reply. I am currently having issues getting the correct output for the PEC. For example, the PEC of 0x0001 (input DIN) will be computed as 0x3D6E as the final result, but I am getting otherwise.
Attached the bitwise operation for this in the post:
Regards,
cyongjed
05-16-2023 10:48 AM - edited 05-16-2023 10:51 AM
Here's what I came up with. Hopefully, you have more test vectors to try this on to make sure it works.
NOTE: The extra Rotate Left With Carry is to get bit 14 from the PEC (a 15-bit CRC is kind of weird).
05-16-2023 08:26 PM
Hi Cross,
Thank you for the assistance given.
I have a doubt here, why did you use 0x4599 instead of 0xC599? I don't really get this.
Hope to hear from you soon!
Regards,
cyongjed
05-17-2023 06:18 AM
You always ignore the top item in the polynomial, in this case the x^15. In this case, it does not really matter since bit 15 is not used in the CRC.