Change

block Change "Output y is true, if the input u has a rising or falling edge (y = change(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 = change(u);

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