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: 

Hide VI then make it reappear if the VI stopped

Hello Community,

 

Is there a way to hide a VI from the taskbar (and also the window itself) during development in a way that it reappears if the VI is stopped?

 

I can use the property node to set the Front panel status of the VI to hidden and then at the end of the code I can use the property node again to set the FP status to normal again, but if the VI is force stopped and this last part of the code doesn't get executed then the VI remains open, but hidden. (so I need to browse it from the project explorer again, double-click on it to display the opened instance again)

 

Thanks for you input.

0 Kudos
Message 1 of 7
(2,423 Views)

Hi 1984,

 

but if the VI is force stopped and this last part of the code doesn't get executed then the VI remains open, but hidden.

Why do you even need to "force stop" that VI?

No program should need to "force stop". It's like using a tree to stop your car…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(2,413 Views)

I'm debugging man... things may not work as they supposed to.

 

FYI: when an engine or car part is under development there are sudden and unexpected stops. When you buy your car you expect nothing like that, but during the development... yes, it happens even with a car. (and pretty much with everything under development)

Message 3 of 7
(2,395 Views)

Hi 1984,

 

even when debugging you can ensure that atleast the code which handles that window state/visibility is executed before you stop your debugging environment…

 

(Example: your subVI may use a QSM to handle request from MainVI. You can use an additional DebuggingVI to send a regular "quit" command into the queue of your subVI instead of hitting that big red stop button in the menu bar!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(2,390 Views)

One approach would be to have a VI which you run manually after an abort, which iterates through all VIs in memory and sets the Front Panel state to Standard if it is currently set to Hidden.

 

show_hidden.png




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
Message 5 of 7
(2,367 Views)

Hey 1984,

Perhaps this is helpful to you. I have two Vi's - Time.vi and Observer.vi

The Test.vi:

test.JPG

And the Observer.vi:

Observer.JPG

I hope I understood what you want to do. I run the Time.vi from Observer.vi and if the Time.vi is aborted, an error is thrown, at which point you can open the front panel of Time.vi.

 

So perhaps you can run a loop that observes the vi in question, since open vi is a reference to vi on disk somewhere. I hope it helps.

0 Kudos
Message 6 of 7
(2,365 Views)

Why not leave the vi unhidden during debugging that might require a force stop. You can put that functionality back in once you're finished debugging.

0 Kudos
Message 7 of 7
(2,331 Views)