Assert Range

Purpose

Issue a warning or an error message when the input leaves the specified range

Library

Assertions

Description

../../_images/assertrange.svg

This block checks whether the input signal lies between the specified lower and upper limits. When the check fails, a message is added to the diagnostics window and the simulation may be paused or stopped.

Parameters

Upper limit

A constant specifying the upper limit for the input signal.

Lower limit

A constant specifying the lower limit for the input signal.

Limits

Either include or exclude, indicating whether the limits are included in or excluded from the allowed range.

Action

One of the following: ignore: the assertion is ignored; warning: when the assertion fails, a warning is added to the diagnostics window; warning/pause: when the assertion fails, a warning is added to the diagnostics window and the simulation is paused; error: when the assertion fails, an error is added to the diagnostics window and the simulation is stopped.

This parameter can be overwritten on a per model basis (see Simulation Parameters). Note that during analyses and simulation scripts, assertions may be partly disabled (see Assertions).

Message

The message that is displayed in the diagnostics window when the assertion fails.

Probe Signals

Input

The middle input signal.

Assertion value

1 while the input is within the range and 0 otherwise.