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: 

how to change color of cluster elements using reference

Solved!
Go to solution

Hello ,

 

I have cluster with 10 LED's, each LED represents a test inside my program, depending on pass or fail I want to change the color of each LED,I am using cluster reference as the input to test sub-vi's.

 

IS there any method to change the color of induvidual elements?

 

thanks in advance.

0 Kudos
Message 1 of 6
(5,318 Views)
If you have only two states, just change the t/f value. If you need more states, use a colorbox instead. (Do a search for "color led" here). Of course you could iterate over all element references, but why make life difficult? Show us a vi containing your cluster and might have more specific suggestions.
0 Kudos
Message 2 of 6
(5,313 Views)

17333i75CEF02846EB57E317335i700FBA23029B4776

 

 

Hi,

 

Attached front panel screen shot and the block diagram image code, basically in the 2nd image I am using all the FP clusters ref as input and update dynamically.

I am not getting the colors option, I do get colors in the decoration property but when I write into that I get ref error.

 

Main intention, when pass LED color should be green and when fail it should be red.

0 Kudos
Message 3 of 6
(5,294 Views)
Solution
Accepted by topic author cancancanopen

The properties available for use with any ref wire are determined by the class of the ref wire itself.

 

Generic refs only have geneirc properties.

 

The get athe the properties of the elements within the cluster you will have to tell LV the class is a cluster. Similarly for the elements within the cluster.

 

Please review this Nugget on using Control references. Don't worry about understanding everytihing I wrote in that Nugget since it was written to be entertaining at all levels. Look for the section where I show

 

 

how to cast ref nums as specific types.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 6
(5,287 Views)

 


@cancancanopen wrote:

Main intention, when pass LED color should be green and when fail it should be red.


 

OK, you need to be more specific than that, because if you only need two colors, you can just use the boolean value while making e.g. TRUE=green and FALSE=Red.

I assume you want at least a third color: Untested=black. Is this assumption correct?

 

As I said: You would really make your life much easier if you would use a color LED instead, where the value is the color. Have a look at my idea for some useful link. Now you could reduce the problem to a single 2D array of color LEDs, getting rid of all that current complexity. Most likely, you don't even need a subVI and references at all.

 

The images you have attached are not that useful to me. Can you attach some actual VIs instead? What is your LabVIEW version?

0 Kudos
Message 5 of 6
(5,282 Views)

Thanks Ben&AltenBach

0 Kudos
Message 6 of 6
(5,272 Views)