LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LED color change

Highlighted

Hi everyone,

I am quite new to labview. I was wondering if there is any possible way to get an LED to change colors among 3 different colors based on the state of the program. For example if I am running a test and, while the test is running, I want to display orange, if the test fails, I want to display red and if the program is a success I want to display green. How do I do that with an LED? I am using labview 8.0 and windows 10.

 

Thanks,

Kaawn

0 Kudos
Message 1 of 13
(218 Views)

A typical LED is of Boolean type, i.e only good for two states. You can change the state colors using property nodes, but that always feels clumsy. 

I recommend to use a colorbox instead. It can be made to look exactly like an LED, but now the color is the data.

 

Do a search or check the links in this idea.


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 2 of 13
(207 Views)

Hi altenbach,

I kinda need to use LEDs. But I am not really sure how I would use the property node in this case. Would you please be able to guide me through this? You dont have to make a vi if you dont have the time, just tell me how I could use the property node to change color.

 

Thanks a lot,

Kazi

0 Kudos
Message 3 of 13
(201 Views)

Sorry, currently posting by phone. No access to LabVIEW.

Just use a regular colorbox for now, we can worry about cosmetics later.

 

Use a color array diagram constant and index into it with the state variable (e.g. enum) to select a color. Look at the examples in my link above.

 

(I really consider it bad form to use property nodes. For example you cannot have more than two colors in an array of LEDs, because properties are shared by all elements.)


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 4 of 13
(197 Views)

Alternatively, use a picture ring with tree different (by color) LEDs. Less flexible, but sufficient if you only need a few colors.


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 5 of 13
(190 Views)

 Like this:

Boolean Color.png

0 Kudos
Message 6 of 13
(158 Views)

Use a Radio Buttons control.

Populate it with whatever LED style you like.

For each LED, set the Off color to transparent, and the On color to what you want for that state.

Position the LEDs on top of one another.

 

See attached example

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 7 of 13
(78 Views)

Hi clnglenn,

Sorry for the late reply. I tried that, but when I add more than 2 colors to he cluster, it gives an error. Attached is the picture of the vi and the error. Please let me know how I can fix that. 

 

Thanks,

Kaawn

0 Kudos
Message 8 of 13
(71 Views)

Hi paul_cardinale,

I am using labview 8.0 so could not open the vi. Would it be possible to send a picture of the vi?

 

Thanks,

Kaawn

0 Kudos
Message 9 of 13
(68 Views)

@kaawn wrote:

Hi clnglenn,

Sorry for the late reply. I tried that, but when I add more than 2 colors to he cluster, it gives an error. Attached is the picture of the vi and the error. Please let me know how I can fix that. 


Nobody told you to do that and it does not make any sense. So don't do it! Look at the better suggestions to solve your problem.


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 10 of 13
(62 Views)