08-01-2013 01:41 AM
Can you please tell how to calculate the CRC. on this code:
unsigned short CRC16(unsigned short crc, unsigned char byte)
{
unsigned short carry;
carry = 0xFF & ((crc >> 😎 ^ byte);
carry = carry ^ (carry >> 4);
return ((crc ^ (carry << 4) ^ (carry >> 3)) << 😎 ^ ((carry ^ (carry << 5)) & 0xFF);
}
Thank you!
Solved! Go to Solution.
08-01-2013 01:52 AM
Hi Sergiv,
you will find a lot of "calculate CRC" threads in the forum! Did you look for and did you check their examples?
Did you know
- you can use boolean logic on integer numbers like U8?
- you can do shifts using "logical shift" function (in the numerics palette)?
Following those two advices it should be easy to convert that C code into LabVIEW/G...
(Can't look at your VI due to the LabVIEW version you use.)
08-01-2013 01:56 AM
thanks for the answer
I tried to make the example, but I did not succeed.
I never programiroval in C.
resave your vi in version 8.6so, and I ask for your help
08-01-2013 02:07 AM - edited 08-01-2013 02:14 AM
08-01-2013 02:14 AM
thank you
08-01-2013 03:35 AM
08-01-2013 05:29 AM