Executing Triggered/Enabled Subsystem

1 回表示 (過去 30 日間)
Mashrur Alam
Mashrur Alam 2021 年 3 月 31 日
回答済み: Jonas 2021 年 4 月 1 日
I am working on a model that is code generates SW to run on a TI micro. This model has a stateflow diagram that controls the state of the SW (init, enabled, disabled, etc.) I want the Stateflow diagram to excecute a subsystem when it transitions from one state to another (or just excecute a subsystem when it enters a new state). I know that Stateflow can trigger function calls but I do not know how. I also don't know if I should be using a triggered or enabled subsystem.
I have tried using a "Simulink Function" block but my code gen process does not support this. So I will have to stick with subsystems.

回答 (1 件)

Jonas
Jonas 2021 年 4 月 1 日
Use a Function Call Subsystem. In your Stateflow chart, use an Event and execute that on a state transition. Set the type of the Event to 'Output' and link it to the Function call port.
https://nl.mathworks.com/help/stateflow/ug/using-output-events-to-activate-a-simulink-block.html

カテゴリ

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

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by