LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to update enum labels when enum is inside an array of clusters?

Solved!
Go to solution

Hello LabVIEW gurus,

 

I'm stuck with a design aspect, and was wondering if you could share some ideas as to how to get past it: I would like to fill a table with strings, and then populate an enum inside an array with the string values. 

 

For purposes of discussion I'll break the steps into two actions, where one takes place before the second (sequential, not in parallel)

 

Action one - The user will be first asked to populate a table with "strings". The table would look like,

row0 - "string0"

row1 - "string1"

row2 - "string2"

and so on....

 

Action two - When ever the user "selects action two" I would like to populate an ENUM inside a cluster with values from "Action one". In other words, I'm trying to dynamically write enum values.

The cluster has several objects such as boolean controls, string controls, AND AN ENUM control (see attached .png)

 

I have tried using Ring, and enums at this point, and have not been successful at it. I read somewhere that because the enum/ring is inside a cluster, and the cluster inside an array, that what I'm trying to do is simply not possible. If that's the case, can you please throw ideas my ideas my way? 🙂

 

In advance, thank you very much.

Cheers,

 

 

0 Kudos
Message 1 of 8
(3,562 Views)

Is this in the full development environment?  Is the cluster (that I assume is a type def) reserved for running at the time?  Because what you described is totally do able IF you are not in an EXE, and this is intended for making an enum to be used elsewhere.  Otherwise this won't work the way you want.  An enum must have it's type defined at run time.  Through scripting you can make the cluster or the enum, or edit ones that already exists (or use one as a template) but as soon as you are in an EXE you have no scripting, and even if you did your code can't compile, so you can't use the new controls even if you could make them.

 

But if you are looking for a way for a user to enter strings into a table, and then update a drop down with those options that is possible using the combo box which keeps track of the string selected, or a ring control which keeps track of the index (or value) associated with the selected item.

 

You gave lots of information, but not the important bits like how this will be used.

0 Kudos
Message 2 of 8
(3,524 Views)

Oh here is a start that you might get something out of.  Run the VI and enter data (or paste) then click the create button and an enum is made, you can do the same thing to update values of an existing enum, as long as it is in edit mode.

0 Kudos
Message 3 of 8
(3,520 Views)

Hi,

I've attached a VI that illustrates what I'm trying to do.

If you run the VI it will generate an error... I'm trying to figure out a way to obviously, run it w/o generating an error.

And yes, the code will NOT be run as an EXE.

I look fwd to your comments. But regardless, thank you for looking at this.

Cheers

Download All
0 Kudos
Message 4 of 8
(3,493 Views)

I'm using LabVIEW 2013

0 Kudos
Message 5 of 8
(3,491 Views)

And yes, to this:  "if you are looking for a way for a user to enter strings into a table, and then update a drop down with those options that is possible using the combo box which keeps track of the string selected, or a ring control which keeps track of the index (or value) associated with the selected item"

0 Kudos
Message 6 of 8
(3,481 Views)
Solution
Accepted by topic author EddieDP

First the issue is your cluster is a strict type def, and that prevents you from updating the ring strings so I turned it into a normal type def.  I also got rid of the sequence and while loop they weren't useful anyway.  Just unzip and run the VI then enter values into the array, as you enter data the ring is updated with the new value.

0 Kudos
Message 7 of 8
(3,461 Views)

Thank you!

Cheers

0 Kudos
Message 8 of 8
(3,419 Views)