Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Using user input to control while loop

Hi! I'd like to use a user specified value to terminate my while loop. For example, acquire for 3 seconds as opposed to acquiring until the user hits the 'stop' button. I've attatchted my code and would appriciate if you could give me some suggestions.

Thanks,
Katie
0 Kudos
Message 1 of 2
(3,016 Views)
Replace "Wait Until Next ms Multiple" with Timeout.vi. The example shows how to use this vi.

Because the duration is given by software, it will not be very accurate. Anyway, it can not be more accurate then the cycle time. If you reduce the cycle time in order to get a better precision, then the CPU usage will increase.
If you need a higher precision, then it will be necessary to use a hardware timing. This can easily be done be using an additional counter that is configured to generate a pulse on its output. This pulse is then used to gate the 3 other counters. This allows a very high and repetitive precision (period of the internal timebase of the counter)!
0 Kudos
Message 2 of 2
(3,016 Views)