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: 

Change color of a specific control in a array of clusters

Solved!
Go to solution

I have an cluster with a tank and a string. That cluster is placed in an array. Can I modify the color attribute for a specific tank in the array in some way?

 

 

 

0 Kudos
Message 1 of 9
(1,426 Views)
Solution
Accepted by topic author TakeANap

No.

In an array all elements share the same properties!

 

You might add a colorbox to your cluster. The value of a colorbox is not a property...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(1,415 Views)

Aaaa. That means I need to handle the "progress" in another way!  One way is to place five of these clusters in a common cluster. I can't use array functions but I still have only one thread to handle in the loop. 

 

0 Kudos
Message 3 of 9
(1,398 Views)

If it is "for display purposes only", you can keep the array as an array and convert the array of clusters to a cluster of clusters when you need to show it with Array To Cluster.  Caveat here is that it makes your code fragile.  Because you have to tell LabVIEW how many elements are in the array, if that changes, your code breaks.  If you're sure the number of elements won't change, this will work.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 4 of 9
(1,341 Views)

I got rid of the array. I made a cluster that contains these 5 clusters with indicators (one slide and one string). 

 

Now I'm struggling with references to clusters pointing at ref. to clusters that points to controls bla bla bla. I want to change the color of the slides in one of the five clusters.  Problems with ref. to strict type.... but this is another story. 

0 Kudos
Message 5 of 9
(1,326 Views)

I'm not sure what you are displaying but there are probably several ways to accomplish it.  Would a single column Listbox work?  This Listbox can display an array of strings, and each row can have different font styles and colors, and different background colors.  I've also done something similar using color boxes to make it look like arrays have a different color, but as others have said only the value of an array can change between elements.

 

https://forums.ni.com/t5/LabVIEW/How-to-handle-40-of-the-same-little-GUI-s/m-p/3615868#M1013866

0 Kudos
Message 6 of 9
(1,278 Views)

Thank you for your suggestion. I will look into it.

 

Five units are tested in a test rig. I use a Tank as an indicator for test progress, 1..8. Below the tank I have a string where I can show messages from that particular channel (1 of 5).  I have these two controls in a cluster. I put five of these clusters in a cluster.

When a channel run into an error (e.g voltage to low or to high) I want to change the color of the channel tank to red. 

That was not possible when I put the channel-cluster in a row. Therefor I put them into a cluster. I can reach the tank Fill color attribute with "To more specific class" and Property Nodes. However, I got problems with a Type Cast and a strict reference. It don't like a ref to Fill Color. I don't know what to do - yet.

 

Edit:  I tested the example you pointed to in the link. I opened Cluster 2.  I can't find attrib Color anywhere. :🙂

0 Kudos
Message 7 of 9
(1,230 Views)

@TakeANap wrote:

 

Edit:  I tested the example you pointed to in the link. I opened Cluster 2.  I can't find attrib Color anywhere. :🙂


That's because you can't have an attribute of an element change in an array.  Only the value can change.  So in my cluster there is a color box behind all the controls that is set to transparent most of the time (this is the value of the color box).  Then when you want it to be red you set the value on that color box to red.  It is just like setting the value on a numeric indicator to a specific value.  In this case the value is represented as a color.

0 Kudos
Message 8 of 9
(1,216 Views)

aha! A color box!! Clever. A new tool/idea to use when designing the FP.

 

 

0 Kudos
Message 9 of 9
(1,207 Views)