Enabled Resettable Delay - Delay input signal by fixed or variable sample periods when external Enable signal

  is true and external Reset signal is false - Simulink ([original](https://www.mathworks.com/help/hdlcoder/ref/enabledresettabledelay.html)) ([raw](?raw))

Delay input signal by fixed or variable sample periods when external Enable signal is true and external Reset signal is false

Since R2024b

Libraries:
HDL Coder / Discrete
Simulink / Discrete

Description

The Enabled Resettable Delay block delays the input signal by a number of time steps when the Enable signal is true and Reset signal is false. When the Reset signal is true, the state and output signal take the value of the Initial condition parameter. The block supports:

Ports

Input

expand all

Input data signal delayed according to parameters settings.

Data Types: half | single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | string | Boolean | fixed point | enumerated | bus

Delay length specified as inherited from an input port. Enabled when you select the Delay length: Source parameter as Input port.

Data Types: half | single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | fixed point

Enable signal that enables or disables execution of the block. To create this port, select the Show enable port parameter.

Data Types: Boolean

External signal that resets execution of the block to the initial condition. To create this port, select the External reset parameter.

Data Types: Boolean

Initial condition specified as inherited from an input port. Enabled when you select the Initial Condition: Source parameter asInput port.

Data Types: half | single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fixed point | bus

Output

expand all

Output signal that is the input signal delayed by the length of time specified by the parameter Delay length. The initial value of the output signal depends on several conditions. See Delay.

Data Types: half | single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | string | Boolean | fixed point | enumerated | bus

Parameters

expand all

To edit block parameters interactively, use theProperty Inspector. From the Simulink® Toolstrip, on the Simulation tab, in thePrepare gallery, select Property Inspector.

Main

Specify whether to enter the delay length directly on the dialog box (fixed delay) or to inherit the delay from an input port (variable delay).

Specify the scalar delay length as a real, non-negative integer. An out-of-range or non-integer value in the dialog box (fixed delay) returns an error. An out-of-range value from an input port (variable delay) casts it into the range. A noninteger value from an input port (variable delay) truncates it to the integer.

Programmatic Use

Block Parameter:DelayLengthSource
Type: character vector
Values: 'Dialog' |'Input port'
Default:'Dialog'
Block Parameter:DelayLength
Type: character vector
Values: scalar
Default: '2'
Block Parameter:DelayLengthUpperLimit
Type: character vector
Values: scalar
Default: '100'

Specify whether to enter the initial condition directly on the dialog box or to inherit the initial condition from an input port.

Programmatic Use

Block Parameter:InitialConditionSource
Type: character vector
Values: 'Dialog' |'Input port'
Default:'Dialog'
Block Parameter:InitialCondition
Type: character vector
Values: scalar
Default: '0.0'

Specify whether the block performs sample- or frame-based processing:

Use Input processing to specify whether the block performs sample- or frame-based processing. For more information about these two processing modes, see Sample- and Frame-Based Concepts (DSP System Toolbox).

Programmatic Use

Block Parameter:InputProcessing
Type: character vector
Values: 'Columns as channels (frame based)' | 'Elements as channels (sample based)'
Default: 'Elements as channels (sample based)'

Select to use a circular buffer for storing the state in simulation and code generation. Otherwise, an array buffer stores the state.

Using a circular buffer can improve execution speed when the delay length is large. For an array buffer, the number of copy operations increases as the delay length goes up. For a circular buffer, the number of copy operations is constant for increasing delay length.

If one of the following conditions is true, an array buffer always stores the state because a circular buffer does not improve execution speed.

Programmatic Use

Block Parameter:UseCircularBuffer
Type: character vector
Values: 'off' |'on'
Default: 'off'

Select to increase the delay length from zero to the lower limit for theInput processing mode.

Selecting this check box prevents direct feedthrough from the input port,u, to the output port. However, this check box cannot prevent direct feedthrough from the initial condition port, x0, to the output port.

Dependency

To enable this parameter, set Delay length: Source toInput port.

Programmatic Use

Block Parameter:PreventDirectFeedthrough
Type: character vector
Values: 'off' |'on'
Default: 'off'

Select to remove code that checks for out-of-range delay length.

Check Box Result When to Use
Selected Generated code does not include conditional statements to check for out-of-range delay length. For code efficiency
Cleared Generated code includes conditional statements to check for out-of-range delay length. For safety-critical applications

Dependency

To enable this parameter, set Delay length: Source toInput port.

Programmatic Use

Block Parameter:RemoveDelayLengthCheckInGeneratedCode
Type: character vector
Values: 'off' |'on'
Default: 'off'

Specify whether to produce a warning or error when the input d is less than the lower limit or greater than the Delay length: Upper limit. The lower limit depends on the setting for Prevent direct feedthrough.

Options for the diagnostic include:

Dependency

To enable this parameter, set Delay length: Source toInput port.

Programmatic Use

Block Parameter:DiagnosticForDelayLength
Type: character vector
Values: 'None' |'Warning' 'Error'
Default: 'None'

Select to control execution of this block with an enable port. The block is considered enabled when the input to this port is nonzero, and is disabled when the input is 0. The value of the input is checked at the same time step as the block execution.

Programmatic Use

Block Parameter: ShowEnablePort
Type: character vector
Values: 'off' | 'on'
Default: 'on'

Specify the trigger event to use to reset the states to the initial conditions.

Reset Mode Behavior
None No reset
Rising Reset on a rising edge
Falling Reset on a falling edge
Either Reset on either a rising or falling edge
Level Reset in either of these cases: When the reset signal is nonzero at the current time stepWhen the reset signal value changes from nonzero at the previous time step to zero at the current time step
Level hold Reset when the reset signal is nonzero at the current time step

Programmatic Use

Block Parameter:ExternalReset
Type: character vector
Values: 'None' |'Rising' 'Falling' 'Either' 'Level' 'Level hold'
Default: 'None'

Specify the time interval between samples. To inherit the sample time, set this parameter to -1. This block supports discrete sample time, but not continuous sample time.

Programmatic Use

Block Parameter:SampleTime
Type: character vector
Value: real scalar
Default: '-1'

State Attributes

Use this parameter to assign a unique name to the block state. The default is' '. When this field is blank, no name is assigned. When using this parameter, remember these considerations:

This parameter enables State name must resolve to Simulink signal object when you click Apply.

For more information, see C Data Code Interface Configuration for Model Interface Elements.

Programmatic Use

Block Parameter: StateName
Type: character vector
Values: unique name
Default: ''

Specify whether state names are required to resolve to signal objects. If selected, the software generates an error at run time if you specify a state name that does not match the name of a signal object.

Selecting this parameter disables the Code generation storage class parameter.

Dependencies

Enabled when you specify a value for the State name parameter and set the Signal resolution model configuration parameter to a value other than None.

Programmatic Use

Block Parameter:StateMustResolveToSignalObject
Type: character vector
Values: 'off' |'on'
Default: 'off'

Extended Capabilities

expand all

HDL Coder™ provides configuration options that affect HDL implementation and synthesized logic.

Block Parameter Setting Description
Set External reset toLevel. Generates a reset port in the HDL code.
Select Show enable port. Generates an enable port in the HDL code.
For Initial condition, set Source toDialog and enter the value. Specifies an initial condition for the block.
Set Input processing to Columns as channels (frame based) or Elements as channels (sample based). Expects vector input data, where each element of the vector represents a sample in time.

Additional Settings When Using State Control Block

If you use a State Control block with the Delay block inside a subsystem in your Simulink model, use these additional settings.

Block Parameter Setting Description
Set External reset to Level hold for Synchronous mode andLevel for Classic mode of the State Control block. Generates a reset port in the HDL code.
Set Delay length to zero for a Delay block with an external enable port. Treated as a wire in only Synchronous mode of theState Control block.
Set Delay length to zero for a Delay block with an external reset port. Treated as a wire in Synchronous andClassic modes of the State Control block.

For more information about the State Control block, see State Control.

HDL Architecture

This block has one default HDL architecture.

HDL Block Properties

AllowDelayDistribution Allow delay to be distributed or absorbed during the distributed pipelining and delay absorption optimizations. The default isinherit. For more details, see AllowDelayDistribution.
InputPipeline Number of input pipeline stages to insert in the generated code. Distributed pipelining and constrained output pipelining can move these registers. The default is0. For more details, see InputPipeline.
OutputPipeline Number of output pipeline stages to insert in the generated code. Distributed pipelining and constrained output pipelining can move these registers. The default is0. For more details, see OutputPipeline.
ResetType Suppress reset logic generation. The default is default, which generates reset logic. See also ResetType.
UseRAM Map delays to RAM instead of registers. The default is off. See also UseRAM.

Variable Integer Delay Support

Complex Data Support

This block supports code generation for complex signals.

Restrictions

Version History

Introduced in R2024b