04-30-2006 05:09 AM
04-30-2006 05:46 AM
04-30-2006 11:12 AM - edited 04-30-2006 11:12 AM
tst is absolutely correct. The time it takes ot execute a loop whil highlighting is somewhat related to the total length of wire and the number of terminals in that particuliar loop.
Your lower loop only has an indicator, thus finishes quickly. The upper loop has a buch of code, thus it takes longer to highlight its execution.
When you highlght execution, both loops take significantly longer than the 10ms, thus the loop rate is entirely determined by the highlighting, while the wait statement is irrelevant. Set your wait longer than the highlighting time of the upper loop (e.g. 20000ms) and you'll probably see things to act more synchronized.
Rhemember that there is no data dependency or synchronization between the loops, so each is ready to execute whenver their inputs contain data. If the lower loop is finished and the upper loop is still busy, the lower loop will execute again. Why shouldn't it? You would see the same thing even without execution highlighting if your upper loop would contain very complex code that takes longer than 10ms to execute. All this is a normal feature of dataflow driven code.
The solution is simple in this case. If the two parts of the code should loop syncronized, place all code in a single FOR loop. 🙂
Message Edited by altenbach on 04-30-2006 09:54 AM