LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control number of led flashes

Solved!
Go to solution

Hey

 

I have made an VI that will make an LED blink, now I need to improve the program so I can control the number of flashes by typing a number and using a rotating dial. And this is where I am stuck.. Anyone who can help me.

0 Kudos
Message 1 of 14
(2,976 Views)

Think I have solved it myselves

0 Kudos
Message 2 of 14
(2,968 Views)

But how do I both have a rotating dial and a the possibility of entering a number as the "control" ?

 

Best regards

0 Kudos
Message 3 of 14
(2,962 Views)

Hi T.Crousin

 

Thanks for using the forums!  Also, well done on solving your problem yourself.

 

- One thing I would consider is initialising the shift register on the For Loop.  The program works as you expect if last value stored in the shift register is False, but if you were to Abort the VI when the value was true, and re-run, you would not get the same behaviour.

 

- What is the larger application?  If you would like the Boolean Indicator to flash while another task is in progress, you might consider using the Blinking property of the indicator to achieve this.  Please see the attached VI for an example of this.

 

Run the example with highlight execution enabled to see that we only read from the "Blinking" control when the value changes, however the indicator will blink periodically.


Regards,

Peter D

0 Kudos
Message 4 of 14
(2,960 Views)

would you save it in 2010 please or before, cant open the file.

0 Kudos
Message 5 of 14
(2,959 Views)
Solution
Accepted by topic author T.Crousin

Here is a modification of your VI to have a dial to set the number of blinks, and a run button to start the flashes.

 

Use the stop button to end the program.


Regards,

Peter D

0 Kudos
Message 6 of 14
(2,957 Views)

Hi B4S3M

 

Here are all the VIs for LabVIEW 2010.


Regards,

Peter D

0 Kudos
Message 7 of 14
(2,953 Views)

Thank you Peter. Your answer was really useful, and I will study your VI´s.

 

I am also trying to control several flash rates. This I have done like you with a "wait. But I have to improve my program so I can chance between three different flash rates. 0,2s on and o,2 sec off, 0,5s on and 0,5 sec off and 0,8 s on and 0,8 sec off. I have tried to just add tree "waits" but this solution does not make it possible to change between the different flash rates.

 

Do you have an idea?

 

Best regards

T.Crousin

0 Kudos
Message 8 of 14
(2,950 Views)

Thanks for your reply T.Crousin.

 

I have modified the VI to allow for varible timing to be specified in the array control.  The VI will now run for the amount of timing loops you specify (i.e. you will get zero flashes if you do not specify a time, or 3 iterations if you specify 3 times).  The VI now uses Auto-Indexing Tunnels to specify the amount of loop iterations.


Regards,

Peter D

Message 9 of 14
(2,937 Views)

Pete, I know you are aware of this but you forgot to throttle the loop with a wait in the false case. This is an oversight that is easy to make.

 

I just wanted to make sure the original poster understands that the loop will use all the CPU doing nothing at all. If there is a wait of 100mS or even 0mS in the false case then the computer will be much happier.

=====================
LabVIEW 2012


0 Kudos
Message 10 of 14
(2,923 Views)