cancel
Showing results for 
Search instead for 
Did you mean: 

Stream 'standard out' from System Exec

Highlighted
Crickett
Member

Stream 'standard out' from System Exec

LV v7.0
WinXP

When I run my external shell program I get a progress report as it is working. When I call it with LV (system exec) I can't see the progress report (standard out) until the process is over. Is there a way that I can have the system exec function stream the standard out to the string indicator?

Greg

Message Edited by Crickett on 04-19-2005 11:09 AM

5 REPLIES 5
shoneill
Active Participant

Re: Stream 'standard out' from System Exec

Not as such, no.

What you can maybe do is re-route the output of the system call to a txt file (Add >textfile.txt) to the end of your command, and then read in the text file intermittantly.

Be aware that you may run into file-sharing problems though.

Would answer more detailed, but I have to finish up......

Sorry

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Dennis_Knutson
Knight of NI

Re: Stream 'standard out' from System Exec

And you would also need to set the wait until completion of System Exec to false.
shoneill
Active Participant

Re: Stream 'standard out' from System Exec

Is it really neccessary to set "Wait until complete" to false? What happens if you try to read the file parallel to the system command?

That's something I wouldn't have thought of.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Crickett
Member

Re: Stream 'standard out' from System Exec

im thinking that an active x container with a wrapper of the cmd command would work best. ive found one but am not happy with it. i may venture writing my own. if someone has one or knows where a good one is, i'd love to see it.
Dennis_Knutson
Knight of NI

Re: Stream 'standard out' from System Exec

You're right, reading in parallel is something that I hadn't thought of. The only time I ever had to do do something like this was when the executable returned a completion string so I could start the task with wait set to false and then keep reading the text file until I saw the completion string. But doing it in parallel and stopping the file read when sytem exec is done should work just fine. I'll have to remember that if I ever have to do something like this again. Thanks.