02-10-2016 03:06 AM
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
Solved! Go to Solution.
02-10-2016 03:11 AM
One easy way is to run a "tasklist" cmd and parse the output string.
See this :
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
02-10-2016 03:19 AM
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
02-10-2016 03:33 AM
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
02-10-2016 03:37 AM
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.
02-10-2016 03:48 AM
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
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
02-10-2016 04:45 AM
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:
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.
02-10-2016 05:36 AM
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..
02-10-2016 05:39 AM - edited 02-10-2016 05:41 AM
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,
02-10-2016 06:17 AM
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