The following example uses a Check Static Lower Bound block to stop simulation when a signal from a Sine Wave block crosses its lower bound limit.
Attach a Check Static Lower Bound block to the signal from a Sine Wave block.
Set the Simulation stop time to 2 seconds.
Double-click the Sine Wave block and set the following parameters:
Set the Amplitude to 1.
Set the Frequency to pi radians per second.
Enable assertion is the default. This parameter enables a verification block for an assertion. You set the Check Static Lower Bound block to detect a signal value of –0.8 or lower. If the signal value reaches that value or falls below it, the simulation stops.
Run the simulation.
The model stops simulating after 1.295 seconds, when the output is –0.8. The software highlights the Check Static Lower Bound block.
To verify the signal value, double-click the Scope block.
To disable the Check Static Lower Bound block from asserting its limit, clear the Enable assertion check box.
The block is crossed out in the model, as shown.