# 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="/files/7sBRw0W5HfS2Bxgvht1f" 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: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.powerio.com/hub/codesys-hvac/hvac-library/functionblocks/button/button4.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
