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: 

can slide color vary with number indicated?

Hello,
I have a slide indicator that I would like to use to indicate cylinder head temperature. When I right click on it and select "properties", I am allowed to select a fill color, but I would like for the color to change with the temperature indicated, ie: green for 0-400deg, yellow for 400-500 deg, and red for >500deg. This appears to be an option on meters - is it also on slide indicators? Thanks.
0 Kudos
Message 1 of 6
(2,675 Views)
Simply create a property node for "Fill Color". Now create a case structure for your condition in front of the property node and place the appropriate colorbox constant in each case. Wire them the property node. See how far you get. 🙂

Message Edited by altenbach on 12-20-2006 10:09 PM

0 Kudos
Message 2 of 6
(2,666 Views)

yup... altenbach is right... i've attached an example... its not the best method of doing it... but hope it gives you a start... Smiley Very Happy

Best Regards,

JQ

LV 8.0 user...
0 Kudos
Message 3 of 6
(2,661 Views)

thanks guys,

i was just stumbling onto property nodes. so much to learn. thanks again.

0 Kudos
Message 4 of 6
(2,658 Views)

Here's a more streamlined version using a case structure with ranges (LabVIEW 8.0). Also remember that if all cases of a case structure contain the same property node, the property node itself belongs outside the case structure.

(I also made the slide an indicator as apparently desired. ;)) Remember that property nodes are relatively expensive, so it might be worth to place it inside another case structure so it only gets written when the color actually changes, and not with each loop iteration.

 

Message Edited by altenbach on 12-20-2006 11:59 PM

Download All
Message 5 of 6
(2,648 Views)
Here's another alternative. Sometimes, the code is easier to read, edit, and debug if you simply index into a lookup table of colors.
 
 
Now all code is completely visible and noting is hidden inside cases.
 
Try it!

Message Edited by altenbach on 12-21-2006 12:17 AM

Download All
Message 6 of 6
(2,644 Views)