> 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/oplnk.md).

# OpLnk

## Description

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-eff03c0e32ed9bc9bfeadeebe20b65908e1680f4%2Fed5fff6f-6bad-427e-a98d-a2295b5163f0.jpg?alt=media" alt=""><figcaption></figcaption></figure>

The **OpLnk** block, located in the **RT-LAB I/O/Opal-RT/Common** library, is used together with an [OpCtrl](https://www.opal-rt.com/docs/rt-lab/simulink-blocks-reference/rt-lab-i-o-library/opctrl.md) block to provide the interface between an RT‑LAB model and the FPGA installed in the simulator or expansion unit. In models where **multiple subsystems access the same FPGA**, only one subsystem contains the **OpCtrl** block, which owns and controls the FPGA. Additional subsystems use **OpLnk** blocks to link to that OpCtrl instance and share access to the FPGA.

Within its subsystem, the **OpLnk** block is responsible for **associating functional I/O blocks with the FPGA controlled by the referenced OpCtrl instance**.

## Mask parameters

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-499c10f2869a9eeb3b70a8f0f3dfb1f3859d18fa%2F6e95d566-fc65-42d9-a684-43db9cded70e.jpg?alt=media" alt="" width="335"><figcaption></figcaption></figure>

<table><thead><tr><th width="158.75">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Controller Name</strong></td><td>Unique identifier for this <strong>OpLnk</strong> block. Functional I/O blocks must reference this <strong>Controller Name</strong> to bind themselves to this <strong>OpLnk</strong> instance.</td></tr><tr><td><strong>Board ID</strong></td><td>Identifies the simulator or expansion unit controlled by this <strong>OpLnk</strong> block. Each unit is assigned a unique <strong>chassis index</strong>. Set the <strong>Board ID</strong> to match the chassis index specified in the <strong>System Description Document</strong>. For a simulator, the <strong>Board ID</strong> is typically <code>0</code>.</td></tr><tr><td><strong>Primary Bitstream FileName</strong></td><td>Specifies the name of the bitstream <code>.bin</code> to program before the model is loaded. Both <strong>bitstream files</strong> (<code>.bin</code> and <code>.conf</code>) provided with your system must be copied in the model folder. <strong>Do not rename bitstream files</strong>, as their naming convention is critical for correct operation.</td></tr><tr><td><strong>Sample Time (s)</strong></td><td><p>Specifies the block sample time, in seconds. A value of <code>0</code> sets a continuous sample time, inherited from the parent subsystem. A value of <code>−1</code> specifies an inherited sample time from the model.</p><p>The <strong>OpLnk</strong> block and its associated functionality blocks and must execute at the same <strong>sample time</strong>.</p></td></tr><tr><td><strong>Board Type</strong></td><td>Specifies the FPGA board to control. Simplifies switching between boards. Must match the FPGA board in the bitstream filename.</td></tr></tbody></table>

## Inputs

This block has no inputs.

## Outputs

<table><thead><tr><th width="136">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>Error</strong></td><td><p>Outputs error codes:</p><ul><li><code>0</code>: No error.</li><li><code>-1</code>: FPGA board not detected.</li><li><code>-2</code>: Timeout waiting for a synchronization signal. If in <strong>Slave</strong> mode, verify the RTSI synchronization signal connection.</li><li><code>-3</code>: Overrun detected.</li><li><code>-10</code>: Indicates a hardware mismatch error.</li></ul></td></tr><tr><td><strong>IDs</strong></td><td>Returns hardware identification codes for all I/O modules installed in the associated simulator or expansion unit. Empty slots return <strong>255</strong> (<code>0xFF</code>).</td></tr></tbody></table>

## Characteristics and limitations

| Characteristic           | Value                 |
| ------------------------ | --------------------- |
| **Operating mode**       | Hardware synchronized |
| **Direct feedthrough**   | No                    |
| **Discrete sample time** | No                    |
| **XHP support**          | Yes (XHP mode only)   |
| **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/oplnk.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.
