Check data types for blocks with index signals
Check ID:
mathworks.hism.hisl_0022
Description
This check identifies the blocks with index signals that have data types other than integers or enum and are within the range of indexed values.
This check applies to the following target components in Simulink:
Assignment
Direct Lookup Table (n-D)
Multiport Switch
Selector
Lookup
Interpolation (n-D)
This check applies to the following target components in Stateflow:
States and transitions
You can consider the following cases for multiport switches:
'Data Port for Default Case' is set to 'Last data port' and 'Data port order' set to 'Zero-based contiguous'. The maximum expected number of data ports for the check is "DATATYPE_MAX+2" and the data type is of the index signal.
'Data Port for Default Case' is set to 'Last data port' and 'Data port order' set to 'One-based contiguous'. The maximum expected number of data ports for the check is "DATATYPE_MAX+1" and the data type is of the index signal.
'Data Port for Default Case' is set to 'Additional data port' and 'Data port order' set to 'Zero-based contiguous'. The maximum expected number of data ports for the check is "DATATYPE_MAX+1" and the data type is of the index signal.
'Data Port for Default Case' is set to 'Additional data port' and 'Data port order' set to 'One-based contiguous'. The maximum expected number of data ports for the check is "DATATYPE_MAX" and the data type is of the index signal.
Available with Simulink® Check™.
Check Parameterization
You can use Model Advisor Configuration Editor to configure this check to include
files with a .m
extension in the analysis. To enable this feature, in
the Input Parameters section, select Check external .m
files referenced in the model.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
One or more Simulink blocks in the model have index signals that have data types other than integer or enum. | Change the data type of block index signals to an integer or enum data type that covers the range of indexed values. |
One or more MATLAB Function blocks have index variables with inappropriate data types. | Change the data type of index variables to an integer or enum data type that covers the range of indexed values. |
One or more Stateflow charts in the model have index variables that have data types other than integer or enum. | Change the data type of index signals of the blocks to an integer or enum data type that covers the range of indexed values. |
Capabilities and Limitations
This check does not support dialog set indices.
Analyzes content in masked subsystems. By default, the input parameter Look under masks is set to
graphical
.Analyzes content of library-linked blocks. By default, the input parameter Follow links is set to
on
.Allows exclusions of blocks and charts.
Flags vector indexing even if the vector contains integer or enum data types.
See Also