From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Different On/Off Times for Individual LEDs

Hey,

 

I've slowly been learning LV but I'm stumped on how to change the blinking rates for LED's.

 

I know that you can change the global blinking rate but I would like to apply different rates for individual LED's (which can be switched on/off) independent of one another.

 

For example:

 

If turned on, LED 1 will be on for 3 seconds, then off for 2 seconds, on for 3 seconds, off for 2, etc, (until I choose to stop this specific LED).

Simultaniously, if turned on, LED 2 will be on for 4 seconds, then off for 4 seconds, etc., (until I choose to this specific LED).

 

 

Any help would be greatly appreciated, thanks in advance.

 

0 Kudos
Message 1 of 5
(3,597 Views)
There is a difference between the two things that you are talking about. The blink rate has to do with a control property and it indeed is global. However, you can turn LEDs on and off at any rate you like.

How many LEDs are there? How fast do they need to toggle? Are the different times all multiples of 1 second?

Why do you need to do this?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 5
(3,528 Views)

Oh okay, well I simply wanted to make two different LED's flash at different rates, and whilst the global blink rate can change the frequency of the flash I was looking at making one LED flash with say 10 seconds off and then 5 seconds off, whilst the other be something like 5 seconds and 6 seconds off. Though the specific on/off times are irrelevant really.

 

And it's because I've started getting in to LabView and would like to get to know the basics, and was stumped by this when there wasn't an easy way to do it as it seems to be a fairly simple function to have.

0 Kudos
Message 3 of 5
(3,485 Views)
OK, I see. As I said you are talking about two different things really. The purpose of the blink property is to provide a quick and easy way to make a control or indicator draw attention to itself by blinking. This why the blink rate can only be set globally -- the only real meaning that the blink communicates is "Hey! Look at me!".

Now a boolean indicator has two states and so can sometimes be used in a similar way. For example I have built systems that have several indicators on the front panel that the software is updating continuously. Sometimes however the change to the data is subtle since the data doesn't change very much. In those cases I will create a small LED on the front panel that simply toggles back and forth very time the data is updated. This indicator is a very distinct indicator to the user that the software is still alive, even when things are happening slowly.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 5
(3,468 Views)

What you're trying to do isn't very complicated.

 

You'll want to start off easier by using the same on and off time.  Make two loops with different wait (ms) times wired.  Start off making things easier on yourself.  Choose blink times of 500 and 1000.  Use a shift register to wire into the LEDs with a NOT wired from the input.  This will flip the value in each iteration and blink the LEDS at the ms rate provided.  Do a quick search to figure out how to stop two different loops using the same control.

 

Once you understand how that works, you can put together logic that will blink on and off for different times.  One thing to be careful with: you don't want to wait the full time you were mentioning before.  Even if it's 6s on and 6s off, that's a LONG time to use a wait (ms).  Your program won't respond to you during that time.  You'd want to do something like a 100ms wait and run the quotient/remainder from the iteration terminal.  If you divide by 60 and the remainder is 0, NOT the shift register.  Otherwise, pass it through.  That way, you'll maintain responsiveness but still flash at the much slower rate.

0 Kudos
Message 5 of 5
(3,454 Views)