Skip to content Skip to navigation

Connexions

You are here: Home » Content » Strings

Navigation

Content Actions

  • Download module PDF
  • Add to ...
    Add the module to:
    • My Favorites
    • A lens
    • An external social bookmarking service
    • My Favorites (What is 'My Favorites'?)
      'My Favorites' is a special kind of lens which you can use to bookmark modules and collections directly in Connexions. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need a Connexions account to use 'My Favorites'.
    • A lens (What is a lens?)

      Definition of a lens

      Lenses

      A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

      What is in a lens?

      Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

      Who can create a lens?

      Any individual Connexions member, a community, or a respected organization.

      What are tags? tag icon

      Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

    • External bookmarks
  • E-mail the author
  • Rate this module (How does the rating system work?)

    Rating system

    Ratings

    Ratings allow you to judge the quality of modules. If other users have ranked the module then its average rating is displayed below. Ratings are calculated on a scale from one star (Poor) to five stars (Excellent).

    How to rate a module

    Hover over the star that corresponds to the rating you wish to assign. Click on the star to add your rating. Your rating should be based on the quality of the content. You must have an account and be logged in to rate content.

    (0 ratings)

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual Connexions member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • National Instruments display tagshide tags

    This module is included in aLens by: National InstrumentsAs a part of collection:"LabVIEW Graphical Programming Course"

    Comments:

    "A full introductory course on programming with LabVIEW."

    Click the "National Instruments" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.

Strings

Module by: National Instruments

Summary: In this lesson, you will learn how to create string controls and indicators.

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.
  • Passing numeric data as character strings to instruments and then converting the strings to numeric values.
  • Storing numeric data to disk. To store numeric values in an ASCII file, you must first convert numeric values to strings before writing the numeric values 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.

Creating String Controls and Indicators

Use the string control and indicator located on the Controls>>Text Controls and Controls>>Text Indicators palettes to simulate text entry boxes and labels. Use the Operating tool or Labeling tool to type or edit text in a string control. Use the Positioning tool to resize a front panel string object. To minimize the space that a string object occupies, right-click the object and select the Visible Items>>Scrollbar option from the shortcut menu.

Right-click a string control or indicator on the front panel to select from the display types shown in the following table. The table also shows an example message for each display type.

Table 1
Display Type Description Message
Normal Display Displays printable characters using the font of the control. Non-printable characters generally appear as boxes. There are four display types. 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.
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

Tables

Use the table control located on the Controls>>All Controls>>List & Table palette or the Express Table VI located on the Controls>>Text Indicators palette to create a table on the front panel. Each cell in a table is a string, and each cell resides in a column and a row. Therefore, a table is a display for a 2D array of strings. The illustration in Figure 1 shows a table and all its parts.

Figure 1: 1. Cell Indicated by Index Values, 2. Column Headings, 3. Vertical Scrollbar, 4. Horizontal Scrollbar, 5. Row Headings, 6. Horizontal Index, 7. Vertical Index
Figure 1 (tableparts.png)

Define cells in the table by using the Operating tool or the Labeling tool to select a cell and typing text in the selected cell.

The table displays a 2D array of strings, so you must convert 2D numeric arrays to 2D string arrays before you can display them in a table indicator. The row and column headers are not automatically displayed as in a spreadsheet. You must create 1D string arrays for the row and column headers.

Comments, questions, feedback, criticisms?

Send feedback