TimeMonitoring block

Requirements.SignalAnalysis.TimeMonitoring  ยท source

Icon of TimeMonitoring

Output is the time duration where the Boolean input was true

Syntax

duration = TimeMonitoring(u=...).y;

Description

Real output y is the duration in seconds, since the input u was true.

The block is implemented with Modelica.Blocks.Logical.Timer: when u becomes true, y starts at zero and increases with slope one (the time elapsed since the rising edge of u); when u becomes false, y is reset to zero. The output can be compared against a duration limit, for example to check that a condition does not hold longer than allowed, or be used with the blocks of ChecksInFixedWindow. A related block that monitors a Real signal is CrossingMonitoring.

Example

This block is demonstrated with the following example:

results in

simulation result

Components and variables

NameTypeDescription
uModelica.Blocks.Interfaces.BooleanInputBoolean input signal
yModelica.Blocks.Interfaces.RealOutputReal output signal = duration of input signal u being true
timerModelica.Blocks.Logical.TimerMeasures the time since u became true