> For the complete documentation index, see [llms.txt](https://support.powerio.com/hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.powerio.com/hub/codesys-hvac/en/hvac-library/functionblocks/general/opmodeselect10.md).

# OpModeSelect10

## `OpModeSelect10` (FB)

FUNCTION\_BLOCK OpModeSelect10 EXTENDS MANASBase IMPLEMENTS IMan

### Short description

> System switch for switching between a maximum of 10 operating modes (automatic and 8 manual operating modes)

### Representation

<figure><img src="https://2592874069-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQR4vCFzt6ixgsqlR3pdR%2Fuploads%2Fgit-blob-203b80805a1b2435b5ef4d4f82a4788e45f6dfc3%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### Interfaces

#### Inputs

| Name  | Data type | Value range | Initial value | Function                                        |
| ----- | --------- | ----------- | ------------- | ----------------------------------------------- |
| *xIn* | BOOL      |             | FALSE         | Status variable for *xActive* in automatic mode |

#### Outputs

| Name        | Data type | Value range | Initial value | Function                                              |
| ----------- | --------- | ----------- | ------------- | ----------------------------------------------------- |
| *xActive*   | BOOL      |             | FALSE         | Output variable in automatic mode                     |
| *xAutoM0*   | BOOL      |             | FALSE         | Display of operating mode Automatic                   |
| *xManOffM1* | BOOL      |             | FALSE         | Display of operating mode Manual-Off                  |
| *xManM2*    | BOOL      |             | FALSE         | Display of operating mode Manual 1                    |
| *xManM3*    | BOOL      |             | FALSE         | Display of operating mode Manual 2                    |
| *xManM4*    | BOOL      |             | FALSE         | Display of operating mode Manual 3                    |
| *xManM5*    | BOOL      |             | FALSE         | Display of operating mode Manual 4                    |
| *sActMode*  | STRING    |             |               | Name of the current operating mode (e.g. 'Automatic') |

#### Setpoints / Parameters

| Name              | Data type | Value range | Initial value     | Function                                                   |
| ----------------- | --------- | ----------- | ----------------- | ---------------------------------------------------------- |
| **tToggleTime**   | TIME      |             | 2s                | Time delay until changing operating mode                   |
| **eMaxMode**      | eOpMode   |             | eOpMode.Mode5     | Definition of the maximum number of manual operating modes |
| **xOpModeToggle** | BOOL      |             | FALSE             | Switching between operating modes                          |
| **xResAuto**      | BOOL      |             | FALSE             | Reset to automatic mode                                    |
| **xEn**           | BOOL      |             | TRUE              | Enable                                                     |
| **sTitle**        | STRING    |             | ‘Operating mode ‘ | Name of the plant switch                                   |
| **sTitle2**       | STRING    |             | ‘Description ‘    | Description of the plant switch                            |
| **eMode**         | eOpMode   |             | eOpMode.Mode0     | Current operating state of the plant switch                |
| **sTitleM0**      | STRING    |             | ‘Automatic’       | Description of automatic operating mode                    |
| **sTitleM1**      | STRING    |             | ‘Manual Off’      | Description of manual-off operating mode                   |
| **sTitleM2**      | STRING    |             | ‘Manual 1’        | Description of manual 1 operating mode                     |
| **sTitleM3**      | STRING    |             | ‘Manual 2’        | Description of manual 2 operating mode                     |
| **sTitleM4**      | STRING    |             | ‘Manual 3’        | Description of manual 3 operating mode                     |
| **sTitleM5**      | STRING    |             | ‘Manual 4’        | Description of manual 4 operating mode                     |

### Functional description

#### General

The plant switch serves to switch between **eMaxMode** +1 different operating modes (automatic, manual-off and **eMaxMode** -1 manual operating modes).\
The switching process is triggered by a rising edge at the setpoint / parameter **xOpModeToggle** .\
The switching is endless, i.e. after the last manual operating mode, the next switching operation selects automatic mode.\
The operating mode can also be explicitly selected by choosing the setpoint / parameter **eMode** in the range eOpMode.Mode0 - **eMaxMode** .\
The current operating mode is represented numerically by the setpoint/parameter **eMode** in the range eOpMode.Mode0 - **eMaxMode** .\
It is additionally represented by the corresponding digital outputs *xAutoM0*, *xManOffM1*, *xManM2*, *xManM3*, etc.

#### Status variable *xIn*

| In    | *xActive* | Note                                                     |
| ----- | --------- | -------------------------------------------------------- |
| FALSE | FALSE     | Only valid in automatic mode (**eMode** = eOpMode.Mode0) |
| TRUE  | TRUE      | Only valid in automatic mode (**eMode** = eOpMode.Mode0) |

#### Output variable *xActive*

In automatic mode (**eMode** = eOpMode.Mode0) the output variable follows *xActive* the input variables *xIn*.\
In all other operating modes, the state FALSE is always active.

#### Reset to automatic mode

Each rising edge at the setpoint/parameter **xResAuto** activates automatic mode if the setpoint/parameter **xEn** is in the TRUE state.

#### Enable/disable switching

Switching of the operating mode can only occur if the setpoint/parameter **xEn** is in the TRUE state.

#### Switching delay **tToggleTime**

The time period between activation of the operating mode switch and the actual switching can be set via the setpoint / parameter **tToggleTime** .\
The time period starts only if the switching of the operating modes was done via the setpoint/parameter **xOpModeToggle** .

#### Operating modes

| **eMode**     | Name of the operating mode | *xIn* | *xActive* | *xAutoM0* | *xManOffM1* | *xManM2* | *xManM3* | *xManM4* | *xManM5* | Note                      |
| ------------- | -------------------------- | ----- | --------- | --------- | ----------- | -------- | -------- | -------- | -------- | ------------------------- |
| eOpMode.Mode0 | **sTitleM0**               | FALSE | FALSE     | TRUE      | FALSE       | FALSE    | FALSE    | FALSE    | FALSE    | Operating mode Automatic  |
| eOpMode.Mode0 | **sTitleM0**               | TRUE  | TRUE      | TRUE      | FALSE       | FALSE    | FALSE    | FALSE    | FALSE    | Operating mode Automatic  |
| eOpMode.Mode1 | **sTitleM1**               | X     | FALSE     | FALSE     | TRUE        | FALSE    | FALSE    | FALSE    | FALSE    | Operating mode Manual-Off |
| eOpMode.Mode2 | **sTitleM2**               | X     | FALSE     | FALSE     | FALSE       | TRUE     | FALSE    | FALSE    | FALSE    | Operating mode Manual 1   |
| eOpMode.Mode3 | **sTitleM3**               | X     | FALSE     | FALSE     | FALSE       | FALSE    | TRUE     | FALSE    | FALSE    | Operating mode Manual 2   |
| eOpMode.Mode4 | **sTitleM4**               | X     | FALSE     | FALSE     | FALSE       | FALSE    | FALSE    | TRUE     | FALSE    | Operating mode Manual 3   |
| eOpMode.Mode5 | **sTitleM5**               | X     | FALSE     | FALSE     | FALSE       | FALSE    | FALSE    | FALSE    | TRUE     | Operating mode Manual 4   |

Legend: X = Undefined

### Visualization

Suitable visualization element from the HVACV Visu Library: **OpModeSelect** **OpModeSelect\_Button**

### Representation

<figure><img src="https://2592874069-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQR4vCFzt6ixgsqlR3pdR%2Fuploads%2F4VLoPdSfmDyv4tnbWhl9%2FOPModeSelect10_Visu.png?alt=media&amp;token=b7ce203d-4e9a-4426-bffc-335076c75345" alt=""><figcaption></figcaption></figure>

#### Interface visualization element OpModeSelect\_Button

| Name                    | Data type         | Type         | Initial value | Function                                                   |
| ----------------------- | ----------------- | ------------ | ------------- | ---------------------------------------------------------- |
| **FB\_OpModeSelect\_0** | HVAC.OpModeSelect | VAR\_IN\_OUT |               | Enter FB instance OpModeSelect here, e.g. PRG.OpModeSelect |

It is sufficient to place the visualization element OpModeSelect\_Button. Clicking it opens the OpModeSelect dialog in the visualization. The number of operating modes is defined in the FB HVAC.OpModeSelect (eMaxMode) as well as the titles (sTitleM0 to M5) and the dialog title (sTitle and sTitle2). The visualization element automatically adapts to the size of the maximum operating modes.

{% hint style="info" %}
Note: VAR\_IN\_OUT interfaces must be assigned; VAR\_INPUT is optional.
{% endhint %}

### Codesys

InOut:

| Scope       | Name            | Type     | Initial          |
| ----------- | --------------- | -------- | ---------------- |
| Input       | `xIn`           | `BOOL`   | 0                |
| Input Const | `tToggleTime`   | `TIME`   | TIME#2s0ms       |
| Input Const | `eMaxMode`      | eOpMode  | eOpMode.Mode9    |
| Input Const | `xOpModeToggle` | `BOOL`   | FALSE            |
| Input Const | `xResAuto`      | `BOOL`   | FALSE            |
| Input Const | `xEn`           | `BOOL`   | TRUE             |
| Input Const | `sTitle`        | `STRING` | ‘Operating mode’ |
| Input Const | `sTitle2`       | `STRING` | ‘Description’    |
| Input Const | `eMode`         | eOpMode  | eOpMode.Mode0    |
| Input Const | `sTitleM0`      | `STRING` | ‘Automatic’      |
| Input Const | `sTitleM1`      | `STRING` | ‘Manual Off’     |
| Input Const | `sTitleM2`      | `STRING` | ‘Manual 1’       |
| Input Const | `sTitleM3`      | `STRING` | ‘Manual 2’       |
| Input Const | `sTitleM4`      | `STRING` | ‘Manual 3’       |
| Input Const | `sTitleM5`      | `STRING` | ‘Manual 4’       |
| Input Const | `sTitleM6`      | `STRING` | ‘Manual 5’       |
| Input Const | `sTitleM7`      | `STRING` | ‘Manual 6’       |
| Input Const | `sTitleM8`      | `STRING` | ‘Manual 7’       |
| Input Const | `sTitleM9`      | `STRING` | ‘Manual 8’       |
| Output      | `xActive`       | `BOOL`   |                  |
| Output      | `xAutoM0`       | `BOOL`   |                  |
| Output      | `xManOffM1`     | `BOOL`   |                  |
| Output      | `xManM2`        | `BOOL`   |                  |
| Output      | `xManM3`        | `BOOL`   |                  |
| Output      | `xManM4`        | `BOOL`   |                  |
| Output      | `xManM5`        | `BOOL`   |                  |
| Output      | `xManM6`        | `BOOL`   |                  |
| Output      | `xManM7`        | `BOOL`   |                  |
| Output      | `xManM8`        | `BOOL`   |                  |
| Output      | `xManM9`        | `BOOL`   |                  |
| Output      | `sActMode`      | `STRING` |                  |


---

# 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://support.powerio.com/hub/codesys-hvac/en/hvac-library/functionblocks/general/opmodeselect10.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.
