Main Content

Check data type of loop control variables

mathworks.hism.hisl_0102

Dependencies: Simulink® Check™

Usage: High-Integrity System Modeling

Guideline: hisl_0102: Data type of loop control variables to improve MISRA C:2012 compliance

Description

This check identifies loop control variables that use noninteger data types.

The check applies to:

  • For Iterator blocks.

  • For loops in MATLAB Function blocks.

Check Parameters

Use the Model Advisor Configuration Editor to define the scope of the analysis by specifying the input parameters.

ParameterDescription

Follow links

Verify and trace links within the Simulink model.

on (default) | off

Look under masks

Specify whether to include masked model elements in the analysis.

all (default) | none| graphical| functional

  • all — Check analysis includes all masked model elements.

  • none — Check analysis excludes masked model elements.

  • graphical — Check analysis includes only the graphical masked model elements.

  • functional — Check analysis includes only the functional masked model elements.

Recommended Actions and Results

Review the violations that are flagged by the check and the recommended action for fixing the issue. After applying the changes, save the model and rerun the check analysis.

Modeling ConditionRecommended Action
For Iterator blocks are using a noninteger data type for loop control counter variable.Set the data type of the loop control counter variable to an integer data type.
For loops are using a noninteger data type for loop control counter variable in MATLAB Function blocks.Set the data type of loop control counter variables to an integer data type.
For Iterator or MATLAB Function blocks are using data types for loop control counter variables that cannot be determined. Manually verify the data type of the variables.

Capabilities and Limitations

  • Does not look at loop control variables inside Stateflow charts

  • Does not run on library models

  • Allows exclusions of blocks and charts

  • Flags undetermined data types as informational result

  • Analyzes only active variant choices

  • Performs model compilation

Version History

Introduced in R2018b