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: 

Dynamic changing of Slider Control fill colours

I'm having a really annoying issue with LabVIEW thermometer controls that I have seen before but never really thought about as it wasn't that important. Unfortunately I'm doing something where this problem has become important and I was hoping someone might have some knowledge of this and maybe a solution.

I am using thermometer controls to display a temperature value measured using a DAQ card. As part of this a check against limits is made. If the temperature is within limits then the Thermometer is green, if over limit then it is red.

All very simple, and just done using the fill property on a property node.

The problem is that everytime you change colour there is a little annoying Smiley Mad bit of the previous colour at the bottom of the slider (please see attached).

Has anybody got any ideas or fixes for this.

Many thanks in advance for any responses.
David Clark
CLA | CTA
IDEX Biometrics UK Ltd
Hampshire, England
0 Kudos
Message 1 of 8
(2,861 Views)
Yes, that is annoying. Not sure if this is still a problem in LV8. The problem is that the coloring of the pixel decrement portion of the control lags behind. The opposite will happen when going from green to red. One thing that can be done as a work-around is to customize the control and simply shrink the pixel decrement portion to be of zero height. This has the effect of "boxing" the control as opposed to giving you a nice oval bottom. You can do the same to the pixel increment portion to make it symmetrical. Not sure if there's anything that's more effective, but perhaps somebody else has another/better suggestion?
Message 2 of 8
(2,853 Views)

Not sure...

"invoke Node >>> Get image""

is sometimes effective in getting LV to update the objects appearence.

Let us know if this work.

Ben

Another CLA

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 8
(2,847 Views)
Thank you both for your responses - I've had a crack at them both. I can't seem to get the 'get image' one working - just doesn't appear to do anything, but I've found  that smercurio _fc's idea seems to work.  I can't shrink the top and bottom portions down to 0, but I've reduced them to 1 then sent them to the back behind the control so they can't be seen - and it actually looks quite reasonable as well - maybe even better.

Many thanks again.

p.s. congratulation on the  4k posts ben.
David Clark
CLA | CTA
IDEX Biometrics UK Ltd
Hampshire, England
0 Kudos
Message 4 of 8
(2,823 Views)

Thank you David.

"I can't seem to get the 'get image' one working - just doesn't appear to do anything,"

Are you wiring the output to anything?

LV will skip doing code that is not used (as part of its optimizing).

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 8
(2,811 Views)
Hey, that actually works, as long as you do it after you've updated the Fill Style, which you can do by using the error I/O to force data dependency.

Cool.

This would definitely work on the original thermometer control. Also, as a follow-up to the control modification, doing so basically gets you a "Tank" control, so if that's OK visually you can use that instead. This way, you don't have to do the nice little trick of getting the image.

Message Edited by smercurio_fc on 04-20-2006 10:03 AM

Message 6 of 8
(2,804 Views)
"Cool."
 
Thanks!
 
And thank you for the update. It is nice to know when these things work.
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 8
(2,792 Views)
That's great that it works - the thermometers don't look quite so good with their top and bottoms missing. Unfortunately I'm on a bit of a tangent at the moment, but as soon as I've got a few minutes I'll give it a go.

Thanks once again.
David Clark
CLA | CTA
IDEX Biometrics UK Ltd
Hampshire, England
0 Kudos
Message 8 of 8
(2,783 Views)