필터 지우기
필터 지우기

Input delay too big when using set_param to change value of constant block.

조회 수: 10 (최근 30일)
Nils Bigl
Nils Bigl 2023년 4월 5일
댓글: Nils Bigl 2023년 4월 9일
I am using the set_param command to change the value of a constant block in a running Simulink model. The set_param command gets called within a callback in an app from Matlab App Designer. Unfortunately the delay after changing the value in the app until Simulink realises the change is too big. How can I fix this? Thanks for your help!
  댓글 수: 2
Luca Ferro
Luca Ferro 2023년 4월 5일
is it acceptable for you to pause the simulink upon callback from the app, update the constant block and restart the simulation from where you left off?
Nils Bigl
Nils Bigl 2023년 4월 5일
Not really. I want to adjust the steering angle of a car with this app and this needs to be recognized immediately by the Simulink model while the simulation is running.

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

답변 (1개)

Oguz Kaan Hancioglu
Oguz Kaan Hancioglu 2023년 4월 6일
There is always delay with communication between simulink and app designer. Maybe writing your reference to workspace and using the variable name in the constant block will reduce the delay.
  댓글 수: 3
Oguz Kaan Hancioglu
Oguz Kaan Hancioglu 2023년 4월 7일
Yes, we had the same problem and the problem still continue. We changed the model structure with time-based inputs. In the app, we set the execution time of the input using set_param. At least, we guarantee that Simulink receives the inputs at the desired time.
Nils Bigl
Nils Bigl 2023년 4월 9일
I tried it with Python and its Matlab Engine API but sadly this works only marginally faster than with the App Designer. So Simulink is probably just the wrong tool for doing stuff like this in real time.

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

카테고리

Help CenterFile Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by