This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Triggered Delay Component

The following example implements a triggered delay component:

component Triggered
   inputs
      u = 0; % input signal
      triggered = 0; % control signal
   end
   variables(Event=true)
      x = 0;
   end
   outputs
      y = 0;
   end
   events
      when edge(triggered>0)
        x = u;
      end
   end
   equations
      y == x;
   end
end

When the control signal becomes positive, the event variable x gets updated to the current value of the input signal u. Output y outputs the value of x. Therefore, the output signal y gets updated to the current value of the input signal u on the rising edge of the control signal, and then holds that value between the events.

Related Examples

More About