> 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-rate-transition.md).

# RTE Rate Transition

## Description

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

The **RTE Rate Transition** block, located in the **RT-EVENTS/Signal Attribute** library, transfers RT-EVENTS Boolean signals between blocks that operate at different sample rates in RT-LAB. It connects the output of a block running at one rate to the input of a block running at another rate to exchange data between real-time subsystems with different rates.

The block behavior depends on the relative rates of the connected ports:

* Fast-to-slow transition: acts as a zero-order hold.
* Slow-to-fast transition: acts as a unit delay.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-5e94383db76906e0986391c4e8a4f3deaa980084%2FRTE_rate_transition_diagram.png?alt=media" alt=""><figcaption><p>Block acts as a zero-order hold block or acts as a unit delay block</p></figcaption></figure>

### **Compensation for skipped events**

When the number of events in the input RTE signal exceeds the Maximum number of events (MaxEvent), extra events stored in memory are ignored. This can cause the last output state to differ from the state that would result if all events were processed. When Skipped events compensation is enabled, the block adds a compensating rising or falling event to toggle the output state so that the final state matches the state that would be reached if all events were considered.

For example, consider a **Fast-to-Slow transition** with MaxEvent = 5, where the fast rate is 1 second and the slow rate is 2 seconds. The figure below shows how compensation affects the event sequence.

* With compensation enabled, the fourth event (falling edge) of the second fast step is carried over and applied at the beginning of the second slow step.
* With compensation disabled, the block suppresses the first event in the slow step because the output is already in the corresponding state.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-b2730507f8b1127e26ad94001bd0fba843e6f030%2FRTE_rate_transition_output_curve.png?alt=media" alt="" width="479"><figcaption><p>Output in case of disabled or enabled compensation</p></figcaption></figure>

In **slow-to-fast transitions**, data transfers occur as soon as new data is available from the source block and the receiving block is ready. The data becomes available at the next fast step.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-d7e2d108df01d7104a42a3d4e04f53d6aa9075f9%2FRTE_rate_transition_output_curve2.png?alt=media" alt="" width="563"><figcaption><p>Output in case of disabled or enabled compensation</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-7278f2174434b62a58dfaa409aefe52f9bd416fb%2FRTE_rate_transition_mask.png?alt=media" alt="" width="314"><figcaption></figcaption></figure>

<table><thead><tr><th width="259.60003662109375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Skipped events compensation</strong></td><td>When enabled, the block compensates for skipped events when the maximum number of events is reached. Default: Disabled.</td></tr><tr><td><strong>Maximum number of events</strong></td><td>Maximum number of events (transitions) that can be output during a single step. Events beyond this limit are ignored. Must be an integer. Default: 4.</td></tr><tr><td><strong>Output sample time</strong></td><td>Output rate to which the input rate is converted. Must be a multiple of the model sample time (or real-time subsystem sample time). Default: Ts.</td></tr></tbody></table>

## Inputs

<table><thead><tr><th width="260.4000244140625">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>Input (RTE Boolean)</strong></td><td>Type: RTE Boolean signal<br>Size: Dynamic<br>Input rate: Inherit</td></tr></tbody></table>

## Outputs

<table><thead><tr><th width="259.60003662109375">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>Output (RTE Boolean)</strong></td><td>Type: RTE Boolean signal<br>Size: Same as input Output<br>Rate: Multiple of model sample time</td></tr></tbody></table>

## Characteristics and limitations

| Characteristic     | Value                                                              |
| ------------------ | ------------------------------------------------------------------ |
| Direct Feedthrough | No for slow-to-fast transitions. Yes for fast-to-slow transitions. |
| Sample time        | 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-rate-transition.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.
