> 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/configure-ios/communication-protocol-ios/scpi/configure-scpi.md).

# Configure SCPI

When working with communication protocols, it is recommended to begin by configuring the protocol through the **I/O Interfaces** section in RT-LAB before proceeding with other steps.

## Configure the SCPI I/O interface

{% stepper %}
{% step %}

### Add a new I/O interface

In RT-LAB Project Explorer, right-click **I/O Interfaces**, select **New I/O Interface**, and choose **SCPI**. Double-click the newly created interface to begin configuration.
{% endstep %}

{% step %}

### Configure the general settings

In the **Folders** list, click **General** and configure the general settings.

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

<table><thead><tr><th width="165">Parameter</th><th>Value (Description)</th></tr></thead><tbody><tr><td><strong>Use an RT core for asynchronous computation</strong></td><td><strong>Checked:</strong> The driver reserves a dedicated real‑time CPU core for its communication tasks.<br><strong>Unchecked:</strong> The communication system runs on core 0 alongside the operating system.</td></tr><tr><td><strong>Enable verbose mode</strong></td><td><strong>Checked:</strong> Displays the full configuration during model loading for debugging.<br><strong>Unchecked:</strong> Only standard log messages are shown.</td></tr><tr><td><strong>Enable virtual mode</strong></td><td><strong>Checked:</strong> Allows the model to execute even if the I/O interface does not match the hardware configuration. All connections are initialized, but the interface performs no communication. Useful for troubleshooting without hardware or preparing models for future systems.<br><strong>Unchecked:</strong> The interface operates normally and requires compatible hardware.</td></tr></tbody></table>
{% endstep %}

{% step %}

### Manage SCPI devices: add, remove, rename, or reorder

In the **Folders** list, click **SCPI Device** and use:

* **+** icon to add devices
* **–** icon to remove devices
* **Arrow** icons to reorder devices

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-5c9ab814083c74a023fcd35d545344d569322325%2FDR-rtlab-scpi-devices.png?alt=media" alt="" width="441"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Configure the device(s) settings

In the **Folders** list, click a device under the **SCPI Device** folder to configure its settings. Repeat this step for each additional device.

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

<table><thead><tr><th width="145">Parameter</th><th>Value (Description)</th></tr></thead><tbody><tr><td><strong>Device</strong></td><td>Selects the SCPI device profile to use:<br><strong>Keysight RP79xx:</strong> Automatically configures a predefined set of default SCPI commands compatible with Keysight RP79xx devices.<br><strong>Custom:</strong> Allows full manual configuration of the SCPI command set.<br>Changing this parameter from <strong>Custom</strong> to <strong>Keysight RP79xx</strong> replaces all existing configured commands with the default RP79xx command set.</td></tr><tr><td><strong>Mode</strong></td><td>Communication mode for SCPI. Only <strong>TCP</strong> is supported.</td></tr><tr><td><strong>NIC name</strong></td><td>Network interface name. Select the correct interface based on your <strong>System Description Document</strong> or Linux <code>ifconfig</code> command.</td></tr><tr><td><strong>IP address</strong></td><td>IP address of the remote SCPI device to which the simulator connects.</td></tr><tr><td><strong>TCP port</strong></td><td>TCP port on which the SCPI device listens for incoming connections. Defaults to <strong>5025</strong>, which is the commonly used standard SCPI port.</td></tr><tr><td><strong>Cycle rate (ms)</strong></td><td>Defines the period at which cyclic control commands are sent and cyclic measurement commands are executed.</td></tr><tr><td><strong>Wait time (ms)</strong></td><td>Specifies the delay inserted between successive SCPI commands. This is useful for devices that cannot reliably process commands sent in rapid succession.</td></tr><tr><td><strong>Log SCPI data to a CSV file</strong></td><td><strong>Checked:</strong> SCPI commands sent and responses received are logged to a CSV file using <code>;</code> (semicolon) as the column separator. The file is transferred to the workstation during model reset. To locate the file, search for <code>SCPI*.csv</code> in the RT‑LAB project directory.<br><strong>Unchecked:</strong> No SCPI data is logged.</td></tr><tr><td><strong>Enable automatic command formatting</strong></td><td><p><strong>Checked:</strong> Each command is automatically prefixed with <code>:</code> and terminated with <code>\n</code> (newline).<br><strong>Unchecked:</strong> Allows full manual control of command termination characters:</p><ul><li><strong>SCPI terminators:</strong> Defines the character sequence appended to each SCPI command.</li></ul></td></tr></tbody></table>
{% endstep %}

{% step %}

### Configure the device(s) commands

1. In the **Folders** list, expand a device to reveal its commands.

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

