LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change colour of led

I have a small problem...the default color of a boolean led is green and i want to change it's color to red if some condition is true. I used property node (the property being colors[4]) for the LED and wired a color box constant with value red to it.But it shows a broken wire and tells me that types are incompatible.How do I fix this error?
Thanks,
CheersSmiley Happy
0 Kudos
Message 1 of 11
(23,635 Views)
Well, why don't you just color the TRUE state red using the coloring tool, then just wire your boolean condition to it? 🙂
 
That's probably the way to go!!! 😄
 
 
(If you still want to use a property node, just open the context help while hovering over the property. It will tell you that it wants an array where each array element is a cluster of two colors. Check the help for details).
 
If you need an LED with more than two colors (e.g. off, red, green), use a colorbox made to look like an LED. Here are some old examples:
 


Message Edited by altenbach on 11-17-2007 10:18 PM
0 Kudos
Message 2 of 11
(23,634 Views)
Thanks altenbach,
I saw ur example...but is there no way an led can be made to exhibit 3 states using a property node?I don't want to create a colorbox as a led because it doesn't go with my codeSmiley Sadi just want to change color of led to red when my boolean condition becomes true.
0 Kudos
Message 3 of 11
(23,631 Views)
Then read my paragraph in parenthesis above! Wire an array of color pair clusters!
 
 
The colorbox is however a much cleaner and more efficient solution, you could do something like the following:
(this has two colors for ON, while off is the same Mix&match according to your requirements)
 
 


Message Edited by altenbach on 11-17-2007 10:46 PM
Message 4 of 11
(23,626 Views)
Sorry again,
I'd be happy if you tell me how to create an array of color pair clusters.
0 Kudos
Message 5 of 11
(23,616 Views)
You can always create the correct datatype by just right-clicking on the property and selecting "create constant". you'll get and empty array of the right type, except that the colors are numerics instead of color boxes (no big difference ;)). Now just right-click on each numeric and select "replace.." and pick a color box constant.
 
Now select the desired color.
 
See how far you get. 🙂
 
 
Or you could do the following:
Resize the built array to two or four elements as needed. Check the help (right-click on the property node and select "help for colors[4]"). It's all there!
 


Message Edited by altenbach on 11-17-2007 11:59 PM
Message 6 of 11
(23,613 Views)

how many colours canbe changed in 1 LED,i like to do 18 colours.Pls give suggestions

 

Thanks

 

0 Kudos
Message 7 of 11
(23,201 Views)
Hi Veeru,

the LED only takes 4 colors (with a purpose for each). But you can change those colors anytime, so it's up to you how many colors you want to show.

BUT:
The more colors you want to show, the easier it will be to use a color box instead!!!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 11
(23,197 Views)
Thanks Gerdw
0 Kudos
Message 9 of 11
(23,194 Views)
which is what Altenbach proposed in post # 2 😉
 


altenbach wrote:
 
If you need an LED with more than two colors (e.g. off, red, green), use a colorbox made to look like an LED. Here are some old examples:
 


Message 10 of 11
(23,167 Views)