LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

query external program status

I have an application that requires an external program to be running in the background.  I can successfully open the program from within labview, but on a second pass I get an error message saying that the program is already running.  Does anyone know how I can query the status of that program (running or not) from within labview to avoid trying to open a running program
0 Kudos
Message 1 of 5
(3,121 Views)

Jerry_T,

I found a way using .NET.  I attached a VI that looks at the currently running processes to see if Notepad is running or not.  I think you could easily adapte this to find any application.  You can also search for a process by window title by using MainWindowTitle property.  Hope this helps.

-cb

0 Kudos
Message 2 of 5
(3,109 Views)
You didn't mention which operating system, so assuming Windows, and if you're on Windows XP Pro, you can use the "tasklist" command with the System Exec function:


You can easily parse the string to find the process you're looking for.


Message Edited by smercurio_fc on 10-24-2007 04:15 PM

Message 3 of 5
(3,100 Views)
If I remember correctly I think on Linux it's "ps -ef | grep programname". Not sure - my Unix is a little rusty.
0 Kudos
Message 4 of 5
(3,095 Views)

10 Degree

Thanks!  With slight modification I was able to create a universal vi that looks for any running process.

0 Kudos
Message 5 of 5
(3,087 Views)