Chart Architecture
hisf_0004: Protect against recursive function calls to improve code compliance
ID: Title | hisf_0004: Protect against recursive function calls to improve code compliance | |
---|---|---|
Description | To improve compliance of generated code, do not call functions recursively. This includes any combination of graphical functions, truth table functions, MATLAB® functions, or Simulink® functions. | |
Prerequisites | ||
Notes | A recursion exists when a function calls itself directly or indirectly through another function call. | |
Rationale | Promote bounded function call behavior. | |
Model Advisor Checks | Check usage of recursions (Simulink Check) | |
References |
| |
Last Changed | R2021a | |
Examples | There are multiple patterns in Stateflow® that can result in recursion.
Recursive Function Calls | |
When the default state A is entered, event
Recursive Function Calls |
hisf_0013: Usage of transition paths (crossing parallel state boundaries)
ID: Title | hisf_0013: Usage of transition paths (crossing parallel state boundaries) | |
---|---|---|
Description | To avoid creating diagrams that are hard to understand, | |
A | Avoid creating transitions that cross from one parallel state to another. | |
Notes | You can use this guideline to maintain a modeling language subset in high-integrity projects. | |
Rationale | A | Enhance model readability. |
Model Advisor Checks | Check Stateflow charts for transition paths that cross parallel state boundaries (Simulink Check) | |
References |
| |
Last Changed | R2017b | |
Example | In the following example, when
|
hisf_0014: Usage of transition paths (passing through states)
ID: Title | hisf_0014: Usage of transition paths (passing through states) | |
---|---|---|
Description | To avoid creating diagrams that are confusing and include transition paths without benefit, | |
A | Avoid transition paths that go into and out of a state without ending on a substate. | |
Notes | You can use this guideline to maintain a modeling language subset in high-integrity projects. | |
Rationale | A | Enhance model readability. |
Model Advisor Checks | Check for inappropriate use of transition paths (Simulink Check) | |
References |
| |
Last Changed | R2018b | |
Examples |
|
hisf_0015: Strong data typing (casting variables and parameters in expressions)
ID: Title | hisf_0015: Strong data typing (casting variables and parameters in expressions) | |
---|---|---|
Description | To facilitate strong data typing, explicitly type cast variables and parameters of different data types in Stateflow. | |
Notes | The Stateflow software automatically casts variables of different type into the same data type. This guideline helps clarify data types of the intermediate variables. | |
Rationale | A | Apply strong data typing. |
Model Advisor Checks | Check Stateflow charts for strong data typing (Simulink Check) | |
References |
| |
Last Changed | R2021a | |
Examples |
Recommended Not Recommended |
hisf_0016: Stateflow port names
ID: Title | hisf_0016: Stateflow port names |
---|---|
Description | The name of a Stateflow input or output must be the same as the corresponding signal. An exception to the guideline is that reusable Stateflow blocks can have different port names. |
Rationale | Support generation of traceable code. |
Model Advisor Checks | Check naming of ports in Stateflow charts (Simulink Check) |
References |
|
Last Changed | 2018a |
hisf_0017: Stateflow data object scoping
ID: Title | hisf_0017: Stateflow data object scoping |
---|---|
Description | Stateflow data objects with local scope must be defined at the chart level or below. |
Rationale | Support generation of traceable code. |
Model Advisor Checks | Check scoping of Stateflow data objects (Simulink Check) |
References |
|
Last Changed | 2018a |
Examples |
Recommended Not Recommended |