From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Running 2 loops 4 hours each.

Greets,
 
I have 2 loops that execute in sequence but I would like them each to run through there loops for 4 hours each.  Whats the best way to go about this?
 
TIA sal2
0 Kudos
Message 1 of 2
(2,456 Views)
You've got a couple of options. There's Get Date/Time In Seconds and Elapsed Time functions on the Time and Dialog palette. To use the first, get the start time outside the while loop and inside, use it again and subtract from it the start time. This gives you elasped time. If greater or equal to the target, stop the loop. With elasped time, you just have to set a target time and when it has elasped, the Boolean output called Time Has Elapsed goes true. In both cases you should probably or the time has elapsed value with a front panel Boolean so that you can stop the loop at an earlier time if desired.
0 Kudos
Message 2 of 2
(2,447 Views)