TimeMonitoring block
Requirements.SignalAnalysis.TimeMonitoring
ยท source
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
| Name | Type | Description |
|---|---|---|
u | Modelica.Blocks.Interfaces.BooleanInput | Boolean input signal |
y | Modelica.Blocks.Interfaces.RealOutput | Real output signal = duration of input signal u being true |
timer | Modelica.Blocks.Logical.Timer | Measures the time since u became true |

