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

7 visualizaciones (últimos 30 días)
Wayne Munslow
Wayne Munslow el 20 de Feb. de 2020
Comentada: Wayne Munslow el 4 de Mzo. de 2020
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.

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 20 de Feb. de 2020
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 comentarios
Fangjun Jiang
Fangjun Jiang el 20 de Feb. de 2020
Editada: Fangjun Jiang el 20 de Feb. de 2020
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 el 4 de Mzo. de 2020
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

Iniciar sesión para comentar.

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by