LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Control color of each element in a cluster?

Can you attach your color LED so I can have a look at it?

 

I don't see any scaling issues in the version I have attached above: ColorLED86.vi

Message Edited by altenbach on 09-25-2009 08:33 AM
0 Kudos
Message 31 of 37
(2,899 Views)

 


DEppAtNGC wrote:

How do I put text in the middle of the indicator like the boolean?  Something like PASS,FAIL,TBD.


 

 

In case you haven't yet figured out how to set multiple texts for a boolean indicator, programmatically, use "Boolean Text > Text" property from the Create > Property node menu (upon right click) of the boolean indicator.

 

Then you may pass a string of the text that you want to show in the middle. Feel free to pass as many texts, depending upon your program's requirements, as you wish. LabVIEW allows us to "abuse" boolean indicator's property like this.

 

See here, what you can do on different "states" of your program execution:

 Boolean_states.png

 

But prioro to this, don't forget to open the properties window of the indicator and check "Show boolean text" option (by default unchecked). And also, you can change the color of the text to "White" if you never want to change the actual status of the indicator but just the text. This way, the indicator will always stay "off" with the dark green color (assuming you don't change the default settings) and you can see that white text in front of the dark green background. 

 

Boolean_properties.png

 

I hope this helps.

Vaibhav
0 Kudos
Message 32 of 37
(2,892 Views)

DEppAtNGC wrote:
I'd prefer something simpler... like a enum that could have colors associated with enum values...

Couldn't open Ben's example, since I haven't yet LV 9.0 on my laptop.

 

But, for my application, I have created a custom control which is exactly what you're looking for (an enum with different colors, using a Picture Ring control, as Ben said above). I edited the names to put your state names. Feel free to change further and use. 

It's a control file, so you can add that on your front panel by Right click>Select a control (and then select the file).

 

But, I would agree with Ben and say this is not so elegant (you cannot change colors at runtime) after looking at what "altenbach" has done with color box, but since you want something more simple, and since you have only a fixed number of colors to select from, I said this is "exactly" what you're looking for.

 

 

Vaibhav
0 Kudos
Message 33 of 37
(2,888 Views)

Hi altenbach,

LED attached for examination and critique.

LabVIEW version 8.6.1

 

There is an issue with your LED too.

If you make it bigger, the Decal hides behind the colour box.

If you shrink it the issue is most obvious.

What is this about?

The centre and the outside are not scaling at the same rate.

 

If you want a universal colour box with scalable Decal, I can't see how to do it.

Message Edited by James W on 09-28-2009 08:36 AM
CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 34 of 37
(2,862 Views)
 Mr. Altenbach  -- thank you.  You're a genius!
0 Kudos
Message 35 of 37
(2,645 Views)

Altenbach,

Does this type of customization only work for images copied out of other LabVIEW controls? I tried importing a different picture (a slightly 3D looking square, solid color except for the 3D effects, similar to your LED), but selecting different colors in the colorbox no longer affects the color of the control.  Is there some trick to get it to work?

 

Cheers,

Christina

0 Kudos
Message 36 of 37
(1,985 Views)

cwolfskill wrote:

Does this type of customization only work for images copied out of other LabVIEW controls? I tried importing a different picture (a slightly 3D looking square, solid color except for the 3D effects, similar to your LED), but selecting different colors in the colorbox no longer affects the color of the control.  Is there some trick to get it to work?


Sorry, I haven not studied this at all, but I suspect that some of those use special colors (above 00FFFFFF) or other functionality built into these special controls.

 

See for example this wiki entry or this page.

 

Maybe somebody else knows more.... I don't. 😉

0 Kudos
Message 37 of 37
(1,979 Views)