LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Periodical task

Solved!
Go to solution

I need to program a part of the code is executed periodically every so often, ie every 1 hour or every 6 hours.

0 Kudos
Message 1 of 5
(2,917 Views)
Inside of a loop, compare the time using get date time with your target time. Use a case structure to execute the code you want periodically executed. Don't forget to put a 1000mS or so delay in the loop so it doesn't hog the CPU.
=====================
LabVIEW 2012


0 Kudos
Message 2 of 5
(2,913 Views)

Here is a simple example. (I was on my phone when I posted so obviously could not work up an example for you)

 

Periodic Task_BD.png

=====================
LabVIEW 2012


0 Kudos
Message 3 of 5
(2,905 Views)

There are also a couple examples of a simple timing Action Egnine posted in the Minneapolis LUG board here

 

The AE approach is a bit cleanre if your vi follows a classic State Machine archtecture.  It probably should from your discription containing Init, Measure, (possibly  Process / file), Idle and Cleanup states.


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 5
(2,899 Views)
Solution
Accepted by topic author Redney

Elapsed Time Express VI on the timing palette.

0 Kudos
Message 5 of 5
(2,896 Views)