03-03-2011 07:22 AM
Hi,All,Now I have 3 while loop in a VI,when I press the STOP button,the 3 while loop stop together ,how to get it? I have try the local variable ,but I failed.
在一个VI中有3个while循环(不嵌套),如何通过一个STOP按钮同时停止3个while循环?试过局部变量了,不行。
03-03-2011 07:59 AM
Can you post a simplified version, just the loops, with the Stop button and any locals you are using?
03-03-2011 08:05 AM
The local variables should have worked.
Did it not work because you got a broken arrow stating the Boolean latch action is incompatible with local variables?
Did work the first time, but then did not work the 2nd time because the loops only looped once?
Did it not work because only one of the loops stopped but the others kept running?
How did it not work.
Post either your VI or png shot of your code.
03-03-2011 08:35 AM
If you stop the innermost loop with the control or an indicator and wire out to the others stop condition, it should work.
/Y
03-03-2011 08:41 AM
I was thinking something along this line.
The poster is not clear how the three loops are set up, so we are only guessing.
03-03-2011 09:22 AM
Then we can suspect the local variables isn't inside the loop and thus will never update.
/Y
03-04-2011 07:56 AM
Awhile back, we put a group together to address just this problem. We came up with quite a few answers (local variables, events, occurrences, data value references, action engines, single-element queues, ...). Unfortunately, we could not come up with a single answer because it depended on the rest of the program. So, a little code or an explanation of what you are trying to do will help us give you the best solution (which usually does not involve local variables).