LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with timing delay (delayed triggering)

I have 2 LEDs that I want to react to a boolean signal. LED1 should light up as soon as the signal is TRUE and stay lit for 5s after it switches FALSE. If the signal goes TRUE again before 5s LED1 should stay lit. LED2 is lit when the signal is FALSE and then switches off when it switches TRUE. It only switches TRUE again when LED1 is off i.e. it is the logical NOT of LED1.
 
The part I'm struggling with is getting LED1 to stay on for a 5s delay after the boolean signal switches. I know roughly how this will work - I think I need to grab the timestamp at the signal switch and then keep comparing it against a constantly updating timestamp.
 
Can anyone help? Thanks!
0 Kudos
Message 1 of 4
(2,720 Views)

Hi russelldav

i made an example for you. it is without reading from hardware, but you can simulate the process. I hope it helps.

Mike



Message Edited by MikeS81 on 02-07-2008 02:42 PM
0 Kudos
Message 2 of 4
(2,704 Views)
Fantastic - this looks spot on. I'll have a play around at integrating it with my main VI tomorrow and let you know. Thanks!!
0 Kudos
Message 3 of 4
(2,691 Views)
MikeS81 - I have modified your code to fit in with my full requirements and it works perfectly. Thanks for the help I am really grateful.
 
My final solution is similar ot the VI I've uploaded - there are 3 LEDs now. The Standby LED comes on after the signal is lost (after 0.5s) and then if no signal is detected for 5s the system indicates it is inactive.
 
 
0 Kudos
Message 4 of 4
(2,681 Views)