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

# OpDilInterface

## Description

{% columns %}
{% column %}

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-f347403c3bb5c271ecbbf96255bb79dff8746d66%2FRTL_opdilinterface_block.png?alt=media" alt=""><figcaption><p>OpDilInterface block before any initialization</p></figcaption></figure>
{% endcolumn %}

{% column %}

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-b705268c08f884f292db9934a4a22eb139a6778c%2FRTL_opdilinterface_file_block.png.png?alt=media" alt=""><figcaption><p>OpDilInterface block after selecting a configuration json file</p></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

**OpDilInterface**, located in the **RT-LAB** library, connects a model to an I/O configured in RT-LAB via the I/O Interfaces mechanism. It uses the I/O configuration JSON file generated by RT-LAB when an I/O interface is created and saved. The configuration files are stored in: \<project\_path>/configurations/SyncExchangerRegistry/DriverConfigs/.

The block exchanges data through buses. Signals from the I/O become inputs to the model, and signals from the model become inputs to the I/O. The structure and data types of both input and output buses must match the definitions in the I/O configuration JSON file.

**Recommended workflow**

* Create and save the I/O interface in RT-LAB to generate the JSON at \<project\_path>/configurations/SyncExchangerRegistry/DriverConfigs/.
* In the model, add an OpDilInterface block, open its mask, select the corresponding JSON file, and apply.
* In Simulink, press Ctrl+D to update the block based on the JSON configuration.
* Use the Bus Editor in Simulink to inspect the expected input and output bus structures.

{% hint style="danger" %}
The structure expected in input must be respected (order and type of signals inside the bus)

After modifying the I/O interface in RT-LAB, update the model in MATLAB (Ctrl+D) or perform a full compilation in RT-LAB to ensure the configuration JSON is refreshed for the simulation.
{% endhint %}

**Bus handling guidance**

* To build the input bus, you can use a Bus Assignment block. Drive its first input with a Constant block configured to output the expected bus format.
* If you use a Bus Creator (or a cascade of Bus Creators), set its Output data type to “Inherit: auto”.
* Use a Bus Selector to extract signals from the block’s output bus.
* Compile the Simulink model at least once (Ctrl+D) before connecting or selecting bus elements.

## Mask parameters

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

<table><thead><tr><th width="219.4000244140625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>I/O Configuration file</strong></td><td>Path to the JSON file generated using RT-LAB “I/O Interfaces”. Files are located in &#x3C;project_path>/configurations/SyncExchangerRegistry/DriverConfigs/*.json.</td></tr></tbody></table>

## Inputs

<table><thead><tr><th width="220.99993896484375">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>Bus input</strong></td><td>Bus containing the data expected at the input of the I/O interface. Elements must match the items listed under the ‘bus_in’ tag in the I/O configuration JSON file, including order and data types.</td></tr></tbody></table>

## Outputs

<table><thead><tr><th width="221.00006103515625">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>Bus output</strong></td><td>Bus containing the data provided by the I/O interface. Elements correspond to the items listed under the ‘bus_out’ tag in the I/O configuration JSON file and can be accessed with a Bus Selector in Simulink.</td></tr></tbody></table>

## Characteristics and limitations

<table><thead><tr><th width="221.00006103515625">Characteristic</th><th>Value</th></tr></thead><tbody><tr><td>Direct Feedthrough</td><td>Yes</td></tr><tr><td>Discrete sample time</td><td>Yes</td></tr><tr><td>XHP support</td><td>Yes</td></tr><tr><td>Work offline</td><td>No</td></tr></tbody></table>


---

# 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-library/opdilinterface.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.
