Ben, I want to personally thank you for being so helpful.
//////////
Okay, I'm creating this VI in LabVIEW that uses SystemExec.vi to run an external, DOS-based program. However, this external program needs input after output of the first segment of text. The input is found using a small Call Library Function, but is BASED ON what the program outputs during its first segment.
So, if you couldn't tell already, I'm having a problem getting the output of the first segment into LabVIEW so I can work with it. In SystemExec.vi, when I set "Wait Until Completion?" to "false", there is no output from the sub-vi. Thus, I can't work with it.
Basically, during the whole execution, I need to have LabVIEW able to interact with the program. But it looks like the program outputs to ONLY ONE device, either the console or LabVIEW. Any suggestions?
//////////
//////////
Hi Bonhomme-
We have to get a little creative here.
Any command line's output may be redirected to a text file with the ">" (e.g. 'ping www.ni.com > benschulte.txt' outputs to benschulte.txt).
1. So you launch your exe with SystemExec
2. Redirect the output to a text file
3. Read the text file in LabVIEW and proceed
Hope this helps.
ben schulte
national instruments
//////////
//////////
Alright, here's the thing. Before I can even write to a text file, the program has to finish executing. Mine cannot because it requires some type of input based on what it output from the first segment. So I have to analyze the output and then send something back in. I cannot do this by writing the output to a text file since there will be no output since the program is not complete. Is this even possible to do? Thanks.
//////////
//////////
This is going to try my memory, so forgive mistakes please.
In the same way output can be redirected from a DOS program, input can be re-directed as well.
So idea follows.
Write .bat file that runs your DOS app.
On next line of bat file, include answers DOS program needs (end with CR).
Use the other Ben's idea to get the results you need.
A pretend example follows.
Dos_Prog_name>results.txt
answer_1
answer_2
exit
If the answers are dynamic, you will have to create this .bat file on the fly.
Ben
P.S. At this point, you may want to let us know what the DOS command syntax looks like, and where things get complicated. We may be able to be of more help.
//////////
Okay, I'm going to post the executable I'm trying to use. I'm still stuck with the problem that I cannot interact with the program during execution like I need to. Other than that, everything works perfectly. I made a dummy executable and it works just fine. Try making a dummy VI that just outputs the results automatically. You can't because the program needs some input in the middle and setting the "Wait" flag to false doesn't allow that.