Handle Overflows in Simulink Models
This example shows how to control the warning messages you receive when a model contains an overflow. This diagnostic control can simplify debugging models in which only one type of overflow is of interest.
This model contains a sine wave with an amplitude of 1.5 passed through two Data Type Conversion blocks. In the Data Type Conversion block, the Saturate on integer overflow parameter is selected. The Data Type Conversion1 block wraps when the signal is too large to fit into the output data type.
Simulate the model.
The Diagnostic Viewer displays two overflow warnings. The first overflow saturated and the second overflow wrapped.
In the Configuration Parameters dialog box:
Set Diagnostics > Data Validity > Wrap on overflow to
Set Diagnostics > Data Validity > Saturate on overflow to
Simulate the model again.
The Diagnostic Viewer displays an error message for the overflow that wrapped, and a warning message for the overflow that saturated.