> 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/hypersim/model-and-simulation/create-oem-controller-code/oem-controller-integration-worflow.md).

# OEM Controller Integration Workflow

OEM controller integration in HYPERSIM follows a **structured process**, from offline validation to real-time deployment.

The workflow typically involves collaboration between the OEM, OPAL-RT, and the end user, as outlined below.

{% stepper %}
{% step %}

## Prepare the power system model

The simulation model is first prepared in HYPERSIM. When required, OPAL-RT or the end user uses dedicated conversion tools to import the power system model from third-party environments such as PSCAD, EMTP, or other EMT tools. This ensures consistency with the original source model.
{% endstep %}

{% step %}

## Compile OEM controller for Windows

The manufacturer provides a Windows-compatible version of the controller (typically .dll, .lib, or .o files).

In numerous instances, this controller code is already available, as it is often used with offline tools like PSCAD, EMTP, or MATLAB/Simulink.
{% endstep %}

{% step %}

## Integrate controller into HYPERSIM

OPAL-RT or the user finalizes the simulation model by integrating the OEM controller using one of the supported block interfaces:

* [IEEE/CIGRÉ Standard DLL Interface](https://www.opal-rt.com/docs/hypersim/model-and-simulation/create-oem-controller-code/use-cigre-interface.md) - Recommended
* [UCM (User Code Module)](https://www.opal-rt.com/docs/hypersim/model-and-simulation/import-models-from-external-software-or-code/create-user-coded-models-ucm.md)
* [Simulink-generated code](https://www.opal-rt.com/docs/hypersim/model-and-simulation/import-models-from-external-software-or-code/import-from-simulink-hyperlink.md)
* FMI (Functional Mock-up Interface) – Coming soon

This step includes setting up signal connections, parameter configurations, and tuning execution settings such as sample time or parallel tasking.

In HYPERSIM, [variables and expressions](https://github.com/Opal-RT-Technologies/product-docs-hypersim/tree/release-2026.4/model-and-simulation/use-variables-and-expressions/README.md) enable flexible parameterization of controller blocks, including CIGRÉ-compliant DLLs, UCMs and Simulink-generated controllers. By allowing parameters to be calculated from other values or defined through logical expressions, they simplify configuration, support automation, and improve the adaptability of real-time simulation models
{% endstep %}

{% step %}

## Validate offline model

Once integrated, the model is validated in offline mode (SIL) on a Windows workstation.

The user or OPAL-RT creates test scenarios to verify the behavior of the controller and ensure that the simulation results match the expected behavior from the source environment.
{% endstep %}

{% step %}

## Compile OEM controller for Linux (Real-time use)

After offline validation, the manufacturer compiles the controller code for Linux real-time execution. This may involve creating library files (.so or .a) using one of the following infrastructures:

* WSL (Windows Subsystem for Linux)
* A virtual machine (VM) running Linux
* An OPAL-RT real-time simulator with a native toolchain.
  {% endstep %}

{% step %}

## Validate real-time performance

OPAL-RT or the user validates the complete model in real time, ensuring that:

* The controller executes within the defined time budget
* Simulation results remain electrically accurate
* Task scheduling and CPU usage are acceptable. If needed, OPAL-RT works closely with the OEM to optimize performance (e.g., memory usage, execution rate, or code efficiency).
  {% endstep %}

{% step %}

## Deploy the integrated controller model

Once validated, the complete HYPERSIM model, including the integrated controller, is delivered to the OEM or end users for testing, certification, and deployment activities.
{% endstep %}
{% endstepper %}


---

# 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/hypersim/model-and-simulation/create-oem-controller-code/oem-controller-integration-worflow.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.
