Main Content

Check safety-related diagnostic settings for type conversions

mathworks.hism.hisl_0309

Dependencies: Simulink® Check™

Usage: High-Integrity System Modeling

Guideline: hisl_0309: Configuration Parameters > Diagnostics > Type Conversion

Description

This check verifies that the model configuration uses optimal parameter settings that apply to type conversions when generating code for a safety-related application.

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.

You can use the Fix button to allow the Model Advisor to fix flagged violations. For this check, the Model Advisor configures model diagnostic settings that apply to type conversions and that can impact safety.

Modeling ConditionRecommended Action
The diagnostic that detects Data Type Conversion blocks when the type conversion is set to none. The software can remove unnecessary Data Type Conversion blocks from generated code, which can result in requirements without corresponding code. The removal of these blocks needs to be identified so model developers can explicitly remove the unnecessary blocks.Set model configuration parameter Unnecessary type conversions to warning.
The diagnostic that detects vector-to-matrix or matrix-to-vector conversions at block inputs is set to none or warning. When the Simulink software automatically makes such conversions, unintended operations or unpredictable behavior can occur.Set model configuration parameter Vector/matrix block input conversion to error
The diagnostic that detects when a 32-bit integer value is converted to a floating-point value is set to none. This type of conversion can result in a loss of precision due to truncation of the least significant bits for large integer values. Set model configuration parameter 32-bit integer to single precision float conversion to warning.

Capabilities and Limitations

  • Does not run on library models

  • Does not allow exclusions of blocks or charts

  • Does not require model compilation

Version History

Introduced in R2007b