03-02-2009 12:58 PM
I am using LabVIEW 8.6 and have some vis that start an external program using the System Exec call. The program that is being started was not written by me, and I have no control over it. I need to make sure that it is started before I proceed, but I don't want it started more than once. At the moment I need to terminate it manually when I exit the vi. I also need to make sure that it is not running when I start the vi or I will get two copies. I have a switch to prevent this, but it requires manual inspection and control every time I start the vi. I would like to know if there is some way the vi can list all the programs running and start the external program only when necessary. Closing it at the end would also be nice, but not as important as starting it once and only once. If I had control over the program I could use the existence of a file to tell me if the program is running or not, but that isn't possible. Is there some tricky way to use stdout in the System Exec call to accomplish the same thing?
Rich
03-02-2009 01:52 PM - edited 03-02-2009 01:52 PM
Nothing tricky about it. Just use the command appopriate for your OS. For Windows:
Then just use the Match Pattern function (for example) to search the string.
03-02-2009 02:21 PM
03-02-2009 02:30 PM
I understand your response now. Run a separate system exec asking for the task list and examine the results. That should work.
Thanks