LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I programatically change a reference to an item in a cluster?

Solved!
Go to solution

Hello!

 

I'm trying to programatically change the text background color of the elements in a large cluster.

 

I'm using LabVIEW 2010 SP1.  Attached is a test vi that I'm expermimenting with.  The test cluster has 6 elements and the final cluster will have 140.

 

All elements will be the same data type.

 

Based on the rate of change of the element value, I have to change the background color.

 

Instead of creating a reference for each element in the cluster (as in my test vi), I'm looking for a way of changing the reference programatically.  Is there a way?

 

I'm also considering building an array of references as a brute force alternative but I would like to see if there is something more elegant / efficient first!

 

Am I making sense?

 

thanks,

 

mike

 

0 Kudos
Message 1 of 3
(2,079 Views)

Mike,

 

You can get references to the elements inside the cluster from the cluster reference using property node: All Objects[].  This is an array of references to the controls inside the cluster.

 

Another way which might have advantages is to put a color box indicator behind each numeric.  Color the numeric backgrounds Transparent.  Then write the color to the color box.  I did a quick modification to your VI to show this possibility.  I did not adjust the size of the color box to match the numeric to emphasize what I did.

 

Lynn

 

Another note: If any of your users are color blind some of the combinations (black on red) might not be very visible.

0 Kudos
Message 2 of 3
(2,067 Views)
Solution
Accepted by topic author mngrigg

Hi Lynn!

 

You gave me the clue I needed.

 

The AllObjs property node was the answer but it needed the "to more specific class" type conversion to go along with it - see attached.

 

Thank you very much!

 

mike

 

0 Kudos
Message 3 of 3
(2,059 Views)