Is is possible to redirect the output of a system command that calls another program?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Eamon
am 10 Feb. 2025
Kommentiert: Walter Roberson
am 10 Feb. 2025
Essentially, I am calling the system command to run Vivado Lab in order to program an FPGA over JTAG. So
status = system('vivado_lab prog.tcl')
is the command I run. The output of this writes to the Command Window of uncompiled code and to the Console of compiled code. Part of this output is a progress bar. Is it possible to make this output to a text area, a different function, or somehow get the output while the command is still running?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 10 Feb. 2025
HDL Coder does not appear to be supported on Mac.
On Linux:
Redirect output (possibly stderr) to a named pipe. Read from the named pipe within MATLAB.
On Windows:
Instead of using system(), use the .NET facility System.Diagnostics.Process . See for example https://www.mathworks.com/matlabcentral/answers/2002092-system-diagnostics-process-doesn-t-execute-all-commands-in-external-file#answer_1280947 but you would RedirectStandardOutput instead of RedirectStandardInput (or possibly RedirectStandardError). You would stdout.ReadLine to get at the output line by line.
2 Kommentare
Walter Roberson
am 10 Feb. 2025
Well, if you are somehow running Vivado on your Mac (perhaps you have Parallels installed to run other binaries through emulation, as Vivado binaries for Mac are not available), then you can use the named pipe approach on your Mac.
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!