04-27-2011 12:35 AM
Hi,
I think case structure is there in LV6.1, correct me if wrong
My solution will be to have while loop with "Stop" button control connected to condition terminal in state of "stop if true". Now inside while loop keep one case structure with "Start" button connected to selector terminal. And keep your VI in run mode as start.
This way till you dont click on start button, false case structure will be running just like wait mode. As you click start button, case will switch and execute the function inside.
Whenever you want to stop the VI press Stop button.
- HS
04-27-2011 07:31 AM
The issue is that the subVIs are inside the event cases. Thus the event case does not complete its execution until the subVI is stopped. If you want the subVIs to run simultaneously, they need to be outside the event structure and its loop. You will either need to launch them using VI Server methods or have parallel loops where they can be called via communications through notifiers or queues. Something like the Producer/Consumer (Events) Design Pattern will work. You may need two consumer loops.
The subVIs should each have a short Wait so that the loop does not grab al the available CPU resources. As you have them they are called "greedy" loops.
Lynn
04-27-2011 08:42 AM
Hi KiranKumar,
First I will suggest to start new thread for discussion as your concern is not directly matching with author who started this thread. It is good for all of us, else we get confused if two issue runs parallel in one thread.
In event structure another event can be fired/executed once current is finished.
Quick option is to use parallel loops and button control to launch VI inside.
Hope it helps.
- HS