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

# OpProbeExternVar

## Description

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

The **OpProbeExternVar** block, located in the **RT-LAB/Monitoring** library, outputs values written by your code to the Simulink model. When this block is present, it exposes a public double array named `OpExternVar`. The array size equals the value of the Number of index in array parameter, and the block creates the same number of outputs, each mapped to the corresponding array element.

{% hint style="info" %}
**To use this variable, declare the extern variable in your code and assign values to OpExternVar\[ ]**
{% endhint %}

## Mask parameters

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

<table><thead><tr><th width="249.7999267578125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Number of index in array</strong></td><td>Specifies the number of doubles to allocate for the <code>OpExternVar</code> array.</td></tr></tbody></table>

## Inputs

This block has no inputs.

## Outputs

<table><thead><tr><th width="248.99993896484375">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>Outputs</strong></td><td>Each output corresponds to an element of the <code>OpExternVar</code> array. The number of outputs equals the value of the Number of index in array parameter. For example, if the value is 3: output 1 = <code>OpExternVar[0]</code>, output 2 = <code>OpExternVar[1]</code>, output 3 = <code>OpExternVar[2]</code>.</td></tr></tbody></table>

## Characteristics and limitations

<table><thead><tr><th width="251.39996337890625">Characteristic</th><th>Value</th></tr></thead><tbody><tr><td>Direct Feedthrough</td><td>No</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/opprobeexternvar.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.
