Example Code

Dynamically Resizable Cluster of String Controls in 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

When using an array of strings, each cell is restricted by the properties of an array. That is, each element of the array must have the same properties. Elements of a cluster, however, are able to have independent properties, but a cluster is not resizable in the way an array is. This example shows how a cluster can be altered to appear as an array, yet have the capabilities of a cluster.

 

Description

This VI performs the following operations:

1. A cluster containing many string controls is initialized and each string is hidden.

2. When the user hits "BUILD", the strings are made visible and resized according to the dimensions of the string array defined by the user.

 

Requirements

  • LabVIEW 2012 (or compatible).

 

Steps to Implement or Execute Code

  1. Run the VI
  2. Type values into the string array
  3. Press "BUILD". Observe the changes in the table.
  4. Redefine the string array and press "BUILD" to repopulate the table.

 

Additional Information or References

 

201708144.png2017081442.png

 

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

Rick C.

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

Comments
pbuerki
Member
Member
on

Even though listed as 2011, the files in Resize Strings - 2011 cannot be opened in LabVIEW 2011. Please provide a LV 2011 compatible version. Thank you.

EccentRick
NI Employee (retired)
on

Hi pbuerki,

Are you unable to open the VIs, the project, or both?

Which errors are you seeing?

Rick C.
pbuerki
Member
Member
on

Thank you for your reply.

It is the whole project that does not open: "LabVIEW: File version is later than the current LabVIEW version."

EccentRick
NI Employee (retired)
on

Hi pbuerki,

I went ahead and uploaded another version that should work with LabVIEW 2011. I believe the dependent controls within the VI library could not be automatically converted for use in 2011, so I saved them as separate controls and can be found under the "Dependencies" section in the project.

Please let me know if it works for you.

Rick C.
pbuerki
Member
Member
on

Hello EccentRick,

Thank you. I can now open the project in LV2011 and run the VI. This is a nice piece of work!

Thank you.

-


EccentRick <web.community@ni.com> wrote:

EccentRick commented on the document

"Dynamically Resizable Cluster of String Controls"

To view all comments on this document, visit: https://decibel.ni.com/content/docs/DOC-39320#comment-40560