LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop VI in a specific time

Hi everyone.
 
I'm making a VI with some "while loops structures" and I want finish my VI in 3 minutes.
 
Each while loop structure doesn't have specific duration time. I want my VI stops in 3 minutes, don't care which while loop is in execution, but in 3 minutes the VI must be finished.
 
Below, I show you an example of the while loop distribution. Please help me!! I'm using LV 7.1 Student Edition.
 
Thank you.
0 Kudos
Message 1 of 3
(2,572 Views)

Your "loop distribution" does not make a lot of sense, because the only loop that will spin is the inner loop on the left. Once any of the two boolean conditions is true, the loop will stop, allowing completion of the left loop (it will spin exactly once). Now thw two inner loops on the right will start (think dataflow, they need to wait until data arrives on all inputs!), but they will stop after spinning exactly once. Now the big loop also stops.

All while loops except the innermost act exactly like single frame sequences, so why use while loops at all?? :o.

It seems unlikely that you want the loop structures this way. Should't there also be some code in the inner loop? You should at least place a small wait statement in it.

Anyway, to stop the VI after 3 minutes, you could place an event structure in paralell with only a timeout case.and wire a 3 minute timeout (180000ms) to it. Inside the event frame, write a TRUE to a local variable of either y or x.

If you want the while loops to run independently, they cannot have data dependency.

0 Kudos
Message 2 of 3
(2,568 Views)
Hi altenbach.
 
I've never seen that like frame sequences Smiley Tongue But, I don't understand how works an "event structure" Smiley Sad (I need more practice for my english Smiley Tongue)
 
Can you help me with an image of code to stop my VI because I don't undestand very well this part that you wrote:
"Anyway, to stop the VI after 3 minutes, you could place an event structure in paralell with only a timeout case.and wire a 3 minute timeout (180000ms) to it. Inside the event frame, write a TRUE to a local variable of either y or x."
0 Kudos
Message 3 of 3
(2,548 Views)