LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to stop a program called with system exec.vi

Solved!
Go to solution

Hi Gang,

 

I need to run a third party application from within LabVIEW.  It works fine when called with the system exec.vi as long as the user enters the correct data.  However in certain (very difficult to determine) conditions, the application hangs up.

 

I want to be able to programmatically force the application to terminate and return to LV.  I supposed there is a way to do this using the Windows API, but I don't know how to do that, and I would need a way to get the Windows handle of the offending application.

 

Short of re-implementing the app in LV, I'm out of ideas.  I'll appreciate all help.

 

 

Thanks,

 

Roger

0 Kudos
Message 1 of 5
(4,495 Views)
Solution
Accepted by topic author RogerMont

if you could post a pic of the offending code it would be great. but two things come to mind, if you want the code to carry on (for example go into a wait for a period then kill a task) wire wait for completion to false.

 

next is another command prompt call, look into taskkill /f

 

you can kill a process

 

hope it helps 

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
Message 2 of 5
(4,487 Views)

Hello Akiel,

 

Thanks for your prompt reply!

 

The Windows command Taskkill seems promising.  I'm going to experiment with that.

 

I'll advise as to how it works out.

 

 

Thanks!

 

Roger

0 Kudos
Message 3 of 5
(4,477 Views)

I built a monitor vi that calls "TaskKill" and it works fine!Smiley HappySmiley Happy

0 Kudos
Message 4 of 5
(4,438 Views)

I'd like to expand this, I'm calling an multiple SSH terminals that sometimes time out.

 

I'd like to:

  • Launch the SSH terminal with System exec with custom title name
  • Run a parallel loop with a timeout that TaskKill any windows that are still open after timeout.

 

How can I change the title of the System exec window so that I can distinguish it from other windows that have not timed out yet?

Vaco_1-1721938782604.png

PS:  I know about LabVIEW SSH library with a built in Timeout, but the behavior is different from System exec.

 

0 Kudos
Message 5 of 5
(354 Views)