LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I test to see if another application is running?

Solved!
Go to solution
I manage systems remotly via PC Anywhere Some VI start automaticly at load but because of a tight loop with in the vi I am unable to get service for the PC Anywhere. I would like to put somthing in the VI that looks to see if PC anywhere is running and if it is terminate the VI loop. Any Ideas?
0 Kudos
Message 1 of 6
(3,344 Views)

Hi Jim,

 

not exactly what you asked for:

Why not put a small delay in the loop? Maybe 1ms wait?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,338 Views)
Are you trying to determine if PC Anywhere is active, or just if it's running?  To find out if it's running you could find out what TCP/IP port it uses and attempt to open it.  If you get an error then that port is already in use and PC Anywhere is probably running.  To find out if it's active and connected you could take this a step further: run "netstat" from System Exec and attempt to parse the output to determine if there's an active connection on that port.
0 Kudos
Message 3 of 6
(3,324 Views)
I need the VI that is running to determin it on it's own automaticly. The Vi is running most of the time PC anywhere is not, some times however a remote user may logon while this vI is running I want the VI to see this contition and stop.
0 Kudos
Message 4 of 6
(3,318 Views)
Solution
Accepted by topic author jimdooris

To determine if a program is already running try using the command line program TaskList (assuming you are using Windows)

 

Run a system exec call with the command line being "tasklist" it will return the list of all applications running from the Standard Output indicator.  You can use this program to access remote computers too but I've never tried it.  

 

To checkout the switches available go to Start >> Run type in "cmd" hit enter, then in the command window type "Tasklist /?" this should show you how to use it to see what applications are running on a remote machine.  Hope this helps.

Message 5 of 6
(3,313 Views)
this works great
0 Kudos
Message 6 of 6
(3,304 Views)