Verification

Assertion Block

Checks that a signal satisfies a property at every simulation step. Reports violations with timestamps.

Open Assertion in BlockWerk →

# Assertion Block

Description

The Assertion block monitors a signal at every simulation step and checks whether it satisfies a user-defined property. When the condition holds the output port emits 1; when it is violated the output emits 0 and a violation is recorded with its timestamp. The block body turns green on pass and red on failure, giving immediate visual feedback during simulation.

Use the Assertion block to encode safety constraints and design requirements directly in a diagram — for example, to verify that a control signal never saturates, that a physical quantity stays within safe bounds, or that two signals remain in a valid relationship. Assertions act as lightweight runtime monitors without requiring external test scripts.

Parameters

mode

Selects which logical property to evaluate. Accepted values:

| Value | Condition checked | | ------------- | ------------------------------------------ | | between | lowerBound <= in <= upperBound (default) | | above | in >= lowerBound | | below | in <= upperBound | | not_between | in < lowerBound or in > upperBound |

lowerBound

The lower threshold used by between, above, and not_between modes. Default: -1.

upperBound

The upper threshold used by between, below, and not_between modes. Default: 1.

Examples

Verifying actuator signal stays within saturation limits

Controller → Assertion → Actuator
             mode=between  lowerBound=-10  upperBound=10

The status output can be plotted alongside the signal to log every violation instant.

Detecting when a temperature leaves a safe range

TempSensor → Assertion → Display
              mode=between  lowerBound=15  upperBound=85

Confirming a signal is strictly positive

PressureSensor → Assertion → FlowCalc
                  mode=above  lowerBound=0

Remarks

See Also