LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CRC-16 VI calculator

Solved!
Go to solution

Hi everyone,

 

I am using labview 2017 and getting measurements from my serial port. I don't have any problems receiving the data but still, I would like to check it out using the CRC-16. It is a CRC-16 based on polynomilal 0x8005 with an initial value at 0x0000.

 

Here is an example of the fata I get : 5B01D0010088065D

5B is the start of packet

5D is the end if packet

8806 is the CRC-16 in this particular example and applies to evrything before (meaning : 5B01D00100)

 

When using this online CRC calculator I get the good CRC (need to swap the values) looking at line "CRC-16/BUYPASS". So i guess that is the offical name of the CRC-16 I am looking for.

 

I have tried using the solution in this post, but it doesn't workout for me :https://forums.ni.com/t5/LabVIEW/CRC-16-with-0x8005-polynomial/td-p/3271384/page/2  And it corresponds to the "CRC-16/ARC" of the online calculator.

 

Would anyone know where I could find the CRC-16/BUYPASS VI ?

 

Thanks.

User

 

 

 

0 Kudos
Message 1 of 10
(10,395 Views)
Solution
Accepted by User79

This should work

 

CRC-16.png

Message 2 of 10
(10,383 Views)

Thanks Jamiva, it works perfectly.

 

0 Kudos
Message 3 of 10
(10,336 Views)

Thanks for the post.

 

For those who need a CRC-16 that require XOR Out, Reflect Input & Reflect Output (i.e. Reverse Bits):

 

crc16.png

Verification

Verified with test vectors from https://crccalc.com/

Source: https://crccalc.com/
Data="123456789"
Algorithm CRC-16 Poly Init RefIn RefOut XorOut
CRC-16/CCITT-FALSE 0xC782 0x1021 0xFFFF false false 0x0000
CRC-16/ARC 0xD4C1 0x8005 0x0000 true true 0x0000
CRC-16/AUG-CCITT 0xEAEE 0x1021 0x1D0F false false 0x0000
CRC-16/BUYPASS 0x80A5 0x8005 0x0000 false false 0x0000
CRC-16/CDMA2000 0xCD4F 0xC867 0xFFFF false false 0x0000
CRC-16/DDS-110 0x0EA6 0x8005 0x800D false false 0x0000
CRC-16/DECT-R 0xEC38 0x0589 0x0000 false false 0x0001
CRC-16/DECT-X 0xEC39 0x0589 0x0000 false false 0x0000
CRC-16/DNP 0x5265 0x3D65 0x0000 true true 0xFFFF
CRC-16/EN-13757 0x4DFE 0x3D65 0x0000 false false 0xFFFF
CRC-16/GENIBUS 0x387D 0x1021 0xFFFF false false 0xFFFF
CRC-16/MAXIM 0x2B3E 0x8005 0x0000 true true 0xFFFF
CRC-16/MCRF4XX 0x2F8D 0x1021 0xFFFF true true 0x0000
CRC-16/RIELLO 0xB9BE 0x1021 0xB2AA true true 0x0000
CRC-16/T10-DIF 0x76E0 0x8BB7 0x0000 false false 0x0000
CRC-16/TELEDISK 0xD192 0xA097 0x0000 false false 0x0000
CRC-16/TMS37157 0xA53D 0x1021 0x89EC true true 0x0000
CRC-16/USB 0x6B81 0x8005 0xFFFF true true 0xFFFF
CRC-A 0x71F4 0x1021 0xC6C6 true true 0x0000
CRC-16/KERMIT 0x200A 0x1021 0x0000 true true 0x0000
CRC-16/MODBUS 0x947E 0x8005 0xFFFF true true 0x0000
CRC-16/X-25 0xD072 0x1021 0xFFFF true true 0xFFFF
CRC-16/XMODEM 0x2672 0x1021 0x0000 false false 0x0000

 

 

0 Kudos
Message 4 of 10
(8,013 Views)

Oops, had the wrong crc-16 test vectors (used "1" instead of "123456789")

Fixed:

Data="123456789"
Algorithm CRC-16 Poly Init RefIn RefOut XorOut
CRC-16/CCITT-FALSE 0x29B1 0x1021 0xFFFF false false 0x0000
CRC-16/ARC 0xBB3D 0x8005 0x0000 true true 0x0000
CRC-16/AUG-CCITT 0xE5CC 0x1021 0x1D0F false false 0x0000
CRC-16/BUYPASS 0xFEE8 0x8005 0x0000 false false 0x0000
CRC-16/CDMA2000 0x4C06 0xC867 0xFFFF false false 0x0000
CRC-16/DDS-110 0x9ECF 0x8005 0x800D false false 0x0000
CRC-16/DECT-R 0x007E 0x0589 0x0000 false false 0x0001
CRC-16/DECT-X 0x007F 0x0589 0x0000 false false 0x0000
CRC-16/DNP 0xEA82 0x3D65 0x0000 true true 0xFFFF
CRC-16/EN-13757 0xC2B7 0x3D65 0x0000 false false 0xFFFF
CRC-16/GENIBUS 0xD64E 0x1021 0xFFFF false false 0xFFFF
CRC-16/MAXIM 0x44C2 0x8005 0x0000 true true 0xFFFF
CRC-16/MCRF4XX 0x6F91 0x1021 0xFFFF true true 0x0000
CRC-16/RIELLO 0x63D0 0x1021 0xB2AA true true 0x0000
CRC-16/T10-DIF 0xD0DB 0x8BB7 0x0000 false false 0x0000
CRC-16/TELEDISK 0x0FB3 0xA097 0x0000 false false 0x0000
CRC-16/TMS37157 0x26B1 0x1021 0x89EC true true 0x0000
CRC-16/USB 0xB4C8 0x8005 0xFFFF true true 0xFFFF
CRC-A 0xBF05 0x1021 0xC6C6 true true 0x0000
CRC-16/KERMIT 0x2189 0x1021 0x0000 true true 0x0000
CRC-16/MODBUS 0x4B37 0x8005 0xFFFF true true 0x0000
CRC-16/X-25 0x906E 0x1021 0xFFFF true true 0xFFFF
CRC-16/XMODEM 0x31C3 0x1021 0x0000 false false 0x0000

 

Message 5 of 10
(7,998 Views)

Better performance for large data sets:

crc16.png

 

Message 6 of 10
(7,985 Views)

Can someone kindly post in LV2019?

 

Snippet isn't work for me for some reason either.

Ryan Vallieu CLA, CLED
Senior Systems Analyst II
NASA Ames Research Center
0 Kudos
Message 7 of 10
(6,838 Views)

I got snippet to work by switching browsers.

Ryan Vallieu CLA, CLED
Senior Systems Analyst II
NASA Ames Research Center
0 Kudos
Message 8 of 10
(6,794 Views)

Thank you for your answer. Based on your answer, I have included each mode. I can pass the CRC16 type guest that needs to be converted without repeatedly entering conversion parameters.

MapleBay_0-1717588439479.png

 

Use this "CRC16_MoreType.vi" need download Lukhe 's "CRC-16_Labview_2015.vi".

0 Kudos
Message 10 of 10
(1,762 Views)