|ID: Title||hisf_0001: State Machine Type|
|Description||To create Stateflow® charts that implement consistent Stateflow semantics, use the same State Machine Type
In Mealy charts, actions are associated with transitions. In the Moore charts, actions are associated with states. In Classic charts, actions can be associated with both transition and states.
At compile time, Stateflow verifies that the chart semantics comply with the formal definitions and rules of the selected type of state machine. If the chart semantics are not in compliance, the software provides a diagnostic message.
|Rationale||Promote a clear modeling style.|
|Model Advisor Checks||Check state machine type of Stateflow charts (Simulink Check)|
|ID: Title||hisf_0002: User-specified state/transition execution order|
Do the following to explicitly set the execution order for active states and valid transitions in Stateflow charts:
In the Chart Properties dialog box, select User specified state/transition execution order.
|Prerequisites||hisl_0311: Configuration Parameters > Diagnostics > Stateflow|
Selecting User specified state/transition execution order restricts the dependency of a Stateflow chart semantics on the geometric position of parallel states and transitions.
Specifying the execution order of states and transitions allows you to enforce determinism in the search order for active states and valid transitions. You have control of the order in which parallel states are executed and transitions originating from a source are tested for execution. If you do not explicitly set the execution order, the Stateflow software determines the execution order following a deterministic algorithm.
|Rationale||A||Promote an unambiguous modeling style.|
|Model Advisor Checks||Check Stateflow charts for ordering of states and transitions (Simulink Check)|
This guideline supports adhering to:
hisf_0009: Strong data typing (Simulink® and Stateflow boundary)
To support strong data typing between Simulink and Stateflow ,
|A||Select chart property Use Strong Data Typing with Simulink I/O.|
|Notes||By default, input to and output from
Stateflow charts are of type |
|Rationale||A||Support strongly typed code.|
|Model Advisor Checks|
Check for Strong Data Typing with Simulink I/O (Simulink Check)
|See Also||Specify Properties for Stateflow Charts (Stateflow)|
hisf_0011: Stateflow debugging settings
To protect against unreachable code and indeterminate execution time,
Set configuration parameters Wrap on overflow
and Simulation range checking to
In the model, open the Debug tab and select Diagnostics > Detect Cyclical Behavior
Right-click on each truth table in the model and select
Properties. Set these parameters to
Run-time diagnostics are only triggered during simulation. If the error condition is not reached during simulation, the error message is not triggered for code generation.
|Rationale||A, B||Protect against unreachable code and unpredictable execution time.|
|Model Advisor Checks||Check Stateflow debugging options (Simulink Check)|
|See Also||Specify Properties of Truth Table Functions (Stateflow)|