Main Content

Detect overflow

Description

Select the diagnostic action to take if a parameter overflow occurs during simulation.

Category: Diagnostics

Settings

Default: error

none

Simulink® software takes no action.

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

  • A parameter overflow occurs if Simulink software encounters a parameter whose data type's range is not large enough to accommodate the parameter's ideal value (the ideal value is either too large or too small to be represented by the data type). For example, suppose that the parameter's ideal value is 200 and its data type is int8. Overflow occurs in this case because the maximum value that int8 can represent is 127.

  • Parameter overflow differs from parameter precision loss, which occurs when the ideal parameter value is within the range of the data type and scaling being used, but cannot be represented exactly.

  • Both parameter overflow and precision loss are quantization errors, and the distinction between them can be a fine one. The Detect overflow diagnostic reports all quantization errors greater than one bit. For very small parameter quantization errors, precision loss will be reported rather than an overflow when

    (Max+Slope)Videal>(MinSlope)

    where

    • Max is the maximum value representable by the parameter data type

    • Min is the minimum value representable by the parameter data type

    • Slope is the slope of the parameter data type (slope = 1 for integers)

    • Videal is the ideal value of the parameter

Command-Line Information

Parameter: ParameterOverflowMsg
Value: 'none' | 'warning' | 'error'
Default: 'error'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

Related Topics