Grouping Data with Strings

A string is a sequence of displayable or non-displayable ASCII characters. Strings provide a platform-independent format for information and data. Some of the more common applications of strings include the following:

  • Creating simple text messages.
  • Controlling instruments by sending text commands to the instrument and returning data values in the form of either ASCII or binary strings which you then convert to numeric values.
  • Storing numeric data to disk. To store numeric data in an ASCII file, you must first convert numeric data to strings before writing the data to a disk file.
  • Instructing or prompting the user with dialog boxes.

On the front panel, strings appear as tables, text entry boxes, and labels. LabVIEW includes built-in VIs and functions you can use to manipulate strings, including formatting strings, parsing strings, and other editing.

Refer to the ASCII Codes topic for more information about ASCII codes and conversion functions.

Strings on the Front Panel

Use the string controls and indicators as text entry boxes and labels.

String Display Types

Right-click a string control or indicator on the front panel to select from the display types shown in the following table. You also can right-click a string control or indicator and select Visible Items»Display Style from the shortcut menu to display a glyph on the object that indicates the display type. The table also shows an example message in each display type.

Type Glyph Display Type Description Message
n Normal Display Displays printable characters using the font of the control. Non-displayable characters generally appear as boxes. There are four display types. \ is a backslash.
\ ‘\’ Codes Display Displays backslash codes for all non-displayable characters. There\sare\sfour\sdisplay\stypes.\n\\sis\sa\sbackslash.
P Password Display Displays an asterisk * for each character including spaces. **************************** *****************
* Hex Display Displays the ASCII value of each character in hex instead of the character itself. 5468 6572 6520 6172 6520 666F 7572 2064 6973 706C 6179 2074 7970 6573 2E0A 5C20 6973 2061 2062 6163 6B73 6C61 7368 2E