10-09-2012 05:58 AM - edited 10-09-2012 06:02 AM
Im trying to use .NET processes to allow me to interact with an external program via STDIN and STDOUT.
The program in question is a .exe which when run in the windows console asks for inputs and writes information to the console that I require in my program. I thought I could use the re-directed standard input, output, and error, streams of a .NET process in order to read and write to this program as it executes. I have attached my work so far which can successfully create the process and redirect the streams and read from them when the process is finished however I cannot seem to get the run-time interactivity that I am after.
Any help would be great
Cheers
Chris
10-12-2012 03:55 AM
Hi Chris
What run-time interactivity are you after, am I right in assuming that you want to monitor stdout whilst the program being called is still running?
Have you checked to see if the System Exec.vi which can be found under Connectivity > Libraries & Executables would work for you? There is an example provided in the help which demonstrates interactivity with the command line using this VI.
Another usefull resource is the example code found in the following forum post: How to read directly from STDOUT
Let me know how you get on.
Thanks
Chris | Applications Engineer NIUK