From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Different set of values for two rings in an array of clusters

Hi, people.

Is it possible to do what it's shown in the attached picture?

I have an array of clusters. Two elements of the cluster are rings. Can I define a different set of values in the second ring (the one at the right) depending on the value selected in the first ring (the one in the middle)?

If not, could you give me a good alternative?

Thanks,
Francisco
Mensaje editado por Porras
0 Kudos
Message 1 of 11
(5,210 Views)
If you're making an event driven program you can easily fill the 2nd Ring controls Strings[] property when the first is selected. It would be quite smooth if you make a 2D array where the 1st Ring control selects the arrays index, and the selected row fills the property.

(The Strings and values[] property is the key to your answer)

/Y
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 11
(5,193 Views)

The short answer is that it's not possible to change the properties of individual array elements.

 

We can get kind of slick though.  One way is to use a combobox as the secondary item and to change the options for the cbox depending on the value in the primary item based off a mouseclick.  That is, we change the drop down options for the combobox for all of the items at once, every time there's a mouseclick.  However, the cbox's value is the string that was selected, so this happens transparently to the user.

 

I whipped up a little VI, in LV2009: 

-Barrett
CLD
0 Kudos
Message 3 of 11
(5,177 Views)

Yamaeda wrote:


1)  (The Strings and values[] property is the key to your answer)

/Y
 
2)  If you're making an event driven program you can easily fill the 2nd Ring controls Strings[] property when the first is selected. It would be quite smooth if you make a 2D array where the 1st Ring control selects the arrays index, and the selected row fills the property.

Fransico-

Yamaeda is D.N.O. (absolutly Correct) on point 1)

On point 2)   He has placed false limitations.

 

You can change the property "Strings & Values[]" of a Ring control at any time in edit mode or while running.  So, any time you can determine that new parameters should be loaded into the Ring you are free to do so.


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 11
(5,172 Views)

blawson wrote:

The short answer is that it's not possible to change the properties of individual array elements.

 

We can get kind of slick though.  One way is to use a combobox as the secondary item and to change the options for the cbox depending on the value in the primary item based off a mouseclick.  That is, we change the drop down options for the combobox for all of the items at once, every time there's a mouseclick.  However, the cbox's value is the string that was selected, so this happens transparently to the user.

 

I whipped up a little VI, in LV2009: 


You are very correct.  THAT example IS pretty slick.  

 

Off Point though.   Close to the OP's desires but, Maybe I missed something...(It Happens):smileysad:


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 11
(5,169 Views)

If I'm not mistaken, simply setting the ring's strings[] property will NOT work for the OP, simply because the cluster is inside an array.  If you do change the strings[] property of the ring, it will change it for all of the rings, meaning your already-selected options will change based on what array is loaded (since these clusters are in an array, they all have to have the same strings[])  Take my example and replace the cbox with a ring, then fix the property node and see what happens.

For those who can't load the example, here's a picture of the event case, this time with comments:

 

dependent selection.png 

-Barrett
CLD
0 Kudos
Message 6 of 11
(5,163 Views)

Porras wrote:
Hi, people.

Is it possible to do what it's shown in the attached picture?

I have an array of clusters
. Two elements of the cluster are rings. Can I define a different set of values in the second ring (the one at the right) depending on the value selected in the first ring (the one in the middle)?

If not, could you give me a good alternative?

Thanks,
Francisco
Mensaje editado por Porras

Of course

 

It happens.  I read Cluster of arrays and looked at the two distinct clusters on th pix. 

 

OP- I guess we need clairification unless I'm the only confused person here.  Do you want tochange the selections for other controls or for elements of the same array.

Elements of the same array MUST have identical properties but elements of a cluster may be unrelated

 

-  Elements in arrays  And elemets in clusters behave quite differently


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 11
(5,144 Views)

@Jeff Bohrer wrote:

Fransico-

Yamaeda is D.N.O. (absolutly Correct) on point 1)

On point 2)   He has placed false limitations.

 

You can change the property "Strings & Values[]" of a Ring control at any time in edit mode or while running.  So, any time you can determine that new parameters should be loaded into the Ring you are free to do so.




Yeah, you're quite right, you can fill the Strings[] at any time, it just felt like a clever and logical solution to do it in an value change event on the 'ruling' combobox.

/Y
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 11
(5,115 Views)

I'm trying to do something very similar to your example but populate the comboboxes (or Rings) programmatically.    What you have is so, so close but it seems to require input from the mouse to get the correct control.    I don't really understand why you can change the String[] parameter in your program and it works fine but mine changes all the elements throughout the array.    The Refnum for the control does not change regardless of what cell is selected.   So, I'm a little puzzled how the correct cell or element is updated with the new combobox string.   

 

Ultimately, I want to have an array of variables with an associated combobox (ring) of options.     So, for variable Temperature, the options are Cold, Cool, Warm, and Hot.   Then, variable 2 is Pressure, which might be Low, Medium and High.    Yes, this is for a fuzzy logic controller (not part of the NI Controls Toolkit).

 

Any help is greatly appreciated!!!

0 Kudos
Message 9 of 11
(4,538 Views)

The difference is in the datatype.  In your other thread, the datatype is a ring (a numeric value).  What you see is defined by a property called strings[] which must be the same for every element of the array.

 

In this case, combobox is a string.  The strings[] property node must be the same for every element of the array, but once you have picked a value, it gets put in as the value in the string.  It doesn't automatically get changed.  The strings property defines the list that you can pick from when you click, but it doesn't directly define what the value is you can ultimately put in.

 

If you play with that example VI, enter a numeric in one element, then enter a color in another.  If you stop the VI and do an edit items on any of the elements, you'll see all the items match whatever was the last enum:type you picked whether you pick an element that was defined as color, or as number.   All elements of the array at that moment have the same Items definition, but the nature of the combobox allows you to choose items (and keep string values) that are not part of the item list.

Message 10 of 11
(4,531 Views)