Embedded Coder Integer Saturation

5 ビュー (過去 30 日間)
Jake Gareau
Jake Gareau 2025 年 2 月 7 日
回答済み: Aravind 2025 年 2 月 10 日
In Stateflow I am using the "after" command as transition logic to delay the next state.
I noticed in embedded coder generated code that this always seems to come with Saturation logic on this counter regardless of if the chart property for saturating on integer overflow is selected.
Is this something I can control or is there some differing requirement with this specific command

回答 (1 件)

Aravind
Aravind 2025 年 2 月 10 日
It seems you are noticing saturation logic being used in the counter for the “after” command in Stateflow's generated code, regardless of whether the "Saturate on integer overflow" option is enabled.
To clarify, the "Saturate on integer overflow" option controls whether integer overflow is permitted for general operations within the chart, but it does not affect how the “after” command is implemented in the generated code. For more details on this option, you can check the documentation here: https://www.mathworks.com/help/releases/R2024a/stateflow/ug/handling-integer-overflow-for-chart-data.html.
The saturation logic for the counter related to the “after” command is automatically included by Embedded Coder to ensure the safety and robustness of the generated code. This logic is not something you can configure or control.
I hope this clears up your question. If you can provide more details about your specific use case and why you want to control the logic for the “after” command in the generated code, I would be glad to offer further assistance.

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by