LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Up Timer

Hi everyone,

How do I setup a timer and instruct my program to run the stipulated time? What kind of tools should I use to build a timer? My program is using a while loop and DAQCard-1200.
0 Kudos
Message 1 of 5
(3,182 Views)
Not very clear on your intent. Could you please elaborate, provide more detail, be specific?

Is this a timer for the VI to start at, to run during? Either way, you will need to compare the current MS Timer Value with a prior value retrieved before your while loop. Be sure to put in a delay.

If this starts after the timer expires, connect the output of the while loop so that your code (subVI?) starts to execute after this timer. If this is to time how long your DAQ runs for, then just put the timer in with your DAQ.
0 Kudos
Message 2 of 5
(3,182 Views)
I'm hoping to set up a timer where I can control the amount of time for the loop to run. E.g.: Start running for two minutes, stop for three minutes and then start running for another 5 minutes.

Are all these possible? If so, what will be the method or function to do so in a while loop?
0 Kudos
Message 3 of 5
(3,182 Views)
I rewrote the following VI three times, but I think it does what you want. The idea is to take the present ms tick time, add the amount of time you want the loop to run, then compare that value to the present ms tick time found inside the loop. There are many variations on this theme and you may need to adapt elements of the example for your program.

Jeremy
0 Kudos
Message 4 of 5
(3,182 Views)
Take a look at While Loop with A Time Limit. You can modify this to achieve your objective with case structure, shift register, etc.
0 Kudos
Message 5 of 5
(3,182 Views)