LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wait (ms) - NI KnowledgeBase article example

I am reading http://digital.ni.com/public.nsf/allkb/12B2EA9AD5B265AD86256257004DD8E2

which is suppose to explain the difference between the Wait (ms) function and the Wait Until Next ms function.

 

I am having a hard time understanding the example given for the Wait (ms) function.

The text talks about 15 ms and 5 ms, yet I don't see anything with the numbers 15 or 5 in the two WHILE loops.

 

Would someone shed some light on this?

0 Kudos
Message 1 of 2
(2,681 Views)

They've probably just updated the vi example since making the description and not updated the description. 

The wait(ms) is literally just a pause. For the top loop I have 10ms wait in the flat sequence structure, and 3ms outside of the while loop. 

Because the waits are seperated by the flat sequence, they can run independantly and therfore (near enough) start at the same time. Since they start at the same time, the 3ms will finish first (because smaller wait).

The while loop cannot finish the iteration until everything is completed, therefore the top while loop takes 10ms as it is the last thing to complete. 

 

If this still isn't helping, delete one of the loops and put really large wait times, then click higlight execution. Then look at the flow of data and see how things progress (may help to wire the ouputs to something, just so you can see data flow out and therefore the wait functions finishing). 

 

 

0 Kudos
Message 2 of 2
(2,663 Views)