Simulink Run Dashboard and App designer query

5 visualizaciones (últimos 30 días)
Amit Patankar
Amit Patankar el 22 de Jun. de 2021
Editada: Rena Berman el 16 de Jul. de 2024
I am working on MATLAB App designer.
Whenever I initiate the run directly through simulink model, I can see the Run Dashboard and all options like 'Pause', 'Stop' etc. as shown below. I can click them and Pause or stop the simulation If I wish.
But when I run the Same simulink model through my developed GUI in app designer, I see the 'Pause, 'Stop' options disabled in simulink model dashboard.
In short when I initiate the run from GUI, I can no longer control the Simulink model run (Stop/Pause/Resume)
Please see the snapshot below.
Is there an option using which, I can initiate a run through GUI and still control the 'Stop' and ' Pasue' function of simulink model ?
Inline with above question,
I also observed that, the StopFcn defined inside the Model Properties option of Simulink model is not getting executed. So I am unable to obtain few outputs.
Also,
When I initiate the Simulink Run from GUI, I do not see the Progress bar at the bottom of my model. I can see only 'Running' tag, but no Time Bar.
But When I initiate the model through Simulink, I can see the progress bar of simulation.

Respuestas (1)

Tejas
Tejas el 1 de Mzo. de 2024
Editada: Rena Berman el 16 de Jul. de 2024
Hello Amit,
When executing a Simulink model via command, the pause, resume, and stop options become inactive within Simulink(when using MATLAB R2017a). To address this, I suggest updating MATLAB to the latest version, where these buttons remain active.
Furthermore, to manage Simulink operations through commands, Simulink does offer specific commands for pause, resume, and stop that can be used to control the model programmatically.
Here is the documentation on commands for "Controlling Simulink Programmatically", which are applicable for use within App Designer:
I have replicated the issue using MATLAB R2017a, and in my experience, the code within the StopFcn did execute. I recommend reviewing the code in your StopFcn for any potential errors.
Additionally, in my tests, the Simulink progress bar was visible when the model was executed using the set_param command. If you continue to encounter issues, please examine your Simulink model for errors. Should the problem persist, here is a link to a MATLAB Answer that provides a suitable workaround using “Simulink Waitbar, which can be customized to act like the original progress bar: https://www.mathworks.com/matlabcentral/answers/168954-view-progress-of-simulation-when-using-sim-command .
Regards,
Tejas.

Categorías

Más información sobre App Building en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by