05-27-2015 04:26 PM
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.
Solved! Go to Solution.
05-27-2015 05:22 PM
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
05-27-2015 05:25 PM
05-28-2015 11:14 AM
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.
05-28-2015 11:24 AM
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
05-28-2015 11:53 AM
05-28-2015 01:25 PM
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.
05-28-2015 02:13 PM
Thanks.