LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting front panel close without an event structure?

Is it possible to detect a front panel close without using an event structure? If so, how?

0 Kudos
Message 1 of 8
(3,432 Views)

You could poll the front panel's state in a loop.  Why don't you want to use an Event structure?

FPState.jpg

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 8
(3,410 Views)

@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.

0 Kudos
Message 3 of 8
(3,403 Views)

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.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 8
(3,397 Views)

@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.

0 Kudos
Message 5 of 8
(3,394 Views)

Have the Event structure in a parallel loop and send messages using a queue, notifier...

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 6 of 8
(3,377 Views)

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.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 7 of 8
(3,374 Views)

@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!).

0 Kudos
Message 8 of 8
(3,315 Views)