Using model references within Stateflow simulink function blocks.
Mostra commenti meno recenti
I'm trying to use Stateflow to organize the conditional execution of Simulink model references, I'm doing this as an alternative to using If blocks and If Action Subsystems because these blocks become difficult to organize when large amounts of signals are used.
I'm attempting to use existing model references in Simulink Function blocks in Stateflow, but I'm running into an issue where a default base rate of 0.2 is being used for execution when the 'Periodic sample time constraint' configuration parameter is set to 'Ensure sample time independent'. For any other settings of 'Periodic sample time constraint' the model will not build due to sample time inheritance issues.
I've tested the function blocks without model references, and have found that removing the model references allows for the 'Periodic sample time constraint' to be set to 'Unconstrained' and the stateflow chart will use the step size specified in the 'Fixed-step size' configuration parameter.
Is it possible to use model references in Stateflow Simulink Function blocks while also using a step size dictated by configuration parameters? Ideally I want to keep using my model references and want to avoid having to manually set the sample rate on every block. How can I manage the step size inheritance of reference models being called by Simulink Function blocks in Stateflow?
1 Commento
Christopher
il 25 Set 2025
Risposte (1)
Corey Lagunowich
il 3 Ott 2025
0 voti
Hi Christopher,
Is it possible for your model references to be Export Function models? Then you could use Stateflow to schedule the rate at which they run using output events. See: https://www.mathworks.com/help/simulink/ug/export-function-models.html#bt2rr_n-1
Categorie
Scopri di più su Decision Logic in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!