Example Code

Programmatically Add Elements to Enum / Ring

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 will show you how to programmatically add elements to an enum or a ring.

 

Description

This VI will show you how to programmatically add elements to an enum or a ring.

You cannot run this code if the actual control is in memory. This means that you cannot change the control and use it at the same time.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Download the attached ZIP file
  2. Open the enum or ring control (.ctl) you want to add elements to (i.e. Enum Control.ctl) 
  3. Specify the filepath of the control opened
  4. Run this VI and see the new elements in the opened control.

 

Additional Information or References

Front Panel

1.png

 

 VI Snippet

2.png

 

 

 

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

National Instruments
Applications Engineer

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

Comments
VIMaster
Member
Member
on

Tried code ...._lv80.zip.

It is not made clear that you must first OPEN the enum control front panel, run the VI, and then SAVE the enum control which now has changed elements.

My goal is to replace a semi-automated enum stuffer with a completely automated method and this helps.

Thanks,

Thomas Plummer

LabVIEW programmer, 15 years.

GIC-SAGM
Member
Member
on

 

Further "evolution".

Hope it helps someone.

 

Create Enum from String Array (by scripting).png

21st November 1905: E=mc² - Physics would never be the same again...