> 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/use-cigre-interface.md).

# Use CIGRÉ Interface

## Overview

HYPERSIM supports **OEM controller code integration** through the standardized **IEEE/CIGRÉ B4.82 interface**. Under this approach, controller logic is distributed as a **dynamic library (.dll or .so)** that follows a defined interface for function calls and data exchange. In HYPERSIM, compliant libraries are automatically wrapped in a **User Code Module (UCM)**, enabling seamless execution within the real-time simulation environment.

The library must comply with the IEEE/CIGRÉ DLL Modeling Method V1.1 specification and expose the required functions and data structures. During simulation, HYPERSIM loads the library and invokes the controller at each simulation time step.

The same DLL source code is used for both:

* **Offline simulation** on Windows
* **Real-time simulation** on opalrtlinux simulators

with only the compilation options and toolchains changing between environments.

For detailed instructions on integrating and customizing a CIGRÉ-compliant controller block, refer to the [CIGRÉ Interface block](https://www.opal-rt.com/docs/hypersim/library-blocks-reference/control-interfaces/cigre-interface.md) documentation.

## IEEE/CIGRÉ API functions

The DLL must export the following C functions with \_\_cdecl calling convention on Windows (standard C calling convention on Linux).

<table data-search="false"><thead><tr><th width="120">Function</th><th>Description</th></tr></thead><tbody><tr><td><strong>Model_GetInfo</strong></td><td>Returns a pointer to a static IEEE_Cigre_DLLInterface_Model_Info structure:<br>- Model name and version,<br>- Number and type of inputs/outputs,<br>- Parameters and states,<br>- Preferred sample time and other configuration flags. <code>const IEEE_Cigre_DLLInterface_Model_Info* Model_GetInfo(void);</code></td></tr><tr><td><strong>Model_FirstCall</strong></td><td><p>Called once at the very beginning of the simulation. Typical responsibilities:<br>- Initialize internal variables,<br>- Allocate internal buffers (if strictly necessary),<br>- Initialize communication to other libraries or systems.</p><p><code>int32_T Model_FirstCall(IEEE_Cigre_DLLInterface_Instance* pInstance);</code></p></td></tr><tr><td><strong>Model_PrintInfo</strong></td><td><p>Called once at startup to print version, build information, and any useful diagnostics to the console/logs.</p><p><code>int32_T Model_PrintInfo(void);</code></p></td></tr><tr><td><strong>Model_CheckParameters</strong></td><td><p>Called before the simulation starts to validate parameter values supplied by HYPERSIM:<br>- Check ranges, consistency, and cross-dependencies,<br>- Return an error code if configuration is invalid.</p><p><code>int32_T Model_CheckParameters(IEEE_Cigre_DLLInterface_Instance* pInstance);</code></p></td></tr><tr><td><strong>Model_Initialize</strong></td><td><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Called within the real-time isolation environment. System calls are not permitted on a real-time simulator at this stage. See the <a href="https://www.opal-rt.com/docs/hypersim/model-and-simulation/create-oem-controller-code/real-time-performance-considerations-for-controller-code.md">Real-Time Perfomance Considerations for Controller Code</a> for more informations.</p></div><p>Called at the <strong>first simulation step</strong> (after Model_FirstCall and parameter validation). Responsible for:<br>- Computing initial output values,<br>- Initializing discrete/continuous states at simulation time t = 0.</p><p><code>int32_T Model_Initialize(IEEE_Cigre_DLLInterface_Instance* pInstance);</code></p></td></tr><tr><td><strong>Model_Iterate</strong></td><td><p><strong>Not supported by HYPERSIM</strong></p><p><code>int32_T Model_Iterate(IEEE_Cigre_DLLInterface_Instance* pInstance);</code></p></td></tr><tr><td><strong>Model_Outputs</strong></td><td><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Called within the real-time isolation environment. System calls are not permitted on a real-time simulator at this stage. See the <a href="https://www.opal-rt.com/docs/hypersim/model-and-simulation/create-oem-controller-code/real-time-performance-considerations-for-controller-code.md">Real-Time Perfomance Considerations for Controller Code</a> for more informations.</p></div><p>Called at each steps to:<br>- Read the current inputs,<br>- Execute the controller algorithm over the step,<br>- Update internal states,<br>- Compute the new outputs.</p><p><code>int32_T Model_Outputs(IEEE_Cigre_DLLInterface_Instance* pInstance);</code></p></td></tr><tr><td><strong>Model_Terminate</strong></td><td><p>Called at the end of the simulation:<br>- Free internal allocations (if any),<br>- Close files or network connections,<br>- Perform any final logging.</p><p><code>int32_T Model_Terminate(IEEE_Cigre_DLLInterface_Instance* pInstance);</code></p></td></tr></tbody></table>

### Execution sequence during a HYPERSIM simulation run

{% stepper %}
{% step %}

#### DLL loading and model discovery

* HYPERSIM loads the DLL into memory.
* HYPERSIM calls Model\_GetInfo() to query the model metadata and create a model instance.
* Optional: In the case that the controller is set to run in a separate task, a RT thread is created and isolated on a dedicated RT core. See the “Run controller code in a separate task” parameter in CIGRÉ Interface .
  {% endstep %}

{% step %}

#### Parameter configuration

* HYPERSIM allocates and initializes an IEEE\_Cigre\_DLLInterface\_Instance structure.
* HYPERSIM sets:
  * Parameter values,
  * Sample time,
  * Pointers for inputs, outputs, states, etc.
    {% endstep %}

{% step %}

#### Model initialization

* Model\_FirstCall(pInstance) is called.
* Model\_PrintInfo() is called to log version/build information.
* Model\_CheckParameters(pInstance) is called to verify parameter values.
* Model\_Initialize(pInstance) is called to compute initial states and outputs at time 0.

{% hint style="danger" %}
Model\_Initialize is called within the real-time isolation environment. **System calls are not permitted on a real-time simulator at this stage.**
{% endhint %}
{% endstep %}

{% step %}

#### Simulation loop (for each time step k)

* HYPERSIM updates input values in the instance structure.
* HYPERSIM calls Model\_Outputs(pInstance)
* HYPERSIM reads outputs from the instance structure and uses them in the EMT network equations.

{% hint style="danger" %}
On a real-time simulator, the simulation is isolated from the rest of the operation system to optimise the performance. **System calls are not permitted during the simulation loop**.
{% endhint %}
{% endstep %}

{% step %}

#### End of simulation

HYPERSIM calls Model\_Terminate(pInstance).
{% endstep %}
{% endstepper %}

## Write a controller code

The controller logic must be wrapped into a pure C API compatible with the standard interface. Internally you may use C or C++, but the exported functions must have C linkage and avoid exceptions crossing the DLL boundary.

Core principles:

* Deterministic execution time (for real-time),
* In the simulation loop (Model\_Outputs):
  * No blocking operations
  * No operation system calls (e.g. reading or writing to a file)
  * No dynamic allocation (allocate once during initialization if needed)
* Thread-safe design if multiple instances are used simultaneously

### Metadata and DLL identification

At the core of the model interface is the static IEEE\_Cigre\_DLLInterface\_Model\_Info structure:

* Typically defined as a global const in a .c or .cpp file in your project.
* Filled at compile-time:
  * modelName, modelVersion,
  * Number of input and output signals,
  * Number and type of parameters and states,
  * Supported function set, timing mode, etc.

#### Best practices

* Use a clear, stable model name; keep it in sync with your documentation.
* Increment the version field when the interface (parameters, I/O) changes.
* Ensure model metadata matches exactly what your code expects (e.g., number of inputs).

<details>

<summary><strong>Example</strong></summary>

{% code overflow="wrap" lineNumbers="true" %}

```
DLLEXPORT const IEEE_Cigre_DLLInterface_Model_Info* FUNCALLTYPE Model_GetInfo() {
static IEEE_Cigre_DLLInterface_Signal InputSignals[] = {
    [0] = {
        .Name = "Vdc",
        .Description = "DC link voltage",
        .Unit = "V",
        .DataType = IEEE_Cigre_DLLInterface_DataType_real64_T,
        .Width = 1
    },
    [1] = {
        .Name = "Vd",
        .Description = "d-axis voltage",
        .Unit = "pu",
        .DataType = IEEE_Cigre_DLLInterface_DataType_real64_T,
        .Width = 1
    },
    [2] = {
        .Name = "Vq",
        .Description = "q-axis voltage",
        .Unit = "pu",
        .DataType = IEEE_Cigre_DLLInterface_DataType_real64_T,
        .Width = 1
    },
    [3] = {
        .Name = "wt",
        .Description = "Angle (omega * time)",
        .Unit = "rad",
        .DataType = IEEE_Cigre_DLLInterface_DataType_real64_T,
        .Width = 1
    }
};

static IEEE_Cigre_DLLInterface_Signal OutputSignals[] = {
    [0] = {
        .Name = "Modind",
        .Description = "Modulation index",
        .Unit = "pu",
        .DataType = IEEE_Cigre_DLLInterface_DataType_real64_T,
        .Width = 1
    },
    [1] = {
        .Name = "Vref",
        .Description = "Reference phase voltages (abc)",
        .Unit = "V",
        .DataType = IEEE_Cigre_DLLInterface_DataType_real64_T,
        .Width = 3
    }
};

static IEEE_Cigre_DLLInterface_Parameter ModelParameters[] = {
    [0] = {
        .Name = "SecondaryNominalVoltage",
        .GroupName = "VoltageSettings",
        .Description = "Nominal voltage of the secondary side",
        .Unit = "V",
        .DataType = IEEE_Cigre_DLLInterface_DataType_real64_T,
        .FixedValue = 1,
        .DefaultValue = { .Real64_Val = 480.0 },
        .MinValue     = { .Real64_Val = 0.0 },
        .MaxValue     = { .Real64_Val = 1.0e12 }
    },
    [1] = {
        .Name = "LimUp",
        .GroupName = "VoltageLimits",
        .Description = "Upper voltage limit",
        .Unit = "V",
        .DataType = IEEE_Cigre_DLLInterface_DataType_real64_T,
        .FixedValue = 0,
        .DefaultValue = { .Real64_Val = 1.0 },
        .MinValue     = { .Real64_Val = 0.0 },
        .MaxValue     = { .Real64_Val = 1.0e12 }
    },
    [2] = {
        .Name = "LimLo",
        .GroupName = "VoltageLimits",
        .Description = "Lower voltage limit",
        .Unit = "V",
        .DataType = IEEE_Cigre_DLLInterface_DataType_real64_T,
        .FixedValue = 0,
        .DefaultValue = { .Real64_Val = 0.0 },
        .MinValue     = { .Real64_Val = 0.0 },
        .MaxValue     = { .Real64_Val = 1.0e12 }
    }
};

static IEEE_Cigre_DLLInterface_Model_Info Model_Info = {
    .DLLInterfaceVersion = { 1, 1, 0, 0 },                  // API version used
    .ModelName = "Vref",                                   // Controller name
    .ModelVersion = "1.0.0.0",                             // Version of the model
    .ModelDescription = "Voltage reference generator based on Vdq inputs and DC voltage", // Short description
    .GeneralInformation = "This controller computes a modulation index and a 3-phase voltage reference (abc) from dq voltages, DC link voltage, and angle.", // Overview
    .ModelCreated = "2025-05-15",                          // Creation date
    .ModelCreator = "Jean-Nicolas Brunet",                 // Creator name
    .ModelLastModifiedDate = "2025-05-15",                 // Last modification date
    .ModelLastModifiedBy = "Jean-Nicolas Brunet",          // Last modified by
    .ModelModifiedComment = "Initial version created for modulation reference control", // Comment
    .ModelModifiedHistory = "v1.0.0.0 - 2025-05-15 - Initial implementation of Vref controller", // History
    .FixedStepBaseSampleTime = 5e-5,                       // Sample time (e.g., 50 µs)

    // Input ports
    .NumInputPorts = 4,
    .InputPortsInfo = InputSignals,

    // Output ports
    .NumOutputPorts = 2,
    .OutputPortsInfo = OutputSignals,

    // Parameters
    .NumParameters = 3,
    .ParametersInfo = ModelParameters,

    // States
    .NumIntStates = 0,
    .NumFloatStates = 0,
    .NumDoubleStates = 0
};

return &Model_Info;
```

{% endcode %}

</details>

### Initialization

#### Parameter handling and validation

Inside Model\_CheckParameters you must:

* Read the parameter values from pInstance->Parameters (or equivalent field).
* Check each parameter for:
  * Valid range (e.g., gains, time constants, limits),
  * Consistency between parameters (e.g., minimum < maximum),
  * Compatibility with the configured sample time.

On error:

* Fill pInstance->LastErrorMessage (or equivalent) with a descriptive message,
* Return a non-zero error code.

#### FirstCall and Initialize

**Model\_FirstCall** is where you can:

* Initialize internal variables not directly represented as states,
* Allocate internal buffers (only once),
* Initialize communication with external systems (if applicable).

**Model\_Initialize** is responsible for:

* Setting initial states (e.g., integrator values),
* Computing initial outputs based on initial inputs and parameters,
* Preparing the controller to start the time-stepping loop from a consistent state.

Make sure that **after Model\_Initialize**:

* All outputs are valid,
* All states contain meaningful values,
* No uninitialized memory will be used in Model\_Outputs. Because Model\_Initialize is called at the first simulation step, it runs within an isolated environment on a real-time simulator. System calls are therefore **not permitted** inside this function.

### Simulation loop

The main controller algorithm runs in Model\_Outputs. The sequence inside this function could look like this:

{% stepper %}
{% step %}

#### Read inputs

Read the input vector from the instance structure, for example:

{% code overflow="wrap" lineNumbers="true" %}

```
const Inputs * in = instance->ExternalInputs;
```

{% endcode %}
{% endstep %}

{% step %}

#### Apply controller logic

Implement your OEM control algorithm:

* Compute intermediate signals,
* Update integrator or state variables,
* Apply limiters, anti-windup, filters, etc.
  {% endstep %}

{% step %}

#### Write outputs

Set the output signals in the instance structure:

{% code overflow="wrap" lineNumbers="true" %}

```
Outputs * out = instance->ExternalOutputs;
out->Vref = computeVref(in);
```

{% endcode %}
{% endstep %}

{% step %}

#### Update state variables

If you have explicit state variables in pInstance->States, update them for the next step.
{% endstep %}
{% endstepper %}

{% hint style="danger" %}

#### **Real-time constraints**

* Do not allocate or free memory during Model\_Outputs.
* Do not perform file I/O or networking that may block.
* Avoid complex algorithms with unbounded or highly variable execution time. See the [Real-Time Perfomance Considerations for Controller Code](https://www.opal-rt.com/docs/hypersim/model-and-simulation/create-oem-controller-code/real-time-performance-considerations-for-controller-code.md) for more informations
  {% endhint %}

<details>

<summary>Example</summary>

Suppose that the following structures are defined within the DLL code:

{% code overflow="wrap" lineNumbers="true" %}

```
char ErrorMessage[1000] = "\0";
    typedef struct {
        double Vdc;
        double Vd;
        double Vq;
        double wt;
    } Inputs;
    typedef struct {
        double Modind;
        double Vref[3];
    } Outputs;
    typedef struct {
        double SecondaryNominalVoltage;
        double LimUp;
        double LimLo;
    } Parameters;
```

{% endcode %}

Model\_Outputs could look like this:

{% code overflow="wrap" lineNumbers="true" %}

```
DLLEXPORT int32_T FUNCALLTYPE Model_Outputs(IEEE_Cigre_DLLInterface_Instance* instance) {
    ErrorMessage[0] = '\0';
    const Inputs * in = instance->ExternalInputs;
    Outputs * out = instance->ExternalOutputs;
    const Parameters * p = instance->Parameters;

    calculate_modulation(in->Vdc, in->Vd, in->Vq, p->SecondaryNominalVoltage, p->LimLo, p->LimUp, in->wt, &out->Modind, &out->Vref[0], &out->Vref[1], &out->Vref[2]);

    return IEEE_Cigre_DLLInterface_Return_OK;
}
```

{% endcode %}

</details>

### End of the simulation

In Model\_Terminate:

* Release any resources allocated during Model\_FirstCall or Model\_Initialize:
  * Heap memory,
  * Communication sockets,
  * Files.
* Optionally log final information (if safe and non-blocking).
* Reset pointers in the instance structure if required by the standard.

After Model\_Terminate returns, HYPERSIM assumes the instance is no longer usable, and may unload the DLL.

## Compile the library

The same source codebase is used to build:

* A Windows DLL (.dll file) for offline simulation,
* A Linux shared library (.so file) for real-time execution on the HYPERSIM target.

In both cases, the library must export symbols with C linkage

The following **DLLEXPORT** and **FUNCALLTYPE** C macro can be used to make the export more readable:

{% code overflow="wrap" lineNumbers="true" %}

```
#if defined(_WIN64) || defined(_WIN32)
#define FUNCALLTYPE __cdecl
#elif defined(__linux) || defined(__linux__) || defined(linux)
    #if defined(__LP64) || defined(__LP64__)
    #define FUNCALLTYPE                          // Not supported, default for this platform
    #else
    #define FUNCALLTYPE __attribute((cdecl))     // 32 bit Linux build
    #endif
#else
    #error This platform is not supported.
#endif

#ifndef DLLEXPORT
    #ifdef _WIN32
        #define DLLEXPORT __declspec(dllexport)
    #else
        #define DLLEXPORT
    #endif
#endif
```

{% endcode %}

Use them in the declaration of your function, for example:

{% code overflow="wrap" lineNumbers="true" %}

```
DLLEXPORT int32_T FUNCALLTYPE Model_Outputs(IEEE_Cigre_DLLInterface_Instance* instance) {
// ...
}
```

{% endcode %}

### For offline (Windows)

#### Typical requirements

* **Compiler**: Microsoft Visual Studio (MSVC) or MinGW, depending on your environment.
* **Architecture**: x86\_64

#### Typical steps

1. Create a new DLL project in Visual Studio (or equivalent in your build system).
2. Add your source files:
   * The controller implementation,
   * The interface wrapper implementing the Model\_\* functions,
   * Any shared utility modules.
3. Add include paths for:
   * The IEEE/CIGRE interface header files,
   * External library header files if any
4. Define configuration macros if required (e.g., \_WIN32, EXPORT\_DLL\_SYMBOLS).
5. Set the output name to something explicit like OEM\_Controller\_XYZ.dll.
6. Build in **Release** mode for best performance.

#### Deliverables for offline use

* OEM\_Controller\_XYZ.dll
* Runtime dependencies such as other dynamic libraries that the DLL depends on.
* Configuration files needed in the initialization phase of the DLL.
* Optional: associated .pdb debug symbols if you want to debug inside HYPERSIM on Windows.

### For real-time (Linux)

For real-time, the same typical steps needed for Windows are also required. However, a different compiler is needed to produce binaries compatible with OPAL-RT simulators.

#### Typical requirements

* **Compiler**: GCC, G++, LLVM/Clang, INTEL, depending on your environment.
* **Architecture**: x86\_64
* **LibC version**: 2.29 or older
* **GLIBCXX version**: 3.4.9 or older
* **Recommended flags**: -fPIC -O2 -Wall
* **Target**: 64-bit .so (e.g., x64).

Respecting LibC and GLIBCXX version requirement is important. Failing to do so may result in the library not loading properly in the simulation executable.

#### Deliverables for real-time use

* OEM\_Controller\_XYZ.so
* Runtime dependencies such as other dynamic libraries that the SO file depends on.
* Configuration files needed in the initialization phase of the SO file.

#### CIGRÉ dependencies

If your CIGRÉ library depends on other .so files, it is strongly recommended to add the paths to these dependencies directly to the CIGRÉ .so RUNPATH at link time.

For example:

* If the CIGRÉ .so depends on other .so files located in the same directory, add $ORIGIN to the RUNPATH.
* If the CIGRÉ .so depends on .so files located in a subdirectory next to it, add $ORIGIN/MyFolder to the RUNPATH.

Use the linker option:

{% code overflow="wrap" lineNumbers="true" %}

```
-Wl,-rpath,<path>
```

{% endcode %}

**Setting the RUNPATH properly is important**. Failing to do so may result in the library not loading in the simulation executable.

<details>

<summary>Compile using a RT target (Recommended setup)</summary>

\* Each RT target should already come with the appropriate toolchain needed to build your CIGRÉ libraries. \* GCC should be installed in usr/bin/gcc.

To validate type the following command:

{% code overflow="wrap" lineNumbers="true" %}

```
root@HYP-RTOS-201:/usr/bin# which gcc
# Output should be:
/usr/bin/gcc
```

{% endcode %}

Setup your workspace with your source code and compile your library using the [recommended settings](https://www.opal-rt.com/docs/hypersim/model-and-simulation/create-oem-controller-code/use-cigre-interface/set-up-an-ide-and-debug-a-dll-library-for-linux.md).

</details>

<details>

<summary>Compile using an OPALRTLinux virtual machine</summary>

**Setup the VM**

1. Install VirtualBox 7.1 ans the VirtualBox extension pack
2. Contact OPAL-RT support to get access to an OPALRTLinux .ova file
3. Open VirtualBox 7.1
4. Import appliance and select the provided .ova file

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-7c7408191fc901a2bc64ac9f1973e5c568aaf8c7%2Foem-cigre-linux-vm-import.png?alt=media" alt=""><figcaption></figcaption></figure>

5. Open the settings of the virtual machine before starting it

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-dd9775a3b4b83d021c89e722283192e8029a7ea1%2Foem-cigre-linux-vm-import-settings.png?alt=media" alt=""><figcaption></figcaption></figure>

6. Under Network section, configure your network adapter(s) depending on your specific requirements.
7. Double click the virtual machine to get it started

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Known issue: VERR_PATH_NOT_FOUND In case this happens, in the VM settings, under General, change the name of the VM.</p></div>
8. Log as root into the VM
9. Type the command ifconfig, and note the IP address (IP should be from interface enp0s3)
10. Press Right Ctrl to release the focus from the VM in VirtualBox.

    <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>For any following operation on the VM, it is recommended to use an <strong>ssh tool</strong>, such as to interact with the machine as it will be more convenient.</p></div>

    The image contains a second disk which can be seen in the VM VirtualBox settings, but is not formatted by default. This second disk can be used to compile your shared libraries, leaving the OS disk as free as possible.
11. Mount the storage disk with the following commands: The following commands have to be **executed only once** and should persist across VM reboots.

    <pre data-overflow="wrap" data-line-numbers><code>parted -s /dev/sdb mklabel gpt
    parted -a optimal -s /dev/sdb mkpart primary ext4 0% 100%
    mkfs.ext4 -F /dev/sdb1
    mkdir -p /export
    sed -i '/\/export/d' /etc/fstab
    echo "UUID=$(blkid -s UUID -o value /dev/sdb1) /export ext4 defaults 1 1" >> /etc/fstab
    mount -a
    </code></pre>

    The disk usage on the VM can be monitored with the following command : df -h
12. Remove the OS core isolation using the following commands: The following commands have to be executed only once and should persist across VM reboots.

    <pre data-overflow="wrap" data-line-numbers><code># Remove the current core partitioning
    syspart --destroy
    # Remove the isolation on OS startup
    systemctl disable syspart
    sed -i -E 's/\s*(isolcpus=[^ ]*|nohz_full=[^ ]*)//g' /boot/loader/entries/boot.conf
    reboot
    </code></pre>

    In order to confirm isolation is correctly removed, make sure the following results can be observed:

    <pre data-overflow="wrap" data-line-numbers><code>root@rtserver:~# syspart --check
    GPP cpuset doesn't exist. Looks like the system is not partitioned.
    root@rtserver:~# nproc
    {The number of cores assigned during the VM creation step above}
    </code></pre>

**Use the VM to compile** Use the toolchain requirements, compile and link your shared library.

</details>


---

# 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/use-cigre-interface.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.
