To download NI software, including the products shown below, visit ni.com/downloads.
The checksum generator is a sub vi that accepts a text and returns the checksum of the text
The following checksums are supported:
0: XOR of characters (8 bit)
1: Modulo 100h of sum of characters (8 bit sum)
2: LRC (8 bit), 256 - Modulo 100h of sum of characters
3: Modulo 10000h of sum of characters (16 bit sum)
4: MODBUS 16 bit CRC
Using the vi:
You can add more checksum methods by expanding the outer case structure. If your checksum will include more than 16 bits you must add a case to the string conversion case on the right and let the case be called by the number of bytes in the checksum
An older version of the vi is used in my String inspector, https://forums.ni.com/t5/Example-Code/Inspect-strings-compute-and-add-checksums-add-non-printable/ta...
Description-Separate-2
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.