LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timed event

What I am trying to do is acquire temperature samples from a DAQ continusely but on the hour I want to jump out of the loop and perform another task.  Currently I am reading the temperatures and displaying them and checking to see if the minutes and seconds of the time are zero in a while loop.  If the minutes and seconds are both zero it exits the while loop.  The problem with this is it has to check the time at exactly the hour inorder for the while loop to exit.  I was thinking that if there is someway to set up a flag on the hour.  The important part of the timed exit is that it is in sink with the real time of the day (with in a tolerance of 5seconds)  I was thinking about using a less then check on the seconds instead of an equal check.   I would still prefer to have the loop exit on the hour, and not a couple of seconds after.
 
Brent
 
The code I have attached is the while loop part of my program only
0 Kudos
Message 1 of 3
(2,253 Views)
Brent,

The attached VI shows one way of stopping a loop after a specified time. I set the default stopping time to 6 seconds because I did not want to wait an hour to see it work.

As you noted, a greater than or less than comparison is always much safer than an equals comparison unless you are certain that the equality case will occur reliably.

Lynn
0 Kudos
Message 2 of 3
(2,245 Views)
Sorry.. Forgot the attachment.

Lynn
0 Kudos
Message 3 of 3
(2,242 Views)