ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timer function

Solved!
Go to solution

Dear all,

 

I'm trying to create a simple timer function that will execute a task for a certain amount of time, then stop for a certain amount of time and then repeat. I know it can be achieved by using a flat sequence structure along with the Wait (ms) block. However, it doesn't seem to allow adjustments to any controls when the task is active unless it's put in a while-loop. Which is why I did the following arrangement with an Elapsed-time-block which only does the job for one iteration since it keeps counting even though it's frame should be inactive, hence making the second iteration go on for 5-3 = 2 seconds (instead of 5 s). I'm all new to labview, is there anyone who could provide some tip on how to implement this simple timer function?

 

Best regards
Patrik

0 Kudos
Message 1 of 4
(3,263 Views)
Solution
Accepted by Pagustaf

Wire a =0? function to the reset input of the timer function coming from the i node of the while loop.  That way the timer resets on the first iteration of the while loop.

0 Kudos
Message 2 of 4
(3,259 Views)

I sense the idea, but I can't figure out what "wire a = 0 function" and the "i node" means?

0 Kudos
Message 3 of 4
(3,255 Views)

Now I get what you mean - and it worked! Thank you sir. 

0 Kudos
Message 4 of 4
(3,244 Views)