Example Code

Select Controls by Label Text and Change Value and Enable Status Programmatically 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 VI shows how to programmatically select controls by label text, set enable state and change its value.

 
Description

This VI allows the user to select any number of Controls/Indicators from his Front Panel using the Control Names Array and set the desired Enable state for them, additionally if the control is a Numeric, Boolean or String he can select the value to be set before the Enable state change.

Note: The Control Name syntax should be Cluster Name/Control Name if the control is inside a Cluster and should be Tab Control Name/Page Name/Control Name if the control is inside a Tab Control.


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Input the right name of the Control you want to enable or disable according to syntax note.
  2. Choose Enable or Disable or Disable and Grayed out in the front panel.
  3. Run the VI.

 

Additional Information or References
VI Snippets

001a.png001b.png001c.png

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

Francisco Arellano

National Instruments Mexico
Field Systems Engineer - Energy Segment
www.ni.com/soporte

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