LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle 25 leds

Hi,

 

I'm a beginner and need some assitance from you experts.

 

My application has 25 leds which are spread around the front panel.

I need to handle these leds by turning them Green, Red or Blinking Green.

My application uses a For loop which output the led number and led stat required.

 

Any advice how to do this efficiently? 

I thought to use some kind of indexing method for accessing the leds...but I don't know how to implement it.

I don't know how to gether all the leds into an array form..

 

 

An advice/example will be appreiated.

 

Thanks

RK

0 Kudos
Message 1 of 17
(3,642 Views)

I'm not entirely sure what you want to do, but I was bored so I made a mini basic tutorial.

 

LEDArray.png

LEDArray2.png

 

Hope this helps. Be more specific if you want something in particular.

0 Kudos
Message 2 of 17
(3,639 Views)

This will control the blink of any one of three leds.

 

Blink.PNG

 

I'll let you figure out how to apply it to your needs.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 17
(3,623 Views)

Pladio, that is good but the LEDs are "Scattered around the front panel"

 

You can create a cluster for the LEDs. If you create the cluster from the classic pallette, you can use the color tool to make it transparent. Nobody will be able to tell by looking at the front panel that the LEDs are in a cluster.

 

I didn't know about the blink property and I already coded up the example below. I don't know if you can adjust the blink rate using the property. If not this will allow you to adjust it to the speed you want.

 

Sorry but you cannot see in the image that some of the LEDs are blinking Smiley Very Happy

 

Example_VI.png

In your application wire the array of LED state enums to a shift register. You can use replace array subset to update an individual LED.
=====================
LabVIEW 2012


Message 4 of 17
(3,609 Views)

Type Cast man says

 

Kudos for making the code more readable!

 

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 17
(3,600 Views)

Thank you all so very much....

 

As I said, I'm a beginner (this is my first task) and even the simplest task takes me a while... I also apologize for the very basic questions I'm posting.

 

1.  I would appreciate if you could also attach the vi you build rather than a picture (I'm using 8.6).

2.  As I'm trying to build this vi, the first problem is how to set the color to transparent.  I'm looking at Steve's  solution and I don't see it.   I went and set a property node.  Then I set the first property to 'color' and also set it to write. I put a constant in front of it which will determine the color.  I put a number and saw that it affect the cluster.  The question is how do I find the colors codes?  (how do I know which code is transparent?)

3. I wish to modify Steve's solution so that I have a main vi and sub vi. (I'm a C programmer and I thinks functions...).  This is a simplifications of my project, but it will give me a start... 

4. The front vi will have 25 switches (associated with the 25 leds), and a pass/fail switch.

5. The sub vi will handle the leds as follow:

        - at first all leds will blink in green

        - as any one of the buttons is pressed, the sub vi will look at the switch number, and the pass/fail button and will do one of the following:

                        - if the status is PASS, it  will turn the associated led to constant green

                        - if the status is FAIL it will turn the associated led to red

        - as the operator press another button, the next led will turn green/red.  The previous led will stay as it was.

 

I"m trying to implement it on my own, but I don't get anywhere... PLEASE HELP !!

 

Thanks

RK

        

0 Kudos
Message 6 of 17
(3,558 Views)

is this what you are looking for?

if you like this example dont forget to give kudos Smiley Happy

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 7 of 17
(3,554 Views)

thank you for the vi, but I can't use....I have only LV 8.6

 

Can you convert it please?

 

thanks

RK

0 Kudos
Message 8 of 17
(3,551 Views)

I would use a cluster of colorboxes that look like LEDs.

 

Here's a quick demo that might give you some ideas (LabVIEW 8.6). I only use 9 LEDs but you can easily scale it to any size you want. (Don't forget to set the cluster size).

 

Download All
Message 9 of 17
(3,550 Views)

Thanks you very much for the vi.

 

I am trying to duplicate your vi (that is..I"m trying to rewrite it myself) and I can seem to figure out the following:

 

1. Radio Buttons

    a.   When I define a radio button (Modern -->Boolean-->Radio Button)  I get something completely different from you.

    b.   In the Front Panel -- I don't see a binary switch like you show

    c.   In the block diagram I get the same symbol like you.

2. Transparent Cluster of colored Leds.

    a.   I define a cluster in the block diagram programming-->cluster Class and Variant-->Cluster constant.

    b/   I get a square ?!

    c.  I define few leds in the front panel.  Then, I put those leds inside the cluster.

    d.  The cluster still shows cluster with 0 elements   .... ?!

 

 

Can you please clarify how to achieve these 2 items?

 

 

In addition, as I stated in my requirement, I would like the vi to leave the state of the LED even after I push a different one.  In other words, once I pushed a button and the led turned to its color (green or red) it will stay so and will not blink again.

 

Can you please show how to achieve that?

 

Thanks

RK

0 Kudos
Message 10 of 17
(3,536 Views)