LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

while loop controlled by x number of seconds

Hello all,
I am a new user of Labview and have enjoyed using it thus far. I have a question about the program I am attempting to create. What I want to happen is, when event 1 is detected, I want the program to watch for a certain second event for 2 or 3 seconds. If nothing is seen in that interval, I want the program to run A, but if the second event is detected then run B. The problem I am having is setting up the program to watch for that second event for 3 seconds. I was thinking about using a while loop but I am not sure how to set it up to be controlled by a timer. I appreciate any help, as I said I am new to Labview so I am definitely up for any other suggestions. Thanks again for the help

Justin
0 Kudos
Message 1 of 2
(2,390 Views)
To accomplish the timer part what you can do is place a "Get Date\Time in seconds" from the time and dialog palette outside your while loop. Before the while loop and then inside the while loop place another one of these function. If you subtract the time outside from the time inside it will give you time elapsed. Use some kind of conditional statement to stop your while loop. Hope this helps.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
Message 2 of 2
(2,390 Views)