LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

close window after execution

Solved!
Go to solution

Hi! I have read the "Distributing Applications with the LabVIEW Application Builder" tutorial and followed the instructions on how to develop a stand-alone application. I have added my VI to a project and built an application specification (EXE). My problem is that after I have run the exe-file, I would like the program to close, but instead a window, much like my exe-file appears, but with a toolbar and a run- and abort button. How can I change the settings so that this window doesn't appear?

 

/Nina

Download All
0 Kudos
Message 1 of 13
(24,998 Views)

Add after the end of code the quit labview vi.  This should be in a case structure and only run when app.kind (property node) is an executable.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 13
(24,991 Views)

What Paul suggested is right, use the "Quit LabVIEW" vi but even in development mode LV will be closed all the time you stop your vi in development and that can be really annoying.

So I do it this way Smiley Happy

 SNAG-011.jpg

Message Edited by Alain S on 08-11-2009 09:27 AM
Message 3 of 13
(24,958 Views)
Solution
Accepted by topic author sunds

sunds wrote:

Hi! I have read the "Distributing Applications with the LabVIEW Application Builder" tutorial and followed the instructions on how to develop a stand-alone application. I have added my VI to a project and built an application specification (EXE). My problem is that after I have run the exe-file, I would like the program to close, but instead a window, much like my exe-file appears, but with a toolbar and a run- and abort button. How can I change the settings so that this window doesn't appear?

 

/Nina


Or simply execute a Frontpanel:Close method node at the end of your application as last operation.

 

Rolf Kalbermatter

Rolf Kalbermatter
My Blog
Message 4 of 13
(24,952 Views)
I always thought this should be a build option, Close exe when last vi finishes.  Once you have a vi that does this you can use it in any application.
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 5 of 13
(24,937 Views)

 

You can use property node to close the front panel. instead of Quit labVIEW. if your second executable is also labVIEW based, then Quit LabVIEW may close both....If you use Property node to close the front panel, this will close the front panel of the present executable as soon as it stops execution.

 

check the image for details..

 

To get this property node, do following.....

 

.place a property node (general), select right click on that.  go to select class-->VI server-->VI-->VI

 

 Then left click on the property, FrontPanel window-->Open

 

then right click on the node and select " change all to write".

 

 

 

Anil Punnam
CLD
LV 2012, TestStand 4.2..........
0 Kudos
Message 6 of 13
(24,924 Views)

falkpl wrote:
I always thought this should be a build option, Close exe when last vi finishes.  Once you have a vi that does this you can use it in any application.

Actually it is not an option but even more forcing than that. As soon as the last FP has been closed the EXE will be removed from memory, eventhough there may still be a VI that has code to execute. Therefore it is important to execute the FP:Close method as last operation in the main VI, after you have closed all files, references and whatever.

 

Rolf Kalbermatter 

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 13
(24,913 Views)

Anil Reddy wrote:

 

 

You can use property node to close the front panel. instead of Quit labVIEW. if your second executable is also labVIEW based, then Quit LabVIEW may close both....If you use Property node to close the front panel, this will close the front panel of the present executable as soon as it stops execution.

 

check the image for details..

 

To get this property node, do following.....

 

.place a property node (general), select right click on that.  go to select class-->VI server-->VI-->VI

 

 Then left click on the property, FrontPanel window-->Open

 

then right click on the node and select " change all to write".

 

 

 

 


No Quit LabVIEW in one executable should not have any influence on another LabVIEW executable. A LabVIEW executable is a single process and what you do in there will not influence other processes, unless you do something specific like interapplication commmunication.

 

Rolf Kalbermatter

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 13
(24,912 Views)

yeah, true...i tried the one with interapplication communication....

 

but this "quit labview" is not good option to close windows unless you are closing the main window that closes the entire application. if we want to close intermediate windows, it is always better to use property node i believe.

 

 

Anil Punnam
CLD
LV 2012, TestStand 4.2..........
0 Kudos
Message 9 of 13
(24,905 Views)

Yes I was suggesting the quit labview to ONLY BE used afte all code has executed in exe ONLY.  This is only to be used on the top level VI.  I have never used the quit Labview in any other place.  If you close the top level window this also quits labview in the exe?  I have never tried this,  I mostly use state machines (queued state machines and place the quit labview to execute acter the rop level state machine is done in an executable and have not found any problems with it.  I dont like to distribute applications tha leave labview opened after completion since it is a confusing state for users who are not used to LabView.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 10 of 13
(24,900 Views)