> 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/pe-add-on-simulink/model-and-simulation/add-and-configure-a-circuit-model-to-the-system-definition/switches-section.md).

# Switches Section

## Overview

Switches accept gating control signals. They are controlled with digital signals (i.e. HIGH, LOW signals) which can come from custom device channels, digital inputs, signal generators, and more. In the electrical circuit model, it is recommended (but not necessary) to denote the switches of the model with the *SWXX* prefix as seen in the circuit model diagram. Switches modeled in eHS are characterized by their [**Switch Conductance (Gs)**](https://www.opal-rt.com/docs/pe-add-on-simulink/simulation-control-monitoring-and-logging/tune-switch-conductance-gs.md).

See [**Supported Circuit Editors**](https://www.opal-rt.com/docs/pe-add-on-simulink/appendix/supported-circuit-editors.md) for a list of supported Switch components in the circuit model.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FsgUE3TkE1JSaeyXO1uC6%2F9f8549e1-b036-4b7e-bdbb-2b9d4feeecaa.png?alt=media&amp;token=951d8e83-c097-479d-8783-8bf7293b23cb" alt=""><figcaption></figcaption></figure>

## Switches Configuration Page

In the **System Explorer** window configuration tree, expand the **Power Electronics Add-On** custom device and select **Circuit Model >> Switches** to display this page. After a model is successfully loaded in the **Circuit Model Section**, this page is added to the configuration tree and populated with a named list of the **Switch** components found in the circuit model. An incoming digital signal must be mapped to each switch to control its state as it is simulated in the eHS solver.

For each switch, the following information and mapping options are available at edit-time.

### Switches Settings

<table><thead><tr><th width="139.3333740234375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Type</strong></td><td>Displays the type of switch (See <strong>Supported Circuit Editors</strong> for a list of supported Switch components in the circuit model).</td></tr><tr><td><strong>Group</strong></td><td>Filters the list of available elements to be mapped to the Switch. The available options are defined by the selected <strong>Hardware Configuration</strong>, however it is typical to see the following options by default:<br><strong>CPU (VeriStand):</strong> VeriStand custom device channels on the CPU. If this Group is selected, the <strong>Element</strong> dropdown is populated with a single option displaying the name of the custom device channel whose value is mapped.<br><strong>PWMs:</strong> PWM outputs of the <strong>PWM Gener</strong><br><strong>ators Section</strong>. In the <strong>Element</strong> dropdown, select the index of the PWM Generator whose output signal to map.<br><strong>SPWMs:</strong> SPWM outputs of the <strong>SPWM Generators Section</strong>. In the <strong>Element</strong> dropdown, select the name of the channel to map.<br><strong>Digital Inputs: Digital Input</strong> channels of the PXI card. In the <strong>Element</strong> dropdown, select the index of the DI channel to map.</td></tr><tr><td><strong>Element</strong></td><td>The name or index of the signal to be mapped to the switch. The options available in this dropdown depend on the selected <strong>Group</strong>.</td></tr><tr><td><strong>Polarity</strong></td><td>The polarity of the switch component. Active High switches are open when LOW is applied to the gate and closed when HIGH is applied to the gate. Active Low switches are closed when LOW is applied to the gate and open when HIGH is applied to the gate</td></tr><tr><td><strong>Gs</strong></td><td>The conductance of the switch.</td></tr></tbody></table>

## Switches Section Channels

After a model has been loaded in the **Circuit Model Section**, the Switches section of the Configuration Tree is populated with a list of channels corresponding to each switch component found in the circuit model. If a switch is mapped to the **CPU (VeriStand)** Group described above, then the value of its corresponding channel defines the state of the switch during the simulation. If the **CPU (VeriStand)** Group is not used, then the value of the channel does not affect the circuit simulation.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FZMyoFsOmPpHE1zLVaKXz%2F3a81d1b5-16bd-41f5-94e2-e302691ca295.png?alt=media&amp;token=c17f6524-c777-4a10-ab4e-e6180251b5c4" alt=""><figcaption></figcaption></figure>


---

# 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/pe-add-on-simulink/model-and-simulation/add-and-configure-a-circuit-model-to-the-system-definition/switches-section.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.
