The 'wait' command and m-code/simulink interaction

Dear Community,
I'm controlling the simulation course of a simulink block diagram for control system design purposes. I do this through changing a property called 'SimulationCommand' to 'pause', 'continue', and 'start' values. As the script file immediately runs the next command line after the 'set_param' command, I couldn't plan my control loop. I was wondering if there is any way perhaps using the 'wait' command to prevent the script from running until the simulation result of the control sample is arrived. That is to wait until the simulink engine is paused by the 'Pause Block' which is defined inside the model.
This is, somehow, a following question for the previous discussion here , which has been left open.

댓글 수: 2

pouya: Could you please elaborate on why S-functions (as suggested on the previous thread) do not solve your problem?
Pouya Jamali
Pouya Jamali 2014년 6월 7일
편집: Pouya Jamali 2014년 6월 7일
Ms Govind: I know that s-functions would solve my issue but I don't have enough time to convert the codes I've written into an s-function format. They like 15 auxiliary functions and 65 parameters from varied classes.
I'm wondering why is that m-code/simulink interaction for if s-function is performing the best. I wish there is a way. If only the 'SimulationCommand' property was not write-only I could solve my issue. Is there any way to find out about simulation status of a simulink blogdiagram? I mean weather it is running, initializing, or is paused?

댓글을 달려면 로그인하십시오.

 채택된 답변

Pouya Jamali
Pouya Jamali 2014년 6월 7일

0 개 추천

Yes SimulationStatus property does it. I'm done. A while loop to check the simulation status is my solution. Thank goodness

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Block and Blockset Authoring에 대해 자세히 알아보기

질문:

2014년 6월 6일

답변:

2014년 6월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by