09-09-2019 05:47 PM
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
09-09-2019 06:02 PM - edited 09-09-2019 06:05 PM
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.
09-09-2019 06:06 PM
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
09-09-2019 06:16 PM
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.)
09-09-2019 06:28 PM
Alternatively, use a picture ring with tree different (by color) LEDs. Less flexible, but sufficient if you only need a few colors.
09-09-2019 07:46 PM - edited 09-09-2019 07:47 PM
Like this:
09-11-2019 11:05 AM
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
09-11-2019 11:16 AM
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
09-11-2019 11:18 AM
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
09-11-2019 11:27 AM
@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.