LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying control panel properties programmatically

Solved!
Go to solution

How do I programmatically change the control panel indicators properties.  I
can get to the captions and labels but I needed to change the background color
of the numerical value of the indicators.  I have a lot of indicators and therefore would like to do this using references to the front panel controls.  I've attached two images, the first
one showing I can only get to "value" from the front panel references and the
second image showing a property node option for an individual Numerical
Indicator.  I am trying to access the numerical indicator properties
programmatically.

Download All
0 Kudos
Message 1 of 3
(2,881 Views)
Solution
Accepted by topic author Guy04

I'll tell you how to do it, but I think you may want to rethink how you're handing things- having literally dozens of indicators is a very messy way to indicate things; it's not very expandable and it's rife with possibilities for errors. It looks like you're wanting to control the colors of each element to indicate some status of that element. I'd recommend making a custom control consisting of a numeric element and a colorbox element. Make the numeric element's background transparent, then change the colorbox to alter the background color. See this article for more information: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000kGuvSAE

 

The issue is that, in LabVIEW, array elements can be different, but their properties will all match. The properties are a component of the Array item, and each individual element contains ONLY a Value item (in this case, a Double).

 

If you're dead set on your current method though, this will work- use "To More Specific Class".

 

Right click the indicator, select "Create Reference", right click the new reference, select "Create Constant", then wire that to the Target Class input of To More Specific Class.tsc.png

 

The problem is this method gets ALL of the controls on the panel, and the To More Specific Class function will throw an error on things that aren't the right target class (like if you have a String control or something).

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

Thank you.  This is exactly what I was looking for.

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