09-25-2011 07:30 AM
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.
Solved! Go to Solution.
09-25-2011 07:43 AM
Think I have solved it myselves
09-25-2011 08:00 AM
But how do I both have a rotating dial and a the possibility of entering a number as the "control" ?
Best regards
09-25-2011 08:09 AM
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.
09-25-2011 08:09 AM
would you save it in 2010 please or before, cant open the file.
09-25-2011 08:16 AM
09-25-2011 08:21 AM
09-25-2011 08:48 AM
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
09-25-2011
09:51 AM
- last edited on
01-21-2025
04:40 PM
by
Content Cleaner
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.
09-25-2011 11:09 AM
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.