Example Code

Simple string input dialog box with character checking Using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This is a simple string input dialog box with character checking and setting of some dialog  box characteristics

 

Description

The vi allows the user to set some characteristics of a string input dialog box. The vi is called with front panel window title, dialog box header text, string input label (actually caption) and default string input value. The input string is checked according to a regular expression and invalid characters are replaced by a replacement character, both specified in the call to the vi. The vi can remove white spaces before and after the string. The vi can be used as a model for other dialog boxes.

 

Requirements

Software

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Open String input dialog box.llb
  2. Load and run vi String input dialog 2012 NIVerified.vi
  3. Hit Call dialog box to display the string input dialog box
  4. Enter some illegal characters, e.g. &%() and watch how each one is replaced by a X
  5. Hit OK to return the result string
  6. Change some parameters and call the dialog  box again. Watch how headers and other characteristics have changed

 

Additional Information or Reference

1-390BD.png

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.