03-25-2009 10:04 PM
HI everyone,
I am writing a program involving nested loops. This program is going to be called by another program eventually. This program is supposed to wait for user input (via voice), execute the selected case, and then repeat that with different user input until a given time interval is up. I am having problems making the while loop time properly. I can't use the stop function because it will quit the higher calling program, which is not acceptable for This project. Right now, I have a case structure an event structure inside a while loop, and the event structure is wired to the conditional stop in the while loop. If This is not wired like that, then the inner loop can't repeat itself and get new user input. But I can't figure out a way to quit the while loop without the conditional stop. Does anyone have any ideas about how This can be done, or suggestions as to other structures I could use (instead of a while loop)? I tried a timing loop, but I couldn't get it to work properly.
Thanks
03-25-2009 10:15 PM
03-25-2009 11:26 PM
I don't know right now if I can post my code, I signed an IP and non-disclosure agreement. I will check with my supervisor tomorrow and see if I can post it.
03-26-2009 08:05 AM
You should be able to post a generic example of what it is you are trying to do. Your description talks about an inner while loop but doesn't say what that while loop is inside of.
I don't understand in what way you want to stop a while loop and why you can't use the stop terminal of the loop. Are you actually trying to stop the loop before it's iteration is finished?
If the code inside of your while loop is so complex that it is really multiple steps, (Get voice, execute, wait, repeat, ......) perhaps you should break up the code into multiple steps and turn your architecture into a state machine.
03-27-2009 12:50 AM
Hello mz1,
Could you make a simple VI to demonstrate the structure of your current VI? This would make it easier to understand exactly what you are trying to do.