LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to open, close and monitor a application (xyz.exe) using labview?

Solved!
Go to solution

Hi All,

 

I have a application, where I need to open a application  for example calc.exe, after openingxyz application I need to monitor wether this application is running or it is forcefuly closed by user. now I am able to open application using System Exec.VI, but not able to check present status of the called application in real time.

 

thanks in advance

Ravi

 

Ravikumar.C
0 Kudos
Message 1 of 11
(7,561 Views)
Solution
Accepted by topic author Ravikumar.C

One easy way is to run a "tasklist" cmd and parse the output string.

 

See this :

2016-02-10_101036.jpg


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 2 of 11
(7,546 Views)

Thank you, I understand your concept,

1. I need to run "tasklist" command

2. then in standard output list to check for my xyz.exe apllication

 

this is what i need, do you have that VI which screen print you added above, it wil help me lot, please attach here if possible.

 

Many thanks.

Ravi

Ravikumar.C
0 Kudos
Message 3 of 11
(7,534 Views)

I'm always up for sharing code, although I think it would only take you 15 minutes to code it yourself and I'm quite sure you'd get a positive mood for doing it yourself.

 

What version of LabVIEW do you have? is 2014 ok for you?


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 4 of 11
(7,519 Views)

hahah I like that, a good way to motivate people to learn, I am using LabView2015, I have very less time, and I'm kind of new to labview coding.

Ravikumar.C
0 Kudos
Message 5 of 11
(7,513 Views)

If you're new you need to learn, this is quite basic... I'm giving you fish instead of teaching you to fish.

 

Oh, and by the way, it's LabVIEW, not LabView, it stands for Laboratory for Virtual Instrumentation Engineering Workbench 😉

 

I know... I'm pedant and I like to shine Smiley Embarassed


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 6 of 11
(7,506 Views)

Use the .NET Process library - it allows you to launch a process (like System Exec) but you can also use the reference it returns to check if it is still running and even register for an event when the application closes. You can even close it yourself from within LabVIEW.

 

Here's a couple of examples of using dotNET Process from some previous threads.

 

In this one, I find a process by name and kill the first instance of it:

dotNet Get Process.png

 

In this one, I launch a process with some flags (ProcessStartInfo) and then redirect the StandardOutput / StandardInput back to LabVIEW (to read the console output of the exe) - but you can see how I start and close the process.

dotNETProcessExample.png


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 7 of 11
(7,494 Views)

I understand how to launch an application using .NET process library, but once I launch an application how to check for the launched application status, does the second VI do that job, what is the Output teminal gives you in the second VI.

 

thanks for the help..

Ravikumar.C
0 Kudos
Message 8 of 11
(7,476 Views)

 

Hi TiTou,

 

I am able to check launched.exe status by running tasklist cmd, I have a bug now, as I am using this as subvi in my application, every time System Exec.VI executes system command window will pop up and automatically close once it finished running VI, I want to avoid this System Command Window, any suggestions ?

 

Thanks,

 

Ravikumar.C
0 Kudos
Message 9 of 11
(7,473 Views)

I think there is a "run minimized" option on the system exec vi that is "false" by default, just connect a True constant.


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 10 of 11
(7,452 Views)