LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically changing elements in an array of menu ring controls

Solved!
Go to solution

I have an array (32 rows, 5 columns) of menu ring controls.  When a menu selection is made in the first column of any given row, the contents of the menu ring for the subsequent columns (same row) may change.  If this is possible, how would you do it?  Thanks.

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

You can't do it with an array, because all array elements are identical in all their properties, and only the values can differ. One property of a ring is the list of options, so changing that list for the array element affects all of the array elements. This has been asked many times. See these threads for two possible solutions:

http://forums.ni.com/t5/LabVIEW/How-to-populate-an-array-of-ring-controls-with-strings/td-p/1841053

http://forums.ni.com/t5/LabVIEW/Can-we-change-the-property-of-each-element-of-an-array-using/td-p/16...

0 Kudos
Message 2 of 8
(3,397 Views)
No. You can't do that with arrays because you can individually address specific elements. You could do it easily with a 32x5 matrix of controls in a cluster.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 8
(3,393 Views)

Thanks Nathan.  I can see how using an array of clusters is probably the way to go, but it is still unclear how to dynamically change the contents of the menu ring for each cell programmically.  In the examples, I see how the value is updated using the same menu ring in a given column, but it is not clear how one can change the menu ring of one cluster element based upon the selection in another.

 

For example, if I had a menu ring of 1,2,3,4.  I want to write some logic that says when 4 is selected, then menu ring in the next row changes to 5,6,7,8.

 

Thanks for your advise.

0 Kudos
Message 4 of 8
(3,343 Views)

Mike,

 

If I did this can I dynamically change the menu ring (not just the value) of one element versus another or does the menu ring have to stay the same.  I'm looking for a structure that will allow me to change the menu ring programmically.  Please advise.  Thanks.

 

Joe

0 Kudos
Message 5 of 8
(3,338 Views)
With the rings in a cluster, ever ring could have different items if you wanted, so you could certainly attain your goal.

Mike

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 8
(3,322 Views)
Solution
Accepted by topic author jschichl

jschichl wrote:

For example, if I had a menu ring of 1,2,3,4.  I want to write some logic that says when 4 is selected, then menu ring in the next row changes to 5,6,7,8.


A ring is just a number as far as LabVIEW is concerned, so the underlying cluster need only store numbers, not rings.

 

In the example I posted in a linked thread, where controls are moved around on top of a table, you need only one ring control. Each time you show that ring, you can assign a new set of strings and values to it, using the Strings and Values property. You can decide what set of strings to show based on the existing data in the cluster, which will get updated each time you change the value in a cell of the table. Does that make sense? I don't have time right now to put together a more detailed example than what I've already uploaded in other threads, and it's only a small change to that.

 

You update the menu ring at the time the user wants to select a value from it, not at the time the user changes the value that determines what set of menu items to show.

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

Thanks.

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