LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SubVI front panel won't close properly after running

Solved!
Go to solution

Hi everyone,

I have a simple SubVI that runs when called from a main VI that isn't closing as expected.  It's essentially just a front panel control in a While loop that pipes a user-selected cDAQ alias to an output terminal so another VI can save it to a config file. I have it set through the SubVI Node Setup to "Show front panel when called" and "Close afterwards if originally closed".  I also have a VI reference inside the loop that feeds to a FP.Close Invoke node.  The issue is that exiting the loop with a stop button doesn't close the SubVI front panel the first time but will on the second try.

Wondering if someone knows a workaround for this. I've just attached snippets because of the simplicity of the VI. Also, this is LabVIEW 2018

Appreciate any help,

Bob

0 Kudos
Message 1 of 6
(1,587 Views)

Hi Bob, I'm not seeing any attachments, can you try to upload them again?

0 Kudos
Message 2 of 6
(1,566 Views)

Sure. Hope it works this time

Download All
0 Kudos
Message 3 of 6
(1,561 Views)
Solution
Accepted by Rsalv

What is the mechanical behavior of the stop button. Are you calling the SubVI twice?

Regardless of the SubVI node setup, the invoke node for front panel close should close the front panel.

 

As a side note, this kind of dialog box should be done with an event structure, rather than a while loop which can eat up PC resources.

0 Kudos
Message 4 of 6
(1,555 Views)

Hi Gregory,

That was it. I had the mechanical action set to Latch when released.  It behaves now that I switched it to Switch when released.

I also changed to an Event structure instead of a While loop. Good call on that.

Thanks a bunch,

Bob

0 Kudos
Message 5 of 6
(1,550 Views)
Hmm, I think latch when released should work. If you use switch when released with the while loop, then on subsequent calls of the VI it will close immediately. But, with the event structure, it should wait for the value change if that's how you set it up.
0 Kudos
Message 6 of 6
(1,547 Views)