08-21-2015 06:16 AM
Hi I am new to LabView and coding so feel I am struggling with some of the basics. I am currently working through the Core 2 course online but am also having a go at writing my own applications.
I am trying to write an application based on the stopwatch example included in Core 1 however I would like the paused LED turned into a run indicator with the following attributes:
1, When the stopwatch is at 0.0 and stopped the LED to be off.
2, When the stopwatch is running the LED is solid on.
3, When the stopwatch is paused the LED flashes on and off.
Suffice to say I have implemented many iterations of the programme to achieve this goal but cannot get the timing to work reliably.
Any help would be appreciated.
Solved! Go to Solution.
08-21-2015 08:16 AM
Suppose you had a While loop with nothing inside it (aside from a Stop button wired to the Stop Indicator) except for a Wait with 500 wired to it. What would happen? What if you had a Shift Register with a Boolean "True" wired (from the outside) to the input of this Shift Register, and inside wired to a Boolean LED Indicator? What if you put a "Not" function on that Boolean wire inside the While loop? What would you do to the Boolean wire to make the LED turn off and stay off?
Bob Schor
08-24-2015 04:00 AM
Hi Bob,
Thank you for your suggestion. I understand that this is an accepted method to flash an indicator on and off at a pre-determined rate (2 Hz using your suggested value). I already tried integrating this with the stopwtach code but the timing of this function corrupted the timing of the flashing LED, I just haven't yet grasped what is happening.
Regards
08-24-2015 05:06 AM
Hz = cycles per second. 500 msec off + 500 msec on = 1000 ms cycle = 1 Hz. Do you know about parallel loops? A Flasher can run in parallel with a Timer (but you need to think about how to get "control" information, i.e. On, Off, Flash, into the Flasher).
Bob Schor
08-25-2015 03:41 AM
Hi,
There are two common method to make an LED flash, firstly like Bob described using shift registers and secondly using the LED property node 'Blinking'.
I have summerised both methods in the attached VI.
Kind regards,
TomS
Applications Engineer
National Instruments
08-28-2015 07:17 AM
Hi Tom_S,
Thank you for your reply, your post was very useful although I was aware of these particular functions in LabView already.
After further research I have managed to implement a VI which is able to toggle a single LED into three states: ON, OFF and flashing. I have included the code for interest and would gratefully receive any constructive feedback. My next task is to implement this SubVI into a stopwatch application.
Many thanks once again.
08-28-2015 07:48 AM