Example Code

Modify Boolean Text in Cluster of Booleans

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 demonstrates how to allow the user to programmatically alter the Boolean Text within a Cluster of Booleans using two different approaches

 

Description
This VI uses two approaches to change the Boolean Text of the Booleans within a Cluster. The first is to reference each Boolean in the Cluster individually and use Property Nodes to modify the "Boolean Text. Text" property. The second approach is to reference the Cluster and use a Property Node to access the Controls within the Cluster as an Array. Each item of the Array can then be specified as a Boolean with the "To More Specific Class" function and the "Boolean Text. Text" property can then be modified with a Property Node, as in the previous case.

Furthermore, in each of these cases, the Boolean Text is not specific to the "ON" or "OFF" state. This is ensured when Right Clicking each Boolean in the Front Panel and selecting Properties. In the Appearance tab, under Show Boolean Text, the Multiple strings box is unchecked. Checking this box allows for different Boolean Text based on if the Boolean is set to True or False.

 

 

Requirements

  1. LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. To run this example, open the included VI.
  2. Select the desired approach: "Using Reference to Cluster" or "Using References to Booleans".
  3. Input desired text for each Boolean.
  4. Run the VI.

 

Additional Information or References

VI Snippet

 Cluster of Boolean Text 2012 NIVerified.png
 

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

Julia P.

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