フィルターのクリア

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

4 ビュー (過去 30 日間)
Diaa Younes
Diaa Younes 2022 年 3 月 3 日
コメント済み: Diaa Younes 2022 年 3 月 3 日
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
Benjamin Thompson 2022 年 3 月 3 日
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
Benjamin Thompson 2022 年 3 月 3 日
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 Center および File ExchangeSimulink Functions についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by