11-26-2009 03:16 PM
Hello all,
I would like to know how to calculate the checksum in Labview.
Ex. code is appreciated.
I have a couple of syntax ex. in VB and C/C++ as follow.
B. Generating a checksum for a binary request
Calculate the accumulated sum of the bytes in the vector.
Get the value of the sum modulo 65536 (10000 hex)
The CRC is the 2 complement of the result.
If lSum is a variable holding the accumulated sum, then
CRC = (Not (lSum Mod &H10000)) + 1 (VB syntax).
CRC = (~(lSum % 0x10000)) + 1 (C/C++ syntax).
Note that the CRC is a two-byte value (while in ASCII format it is a one-byte value).
Kind regards
Andreas Svensson
11-26-2009 04:39 PM
11-27-2009 07:38 AM
11-27-2009 09:49 AM - edited 11-27-2009 09:49 AM
Hi Andreas,
Your description is for a checksum calculation not for a CRC.
11-27-2009 10:55 AM
Thanks KC for pointing that out.
Just in case you were looking for the CRC and not Checksum.. below are links of interest...
I didn't check the contents of the examples, but it is supposidly for a CRC16.
http://forums.ni.com/ni/board/message?board.id=170&message.id=142902
another from Shane:
http://forums.ni.com/ni/board/message?board.id=170&message.id=66015