필터 지우기
필터 지우기

Simulink object... ...was changed during simulation

조회 수: 1 (최근 30일)
Wayne Munslow
Wayne Munslow 2020년 2월 20일
댓글: Wayne Munslow 2020년 3월 4일
When I run a simulation, I get error messages of the type:
An error occurred during simulation of Model block 'xxx.slx'.
Caused by:
  • An error occurred during simulation of Model block 'xxx/submodel/submodel/yyy.slx'
  • The Simulink signal object 'aaa' for output port 1 of block 'yyy/zzz' was changed during simulation
The things that was reported as "changed during simulation" are things that are expected to change during simulation, like a model output signal.

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2020년 2월 20일
I had a user who had problem matching this although Simulink (earlier version) didn't give this exact error message.
There is a signal line labeled "aaa" in the model. There is an aaa=Simulink.Signal object in the base workspace. This is all good. The user also wanted to log the simulation data so he added a "ToWorkspace" block which connected to the "aaa" signal line. The problem is that he specified the ToWorkspace variable as "aaa" (make sense, right? after all, it is the signal name.) When the logged data is written to the workspace variable "aaa", it overwrites the signal object "aaa".
If this is what happened to you, just change the data logging variable name.
In fact, Mathworks must have realized this problem and has fixed it (at least in R2019b). Now when you specify the data logging variable as "aaa", it is saved to out.aaa.
  댓글 수: 4
Fangjun Jiang
Fangjun Jiang 2020년 2월 20일
편집: Fangjun Jiang 2020년 2월 20일
Without the model, I could only guess, although I can't explain the different behavior between laptop and desktop.
Do you have name conflicts between signal and data store memory, meaning a "aaa" singal object in the base workspace but there is an "aaa" signal line label in the model and "aaa" is used as the name for DataStore Memory/Read/Write block?
From the document
You can use Simulink.Signal objects in addition to, or instead of, Data Store Memory blocks to define data stores. A data store defined in the baseworkspace with a signal object is a global data store.
Wayne Munslow
Wayne Munslow 2020년 3월 4일
Thanks Fangjun
In fact, I noticed that the laptop was at v9 of 2017b, whereas the desktop was at the initial 2017b version. So, I ran the v9 update on the desktop, and now the simulation runs as expected (no false reports of Simulink objects changing). Hopefully that's it sorted

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

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by