07-25-2012 11:00 AM
With the System Exec.vi I can open up a command window and keep the window open using the /k command. How though can I return to that open command window and execute another command? If I run System Exec.vi again it will just open up a new command window which I don't want.
I appreciate any help on this.
Thanks
Loren
07-25-2012 11:48 AM
Unfortunately, you are limited to the functionality you are experiencing.
07-25-2012 03:44 PM
You can try using OpenG Pipe library. It works similar to System Exec, but communication with the standard IO of the application happens over pipes. This allows to send commands to the console application and receive answeres from it at runtime.
07-25-2012 05:10 PM
Thanks Rolf. I'll have a look at that.
Loren
07-26-2012 08:21 AM
You can also try the copy/paste method I showed here: Re: URGENT!!! How we read stdout directly? - LabVIEW - NI Discussion Forums
07-26-2012 04:00 PM
Rolf,
Would you be able to send me a quick example VI showing how I would use the OpenG pipes to open up a command window run a "dir" command to get the directory list and read that back into LabVIEW? I certainly appreciate your help on this.
Loren
07-27-2012 12:50 AM
One of the marked solutions is here.
You would need to use WIN APIs.
07-27-2012 02:31 AM
@lmcclennan wrote:
Rolf,
Would you be able to send me a quick example VI showing how I would use the OpenG pipes to open up a command window run a "dir" command to get the directory list and read that back into LabVIEW? I certainly appreciate your help on this.
Loren
This is one way to do what you describe. You can disregard the standard error output (and set the according boolean to false to not create the according pipe) if you know that the command should work.
07-31-2012 05:52 PM
Rolf,
That VI was extremely helpful. Thanks for your support.
Loren
03-07-2013 07:54 AM - edited 03-07-2013 07:55 AM
Hello,
I'm trying to implement the OpenG pipes library on windows 7 64bit with labview 2012.
When I execute the example code that Rolf posted. (System Command (cmd.exe) test.vi) I get the following error:
The process tried to write to a nonexistent pipe.
Any tips on what I can do?