LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing background color based on value

Solved!
Go to solution

I am sure this is a trivial issue, but I cannot seem to find the method for doing it.

 

I want to change the background color of an indicator depending on it's value.

For example: if I have a setpoint of say 123degF, I would like the background color to be green if the value is within say 1%, or +/- 2degF.

Otherwise the color could be red if over and blue if under.

 

I have been able to program an indicator light that acomplishes it, but with over 50 indicators the interface gets rather busy.

0 Kudos
Message 1 of 4
(5,027 Views)

Create a subvi that will do the color changing of indicator depends on condition. But make sure you have taken provision to to pass the control reference to that vi.

Make that vi  as reentrant so you can use one vi to change the color of 50 indicators, you have to just call the subvi and pass the reference of control that you need to change the color.

Hope this helps

Regards

Santosh

0 Kudos
Message 2 of 4
(5,020 Views)
Solution
Accepted by topic author rdgriego

Santosh is correct. Here is a quick example of how to implement that code:

I also attached a copy of this VI, with the terminals already connected, so you may use it as a sub-vi if you wish.

It takes inputs of temperature, lower limit and upper limit. It then outputs the temperature value, with the color of the indicator modified.

Message Edited by Cory K on 02-13-2009 08:24 AM
Cory K
Download All
Message 3 of 4
(5,007 Views)
You can find a VI to give you continuous color variation (hue) here.
0 Kudos
Message 4 of 4
(4,978 Views)