Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
parsing dos output to a GUI

Subject: parsing dos output to a GUI

From: Naresh Pai

Date: 4 Oct, 2012 19:50:08

Message: 1 of 3

I am developing a GUI that runs a Fortran-based dos program in the background. Currently, I am using:

dos('program.exe')

to run the program as part of a pushbutton callback from the GUI. The executable prints several messages (showing it's status) to the Matlab prompt. However, I would like to show these messages on my GUI instead of the prompt. I tried using:

[status, result] = dos('program.exe')

The "result" variable has all the messages but it becomes available only after the program has finished executing. Is there a way to parse the messages in real time to a GUI (similar to Matlab which is able to show it on its command prompt)?

Thanks,
Naresh

Subject: parsing dos output to a GUI

From: dpb

Date: 4 Oct, 2012 20:09:14

Message: 2 of 3

On 10/4/2012 2:50 PM, Naresh Pai wrote:
> I am developing a GUI that runs a Fortran-based dos program in the
> background. Currently, I am using:
>
> dos('program.exe')
>
> to run the program as part of a pushbutton callback from the GUI. The
> executable prints several messages (showing it's status) to the Matlab
> prompt. However, I would like to show these messages on my GUI instead
> of the prompt. I tried using:
>
> [status, result] = dos('program.exe')
>
> The "result" variable has all the messages but it becomes available only
> after the program has finished executing. Is there a way to parse the
> messages in real time to a GUI (similar to Matlab which is able to show
> it on its command prompt)?

Perhaps you could redirect output to a file and try processing that file
while the program is running--certainly not guaranteed...

Do you have the source for the Fortran program? If so, how about
turning the program into a function via mex--then you can do whatever w/
the output via returning results as Matlab variables/arrays/whatever.

Alternatively all I know of would require writing WinAPI calls to spawn
the process so it shares space or modify the Fortran to write to shared
memory and another mex to read that or...

IOW, it's no cakewalk...

--

Subject: parsing dos output to a GUI

From: Amit Doshi

Date: 25 Jan, 2013 06:06:07

Message: 3 of 3

Naresh,
Could you figure out how to do it? Even I am stuck at the same point.
Many thanx in advance!!
-Amit


"Naresh Pai" wrote in message <k4kp9f$oda$1@newscl01ah.mathworks.com>...
> I am developing a GUI that runs a Fortran-based dos program in the background. Currently, I am using:
>
> dos('program.exe')
>
> to run the program as part of a pushbutton callback from the GUI. The executable prints several messages (showing it's status) to the Matlab prompt. However, I would like to show these messages on my GUI instead of the prompt. I tried using:
>
> [status, result] = dos('program.exe')
>
> The "result" variable has all the messages but it becomes available only after the program has finished executing. Is there a way to parse the messages in real time to a GUI (similar to Matlab which is able to show it on its command prompt)?
>
> Thanks,
> Naresh

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us