Simulink Run Dashboard and App designer query
조회 수: 6 (최근 30일)
이전 댓글 표시
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/661060/image.png)
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/661065/image.png)
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/661070/image.png)
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/661075/image.png)
But When I initiate the model through Simulink, I can see the progress bar of simulation.
댓글 수: 0
답변 (1개)
Tejas
2024년 3월 1일
편집: Rena Berman
2024년 7월 16일 16:59
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:
https://www.mathworks.com/help/releases/R2017a/simulink/ug/control-simulations-programmatically.html .
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!