07-15-2015 10:15 AM
Is it possible to detect a front panel close without using an event structure? If so, how?
07-15-2015 10:51 AM - edited 07-15-2015 10:53 AM
07-15-2015 10:54 AM
@jcarmody wrote:
You could poll the front panel's state in a loop. Why don't you want to use an Event structure?
I have a series of while loops being executed until an analog user input is detected. Basically I want to be able to control the exiting behavior of a subVI whenever the user closes the subVI's front panel before it has completed.
07-15-2015 10:56 AM
Use the panel close? filter event and you can discard the actual close event (from closing the front panel) and use that to tell your loops to shutdown/exit etc.
07-15-2015 10:59 AM
@Sam_Sharp wrote:
Use the panel close? filter event and you can discard the actual close event (from closing the front panel) and use that to tell your loops to shutdown/exit etc.
Im trying to stay away from event structures, in a previous post i was told that having all of the while loops in the event structures "gums things up" and that i should use a state machine. So i switched to a state machine and now I just need to handle a panel close.
07-15-2015 11:01 AM
07-15-2015 11:02 AM
No - have a seperate loop with just the event structure and register for the panel close. In the panel close? filter event, use some method to tell the other while loops to shutdown. Look at the producer/consumer (events) template/example.
07-15-2015 12:08 PM - edited 07-15-2015 12:09 PM
@CETGirl wrote:
Im trying to stay away from event structures, in a previous post i was told that having all of the while loops in the event structures "gums things up" and that i should use a state machine. So i switched to a state machine and now I just need to handle a panel close.
Having an event structure (good!) has nothing to do with having interactive while loops inside an event structure (bad!).