> 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/ehs/3.7/model-in-sps-rt-lab-only/configure-the-ehs-circuit-interfaces/configure-gate-signal-inputs.md).

# Configure Gate Signal Inputs

## Interface switch blocks

**Switch** blocks gate control signals are fully driven by external inputs. These inputs can originate from:

* The CPU model
* Physical digital input channels

To select the external input:

1. Double-click the **eHS CPU Block** to open it's mask.
2. Navigate to the **Gates** tab.

<figure><img src="https://521571437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fo99Izmvvw5eHT4ldzI4g%2Fuploads%2Fgit-blob-614d3cfc60fda06f76b0a9349e22fd6505b0ac01%2Fimage%20(10).png?alt=media" alt=""><figcaption></figcaption></figure>

3. Click the **Configure Switch Gates** button.
4. For each switch, define the external signal that drives its gate:
   * Set **Gate Signal Source** to **Digital Inputs** to drive the gate signal from a digital input module channel, then set the **Index**. For systems with a single digital input module, indexes **1 to 32** correspond to physical channels **0 to 31**. In systems with multiple digital input modules, indexes are assigned sequentially across modules: the first module uses indexes **1–32**, the second **33–64**, the third **65–96**, and the fourth **97–128**. Each additional module adds an offset of **32 channels**, so the index uniquely identifies both the module and the channel within that module.
   * Set **Gate Signal Source** to **CPU Model** to drive the gate signal from the CPU model. In this case, the **Index** specifies the position of the signal within the vector connected to the **Gates** port of the **eHS CPU Block**.
   * Set **Gate Signal Source** to **PWM** to drive the gate signal from internal PWM generators embedded in the FPGA firmware. See [Configure Internal FPGA PWM Generators](https://www.opal-rt.com/docs/ehs/3.7/model-in-sps-rt-lab-only/configure-the-ehs-circuit-interfaces/configure-gate-signal-inputs/configure-internal-fpga-pwm-generators.md) for details. In this case, the **Index** specifies the PWM generator assigned to the switch.

<figure><img src="https://521571437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fo99Izmvvw5eHT4ldzI4g%2Fuploads%2Fgit-blob-e800918d256b68ab9990fd8bd154537df633309a%2Fimage%20(11).png?alt=media" alt=""><figcaption></figcaption></figure>

5. For each switch, define the **Gate Polarity:**

* **HIGH**: The gate signal is active when the digital input is **high**.
* **LOW**: The gate signal is active when the digital input is **low**.

6. Click **OK** or **Apply** to save changes.

{% hint style="info" %}
Multiple switches can be assigned to the same **Index**. When doing so, ensure that the polarity of each gate signal is configured appropriately.
{% endhint %}


---

# 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/ehs/3.7/model-in-sps-rt-lab-only/configure-the-ehs-circuit-interfaces/configure-gate-signal-inputs.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.
