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

1 visualizzazione (ultimi 30 giorni)
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 Commento
Benjamin Thompson
Benjamin Thompson il 3 Mar 2022
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.

Accedi per commentare.

Risposte (1)

Benjamin Thompson
Benjamin Thompson il 3 Mar 2022
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 Commento
Diaa Younes
Diaa Younes il 3 Mar 2022
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

Accedi per commentare.

Categorie

Scopri di più su Deployment, Integration, and Supported Hardware in Help Center e File Exchange

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by