09-09-2009 03:14 AM
Hi All,
The main concept of user interface is to allow user start and break (go out) while loop. Start again, and break again. Start... and so on.To do that I created vi presented on vi1.png
Two buttons (Start & Stop), two events structures (to try to make them independent - right now I know it doesn't work). Start button triggers while loop. The mechanism to accept notifications and break that loop is presented in the file vi2.png
However, that system is
not working and I'm thinking I miss a kind of funtametal LV feature
designing that solution. Despite putting these two buttons in separate
and independent event structures UI is blocked and loop inside the
Start event is unable to receive a 'Stop' notification.
Could you tell me is there posibility of multiply calling (one by one - not all toghether) the while loop with ability to stop it and go out any time?
How can I start with a button a while loop as a separate thread or process and go to main vi back without waitin for results from that triggered loop?
I want that the start and stop events will be triggered by user.
Cheers,
K.
09-09-2009 03:27 AM
09-09-2009 03:32 AM - edited 09-09-2009 03:34 AM
Hi MiniKLM,
you shouldn't use two event structures. You can use a parallel loop with a queue in it.
See the attached example.
Mike
09-09-2009 04:36 AM
09-09-2009 10:12 AM
It is difficult to debug a picture. Please always attach actual VIs. We cannot see if there are other event cases and we cannot see how the events are configured. We also cannot see the mechanical action of your various buttons.
As others have said, there are some very basic design flaws.
09-11-2009 02:05 AM
Hi All,
Thank you very much for your responses.
Many thanks to parthabe and altenbach for constructive feedback. MikeS81, your solutnion doesn't allow me to go out and start that loop again, does it? Harold, could you use more punctuation and capital letters please?
An idea for my solution was like that:
1. Trigger one loop by one event
2. To exit that loop send a notification by clicking a button controled by SECOND and INDEPENDENT event structure.
I think that concept would have worked if the LV hadn't controlled those two event structures as one. The reason that my concept doesn't work is the UI is frozen (despite the fact that I'm using two separete and independent event structures)
Having read your posts I concluded that I have to base my solution on Register Event Callbacks technique. Is that correct?
What you would do if you were in my shoes?
The main criteria is: to start the same while loop multiple times.
K.
09-11-2009 02:54 AM
Hi MimiKLM,
i'm not sure what you mean. You can "start" and "stop" the example counter. Why should you exit the loop?
Mike