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

# 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-aa61b889f5905fe98c9ebbc10ad77af86c05fd82%2F7f533b62-1e21-4aaf-878b-f6e3e268a9f1.png?alt=media" alt=""><figcaption></figcaption></figure>

The **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>

## Mask parameters

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-fc326de76f1fd37cd05419a27c0ce66bfa5aabee%2F49f4706a-492c-4930-b47e-816d8d463145.png?alt=media" alt="" width="315"><figcaption></figcaption></figure>

<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>Maximum number of PWM signals controlled by this block</strong></td><td>Read‑only field displaying the maximum number of channels available in the selected subsection.</td></tr><tr><td><strong>Number of PWM signals</strong></td><td>Specifies the size of the block input vector, corresponding to the number of channels to transmit at each calculation step. The value must be less than or equal to the <strong>Maximum number of PWM signals</strong>. 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>Polarity</strong></td><td><p><strong>Active‑High:</strong> Interprets a logical Low as <code>0</code> and a logical High as <code>1</code>. In <strong>Complementary mode</strong> with a non‑zero <strong>Dead time</strong> value, the PWM output is forced to <code>0</code> during the dead time interval.</p><p><strong>Active‑Low:</strong> Interprets a logical Low as <code>1</code> and a logical High as <code>0</code>. In <strong>Complementary mode</strong> with a non‑zero <strong>Dead time</strong> value, the PWM output is forced to <code>1</code> during the dead time interval.</p></td></tr><tr><td><strong>Carrier wave mode</strong></td><td><strong>Symmetric</strong>: Produces a triangular carrier.<br><strong>Asymmetric</strong>: Produces a sawtooth carrier.<br>The active phase is centered for Symmetric and not centered for Asymmetric.<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>Allow disabling channel</strong></td><td><p><strong>Checked:</strong> Adds a <strong>Disable</strong> input that allows channels to be disabled in real time. When <strong>Output complementary channel</strong> is enabled, each input element controls both the channel and its complementary output. When disabled, the duty cycle is forced according to the selected polarity (<code>0</code> for <strong>Active‑High</strong>, <code>1</code> for <strong>Active‑Low</strong>).</p><p><strong>Unchecked:</strong> Channel enable/disable behavior cannot be controlled at runtime.</p></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="" data-size="original"><br>The following two parameters can be configured:</p><ul><li><strong>Dead-time control from an input</strong>: When checked, replaces the <strong>Dead time value</strong> parameter with a <strong>Dead time</strong> block input to allow updates from the model in real time.</li><li><p><strong>Dead time value</strong>: Specifies the dead time duration, expressed in seconds. The effective range is <strong>0.01e-6 s to 10.23e-6 s</strong>. Adding dead time shortens the active phase of both complementary PWM waveforms, reducing the effective duty cycle. During the dead time interval, the PWM output is forced to <code>1</code> for <strong>Active‑Low</strong> polarity and <code>0</code> for <strong>Active‑High</strong> polarity.<br></p><div><figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-e8893b4df59c494d79810cd72c72090c02fce92a%2FRTLIO_pwm_out_dead_time.png?alt=media" alt=""><figcaption></figcaption></figure></div></li></ul><p><strong>Unchecked:</strong> Channels operate independently, and complementary PWM signals are not generated.</p></td></tr><tr><td><strong>Carrier phase control from an input</strong></td><td><p><strong>Checked</strong>: Replaces the <strong>Initial phase</strong> parameter with a <strong>Phase</strong> block input to allow updates from the model in real time.</p><p><strong>Unchecked:</strong> The block uses the <strong>Initial phase</strong> parameter and has no <strong>Phase</strong> input.</p></td></tr><tr><td><strong>Initial phase</strong></td><td>Specifies the phase offset between each PWM signal and the carrier wave. Enter a <strong>1×n vector</strong>, where <em>n</em> is the number of PWM signals. Phase values are expressed as a <strong>cycle ratio</strong> between <code>0</code> and <code>1</code> and are <strong>quantized to the nearest 1/1000</strong>.</td></tr></tbody></table>

## Inputs

<table><thead><tr><th width="127.25">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>Hz</strong></td><td>Inputs the PWM carrier frequencies 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 signals</strong> parameter. Use a <strong>Mux</strong> block to combine individual signals into a single input vector.</td></tr><tr><td><strong>Duty</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 signals</strong> parameter. Use a <strong>Mux</strong> block to combine individual signals into a single input vector.</td></tr><tr><td><strong>Dead time</strong></td><td><em>Available only when <strong>Output complementary channel</strong> and <strong>Dead-time control from an input</strong> are <strong>checked</strong>.</em><br>Inputs the dead time durations, expressed in seconds, between complementary PWM outputs. The effective range is <strong>0.01 µs to 10.23 µs</strong>.</td></tr><tr><td><strong>Phase</strong></td><td><em>Available only when the <strong>Carrier phase control from an input</strong> parameter is <strong>checked</strong>.</em><br>Inputs the phase offset between each PWM signal and the carrier wave, expressed as a <strong>cycle ratio</strong> between <code>0</code> and <code>1</code> and <strong>quantized to the nearest 1/1000</strong>.</td></tr><tr><td><strong>Disable</strong></td><td><em>Available only when the <strong>Allow disabling channel</strong> parameter is <strong>checked</strong>.</em><br>Stops PWM generation on a rising edge of this 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></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/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.
