The inner loop will run every 10 ms until you press the inner stop button, at which time the outer loop will spin once and the inner loop will again spin forever, until you press the inner stop button again. (Assuming the buttons are latch action)
Remember, the outer loop must wait for the next iteration until all nodes in it have finished. This only happens whenever the inner loop stops.
The timer in the outer loop does not do much....
If you want the loops to run independently, they must be next to each other.
"Wait next ms" multiple waits for regular elapsed intervals
"Wait ms" takes a break for the given time.
Analogy:
Wait next ms multiple: do something every hour on the hour, etc. (The break will depend how long it takes you for each job).
Wait: Do something, when done take a one hour break, do something, etc.
A wait next ms multiple is typically used inside a loop so the loop executes at regular intervals, for example every 100 ms. It should not depend if the calculations in each loop take 1 ms or 50ms, the repetition rate will be constant. (Of course if the calculations take 200ms you have a problem ;))
A plain wait is used if you need to wait a given amount of time, e.g. send a command to a device, wait 200ms, the send another command. Show a popup window for 2 seconds, wait for a timeout, etc.
For more details, read the online help on the two. 🙂
Message Edited by altenbach on 09-21-2005 07:44 PM