Example Code

Modify Prompt User Input Express VI To Have Default Values 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
The Prompt User for Input Express Vi is an easy VI to show a dialog box in which the user will enter values and click on an OK button to continue with the VI


Description
The user can select the data type to be used in this Express VI, but every iteration of the VI defaults to the default value of the data type (0 for numeric, empty string for text box, etc.). The attached VI shows how to set custom default values for this VI, as well as retaining the values entered, if desired.
Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Put down a Prompt User for Input Express VI on the block diagram of a VI
  2. Configure the Express VI for the Message, Inputs, Buttons, and Window Title that you want. Click OK when finished.
  3. Open the front panel of the VI by right-clicking on the Express VI and select Open Front Panel.
  4. Move the inputs from inside the While Loop to the right outside the loop.
  5. Rewire inputs to their respective outputs, then create shift registers.
  6. On the Front Panel, enter the values in the controls that are to be the default values. Then select Edit » Make Current Values Default.
  7. If you want the VI to retain the values entered on previous iteration, instead of reinitializing every time, remove the Default Values,and Reinitialize all Invoke Node

Additional Information or References

 5-316.png

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

 

 

Robert R. | Applications Engineer | National Instruments

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