.ModelicaReference.Operators.'edge()'

Information

Indicate rising edge

Syntax

edge(b)

Description

Is expanded into "(b and not pre(b))" for Boolean variable b. The same restrictions as for the pre operator apply (e.g., not to be used in function classes).

Examples

model RisingEdge
  Boolean u;
  Integer i;
equation
  u = Modelica.Math.sin(time) > 0.5;
  when edge(u) then
    i = pre(i) + 1;
  end when;
end RisingEdge;
Simulation result
Generated at 2019-12-11T02:39:08Z by OpenModelicaOpenModelica 1.16.0~dev-72-gc3a557c using GenerateDoc.mos