11-12-2009 06:11 PM
I have attached an image of a VI that I have created to try to debug what I am calling a sequential timing structure. I am using the Elapsed Time express VIs in the flat sequence structures with auto-reset enabled. I have indicators for the two elapsed times. What happes is the first loop will execure and not stop until the elapsed time reaches 5 seconds, then the second loop will start and execute until the elapsed time on the second elapsed timer reaches 5 seconds. What I expect to happen is the outer while loop will return execution to the first flat sequence while loop, the timer will reset, and the aforementioned sequence will start again. What actually happens is that the 'Time has Elapsed' in the first elapsed timer remains true and the loop imediatly exits. The second timer does reset and counts as expected. I am sure this is a simple mistake I am making, but some guidance would be refreshing.
Solved! Go to Solution.
11-12-2009 07:17 PM - edited 11-12-2009 07:21 PM
Wire a "equal zero" to the iteration terminal and then wire the boolean output of it to the "reset" input of your express VI.
(Of course I assume that your real code has more to it. Your current example is relatively clumsy. All you probably need is a proper state machine instead of all that duplicate code, CPU burner loops, sequences, and value property mess. ;))
11-12-2009 07:49 PM
Here is what happens in your case:
Both express VIs are set to autoreset, meaning when the time of the first loops has elapsed, it resets the timer and starts counting again. Five seconds later the second loop stops and the first loop starts again. By now, more than 5 seconds have elapsed after it got reset, so the time has again elapsed.
11-14-2009 08:51 AM