(R2021b) Simulink/Embedded Coder : Not able to disable Stateflow states data logging

1 次查看(过去 30 天)
Hello,
The states of the Stateflow model are getting logged automatically. I am flashing code on an a microcontroller with embedded coder.
I have read a lot on how to disbale logging and even tried a suggested script: How can I disable data logging for all the signals in my model? - (mathworks.com)
But that didn't work.
I am also seeing that one 'tunable parameter" is also getting logged.
The interesting thing is that the states in the stateflow are not selected for logging but still get logged.
Also, even if I remove the check for "Signal logging" in "Configuration/Data Import/Export", those states still get logged, while the signals I normally log no longer get logged (which what I expect).
The state names I see are someting like : is_active_c3_model is_c3_model is_finally_c3_model Normal_Op_is_Normal_Op
Could you please help.fi
Thank you
Diaa
  1 个评论
Benjamin Thompson
The generated code will not log any data as it would in Simulink. Here is the relevant documentation from the Embedded Coder User Guide:
Data Logging Limitations
• To Workspace blocks and Scope blocks are ignored when Simulink Coder generates code for a referenced model. The resulting code is the same as if the blocks did not exist. In some cases for models with Scope block and MAT-file logging enabled, the code generator produces an extra PWork in the model's DWork structure.
• Code generated for referenced models cannot log data to MAT-files. If you enable data logging for a referenced model, Simulink Coder disables the option before code generation and re-enables it afterward.
• If you log states for a model that contains referenced models, the ordering of the states in the output is determined by block sorted order, and might not match between simulation output and generated code MAT-file logging output.

请先登录,再进行评论。

回答(1 个)

Benjamin Thompson
The generated code will not log any data as it would in Simulink. Here is the relevant documentation from the Embedded Coder User Guide:
Data Logging Limitations
• To Workspace blocks and Scope blocks are ignored when Simulink Coder generates code for a referenced model. The resulting code is the same as if the blocks did not exist. In some cases for models with Scope block and MAT-file logging enabled, the code generator produces an extra PWork in the model's DWork structure.
• Code generated for referenced models cannot log data to MAT-files. If you enable data logging for a referenced model, Simulink Coder disables the option before code generation and re-enables it afterward.
• If you log states for a model that contains referenced models, the ordering of the states in the output is determined by block sorted order, and might not match between simulation output and generated code MAT-file logging output.
  1 个评论
Diaa Younes
Diaa Younes 2022-3-3
Thanks Benjamin,
My issue is that states of sateflow are getting logged but I don't want them to be logged in order to save execution time in the microcontroller.
Thanks
Diaa

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by