Example Code

Using Property Nodes to resize Elements in an Array on the LabVIEW Front Panel

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

Download All

Overview

This example shows how to use Property Nodes to resize Elements in an Array on the LabVIEW Front Panel.

 

Description

Front Panel objects in LabVIEW, such as Controls and Indicators, have Properties that can be modified during development.  These properties include custom colors or sizes.  If a developer wanted  to change a Control's Properties while the code is executing, Property Nodes could be used in the Block Diagram.  Array Controls or Indicators, however, are a structure that can adapt to any data type.  It is possible to change the properties of elements within the array using explicit References and Classes.

 

This example shows that an Array of any data type has the Properties of the Array Class.  An array Property Node can be use to retrieve a Reference to the element.  The 'To More Specific Class' VI can be used to change Properties of the Element's class.  This example demonstrates this with an Array of Doubles, where each element is a standard Digital Numeric Control.

 

ArrayElementWidth.png

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Enter a value in Element Width
  2. Click Run arrow
  3. Notice that the width of the element in the Array of Interest has been resized.

 

Additional Information or References

A 3rd Party video tutorial on Property Node basics is found on YouTube.  The following link will shortcut to minute 1:51 where the tutorial on property nodes begins.

VI High #2a: Enhance Usability by Disabling and Enabling LabVIEW Front Panel Objects

 

 

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

George T.
Senior Applications Engineer
National Instruments UK and Ireland

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