To download NI software, including the products shown below, visit ni.com/downloads.
A new version of the sub vi Checksum.vi can be found at: https://forums.ni.com/t5/Example-Code/Checksum-generator-XOR-8-bit-8-bit-sum-LRC-8-bit-16-bit-sum/ta...
Overview
String inspector was developed as a tool for investigating serial type communication protocols. It lets you inspect text in different formats, compose command type strings with none-printable ASCII characters and calculate XOR and 8 bit sum checksums. For TCP communication, you can prefix the command string with string length. The string length value is formatted as either a 4 byte text or 4 byte type cast. You can view text in ASCII (text), hex, '\', binary and decimal mode.
Description
The vi can be run as a stand alone vi or it can be called from another vi with the text you want to inspect. The vi returns the (edited/a new) text.
To add non-printable ASCII characters to the text pick a decimal number in ASCII table and hit -> (right arrow). The character is inserted at the cursor position. Number of characters in Text (string length) is displayed above the Text box. You can add the string length to text in Text by hitting Add in section String length. The value is inserted at the cursor position. Mark text if you want to get string length of only part of text. The string length can be added as either a 4 byte text or a 4 byte type cast value. This is useful for testing TCP connections when the string length prefixes the string. You can choose a checksum type and hit Calculate to calculate the checksum of text in Text. Check Invert to negate the result. Mark text if you want to calculate the checksum of only part of text. Choose how the checksum shall be represented in Add as and hit Add to insert checksum at cursor position. ASCII inserts checksum as the ASCII character represented by the checksum value, e.g. decimal value 65 will be inserted as the character A.
Requirements
Steps to Implement or Execute Code
Additional Information or References
Front Panel of String Inspector
**This document has been updated to meet the current required format for the NI Code Exchange.**
Description-Separate-2Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.