From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Programmatically close a VI without saving the changes in all sub-vi:s

Solved!
Go to solution

Hello,

 

I am working on a wrapper, which automatically controls a main gui, with a lot of sub-vi:s. The wrapper starts the gui, controlls everything, makes a few changes, then it close everything down and even exits Labview. However, the next time I open LabView, I am asked if I want to recover the changes I made in the previous run. As everything is supposed to happen automatically (including the execution of the wrapper, which is controlled externally from a Java application) the shut down of LabView has to happen in a way so that the recovery dialog does not appear the next time the wrapper is started. Does anyone know a good procedure that might help me with my problem?

 

Best Regards,

Magnus

0 Kudos
Message 1 of 10
(4,558 Views)

Hi Magnus,

 

create an executable from your VIs: in the RTE there will be no changes to your program code to recover (and there is no need to shut down LabVIEW)…

Best regards,
GerdW


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

Hi Gerd,

 

Thank you for your fast answer.

 

Unfortunately I have the limitation of not being allowed to use an executable, as the GUI sw isn't in a constant state (about 40 different developers are messing around with it full time). The wrapper will be run by an Java application, which is run by Jenkins whenever a new build is available and in between runs LabView have to be shut down, so I need a way of solving this issue during shut down of LabView.

 

BR,

Magnus

0 Kudos
Message 3 of 10
(4,504 Views)

Hi Magnus,

 

when LabVIEW shows that "recover" dialog it was ended "ungraceful" before.

So I guess you should try to "shutdown" (or better: close) LabVIEW in a more suitable way!

Best regards,
GerdW


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

I agree, this is exactly what I am trying to do, but I am failing, so I was hoping that some would have an idea of how I may move forward.

0 Kudos
Message 5 of 10
(4,491 Views)

Hi Magnus,

 

you should tell us, HOW you are closing and exiting LabVIEW using your JAVA driven wrapper…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(4,483 Views)

Hi Gerd,

 

The Java program starts LabView (in Linux) and the wrapper is automatically executed. During its exicution, it makes changes to the GUI and at the end of the execution it stops the gui (not closing it down) and then it uses the "Quit Labview" function to shut everything down.

 

I suppose that I should look into closing the gui properly and not only stopping it.

 

BR,

Magnus

0 Kudos
Message 7 of 10
(4,454 Views)

Hi Magnus,

 

I suppose that I should look into closing the gui properly and not only stopping it.

Yes, this sounds like a very good idea…

 

Stop the UI VI properly, then close the VI properly. Then (just then!) close LabVIEW

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 10
(4,433 Views)
Solution
Accepted by topic author Magnus_Strahl

I would agree with both the recommendations to build an EXE and to exit properly, but if this is not possible, you can also disable autosave from the Options dialog (in the environment page), which I assume should stop this.


___________________
Try to take over the world!
Message 9 of 10
(4,371 Views)

Hello tst,

 

I've accepted your answer as the solution for my problem. I added a property node that shut down the gui before I closed LabView, but the recover pop-up still appears when LabView restarts (even if the option does not appear when I close the gui with the property node). However, I disabled the autosave function and that seemed to do the trick.

 

Thank you to the both of you for helping me with this issue!

 

Best Regards,

Magnus

0 Kudos
Message 10 of 10
(4,260 Views)