07-16-2009 10:37 AM
I've created a control that has a cluster made of a Boolean, a String and a Numeric. Then in my front panel I've created an array of these custom controls. I would like to have access to the property of the controls inside of the cluster within the array. ie, I want to change the color of the Boolean or make it blink, or "disable and gray" the text box. I think I'm on the right track, or maybe I'm on the wrong path. I've attached and example VI (testtray.vi) and the control that I'm using (UUT_Display.ctl). Please excuse the use of a Flat Sequence Structure, I know it's poor programming practices, but I just wanted to throw something together.
Any help would be appreciated.
kevin
Solved! Go to Solution.
07-16-2009 01:14 PM
I am stuck in the Stone Age with LV8.2 so I couldn't look at your example, but I have come across a similar issue. I assume that you want all elements of the array to have the same properties (boolean enabled, string grayed out...). In this case, for most of the properties you can right-click the control (inside the cluster) -> create property node and change the value programmatically as you would any other control not inside an array of clusters. Changing the 'Blinking' property of a Boolean buried in an array of clusters is ignored (as you've probably noticed). My workaround is to simulate blinking by changing the color in a timed loop. As a bonus, you can get better effects than the simple flashing between two colors that LV gives you. If you need more help I can try to scrounge up an old VI or two.
-Darin
07-16-2009 02:17 PM
07-16-2009 02:24 PM
Elements of an array can have different values BUT every element in the array share the same properties.
Since "blink" is a property when you make one element in tha array blink you will amke them all blink.
This restriction does not apply to clusters.
So in theory you could develop an XControl that has a data type that is an array but the display is actually a cluster that looks like an array. But writing an XControl is not a trivial task.
Ben
07-16-2009 02:25 PM
07-16-2009 02:27 PM
07-16-2009 02:36 PM
oKevin wrote:
So, Ben, if I make a cluster of MyClusters instead of an array of MyCluster will this solve me problem?
I would have to stop and think to answer that Q so I can't say. I was only replying to your thought of doing an XControl.
From what I understand of your query I suspect you have much better results using a cluster as long as you can live the the cluster's "fixed size". If you have not already seen it, my Nugget on using control references may save you some headaches.
Have fun!
Ben
07-16-2009 02:57 PM
I have enclosed a quick and dirty example of replicating the blinking in an array of clusters. You can turn it on and off, but as we have noted, only for all of the elements. If you were only showing one element of the array you could change properties based on which element was displayed. You probably want to see them all. In that case, you could use a cluster of clusters. This may be a pain, but I would suggest that you use an array of clusters to do your manipulations. Use Array->Cluster to convert to a cluster for display purposes. Then you can manipulate the properties of the cluster.
My guess is easier said than done, good luck.
07-16-2009 03:09 PM
Ben, I have looked at your Nuggets thread and appriciated it. It lead me to the point where I'm at. I'm going to stay away from XControl for now (maybe on my next project) and just do a cluster of clusters.
Darin, thanks for the program, it looks great!