2. Click a command type and use:

* **+** icon to add commands
* **–** icon to remove commands
* **Arrow** icons to reorder commands

3. Change parameters as desired:

{% tabs %}
{% tab title="Initial commands" %}

<table data-header-hidden><thead><tr><th width="165"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>User‑defined identifier for the command. This name must be unique within the list of initial commands.</td></tr><tr><td><strong>SCPI command</strong></td><td>SCPI command that is sent automatically at the beginning of the simulation.<br>The command must <strong>not</strong> contain a question mark (<code>?</code>), must <strong>not</strong> begin with a colon (<code>:</code>), and must <strong>not</strong> end with a semicolon (<code>;</code>).</td></tr></tbody></table>
{% endtab %}

{% tab title="Measurements" %}

<table data-header-hidden><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>User‑defined identifier for the measurement. This name must be unique within the list of measurements.</td></tr><tr><td><strong>SCPI command</strong></td><td>SCPI query command sent to the device to retrieve a measurement. The command is issued either at the configured cycle rate or based on a trigger.<br>The command <strong>must contain</strong> a question mark (<code>?</code>), and must <strong>not</strong> begin with a colon (<code>:</code>) or end with a semicolon (<code>;</code>).</td></tr><tr><td><strong>Request on trigger</strong></td><td><strong>Checked:</strong> Exposes a <strong>trigger</strong> connectable point for the command. In <strong>Dashboards</strong>, a new <strong>Simulator Channel</strong> named <strong>&#x3C;Name> trigger</strong> is available. This channel can be mapped to an <strong>OpOutput</strong> block allowing to trig the measurement command directly from the model during execution.<br><strong>Unchecked:</strong> The measurement command is sent periodically based on the configured cycle rate (ms).</td></tr></tbody></table>

{% hint style="info" %}
If the SCPI device returns an alphanumeric response, only the numeric portion is propagated to the model. The complete response can be viewed in the RT‑LAB console when the model is paused, provided that verbose mode is enabled.

If the SCPI device returns a non‑numeric string as the measurement result, the value is not propagated to the model and an error message is logged in the RT‑LAB console when the model is paused.
{% endhint %}
{% endtab %}

{% tab title="Controls" %}

<table data-header-hidden><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>User‑defined identifier for the control command.<br>If the name is <strong>not unique</strong>, the command is always sent based on the configured trigger behavior.</td></tr><tr><td><strong>SCPI command</strong></td><td>SCPI command to be sent to the device.<br>The command must <strong>not</strong> contain a question mark (<code>?</code>), must <strong>not</strong> begin with a colon (<code>:</code>), and must <strong>not</strong> end with a semicolon (<code>;</code>).</td></tr><tr><td><strong>Send on trigger</strong></td><td><p><strong>Checked:</strong> Exposes a <strong>trigger</strong> connectable point for the command. In <strong>Dashboards</strong>, a new <strong>Simulator Channel</strong> named <strong>&#x3C;Name> trigger</strong> is available. This channel can be mapped to an <strong>OpOutput</strong> block allowing to trig the control command directly from the model during execution. The trigger value must be configured:</p><ul><li><strong>Send when trigger value is:</strong> Defines the trigger value that causes the command to be sent.</li></ul><p><strong>Unchecked:</strong> The command is sent at every configured cycle rate (ms), <strong>only if the model value has changed</strong>.<br>This option is automatically enabled when the command <strong>Name</strong> is not unique.</p></td></tr><tr><td><strong>Full SCPI command</strong></td><td>Read‑only field displaying the complete SCPI command that will be transmitted to the device. During runtime, the placeholder <code>&#x3C;command name></code> is dynamically replaced with the current value of the associated model output connection point.</td></tr></tbody></table>
{% endtab %}

{% tab title="Reset commands" %}

<table data-header-hidden><thead><tr><th width="125"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>User‑defined identifier for the reset command. This name must be unique within the list of reset commands.</td></tr><tr><td><strong>SCPI command</strong></td><td>SCPI command that is sent automatically at the end of the simulation to place the device in the desired post‑simulation state.<br>The command must <strong>not</strong> contain a question mark (<code>?</code>), must <strong>not</strong> begin with a colon (<code>:</code>), and must <strong>not</strong> end with a semicolon (<code>;</code>).</td></tr></tbody></table>
{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

### Save the configuration

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-44bd03ce3c41f8ba5c990b61c29b38c9b80ae5f2%2FDR-rtlab-save.png?alt=media" alt=""><figcaption></figcaption></figure>
{% 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/rt-lab/configure-ios/communication-protocol-ios/scpi/configure-scpi.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.
