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

# OpComm

## Description

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

The **OpComm** block, located in the **RT-LAB** library, simulates the real-time communication link within sc\_, sm\_ and ss\_ subsystems. Any signal entering such subsystem must pass through an OpComm block.

{% hint style="danger" %}
Only **double-precision signals** are supported. OpComm block names must not be modified.
{% endhint %}

**Purpose and behavior**

* Provides RT-LAB with data size and type information exchanged between subsystems.
* Defines acquisition groups and parameters (Console subsystem only).
* Emulates real-time subsystem communication when running offline: the block waits for all inputs to update before updating outputs.
* Specifies the sample time of the subsystem where the block is placed.
* Specifies the communication sample time for exchanges between calculation subsystems (Master or Slave).

**Placement rules**

* Console subsystem: use one OpComm block per acquisition group.
* Master/Slave subsystems: up to two OpComm blocks are allowed—one for signals from the Console (non-real-time) and one for signals from other Master/Slave subsystems (real-time). A single OpComm block cannot receive from both a Console and a Master/Slave subsystem.

{% hint style="info" %}
Parameters depend on whether the block is located in the **sc\_ subsystem** or in a **computation subsystem** (such as **sm\_** or **ss\_**).
{% 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-83850eba5769e9ce821bf19175eacae8fe803fa4%2FRTL_opcomm_mask.jpg?alt=media" alt="" width="563"><figcaption></figcaption></figure>

{% tabs %}
{% tab title=" sc\_ subsystem parameters" %}

<table><thead><tr><th width="184.90911865234375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Number of inports</strong></td><td>Specifies the acquisition group for all signals passing through this block.</td></tr><tr><td><strong>Acquisition group</strong></td><td>Specifies the acquisition group for all signals passing through this block.</td></tr><tr><td><strong>Subsystem sample time</strong></td><td>Sample time in seconds for the acquisition group. Enter 0 to inherit the model sample time when no multirate is used.</td></tr><tr><td><strong>Enable Synchronization</strong></td><td>Enables synchronization to prevent aliasing and other distortions. The Console attempts to run at the model rate. If data is lost between frames, the Console estimates the loss duration and either holds the last value or performs linear interpolation. Blocking mode must be selected in the Probe Control panel to enable this option.</td></tr><tr><td><strong>Enable Interpolation</strong></td><td>Performs linear interpolation between two values during data loss. If not selected, the last received value is held. Applies only if Enable Synchronization is selected.</td></tr><tr><td><strong>Threshold time between Command Station and target</strong></td><td>If the difference between simulation time and Console time exceeds this value (s), the Console stops filling missed data (interpolated or held) and resynchronizes with the new value. Prevents the Console from drifting too far behind model execution.<br>Applies only if Enable Synchronization is selected.</td></tr><tr><td><strong>Missed data signal</strong></td><td>Creates a block output for the number of calculation steps missed between data packets. Applies only if Enable Synchronization is selected.</td></tr><tr><td><strong>Simulation offset signal</strong></td><td>Creates a block output for the simulation time at which the Console started the acquisition. Updated when the Console is stopped and started again, but not when resuming from pause.</td></tr><tr><td><strong>Simulation time signal</strong></td><td>Creates a block output for the simulation time on the simulator nodes.</td></tr><tr><td><strong>Sample/second signal</strong></td><td>Creates a block output for the average number of samples per second displayed on the Console. Includes points inserted during data loss, whether interpolated or not.</td></tr><tr><td><strong>Dynamic signals output</strong></td><td>Creates a block output to connect to displays and scopes, preparing connections for dynamic signals. Enabling or disabling this option does not enable or disable dynamic acquisition. Refer to the Probe Control panel for details.</td></tr></tbody></table>
{% endtab %}

{% tab title="Computation subsystems such as sm\_ or ss\_" %}

<table><thead><tr><th width="150.3636474609375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Acquisition group</strong></td><td>Specifies the acquisition group for all signals passing through this block.</td></tr><tr><td><strong>Subsystem sample time</strong></td><td>Sample time in seconds for the subsystem where the block is placed. Enter 0 to inherit the model sample time when no multirate is used.</td></tr><tr><td><strong>Communication sample time</strong></td><td><p>For each input in a MATLAB array, specifies the incoming signal’s sample time in seconds. If only one value is entered, it applies to all inputs. This parameter is only used when OpComm simulates real-time communication (between a Master and a Slave or between two Slaves). It is ignored when receiving signals from a Console. When subsystems run at different time steps, the communication sample time should be at least the slowest time step used by either subsystem linked by the OpComm.</p><p>Example: [0.001 0.005 0.01] => input 1 at 0.001 s, input 2 at 0.005 s, and so on.</p></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Inputs <a href="#inputs" id="inputs"></a>

<table><thead><tr><th width="176.727294921875">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>Signals</strong></td><td>One vector input per value specified by <em>Number of inports</em>. Each input is vectorized. Data type: double.</td></tr></tbody></table>

## Outputs

<table><thead><tr><th width="171.272705078125">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>Signals</strong></td><td>One vector output per input, created based on Number of inports. Outputs update after all inputs have been updated.</td></tr><tr><td><strong>Missed Data</strong></td><td>Number of calculation steps missed between data packets. Available when Enable Synchronization and Missed data signal are selected.</td></tr><tr><td><strong>Simulation Offset</strong></td><td>Simulation time at which the Console started the acquisition. Refreshed when the Console is stopped and started again; not refreshed when resuming from pause. Available when Simulation offset signal is selected.</td></tr><tr><td><strong>Simulation Time</strong></td><td>Simulation time on the simulator nodes. Available when Simulation time signal is selected.</td></tr><tr><td><strong>Sample/second</strong></td><td>Average number of samples per second displayed on the Console, including points inserted during data loss. Available when Sample/second signal is selected.</td></tr><tr><td><strong>Dynamic signals output</strong></td><td>Output used to connect to displays and scopes to prepare connections for dynamic signals. Enabling this output does not enable dynamic acquisition. Available when Dynamic signals output is selected.</td></tr></tbody></table>

## Characteristics and limitations

<table><thead><tr><th width="227.6363525390625">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>N/A</td></tr><tr><td>Work offline</td><td>Yes</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/opcomm.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.
