> 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-i-o-library/rcp-pwm-out.md).

# RCP PWM Out

## Description

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

The **RCP PWM Out** block, located in the **RT-LAB I/O/Opal-RT/Common** library, transmits a PWM frequency and duty cycle per time step per channel to a Digital Output module installed in the simulator or expansion unit. Output voltage levels are **0 V** or **V**<sub>**user**</sub> volts, with the mapping to logical low and high values determined by the selected polarity.

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

In addition, the block provides a **synchronization output** to the model for use with the **RCP Analog In** block. This synchronization signal enables **analog acquisition aligned with PWM timing**, allowing periodic measurements to be performed with a **time resolution of up to 4 µs within each simulation time step**.

Availability of this functionality depends on the bitstream supplied with the system.

## Mask parameters

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

{% tabs %}
{% tab title="Controller Parameters" %}

<table><thead><tr><th width="174.5">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Controller Name</strong></td><td>Specifies the <strong>OpCtrl</strong> block this block is bound to. Enter the same <strong>Controller Name</strong> as defined in the corresponding <strong>OpCtrl</strong> block.</td></tr><tr><td><strong>DataIn port number</strong></td><td>Specifies the Digital Output module and subsection to which this block transmits signals. Subsection 1 corresponds to channels 0–7, subsection 2 corresponds to channels 8–15, and so on.<br>Configure the <strong>DataIn port number</strong> according to your <strong>System Description Document</strong> or <code>.conf</code> file.</td></tr><tr><td><strong>Slot infos</strong></td><td>Read‑only field displaying the expected physical location (Slot, Section, Subsection) of the Digital Output module derived from the selected <strong>DataIn port number</strong>. If the port number is invalid, <em>Slot 0 Module X Subsection 0</em> is displayed.</td></tr><tr><td><strong>Number of pwm lines</strong></td><td>Specifies the size of the block input vector, corresponding to the number of channels to transmit at each calculation step. Due to the data transfer mechanism, channels cannot be individually selected; the block transmits data to the first N channels of the subsection, where <em>N</em> is this parameter.</td></tr><tr><td><strong>Output complementary channel</strong></td><td><p><strong>Checked</strong>: Enables generation of <strong>complementary PWM signals</strong>, dividing the number of available PWM channels by <strong>two</strong>. For each channel, the <strong>next channel outputs the complementary PWM signal</strong>.</p><p><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-d1186ea87660ff2d07ba89246c8d48b2acfa5246%2FRTLIO_pwm_out_signal.png?alt=media" alt=""><br></p><p><strong>Unchecked:</strong> Channels operate independently, and complementary PWM signals are not generated.</p></td></tr></tbody></table>
{% endtab %}

{% tab title="Synchronization Parameters" %}

<table><thead><tr><th width="174.5">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Period</strong></td><td>Read-only field displaying the model time step, which is used as the basis for PWM synchronization.</td></tr><tr><td><strong>Delay between step beginning and PWM period beginning</strong></td><td>Specifies the delay, in seconds, between the start of the CPU model time step and the beginning of the PWM period.</td></tr><tr><td><strong>Trigger Pulse Source</strong></td><td>Selects the PWM channel used to trigger analog acquisition.</td></tr><tr><td><strong>Trigger Pulse Type</strong></td><td>Specifies when analog inputs are acquired relative to the selected PWM signal: at the beginning of the period, the middle of the period, or both.</td></tr></tbody></table>
{% endtab %}

{% tab title="PWM x" %}
All PWM tabs share the same parameter set. Each PWM instance is configured independently, and parameter values apply only to the corresponding PWM channel.

<table><thead><tr><th width="174.5">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>PWM Period/Model period Ratio</strong></td><td>Specifies the ratio between the CPU model time step and the PWM period. This parameter sets the PWM frequency and must be an integer between <strong>1 and 255</strong>.</td></tr><tr><td><strong>Frequency Estimation</strong></td><td>Read‑only field displaying the estimated PWM frequency based on the current model time step and period ratio.</td></tr><tr><td><strong>PWM Carrier Type</strong></td><td><strong>Triangular (symmetric)</strong>: Produces a triangular carrier.<br><strong>Sawtooth (asymmetric)</strong>: Produces a sawtooth carrier.<br>The active phase is centered for Triangular and not centered for Sawtooth.<br><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-a5774303409c7877b4ed6d81f26cdcd087f4b0a5%2FRTLIO_pwm_out_signal_asym_sym.png?alt=media" alt=""></td></tr><tr><td><strong>Update time of Duty Cycle</strong></td><td>Specifies when the PWM duty cycle is updated: at the beginning of the period, the middle of the period, or both.</td></tr><tr><td><strong>Phase [deg]</strong></td><td>Specifies the phase offset between each PWM signal and the carrier wave, expressed in degrees.</td></tr><tr><td><strong>Deadtime [0 - 20e-6 sec]</strong></td><td>Specifies the dead time inserted between the falling edge of a PWM signal and the rising edge of its complementary signal, expressed in seconds<strong>.</strong> Valid range is <strong>0 to 20e-6 s</strong>.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Inputs

<table><thead><tr><th width="127.25">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>Duty cycle</strong></td><td>Inputs the PWM duty cycle values (from <code>0</code> to <code>1</code>) to be transmitted to the Digital Out module for the selected channel subset. The input vector size is determined by the <strong>Number of PWM lines</strong> parameter. Use a <strong>Mux</strong> block to combine individual signals into a single input vector.</td></tr><tr><td><strong>Stop</strong></td><td>Stops PWM generation on a rising edge of this input. Once stopped, PWM generation can be resumed <strong>only</strong> by a rising edge on the <strong>Restart</strong> input.</td></tr><tr><td><strong>Restart</strong></td><td>Restarts PWM generation on a rising edge of this input. This input is effective <strong>only</strong> after PWM generation has been stopped by a rising edge on the <strong>Stop</strong> input.</td></tr></tbody></table>

## Outputs

<table><thead><tr><th width="148.6666259765625">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>Status</strong></td><td><p>Outputs the block status:</p><ul><li><code>0</code>: No error.</li><li><code>-1</code>: Block not associated with an <strong>OpCtrl</strong> block (check the <strong>Controller Name</strong> parameter), or FPGA initialization failure.</li><li><code>-2</code>: Internal memory initialization failure.</li></ul></td></tr><tr><td><strong>Sync</strong></td><td>Outputs a synchronization vector used by the <strong>RCP Analog In</strong> block to initiate acquisition. The first element specifies the <strong>acquisition period</strong>, and the second element specifies the <strong>time of the first acquisition</strong>. If the <strong>Trigger Pulse Type</strong> parameter is set to <strong>Both</strong>, a <strong>third element</strong> is included to indicate the <strong>time of the second acquisition</strong>.</td></tr></tbody></table>

## Characteristics and limitations

<table><thead><tr><th width="239">Characteristic</th><th>Value</th></tr></thead><tbody><tr><td><strong>Connector pin assignments</strong></td><td>Refer to the <strong>System Description Document</strong> provided with your order, or refer to the pin assignment of the <a href="https://opal-rt-technologies.gitbook.io/opal-rt-technologies-docs/op53xx/"><strong>OP53xx series I/O module</strong></a> associated with each subsection.</td></tr><tr><td><strong>Direct feedthrough</strong></td><td>No</td></tr><tr><td><strong>Discrete sample time</strong></td><td>Inherited</td></tr><tr><td><strong>XHP support</strong></td><td>Yes</td></tr><tr><td><strong>Work offline</strong></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-i-o-library/rcp-pwm-out.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.
