08-10-2009 07:32 AM
08-10-2009 07:40 AM
Hi Tar
Try using a While loop. See the attached.
Best Regards
David
NISW
08-10-2009 09:57 AM
Well, a while loop is correct, but your implementation is not. In that example the subVI will not run until the while loop is finished, which is, errrr... pointless. Also, you have a greedy loop.
The question is somewhat misleading because the subVI is set up to run when opened, and "suspend when called", which doesn't make sense if it's supposed to be a subVI. It's possible the user did this when he couldn't get the code to work.
One solution is to turn off the "run when opened" and "suspend when called" from the subVI and simply call the subVI, passing values from control on the top VI.
This does beg the question: are you trying to create a popup?
08-10-2009 01:47 PM
You are completely right smercurio, a greddy loop is a definite no no, I stand corrected. Shouldn't have been in such a hurry
As to the pointlessness, I agree. But then again I myself write completely pointless VIs to test parts of algorithms. In this case the question posted was "Why do I have to press the run button after I the boolean button to make my subVI appear?" The answer to that isn't "Why do you want to subVI to appear?", it's "because your code reads the boolean button only ones at the start before you have time to press it and then the VI is finishes". I imagine the why will come in a later post
Best Regards
David
08-11-2009 03:08 AM