> 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-lab-i-o-library/loadin.md).

# LoadIn

## Description

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-7e0622e8ec30d05adfd3fc9478dc5433b69c2b85%2F37ce98da-af9d-4481-8de6-c88e99f5b579.jpg?alt=media" alt=""><figcaption></figcaption></figure>

The **LoadIn** block, located in the **RT-LAB I/O/Opal-RT/Common** library, sends raw data **asynchronously** **directly to the FPGA**, bypassing standard I/O unpacking blocks. Data is transferred through the FPGA **LoadIN ports** and is intended for use cases where the bitstream logic consumes **configuration‑type** (non time‑step‑critical) raw data words. Unlike DataIN, LoadIN transfers rely on a **slower CPU-FPGA communication link** and are **not meant to be used at every simulation time step**; doing so can reduce simulation performance. Each LoadIN port supports up to **250 32‑bit data words**, enabling asynchronous exchange of raw data between the model and the FPGA logic implemented on the board.

Correct use of this functionality requires a clear understanding of the **bitstream logic** that processes the transmitted data. An incorrect data frame configuration may result in **invalid or undefined FPGA behavior**. Refer to the **System Description Document** for details on the bitstream implementation.

## Mask parameters

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-0bf9b535361a2b089ed51e9dba12ecf9cf12bc91%2F4ea7738e-7876-4d0c-935b-e3295931bfc6.jpg?alt=media" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="194.333251953125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Controller Name</strong></td><td>Specifies the <strong>OpCtrl</strong> block this block is bound to. Enter the same <strong>Controller Name</strong> as defined in the corresponding <strong>OpCtrl</strong> block.</td></tr><tr><td><strong>LoadIn port number</strong></td><td>Specifies which LoadIn port this block uses to send raw data words. Configure the <strong>LoadIn port number</strong> according to your <strong>System Description Document</strong> or <code>.conf</code> file.</td></tr><tr><td><strong>LoadIn port width</strong></td><td>Specifies the maximum number of data words that will be sent to the FPGA at each calculation step.</td></tr><tr><td><strong>LoadIn port type</strong></td><td><p>Selects the data type of the LoadIn input port. Available options are <strong>uint32</strong> and <strong>double</strong>.</p><p>When <strong>double</strong> is selected, the driver <strong>typecasts values from double to uint32</strong> before transmission. As a result, input values are limited to the valid range <strong>0 ≤ x ≤ 2³² − 1</strong>.</p><p>Selecting <strong>uint32</strong> avoids typecasting and provides <strong>optimal performance</strong>.</p></td></tr></tbody></table>

## Inputs

<table><thead><tr><th width="137.5">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>Enable</strong></td><td>Controls when data is sent to the FPGA. When this input is <code>1</code>, the <strong>Data</strong> input is sent to the board; otherwise, no data is sent.</td></tr><tr><td><strong>Data</strong></td><td>Inputs data to be sent to the FPGA. No scaling or formatting is applied. If the <strong>LoadIn</strong> <strong>port type</strong> parameter is set to <strong>double</strong>, values are <strong>typecast from double to uint32</strong> before being transmitted.</td></tr></tbody></table>

## Outputs

<table><thead><tr><th width="148.6666259765625">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>Status</strong></td><td><p>Outputs the block status:</p><ul><li><code>0</code>: No error.</li><li><code>-1</code>: Block not associated with an <strong>OpCtrl</strong> block (check the <strong>Controller Name</strong> parameter), or FPGA initialization failure.</li><li><code>-2</code>: Internal memory initialization failure.</li></ul></td></tr></tbody></table>

## Characteristics and limitations

| Characteristic           | Value     |
| ------------------------ | --------- |
| **Direct Feedthrough**   | No        |
| **Discrete sample time** | Inherited |
| **XHP support**          | Yes       |
| **Work offline**         | No        |


---

# 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-lab-i-o-library/loadin.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.
