On/Off Delay

Implement switch-on or switch-off delay

Library

Control and Measurements/Logic

Description

The On/Off Delay block implements the following logic when the Select type parameter is set to On delay:

  • When the input becomes true, the output becomes true after a preset time delay. The output remains true as long as the input is true.

  • When the input is false or becomes false, the output becomes false with no delay.

  • When the Initial condition of previous input parameter is set to 1, and the input is true at t = 0, the output is true with no delay.

The On/Off Delay block implements the following logic when the Select type parameter is set to Off delay:

  • When the input becomes false, the output becomes false after a preset time delay. The output remains false as long as the input is false.

  • When the input is true or becomes true, the output is true with no delay.

  • When the Initial condition of previous input parameter is set to 0, and the input is false at t = 0, the output is false with no delay.

Dialog Box and Parameters

Select type

Select between On delay or Off delay type.

Time delay (s)

Specify the duration of the delay, in seconds. When the Sample time parameter is greater than 0, the time delay value must be a multiple of the sample time.

Initial condition of previous input

Specify the initial value of the previous input.

Sample time

Specify the sample time of the block, in seconds. Set to 0 to implement a continuous block.

Inputs and Outputs

The input signal must be a Boolean signal. The output is Boolean.

Characteristics

Direct FeedthroughYes
Sample TimeSpecified in the Sample Time parameter
Scalar ExpansionYes, of parameters
DimensionalizedYes
Zero-Crossing DetectionNo

Example

The power_Logicpower_Logic example shows the operation of the On/Off Delay block.

The model sample time is parameterized with the variable Ts (default value Ts = 5e-3). To simulate a continuous On/Off Delay block, specify Ts = 0 in the MATLAB® Command Window.

Was this topic helpful?