LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to close an exe file on windows operation system from labview ?

Hi all ,
 
I have an exe application running from my labview program i want to teminate this application ,after some amount of time ,
My question is :
how to close an exe file on windows operation system from labview ?
 
I have labview 7.1 running on windows xp ,
 
Please send any ideas ,
Thanks
doron
 
0 Kudos
Message 1 of 10
(4,693 Views)

go to Block diagram>>functions palette>> applications control>>quit LabVIEW

By passing a 'true' boolean to this function, you can quit/ close the application/LabVIEW

So when you want to close your executable, include code to pass a true boolean to this function on your Block Diagram

0 Kudos
Message 2 of 10
(4,682 Views)
Hi devchander ,
 
Thanks but the exe file is outside program not one i created in labview
and second  i would like my vi to stay open .
 
 
thanks
Robot tongue 
0 Kudos
Message 3 of 10
(4,680 Views)
If the window name never change, you can use lvwutil32.zip (you can download it from NI) to Quit Application.
 
If the window name is not available, try ExtApp at:
    http://gtoolbox.yeah.net
George Zou
0 Kudos
Message 4 of 10
(4,671 Views)
Hi,


See this thread:


http://forums.ni.com/ni/board/message?board.id=170&message.id=94159&query.id=114041#M94159


The attached vi (by me) does the job.


Regards,


Wiebe.


"Doran" <x@no.email> wrote in message news:1154589008395-399780@exchange.ni.com...
Hi all ,
&nbsp;
I have an exe application running from my labview program i want to teminate this application ,after some amount of time ,
My question is :
how to close an exe file on windows operation system from labview ?
&nbsp;
I have labview 7.1 running on windows xp ,
&nbsp;
Please send any ideas ,
Thanks
doron
&nbsp;
0 Kudos
Message 5 of 10
(4,666 Views)
Wiebe's method works.  But it's a little bit "brutal".  Should be used as last resort.  If you search Microsoft for "teminating a process", you will find they recommand other methods.
NI's VIs, on the other hand, provide a nice way to close other applications.
 
 
George Zou
 
George Zou
0 Kudos
Message 6 of 10
(4,650 Views)

"zou" <x@no.email> wrote in message news:1154635807692-400167@exchange.ni.com...
Wiebe's method works.&nbsp; But it's a little bit "brutal".&nbsp; Should be used as last resort.&nbsp; If you search Microsoft for "teminating a process", you will find they recommand other methods.
NI's VIs, on the other hand, provide a nice way to close other applications.
&nbsp;
&nbsp;
George Zou
<a href="http://gtoolbox.yeah.net" target="_blank">http://gtoolbox.yeah.net</a>
&nbsp;



Sending a windows message is nicer. But it won't work on command line programs. Do you have any idea what method NI use?


Regards,


Wiebe.
0 Kudos
Message 7 of 10
(4,623 Views)
Wiebe wrote:
>Sending a windows message is nicer. But it won't work on command line programs. Do you have any idea what method NI use?
 
Are you sure about this?  I just tried to close DOS windows (command prompt and cmd.exe), works fine.
NI's method uses Windows message.
 
George Zou
 


 

Message Edited by zou on 08-07-2006 09:05 AM

George Zou
0 Kudos
Message 8 of 10
(4,609 Views)

"zou" <x@no.email> wrote in message news:1154959809347-401078@exchange.ni.com...
Wiebe wrote:
&gt;Sending a windows message is nicer. But it won't work on command line programs. Do you have any idea what method NI use?
&nbsp;
Are you sure about this?&nbsp; I just tried to close DOS windows (command prompt and&nbsp;cmd.exe), works fine.
NI's method uses Windows message.
&nbsp;
George Zou
<a href="http://gtoolbox.yeah.net/" target="_blank">http://gtoolbox.yeah.net</a>
&nbsp;
&nbsp;Message Edited by zou on 08-07-2006 09:05 AM


Could be, never tried it. My guess is that sending the message to a dos program closes the Window it's in, just like closing it by hand.


Have you tried to close a running DOS program that is not running in a window? For instance if it is started with System Exec? Perhaps windows makes a hidden window for it, so it might still work...


If the program is not responsive (hanging), sending the message won't work (?). In any other case, sending the message is more decent.


Regards,


Wiebe.
0 Kudos
Message 9 of 10
(4,592 Views)
For hang window, send message won't work for sure.  Terminate process would be a good choice.
But be aware that it terminates the process right away.  The process won't even get a chance to close the dll its calling.
 
 
George Zou
 
George Zou
0 Kudos
Message 10 of 10
(4,584 Views)