> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/rt-lab/simulink-blocks-reference/rt-events-library/rte-delay.md).

# RTE Delay

## Description

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-8af19d9f980981d83ff2b3bd92c62adb8b2e9055%2FRTE_delay_block.png?alt=media" alt=""><figcaption></figcaption></figure>

The **RTE Delay** block, located in the **RT-EVENTS/Discrete** library, delays an RTE Boolean input by a variable time. The block has two inputs: the RTE Boolean signal to delay and a delay time. During simulation, the block stores events in an internal buffer. At the start of the simulation, it outputs the value specified by the Initial Condition parameter until the simulation time exceeds the delay input. Thereafter, at each simulation step, it outputs the input signal at time equal to the current simulation time minus the delay.

The Buffer size parameter defines the maximum number of events that can be stored. Events beyond this capacity are clipped. Buffer size must be greater than or equal to zero. The Maximum number of events parameter sets how many transitions can occur during a single step; events beyond this limit are ignored and not output.

When the delay increases rapidly, the same event may be scheduled for output multiple times. Use the Ignore event output multiple times parameter to suppress these repeated outputs. When the delay decreases rapidly, some stored events may be skipped, potentially leaving the output in an invalid state.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-b04adc8515d2c32c741bbb2ed36a4d43f6fcef56%2FRTE_delay_output.png?alt=media" alt=""><figcaption><p>Multiple output of same event parameter</p></figcaption></figure>

Enabling the Skipped events compensation parameter adds a corrective rising or falling event to toggle the output to a valid state.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-6f90aa07f2afe6888d0c73316fd8b10e6534864b%2FRTE_delay_event.png?alt=media" alt=""><figcaption><p>Skipped Events Compensation parameter</p></figcaption></figure>

## Mask parameters

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-49feb0027384a07c788c0449b0b70320ac3ab7f8%2FRTE_delay_mask.png?alt=media" alt="" width="317"><figcaption></figcaption></figure>

<table><thead><tr><th width="280.4000244140625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Ignore event output multiple times</strong></td><td>When enabled, the block ignores events that should be output multiple times.</td></tr><tr><td><strong>Skipped events compensation</strong></td><td>When enabled, the block compensates for skipped events.</td></tr><tr><td><strong>Initial Condition</strong></td><td>Initial state condition output before the first event is detected.</td></tr><tr><td><strong>Buffer size</strong></td><td>Number of events the block can store in memory.</td></tr><tr><td><strong>Maximum number of events</strong></td><td>The maximum number of events or transitions that can occur during a single step. Over this number, events are ignored and not output.</td></tr></tbody></table>

## Inputs

<table><thead><tr><th width="279.60003662109375">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>Input (RTE Boolean)</strong></td><td>RTE Boolean signal to delay.</td></tr><tr><td><strong>Delay (Double)</strong></td><td>Delay signal.</td></tr></tbody></table>

## Outputs

<table><thead><tr><th width="279.5999755859375">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>Output (RTE Boolean)</strong></td><td>Delayed RTE Boolean signal.</td></tr></tbody></table>

## Characteristics and limitations

| Characteristic     | Value                        |
| ------------------ | ---------------------------- |
| Direct Feedthrough | Yes                          |
| Sample time        | Inherited and fixed discrete |
| Work offline       | Yes                          |
| Dimensionalized    | Yes                          |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/rt-lab/simulink-blocks-reference/rt-events-library/rte-delay.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
