> 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/hvac-library/functionblocks/button/button4.md). Agents can also search and read this documentation through its [MCP server](https://support.powerio.com/hub/~gitbook/mcp).

# Button4

## `Button4` (FB)

FUNCTION\_BLOCK Button4

### Kurzbeschreibung

> Schaltelement mit vier Bedieneingängen und vier Schaltausgängen.\
> Zusätzlich ist ein Gesamtausgang verfügbar.

### Darstellung

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

### Schnittstellen

#### Eingänge

| Name         | Datentyp | Wertebereich | Initialwert | Funktion                                      |
| ------------ | -------- | ------------ | ----------- | --------------------------------------------- |
| *xButton1*   | BOOL     |              |             | Eingang Bedientaste 1                         |
| *xButton2*   | BOOL     |              |             | Eingang Bedientaste 2                         |
| *xButton3*   | BOOL     |              |             | Eingang Bedientaste 3                         |
| *xButton4*   | BOOL     |              |             | Eingang Bedientaste 4                         |
| *xButtonOff* | BOOL     |              |             | Eingang Zentrale Deaktivierung aller Ausgänge |

#### Ausgänge

| Name  | Datentyp | Wertebereich | Initialwert | Funktion        |
| ----- | -------- | ------------ | ----------- | --------------- |
| *xQ1* | BOOL     |              |             | Schaltausgang 1 |
| *xQ2* | BOOL     |              |             | Schaltausgang 2 |
| *xQ3* | BOOL     |              |             | Schaltausgang 3 |
| *xQ4* | BOOL     |              |             | Schaltausgang 4 |
| *xQ*  | BOOL     |              |             | Gesamtausgang   |

#### Sollwerte / Parameter

| Name               | Datentyp | Wertebereich | Initialwert | Funktion                  |
| ------------------ | -------- | ------------ | ----------- | ------------------------- |
| **xButton1Visu**   | BOOL     |              | FALSE       | Funktion wie *xButton1*   |
| **xButton2Visu**   | BOOL     |              | FALSE       | Funktion wie *xButton2*   |
| **xButton3Visu**   | BOOL     |              | FALSE       | Funktion wie *xButton3*   |
| **xButton4Visu**   | BOOL     |              | FALSE       | Funktion wie *xButton4*   |
| **xButtonOffVisu** | BOOL     |              | FALSE       | Funktion wie *xButtonOff* |

### Funktionsbeschreibung

#### Allgemeines

Die fünf Eingänge für die Bedientasten und die fünf Visutasten werden permanent auf ansteigende Flanken (= Taste betätigt) überwacht.\
Die Schaltausgänge und der Gesamtausgang werden in Abhängigkeit davon, an welchen Eingang eine ansteigende Flanke erkannt wurde, festgelegt.\
Der Eingang *xButton1* hat dabei die höchste, der Eingang *xButton2* die zweithöchste Priorität, usw.\
Wird an keinem der vier Eingänge eine ansteigende Flanke erkannt, so verändern sich die Zustände der Ausgänge nicht.

#### Gesamtausgang *xQ*

Der Gesamtausgang wird aktiviert (*xQ* = TRUE), falls mindestens einer der vier Schaltausgänge aktiv ist.\
Er ist nicht aktiv (*xQ* = FALSE), falls keiner der vier Schaltausgänge aktiv ist.

| *xButton1*       | *xButton2*       | *xButton3*       | *xButton4* | *xQ1* | *xQ2* | *xQ3* | *xQ4* | Hinweis              |
| ---------------- | ---------------- | ---------------- | ---------- | ----- | ----- | ----- | ----- | -------------------- |
| L/H              | X                | X                | X          | TRUE  | FALSE | FALSE | FALSE | Betätigung - Taste 1 |
| FALSE, TRUE, H/L | L/H              | X                | X          | FALSE | TRUE  | FALSE | FALSE | Betätigung - Taste 2 |
| FALSE, TRUE, H/L | FALSE, TRUE, H/L | L/H              | X          | FALSE | FALSE | TRUE  | FALSE | Betätigung - Taste 3 |
| FALSE, TRUE, H/L | FALSE, TRUE, H/L | FALSE, TRUE, H/L | L/H        | FALSE | FALSE | FALSE | TRUE  | Betätigung - Taste 4 |

Legende: X … nicht relevant, L/H … ansteigende Flanke, H/L … abfallende Flanke

#### Zentrale Deaktivierung aller Ausgänge *xButtonOff* bzw. **xButtonOffVisu**

Die Ausgänge *xQ1* bis *xQ4* werden deaktiviert (= FALSE), falls am Eingang *xButtonOff* oder am Sollwert / Parameter **xButtonOffVisu** eine ansteigende Flanke erkannt wird.\
(unabhängig von den aktuellen Zuständen an den Bedieneingängen *xButton1* bis *xButton4*).

### CODESYS

InOut:

| Scope       | Name             | Type   | Initial |
| ----------- | ---------------- | ------ | ------- |
| Input       | `xButton1`       | `BOOL` |         |
| Input       | `xButton2`       | `BOOL` |         |
| Input       | `xButton3`       | `BOOL` |         |
| Input       | `xButton4`       | `BOOL` |         |
| Input       | `xButtonOff`     | `BOOL` |         |
| Input Const | `xButtonOffVisu` | `BOOL` | FALSE   |
| Input Const | `xButton4Visu`   | `BOOL` | FALSE   |
| Input Const | `xButton3Visu`   | `BOOL` | FALSE   |
| Input Const | `xButton2Visu`   | `BOOL` | FALSE   |
| Input Const | `xButton1Visu`   | `BOOL` | FALSE   |
| Output      | `xQ1`            | `BOOL` |         |
| Output      | `xQ2`            | `BOOL` |         |
| Output      | `xQ3`            | `BOOL` |         |
| Output      | `xQ4`            | `BOOL` |         |
| Output      | `xQ`             | `BOOL` |         |


---

# 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/hvac-library/functionblocks/button/button4.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.
