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

1 view (last 30 days)
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 Comment
Benjamin Thompson
Benjamin Thompson on 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.

Sign in to comment.

Answers (1)

Benjamin Thompson
Benjamin Thompson on 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 Comment
Diaa Younes
Diaa Younes on 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

Sign in to comment.

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!