Main Content

On-Off Delay

Boolean-signal delay

  • On-Off Delay block

Simscape / Electrical / Control / General Control


The On-Off Delay block applies a delay on the Boolean input signal.

A time delay is added when a transition is detected in the input signal. This block allows you to add a time delay to the input signal when:

  • An ON transition (input change from 0 to 1) is detected,

  • An OFF transition (input signal change from 1 to 0) is detected, or

  • Either transition is detected.

The operation of the on-off delay is represented in the following figure:



expand all

Input Boolean signal.

Data Types: Boolean


expand all

Output signal with delays.

Data Types: Boolean


expand all

Specify delay time when input is ON.

Specify delay time when input is OFF.

Specify initial state.

Time between consecutive block executions. During execution, the block produces outputs and, if appropriate, updates its internal state. For more information, see What Is Sample Time? and Specify Sample Time.

For discrete-time operation, set the sample time to a positive value. For continuous-time operation, set the sample time to 0.

If this block is in a masked subsystem, or other variant subsystem that allows either continuous and discrete operation, promote the sample time parameter. Promoting the sample time parameter ensures correct switching between the continuous and discrete implementations of the block. For more information, see Promote Block Parameters on a Mask.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2018b