> 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/ehs/model-in-sps-rt-lab-only/configure-the-ehs-circuit-interfaces/configure-measurement-outputs.md).

# Configure Measurement Outputs

**Measurements** are used to communicate circuit voltages and currents to the **CPU model** or to **physical analog outputs**. By default, the **eHS CPU Block** outputs measurements through its output vector, in the same order as the measurement blocks in the circuit (e.g., **Y01**, **Y02**, ...).

To route measurements to physical analog outputs, use the **Aout Mapping and Adjustment CPU block** together with the **Analog Output Mapping and Rescaling block (AOMR)**.

{% stepper %}
{% step %}

### Add the Aout Mapping and Adjustment CPU block

1. Open the **Simulink Library Browser** and navigate to **eFPGASIM > External circuit editor workflow > I/O Management** and drag the **Add the Aout Mapping and Adjustment CPU block** into the same model subsystem as the **OpCtrl** and **eHS CPU Block**.
2. Double-click to open it's mask, and enable **Communications Settings Automatic Configuration**.
   * When enabled, the block automatically configures its communication ports using the `.conf` file associated with the bitstream (`.bin`) selected in the **OpCtrl** block.
   * When disabled, the communication parameters become editable and must be configured manually.

<figure><img src="https://3212678799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABuoXNYgvaoO7wIe3bfO%2Fuploads%2Fgit-blob-81dd1f0b933a0a2887aea08ebf4f49c631ed4135%2Fimage%20(37).png?alt=media" alt=""><figcaption></figcaption></figure>

3. If you also want to output analog signals from the **CPU model** (in addition to measurements from the eHS circuit running on the FPGA), configure **Number of Aout User Signals**. This parameter specifies the number of user-defined signals available to the mapping function. These signals are generated in the CPU model and must be connected to the **`user_aout`** input of the **Aout Mapping and Adjustment** block.
4. Configure the remaining parameters according to the **firmware documentation** or the corresponding **RT-XSG model**.
   {% endstep %}

{% step %}

### Add the Analog Output Mapping and Rescaling block (AOMR)

The **Analog Output Mapping and Rescaling (AOMR)** block is used to configure the behavior of the **Aout Mapping and Adjustment CPU block**.

To add the block:

1. Open the **Simulink Library Browser**.
2. Open the **Simulink Library Browser** and navigate to **eFPGASIM > External circuit editor workflow > I/O Management** and drag the **Analog Output Mapping and Rescaling block** into the `SC_` subsystem.

The AOMR block is used to:

* Assign measurements to analog output channels
* Apply gain and offset compensation
* Limit output values using minimum and maximum saturation limits
* Map FPGA signals to physical analog output channels

Configure the block according to the selected firmware and the desired analog output mapping. Refer to the firmware documentation or the corresponding **RT-XSG model** for details on the available channels and mappings.

<figure><img src="https://3212678799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABuoXNYgvaoO7wIe3bfO%2Fuploads%2Fgit-blob-1d4317bb323445bcc278a3f720c42abe13cec107%2Fimage%20(23).png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Connect the AOMR block to the Aout Mapping and Adjustment CPU block

The **AOMR** block outputs a vector containing the **mapping**, **gain**, **offset**, **maximum saturation**, and **minimum saturation** values used by the **Aout Mapping and Adjustment** **CPU block**.

<figure><img src="https://3212678799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABuoXNYgvaoO7wIe3bfO%2Fuploads%2Fgit-blob-741206278b0a500f7ad1bf3277c9a83d97873618%2Fimage%20(24).png?alt=media" alt=""><figcaption></figcaption></figure>

To connect the blocks:

1. Add a **BusSelector** block between the **AOMR** block and the **Aout Mapping and Adjustment** block.
2. Configure the **BusSelector** to expose the required signals.
3. Connect each **BusSelector** output to the corresponding input of the **Aout Mapping and Adjustment CPU block**.

It is recommended to use a **Selector** block to ensure that each input vector has the expected dimensions and ordering.

<figure><img src="https://3212678799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABuoXNYgvaoO7wIe3bfO%2Fuploads%2Fgit-blob-275c4235d916705fbd77a61e7c2bdf4d94b57c5b%2Fimage%20(25).png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Control the Aout mapping and adjustment during simulation

The **AOMR** block controls the **mapping**, **gain**, **offset**, **minimum saturation**, and **maximum saturation** values used by the **Aout Mapping and Adjustment CPU block**.

To modify these settings during simulation:

1. While the simulation is running, double-click the **AOMR** block from the console.
2. Click **Open Mapping Table**.
3. For each analog output channel, configure:
   * The signal to output
   * The gain
   * The offset
   * The minimum value
   * The maximum value
4. Click **Apply** or **OK** to activate the changes.

<figure><img src="https://3212678799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABuoXNYgvaoO7wIe3bfO%2Fuploads%2Fgit-blob-f8120ca7972b5d0f8861f3c3e045f2f753776511%2Fimage%20(26).png?alt=media" alt=""><figcaption></figcaption></figure>

Changes are applied during simulation without requiring the model to be stopped or reloaded, allowing analog output mappings and scaling parameters to be adjusted dynamically.
{% 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/ehs/model-in-sps-rt-lab-only/configure-the-ehs-circuit-interfaces/configure-measurement-outputs.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.
