ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interactive system exec session

Hi,

 

I need to run a separate executable through cmd in my LV application. Is it possible in any way to interact with the command line while it is executing the external program? I would need to start the executable, then read it's output (stdout) while executing and when I see a certain string, do something else in my LV app in order for the executable to continue. I know it is possible to achieve this by using a fixed delay and act after the delay to allow the executable to continue, but that is not a very robust way.

 

I searched around for answers but could only find either really old threads or not dealing with the exact same situation. Most answers related to piping(?) and .NET if I understood them correctly. As always, any help would be appreciated.

0 Kudos
Message 1 of 5
(4,906 Views)

Thanks for the links. I guess i'll have to study the subject and see if I can make it work.

 

I also realised there is a way to read the system exec output in real time, by directing the output to a file. In my case it could be enough to read the file while it updates, since I don't really have to input anything more to the executable.

0 Kudos
Message 3 of 5
(4,831 Views)

Have you had any luck finding an answer. All Windows Pipe code seems to have vanished.

0 Kudos
Message 4 of 5
(4,513 Views)

I ended up using the solution where I redirect the output to a text file and poll the file. It was enough for my case. For the polling you have to open the file in read only mode. Sorry for late response 🙂

0 Kudos
Message 5 of 5
(4,479 Views)