From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using multiple event structures polling for panel closing event

I have attached an example of my dilemma. I want the vi to end when the 'X' button is pressed to close the front panel of the vi. It can run in two modes (select true of false). In the True mode, the outer while loop is the iterative loop, and therefore the event structure is placed outside the case structure. In the Flase mode, the inner while loop is the iterative loop, therefore the event structure has to be in the inner loop. As you can see, I need two event structures, both polling for the panel closing event. But, in False mode, the event structure doesn't fire. Any ideas? Thanks.
0 Kudos
Message 1 of 5
(2,799 Views)
Use a single event structure. Create an event for Value changed of the Boolean and put your logic in there or just put the case outside the event structure. The LabVIEW help contains a section called "Caveats and Recommendations when Using Events in LabVIEW" and one of the topics is "Avoid placing two Event structures in one loop.
Message 2 of 5
(2,799 Views)
Thanks Dennis. There was some misleading info on the developer zone, but an NI engineer set me straight.
cheers.
0 Kudos
Message 3 of 5
(2,799 Views)

Hi vituning, 

 

I am also facing a similar problem of using panel close? in two different event structures. Can you please share how you solved the problem.

 

Thanks.

0 Kudos
Message 4 of 5
(2,278 Views)

Kind of an old thread.  (10 years old).

 

It would be easier to help you if you tell us what you are doing, and what kind of problem you are having now.  Even post some code so we can see it.

0 Kudos
Message 5 of 5
(2,267 Views)