Stateflow® Block Constraint | FATAL / Nonfatal | Compatibility Check |
---|---|---|
Function packaging
(RTWSystemCode ) must be set to
Inline or Nonreusable
function . The subsystem must be in supported configurations
for Nonreusable function . Simulink®
Code Inspector™ supports the Chart (Stateflow) block for code
inspection. | Nonfatal | Check usage of Stateflow blocks |
Chart (Stateflow) Constraint | FATAL / Nonfatal | Compatibility Check |
---|---|---|
The chart must not contain any of the following objects:
| FATAL | Check usage of Stateflow charts > Check usage of Stateflow object palette |
A chart that uses MATLAB action language must have unique names for the Simulink functions, graphical functions, and truth tables it contains. | Nonfatal | Check usage of Stateflow charts >Check name usage in a Stateflow chart that uses MATLAB action language |
The MATLAB code in a chart that uses MATLAB action language must follow the same constraints as the code in MATLAB Function blocks. | Nonfatal | Check usage of Stateflow MATLAB action language |
Chart property Create data for monitoring child activity must not be selected. | Nonfatal | Check usage of Stateflow charts > Check that all charts unselect ‘Create data for monitoring child activity’ option |
Chart property Update method must be set to
Inherited . | Nonfatal | Check usage of Stateflow charts > Check that all charts specify 'Inherited' as their update method |
States and substates in the chart must have default transitions. | Nonfatal | Check usage of Stateflow charts >Check that states or substates have a default transition |
Chart property Enable Super Step Semantics must not be selected. | Nonfatal | Check usage of Stateflow charts > Check that all charts unselect ‘Enable Super Step Semantics’ option |
Chart property Execute (enter) Chart at Initialization must not be selected. | Nonfatal | <Check usage of Stateflow charts > Check that no charts execute at initialization |
Chart property Export Chart Level Functions must not be selected. | Nonfatal | Check usage of Stateflow charts > Check that no charts export chart level functions |
Chart property Saturate on integer overflow must not be selected. | Nonfatal | Check usage of Stateflow charts > Check that no charts specify saturation on overflow for integer operations |
Chart property State Machine Type must not be
set to Moore . | Nonfatal | Check usage of Stateflow charts > Check usage of State Machine Type |
Chart property Support variable-size arrays must not be selected. | FATAL | Check usage of Stateflow charts > Check that no charts support variable-size arrays |
The control flow must not have more than 1 default transition. | Nonfatal | Check usage of Stateflow charts > Check that all control flows have unique default transitions |
Data or Event Constraint | FATAL / Nonfatal | Compatibility Check |
---|---|---|
Stateflow data must not be of machine scope. | Nonfatal | Check for Stateflow machine data > All Stateflow data must be parented by a Stateflow chart |
Stateflow events must not be of machine scope. | Nonfatal | Check for Stateflow machine events > All Stateflow events must be parented by a Stateflow chart |
Chart must not define Stateflow data with Constant scope. | Nonfatal | Check usage of Stateflow data > Check that the chart does not define Stateflow data with Constant scope |
InitializeMethod
for Local or Output scope
Stateflow data must not be set to
Parameter . | Nonfatal | Check usage of Stateflow data > Check usage of Stateflow data Initialize Method |
Chart data types must be
| Nonfatal | Check usage of Stateflow data > Check that Stateflow data is of a supported data type |
The First Index property for
Stateflow data must be empty or 0. | Nonfatal | Check usage of Stateflow data > Check that the 'First Index' of Stateflow data are empty or 0 |
Size of Stateflow parameter data must be the same in Stateflow and the base workspace. | Nonfatal | Check usage of Stateflow data > Check that Stateflow parameter data sizes in Stateflow and the base workspace match |
Chart must not use complex data. | Nonfatal | Check usage of Stateflow data > Check that the chart uses only non-complex data |
Stateflow states and boxes must not define Stateflow data. | Nonfatal | Check usage of Stateflow data > Check that states and boxes do not define Stateflow data |
Event scope must be Output or
Local . | Nonfatal | Check usage of Stateflow events > Check that the chart uses only events of scope Local or Output |
Event trigger must be a function-call . | Nonfatal | Check usage of Stateflow events > Check that the chart uses only function-call events |
Graphical Function Constraint | FATAL / Nonfatal | Compatibility Check |
---|---|---|
Graphical function must not contain control flow cycles. | FATAL | Check usage of Stateflow graphical functions > Check that control flows do not have cycles |
Graphical function property Function Inline
Option (InlineOption ) must be
Inline or
Function . | Nonfatal | Check usage of Stateflow graphical functions > Check usage of InlineOption setting |
For a graphical function with Function Inline
Option (InlineOption ) set to
Function , the configuration parameter
Code interface packaging
(CodeInterfacePackaging ) must be set to
Nonreusable function . | Nonfatal | Check usage of Stateflow graphical functions > Check configuration for models with non-inlined graphical functions |
Non-inlined graphical functions must have unique function names. | Nonfatal | Check usage of Stateflow graphical functions > Check non-inlined graphical function names |
Graphical function must not be recursive. | Nonfatal | Check usage of Stateflow graphical functions > Check usage of recursive Stateflow function |
Graphical function must not contain unstructured control flow. | FATAL | Check usage of Stateflow graphical functions > Check that control flows are structured |
State must not have graphical function calls with different actual and expected argument data types. | Nonfatal | Check usage of Stateflow states > Check data type of Graphical Function arguments |
State must not have graphical function calls with different actual and expected argument sizes. | Nonfatal | Check usage of Stateflow states > Check dimensions of Graphical Function arguments |
Transition must not have graphical function calls with different actual and expected argument data types. | Nonfatal | Check usage of Stateflow transitions > Check data type of Graphical Function arguments |
Transition must not have graphical function calls with different actual and expected argument dimensions. | Nonfatal | Check usage of Stateflow transitions >Check dimensions of Graphical Function arguments |
Simulink Function Constraint | FATAL / Nonfatal | Compatibility Check |
---|---|---|
Simulink function calls in states must have the same argument data type as the inports and outports in the defining Function-Call Subsystem. | Nonfatal | Check usage of Stateflow states > Check data type of Simulink Function arguments |
Simulink function calls in states must have the same argument size as the inports and outports in the defining Function-Call Subsystem. | Nonfatal | Check usage of Stateflow states > Check dimensions of Simulink Function arguments |
Simulink function calls in transitions must have the same argument data type as the inports and outports in the defining Function-Call Subsystem. | Nonfatal | Check usage of Stateflow transitions > Check data type of Simulink Function arguments |
Simulink function calls in transitions must have the same argument size as the inports and outports in the defining Function-Call Subsystem. | Nonfatal | Check usage of Stateflow transitions > Check dimensions of Simulink Function argument |
Junction Constraint | FATAL / Nonfatal | Compatibility Check |
---|---|---|
Junctions must not have outgoing transitions jumping outside of a loop. | Nonfatal | Check usage of Stateflow junctions > Check that Stateflow junctions do not have outgoing transitions jumping outside of the loop |
Non-terminating junctions must have exactly one unconditional transition exiting them. | FATAL | Check usage of Stateflow junctions > Check that non-terminating junctions have exactly one unconditional exiting transition |
Chart must not contain a history junction. | Nonfatal | Check usage of Stateflow junctions > Check that the chart uses no history junctions |
Header junctions must have two incoming and two outgoing transitions. | Nonfatal | Check usage of Stateflow junctions > Check that control flows do not have loops with unsupported header junctions |
Terminating junctions must not trace back to a Stateflow state. | Nonfatal | Check usage of Stateflow junctions > Check usage of terminating Stateflow junctions |
Unconditional transition must be last in order of execution. | FATAL | Check usage of Stateflow junctions > Check that unconditional transitions execute last in execution order |
The chart must not contain unstructured control flow. | Nonfatal | Check usage of Stateflow junctions > Check that control flows are structured |
States (Stateflow) Constraint | FATAL / Nonfatal | Compatibility Check |
---|---|---|
States must not contain control flow cycles. | FATAL | Check usage of Stateflow states > Check that control flows do not have cycles |
Action must be for one of these operations:
| Nonfatal | Check usage of Stateflow states > Check that actions do not have unsupported operations |
Arrays of more than one dimension must not use indexing. | Nonfatal | Check usage of Stateflow states > Check for indexing in arrays that are more than one dimension |
Arrays must use index of data type
int32 . | Nonfatal | Check usage of Stateflow states > Check that all arrays use index of type 'int32' |
Action must not access context-sensitive constants. | Nonfatal | Check usage of Stateflow states > Check that no actions access context-sensitive constants |
Action must not access custom data. | Nonfatal | Check usage of Stateflow states > Check that no actions access custom data |
States and substates in the chart must have default transitions. | Nonfatal | Check usage of Stateflow states > Check that states or substates have a default transition |
State must not use any of the following unsupported operations on enumeration type operands:
| Nonfatal | Check usage of Stateflow states > Check that actions do not have unsupported operations on enumeration type operands |
Math functions in actions must have:
| Nonfatal | Check usage of Stateflow states > Check that no actions contain a function whose argument is of an invalid data type |
Action must not contain a binary operator with mixed data type operands. | Nonfatal | Check usage of Stateflow states > Check that no actions contain a binary operator whose operands are of mixed data type |
Stateflow functions must not have more than 2 arguments. | Nonfatal | Check usage of Stateflow states > Check that no Stateflow functions have more than 2 arguments |
Stateflow states must not have recursive send function calls. | Nonfatal | Check usage of Stateflow states > Check usage of States with recursive send function calls |
State property Function
Inline Option must not be Auto
or Function . | Nonfatal | Check usage of Stateflow states > Check usage of Stateflow state InlineOption |
State property Create data for monitoring must
not be selected (set to on ). | Nonfatal | Check usage of Stateflow states > Check that all states unselect ‘Create data for monitoring’ option |
Actions must not access time. | Nonfatal | Check usage of Stateflow states > Check that no actions access time (t) |
States must not contain unstructured control flow. | Nonfatal | Check usage of Stateflow states > Check that control flows are structured |
The control flow must not have more than 1 default transition. | Nonfatal | Check usage of Stateflow states > Check that all control flows have unique default transitions |
Paths from a state must be one of the following: inner transition to a substate, or outer transition to a sibling, direct parent, or direct substate. | Nonfatal | Check usage of Stateflow states > Check that all transition paths are either inner transitions to a substate, or outer transitions to siblings, direct parent, or direct substates |
Actions must not contain an XOR operator with
boolean operands when model parameter Casting modes
is set to Standards . | Nonfatal | Check usage of Stateflow states > Check that no actions contain an xor operator with boolean operands |
Charts must not have graphical function calls with unassigned outputs. | Nonfatal | Check usage of Stateflow states > Check unassigned graphical function outputs |
Transitions (Stateflow) Constraint | FATAL / Nonfatal | Compatibility Check |
---|---|---|
Action must be for one of these operations:
| Nonfatal | Check usage of Stateflow transitions > Check that actions do not have unsupported operations |
Arrays of more than one dimension must not use indexing. | Nonfatal | Check usage of Stateflow transitions > Check for indexing in arrays that are more than one dimension |
Arrays must use index of data type
int32 . | Nonfatal | Check usage of Stateflow transitions > Check that all arrays use index of type 'int32' |
Transition condition must be of Boolean data type. | Nonfatal | Check usage of Stateflow transitions > Check that all transition conditions are of boolean data type |
Action must not access context-sensitive constants. | Nonfatal | Check usage of Stateflow transitions > Check that no actions access context-sensitive constants |
Action must not access custom data. | Nonfatal | Check usage of Stateflow transitions > Check that no actions access custom data |
Transition must not use any of the following unsupported operations on enumeration type operands:
| Nonfatal | Check usage of Stateflow transitions > Check that conditions and actions do not have unsupported operations on enumeration type operands |
Transition must not have an event trigger. | Nonfatal | Check usage of Stateflow transitions > Check that no transitions have event triggers |
Transition must not have a transition action. | Nonfatal | Check usage of Stateflow transitions > Check that transitions do not have transition actions |
Math functions in actions must have:
| Nonfatal | Check usage of Stateflow transitions > Check that no actions contain a function whose argument is of an invalid data type |
Stateflow transitions must not reuse induction variables outside of a loop. | Nonfatal | Check usage of Stateflow transitions > Check that Stateflow transitions do not reuse induction variables outside of a loop |
Stateflow loops must not have unsupported step in transitions. | Nonfatal | Check usage of Stateflow transitions > Check that transitions do not have an unsupported loop step |
Stateflow loops must not have an unsupported body in transitions. | Nonfatal | Check usage of Stateflow transitions > Check that transitions do not have an unsupported loop body |
Stateflow loops must not have an unsupported condition in transitions. | Nonfatal | Check usage of Stateflow transitions > Check that transitions do not have an unsupported loop condition |
Stateflow loops must have a valid induction variable in transition that defines loop condition. | Nonfatal | Check usage of Stateflow transitions > Check for valid induction variable in transition that defines loop condition |
Stateflow loops must not have unsupported initialization actions in transitions. | Nonfatal | Check usage of Stateflow transitions > Check that transitions do not have unsupported loop induction variable initialization |
Action must not contain a binary operator with mixed data type operands. | Nonfatal | Check usage of Stateflow transitions > Check that no actions contain a binary operator whose operands are of mixed data type |
Transition must not have a function with more than 2 arguments. | Nonfatal | Check usage of Stateflow transitions > Check that no transitions have a function with more than 2 arguments |
Actions must not access time. | Nonfatal | Check usage of Stateflow transitions > Check that no actions access time (t) |
Actions must not contain an XOR operator with
boolean operands when model parameter Casting modes
is set to Standards . | Nonfatal | Check usage of Stateflow transitions > Check that no actions contain an xor operator with boolean operands |
Charts must not have graphical function calls with unassigned outputs. | Nonfatal | Check usage of Stateflow transitions > Check unassigned graphical function outputs |
Charts must not contain transitions that are configured as variant transitions. | Nonfatal | Check usage of Stateflow transitions > Check that Stateflow transitions are not configured as variant transitions |
Truth Table Constraint | FATAL / Nonfatal | Compatibility Check |
---|---|---|
Control flows must not have cycles. | FATAL | Check usage of Stateflow truth tables > Check that control flows do not have cycles |
Truth table property Function Inline Option
(InlineOption ) must not be
Auto or
Function . | Nonfatal | Check usage of Stateflow truth tables > Check usage of InlineOption setting |
Truth table must not be recursive. | Nonfatal | Check usage of Stateflow truth tables > Check usage of recursive Stateflow function |
Truth table property Language must be set to
C . | Nonfatal | Check usage of Stateflow truth tables > Check usage of Stateflow truth table Language |
Control flows must be structured. | FATAL | Check usage of Stateflow truth tables > Check that control flows are structured |
States must not specify truth tables with different actual and expected argument data types. | Nonfatal | Check usage of Stateflow states > Check data type of truth table arguments |
States must not specify truth tables with different actual and expected argument sizes. | Nonfatal | Check usage of Stateflow states > Check dimensions of truth table arguments |
Transitions must not specify truth tables with different actual and expected argument data types. | Nonfatal | Check usage of Stateflow transitions > Check data type of truth table arguments |
Transitions must not specify truth tables with different actual and expected argument sizes. | Nonfatal | Check usage of Stateflow transitions > Check dimensions of truth table arguments |