LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to display cmd prompt output via System Exec

I use the system exec VI to issue a command using the windows cmd prompt.

The command I execute takes a while to execute and display progress when

called from an actual command prompt.  When I set the 'run minimized' parameter

to false, I see a big black empty window while it is running.  If I also set 'wait until

completion' to false, I now can see the progress, BUT it breaks my flow control

since the subVI after the System Exec VI assumes the execution is complete.

How can I show progress WITHOUT leaving the System Exec VI?

0 Kudos
Message 1 of 7
(5,930 Views)
The easiest way to do this is to redirect the output to a file (e.g., "youcommand > yourtextfile.txt" ) and then intermittently read the text file from LabVIEW.
Message Edited by smercurio_fc on 09-03-2008 10:08 AM
0 Kudos
Message 2 of 7
(5,926 Views)

Thanks for the quick reply.

 

Some problems though:

1.  When I tried adding a ' > outfile.txt' to my labview command, nothing got created.  I searched throughout my drive.

2.  When I opened a command prompt and performed the operation there, a outfile.txt WAS created, but it didn't get filled until the operation finished, which

really isn't useful for monitoring progress.

 

Any other suggestions, or some way of getting around these issues for this suggestion?

 

Thanks...

0 Kudos
Message 3 of 7
(5,910 Views)

What are you using for your command? You may need to preceded with "cmd /c" or "cmd /k". For example, the command

    cmd /c ipconfig > c:\result.txt

will output the result of ipconfig to c:\result.txt. 

0 Kudos
Message 4 of 7
(5,897 Views)

I am using an executable I created.

 

I can try the cmd /c idea...  but even with that, it seems like I will still have the other issue:  The file not having any stuff in it until the process is completely done.

0 Kudos
Message 5 of 7
(5,882 Views)
That is correct, and it is also by design. Since you created the executable that you're trying to run, why not have it write its progress to file directly?
0 Kudos
Message 6 of 7
(5,875 Views)

hi

 

do you get solution for this?

0 Kudos
Message 7 of 7
(3,324 Views)