From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a 3 color tank indicator?

Greetings All,

 

I've written a short display GUI that reads pressure out and am looking to make a fancier display for it.  I'm trying to make something like the "numerictank" indicator that changes colors as it progresses.  Currently, I can change the entire fill color, but I'm looking to go one step farther.  I'd like it to change color in certain areas as it approaches a certain range.

 

For example:  a numeric tank that goes from 0-15.  I'd like to make the 0-5 range red, the 5-10 range yellow, and the 10-15 range green.  This way all 3 colors will be displayed and not just changing the entire fill color.  Is this possible with existing controls?

 

Many thanks for reading,

Rob

0 Kudos
Message 1 of 17
(4,506 Views)

Hi,

 

while you can not change the basic shape or functionality of existing controls within CVI (except with respect to colors) you can consider stacking several controls on top of each other, with parts of the control set to transparent.

 

3-color-tank.jpg this is an example of two tanks stacked on top of each other

0 Kudos
Message 2 of 17
(4,505 Views)

Please forgive my ignorance 😞  I can set the transparency for the entire fill area, but cannot find out to set only part of it as transparent? 😞

 

I really like the look of your picture & it's exactly the type of thing i'm looking for 🙂

 

Can you point me to how to set only part of the tank transparent?  Or does it have to be set in the code? 

 

Thanks again,

Rob

0 Kudos
Message 3 of 17
(4,492 Views)

Sorry, duplicated post.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 17
(4,491 Views)

If you are using CVI in a version from 8.5 on (not sure about 8.0), you can add a color ramp near the tank indicator: simply add some value in Color ramp settings dialog box in tank properties.

 

Here the tank with the color ramp and corresponding settings:

 

rampindicator.PNG



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 17
(4,490 Views)

😞  Can't find a color ramp in 8.0.1 😞

0 Kudos
Message 6 of 17
(4,484 Views)

It's not a special control: it's an attribute of the numerico control; if present, it can be found here:

 

colorramp.PNG



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 7 of 17
(4,481 Views)

Rob,

 

for the tank 'on top' the entire non-filled area is transparent (fill option: fill below)

0 Kudos
Message 8 of 17
(4,482 Views)

Ok, I see that I don't have it in my version 😞

 

noramp.jpg

 

But I think I figured out how Wolfgang did the transparency thing... I'll update shortly 🙂

 

Thanks to all 🙂

0 Kudos
Message 9 of 17
(4,479 Views)

Greetings all!

 

First off, I'd like to thank all that responded 🙂  It's good to have a spot to come & get help 🙂

 

Unfortunately, it seems that to do what I was trying to do, I had to just have 3 "tanks" stacked one on top of the other w/ their own separate ranges.  I was able to make it look like one complete gauge 🙂

 

tricolor.jpg

 

Thanks again for all the help!!!

 

Rob

0 Kudos
Message 10 of 17
(4,466 Views)