Documentation Center

  • Trial Software
  • Product Updates

Diagnostics Pane: Type Conversion

Type Conversion Diagnostics Overview

Specify the diagnostic actions that Simulink® software should take when it detects a data type conversion problem while compiling the model.

Configuration

Set the parameters displayed.

Tips

  • To open the Type Conversion pane, in the Simulink Editor, select Simulation > Model Configuration Parameters > Diagnostics > Type Conversion.

  • The options are typically to do nothing or to display a warning or an error message.

  • A warning does not terminate a simulation, but an error does.

See Also

Unnecessary type conversions

Select the diagnostic action to take when Simulink software detects a Data Type ConversionData Type Conversion block used where no type conversion is necessary.

Settings

Default: none

none

Simulink software takes no action.

warning

Simulink software displays a warning.

Command-Line Information

Parameter: UnnecessaryDatatypeConvMsg
Type: string
Value: 'none' | 'warning'
Default: 'none'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionwarning

See Also

Vector/matrix block input conversion

Select the diagnostic action to take when Simulink software detects a vector-to-matrix or matrix-to-vector conversion at a block input.

Settings

Default: none

none

Simulink software takes no action.

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

Simulink software converts vectors to row or column matrices and row or column matrices to vectors under the following circumstances:

  • If a vector signal is connected to an input that requires a matrix, Simulink software converts the vector to a one-row or one-column matrix.

  • If a one-column or one-row matrix is connected to an input that requires a vector, Simulink software converts the matrix to a vector.

  • If the inputs to a block consist of a mixture of vectors and matrices and the matrix inputs all have one column or one row, Simulink software converts the vectors to matrices having one column or one row, respectively.

Command-Line Information

Parameter: VectorMatrixConversionMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

32-bit integer to single precision float conversion

Select the diagnostic action to take if Simulink software detects a 32-bit integer value was converted to a floating-point value.

Settings

Default: warning

none

Simulink software takes no action.

warning

Simulink software displays a warning.

Tip

Converting a 32-bit integer value to a floating-point value can result in a loss of precision. See Working with Data TypesWorking with Data Types for more information.

Command-Line Information

Parameter: Int32ToFloatConvMsg
Type: string
Value: 'none' | 'warning'
Default: 'warning'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionwarning

See Also

Detect underflow

Specifies diagnostic action to take when a fixed-point constant underflow occurs during simulation.

Settings

Default: none

none

Simulink software takes no action.

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

  • This diagnostic applies only to fixed-point constants (net slope and net bias).

  • Fixed-point constant underflow occurs when Simulink software encounters a fixed-point constant whose data type does not have enough precision to represent the ideal value of the constant because the ideal value is too small.

  • When fixed-point constant underflow occurs, casting the ideal value to the data type causes the value of the fixed-point constant to become zero, and therefore to differ from its ideal value.

Dependency

This parameter requires a Fixed-Point Designer™ license.

Command-Line Information

Parameter:FixptConstUnderflowMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Detect precision loss

Specifies diagnostic action to take when a fixed-point constant precision loss occurs during simulation.

Settings

Default: none

none

Simulink software takes no action.

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

  • This diagnostic applies only to fixed-point constants (net slope and net bias).

  • Precision loss occurs when Simulink software converts a fixed-point constant to a data type which does not have enough precision to represent the exact value of the constant. As a result, the quantized value differs from the ideal value.

  • Fixed-point constant precision loss differs from fixed-point constant overflow. Overflow occurs when the range of the parameter's data type, that is, the maximum value that it can represent, is smaller than the ideal value of the parameter.

Dependency

This parameter requires a Fixed-Point Designer license.

Command-Line Information

Parameter:FixptConstPrecisionLossMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Detect overflow

Specifies diagnostic action to take when a fixed-point constant overflow occurs during simulation.

Settings

Default: none

none

Simulink software takes no action.

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

  • This diagnostic applies only to fixed-point constants (net slope and net bias).

  • Overflow occurs when the Simulink software converts a fixed-point constant to a data type whose range is not large enough to accommodate the ideal value of the constant. The ideal value is either too large or too small to be represented by the data type. For example, suppose that the ideal value is 200 and the converted data type is int8. Overflow occurs in this case because the maximum value that int8 can represent is 127.

  • Fixed-point constant overflow differs from fixed-point constant precision loss. Precision loss occurs when the ideal fixed-point constant value is within the range of the data type and scaling being used, but cannot be represented exactly.

Dependency

This parameter requires a Fixed-Point Designer license.

Command-Line Information

Parameter:FixptConstOverflowMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Was this topic helpful?