Modelica.Blocks.MathBoolean.OnDelay Modelica.Blocks.MathBoolean.OnDelay

Delay a rising edge of the input, but do not delay a falling edge.

Modelica.Blocks.MathBoolean.OnDelay

Information

A rising edge of the Boolean input u gives a delayed output. A falling edge of the input is immediately given to the output.

Simulation results of a typical example with a delay time of 0.1 s is shown in the next figure.

OnDelay1.png
OnDelay2.png

The usage is demonstrated, e.g., in example Modelica.Blocks.Examples.BooleanNetwork1.

Extends from Modelica.Blocks.Interfaces.PartialBooleanSISO_small (Partial block with a BooleanInput and a BooleanOutput signal and a small block icon).

Parameters

TypeNameDefaultDescription
TimedelayTime Delay time [s]

Connectors

TypeNameDescription
input BooleanInputuBoolean input signal
output BooleanOutputyBoolean output signal

Modelica definition

block OnDelay "Delay a rising edge of the input, but do not delay a falling edge." extends Modelica.Blocks.Interfaces.PartialBooleanSISO_small; parameter Modelica.SIunits.Time delayTime "Delay time"; protected Boolean delaySignal(start=false,fixed=true); discrete Modelica.SIunits.Time t_next; initial equation pre(u) = false; pre(t_next) = time - 1; algorithm when initial() then delaySignal := u; t_next := time - 1; elsewhen u then delaySignal := true; t_next := time + delayTime; elsewhen not u then delaySignal := false; t_next := time - 1; end when; equation if delaySignal then y = time >= t_next; else y = false; end if; end OnDelay;

Automatically generated Mon Sep 11 16:11:56 2017.