05-17-2022 04:00 PM
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
Solved! Go to Solution.
05-17-2022 05:07 PM
Hi Bob, I'm not seeing any attachments, can you try to upload them again?
05-17-2022 05:10 PM
Sure. Hope it works this time
05-17-2022 05:20 PM
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.
05-17-2022 05:29 PM
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
05-17-2022 05:39 PM