LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delaying While-Loop starting time

I am trying to delay the execution of a while loop, with all other while loops executing as I run the program. However, due to the time sensitivity requirement of my program, I have to use "Wait Until Next ms Multiple", as the "Wait" function is simply too inaccurate for it, after 10minutes of running, it will not work as intended.  

 

Please help me on this front. I have included a very dumbed down sample program, where hopefully Boolean 2 is able to switch 100ms later than Boolean 1. I am currently using LabView 2011.

 

0 Kudos
Message 1 of 5
(1,604 Views)

You're going to need to describe things a lot more thoroughly.  The "dumbed-down" program is 2 parallel loops whose timing is defined to be EXACTLY the same.  That's way too much dumbing down.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 5
(1,573 Views)

First of all if your timing is really that critical then you should consider using a real-time target.

 

Without seeing more code (I agree with @Kevin_Price that your example is basically useless) I would suggest that you could message Loop 2 when Loop 1 starts - then delay and start loop 2. 

0 Kudos
Message 3 of 5
(1,552 Views)

If all you want to do is run the first loop until it stops then run the second loop all you have to do is wire a signal from the inside of the first loop to the border of the second loop.  That signal does not have to do anything.  Just wiring it up to the border defines order of events.

 

If you want to loops to run in parallel with one stalling while the other runs then there are multiple ways to approach that.  For example two timed loops with event structures.

0 Kudos
Message 4 of 5
(1,549 Views)

Let's say you have 3 For Loops, all running synchronously at, say, 1 Hz (i.e. once/second), but with the contents of the last loop delayed by 200 ms from the other two.  Use Wait until Next ms Multiple to synchronize all the Loops (wire a U32 to the input to avoid the coercion dot), but add a 200 ms delay in the third before the Loop contents start to execute.  This is (one of the few) good use(s) for a Frame Sequence.

Wait and Wait Multiple.png

 

Bob Schor

0 Kudos
Message 5 of 5
(1,535 Views)