Edge

block Edge "Output y is true, if the input u has a rising edge (y = edge(u))"
    parameter Boolean pre_u_start = false "Start value of pre(u) at initial time";

    extends Blocks.Interfaces.partialBooleanSISO;
initial equation
    pre(u) = pre_u_start;
equation
    y = edge(u);

    annotation (
        defaultComponentName = "edge1",
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Text(
                    extent = {
                        {-90, 40}, 
                        {90, -40}},
                    textString = "edge")}),
        Documentation(info = "<html>\n<p>\nThe output is <strong>true</strong> if the Boolean input has a rising edge\nfrom <strong>false</strong> to <strong>true</strong>, otherwise\nthe output is <strong>false</strong>.\n</p>\n</html>"));
end Edge;