PLECS 3.7 Online Help

Assertion

Purpose

Issue a warning or an error message when the input becomes 0

Library

Assertions

Description

pict

The assertion block checks whether a condition stays true during the simulation. While the input signal is non-zero, the block does nothing. When the input signal becomes zero, the specified message appears. Depending on the "action" setting, the message is added either as a warning or as an error to the diagnostics window. If it is added as a warning, it is possible to additionally automatically pause the simulation. If it is added as an error, the simulation always stops. To disable the assertion, set its action to ignore.

Parameters

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.
Highlight level
The number of levels the highlight is propagated upwards in the component hierarchy when the assertion fails. A highlight level of 0 means that the assertion block itself will be highlighted when the assertion fails. A highlight level of 1 means that the component containing the assertion block will be highlighted when the assertion fails, etc.