Controlling the Simulink model run status through external API

조회 수: 4 (최근 30일)
Kamali
Kamali 2013년 3월 18일
RTWT workshop is used to generate C code for a Simulink model and start/ stop of the model is controlled through a VC++ GUI (Visula studio 2008) using set_param() commands. This is working fine. But when it is desired to pause the model execution using a similar method (set_param(‘modelname’,’SimulationCommand’,’pause’)), we find that the model does not pause. We have also tried using a assertion block, but of no use. We wanted to know the conditions in which any model cannot be paused (because we have tried the same in a very simple simulink model and it works).
  댓글 수: 2
Kaustubha Govind
Kaustubha Govind 2013년 3월 18일
By RTWT, did you mean Real-Time Windows Target, or are you simply using External Mode?
Kamali
Kamali 2013년 3월 19일
We use Real time windows target.

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

채택된 답변

Jan Houska
Jan Houska 2013년 3월 25일
Code running in real time generally cannot be paused. That would contradict its purpose to run in real time. For example, if the code controls an externally connected device, pausing the code would get the control algorithm out of sync with the device state. After resuming the paused code the results will be unpredictable.
Please be more specific about what you are trying to achieve by pausing real-time code. Most likely, there are other ways to get the desired effect.
  댓글 수: 4
Kamali
Kamali 2013년 4월 3일
Thanks. I could pause/continue the model execution using an enable subsystem. This solves our problem.
vineetha
vineetha 2013년 4월 26일
Is it possible to get data from the model while pausing the simulation using subsystem. I have tried retrieving data using enabled subsystem, but it is not working. Is there any way to get data from RTWT while model is running?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Target Computer Setup에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by