LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I limit the run time of my VI so that it starts when the arrow is clicked, and stops automatically when a specified time has elapsed using Labview 7?

I can't seem to find the proper tools to do this. Any help would be greatly appreciated. Thanks in advance.
0 Kudos
Message 1 of 4
(3,042 Views)
I'm guessing that you're running something in a While loop, so you should be able to stop whenever you want.

In LabVIEW 7, there is a new Express VI on the Time & Dialg palette named Elapsed Time. You specify the time you want, and it generates a boolean True after that amount of time has passed. Just connect this boolean to the Wile loops conditional terminal, either directly or "OR" it with a stop button so you can stop it yourself if needed.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 2 of 4
(3,042 Views)
You've got a couple of functions to get time - Get Date/time in Seconds and Tick Count (ms). Have one of these outside your while loop so that it is the first function executed. This is the start time. Inside the while loop, place another instance of the function and take the output and subtract the start time. This is the elapsed time. Compare this to a variable that you specify and if greater or equal, stop the loop.
0 Kudos
Message 3 of 4
(3,042 Views)
If you have some kind of repetetive task with a while loop you can use LV function that returns the number of seconds passed since 1st january 1904. Save this value in the first iteration of the loop and then calculate the difference between new values and the first one in each iteration - this you can use as the elapsed time. Stop the loop and your vi when this value will be greater then the one you specified.
0 Kudos
Message 4 of 4
(3,042 Views)