LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

On using System Execution VI

I have used system execution VI (of Communication's function) for calling execution file that run in DOS environment; most of the time (as usual)we need to set a fixed command line and then captured the standard output of the DOS program. And only after the program has finished running, then LabView could only print out the standard output of the DOS program. My question is: Is it possible to see the standard output being displayed synchronously at panel of LabView or in real time while the program is running instead of waiting until the program has finished completing its execution? If putting the Option of "Wait until Completion?" to False, we will not be able to capture the standard output of the program.
0 Kudos
Message 1 of 16
(4,022 Views)
If you route the output of the screen toa text file (I remember it could be done with directory structures using command >text.txt) then you may be able to monitor the resulting text file in real-time.

I have just tried it with a batch file, and the text output of the screen can be directed to a text file in this way. Whether this works for your case, I can`t say. I also don`t think this works for graphics.

Shane
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 2 of 16
(4,022 Views)
Thank you for the answer but I do not quite understand the solution. Does it means that the "standard output" of System Exec VI is routed to "Write Characters to File" VI or add an extra command to the command line routed to "System Exec" VI?
0 Kudos
Message 3 of 16
(4,022 Views)
At the end of whatever command you send to the System (for example "dosomething.bat c:\"), you append the string " >Textfile.txt". Then the output of the DOS screen should be re-routed to this text file.

I tested the example below with a batch file called "dostuff.bat" which contains the command "dir c:\".

Upon running, the text file "c:\Textfile.txt" is generated.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 4 of 16
(4,022 Views)
In addition, I can`t claim to be an expert on this subject, but it just occurred to me that instead of routing to a text file, there may be a way to route to another device (I know that the Parallel port works when "LPT1" is ised instead of a filename). Perhaps there`s a better method using the >something command.

Anyone else got an idea??

Shane
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 5 of 16
(4,022 Views)
I think this way also the same with printing the DOS output using "standard output" terminal; what I really want to see is when I run the program, I can see the DOS output popping up at LabView's panel indicator in synchronous with actual program running in DOS mode. This means I do not have to open any file (in this case, a text file) in order for me to see the execution output. By doing this, the LabView environment is felt like running a DOS application and the purpose of doing this is because I am able monitor the progress of the DOS program's execution instead of waiting until the program has finished its execution before I am able to see the outcome of the program's execution.
0 Kudos
Message 6 of 16
(4,022 Views)
I understand what it is you would like to do, but I don`t think this is possible.

The only way I can imagine this would work would be if there was an ActiveX object for the command prompt. To the best of my knowledge, this doesn`t exist (Would be great though).

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 7 of 16
(4,022 Views)
Anyway, thank you for your answer; I have actually have a thought about this and it was quite impossible to do it unless I am able to modified the system exec vi and make it able to print DOS output in parallel with the program execution. Unfortunately, I do not have any Active-X objects for me to use for that particular program. I wonder if someone out there have a similar requirement as mine.
0 Kudos
Message 8 of 16
(4,022 Views)
Have a look at the following address. It seems they have done just what you (we) were looking for.

Click here

Cheers

Shane
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 9 of 16
(4,022 Views)
Thank you for directing me to that website, unfortunately that sofware needs to be registered (need to be purchased).
0 Kudos
Message 10 of 16
(4,022 Views)