# Button1

## `Button1` (FB)

FUNCTION\_BLOCK Button1

### Short description

> Switching element with timer program and push button.

### Representation

<figure><img src="/files/9089ee40a2017056bd0636cd3fde3a1a14851818" alt=""><figcaption></figcaption></figure>

### Interfaces

#### Inputs

| Name            | Data type | Value range | Initial value | Function               |
| --------------- | --------- | ----------- | ------------- | ---------------------- |
| *xClockchannel* | BOOL      |             |               | Input - timer program  |
| *xButton*       | BOOL      |             |               | Input - control button |

#### Outputs

| Name         | Data type | Value range | Initial value | Function                                      |
| ------------ | --------- | ----------- | ------------- | --------------------------------------------- |
| *xQ*         | BOOL      |             |               | Enable output                                 |
| *xQET*       | BOOL      |             |               | Indicator: hold-extension is active           |
| *tET*        | TIME      |             |               | Remaining time - hold-extension               |
| *tTime*      | TIME      |             |               | Scaled display of **udiTime**                 |
| *udiMinVisu* | UDINT     |             |               | Display of **tMinTime** for the visualization |
| *udiMaxVisu* | UDINT     |             |               | Display of **tMaxTime** for the visualization |

#### Setpoints / parameters

| Name               | Data type | Value range                                 | Initial value | Function                                                              |
| ------------------ | --------- | ------------------------------------------- | ------------- | --------------------------------------------------------------------- |
| **eManModeB**      | eMANBIN   | eMANBIN.Auto, eMANBIN.ManOff, eMANBIN.ManOn | eMANBIN.Auto  | Operating mode of the manual override for the digital output *xQ*     |
| **xButtonVisu**    | BOOL      |                                             | FALSE         | Function like *xButton*                                               |
| **xEnClockButton** | BOOL      |                                             | FALSE         | Option 'Enable control button during active timer program'            |
| **xEnToggle**      | BOOL      |                                             | TRUE          | Option 'Lock - toggle operating mode'                                 |
| **udiTime**        | UDINT     |                                             | 120           | Time input (absolute limits: 0..7 days) depending on scaling          |
| **eTimeScale**     | eTime     |                                             | eTime.Minute  | Definition of the scaling of the time input (seconds, minutes, hours) |
| **tMinTime**       | TIME      |                                             | T#0m          | Lower limit for the time input **udiTime**                            |
| **tMaxTime**       | TIME      |                                             | T#120m        | Upper limit for the time input **udiTime**                            |

### Function description

#### General

The function block is basically used to define the operating modes night operation (*xQ* = FALSE) and day operation (*xQ* = TRUE) depending on the states of the inputs timer program (*xClockchannel*) and control button (*xButton* and / or **xButtonVisu**).\
The operating behavior is influenced by a total of two adjustable options.\
In the basic configuration (see option settings below), the basic functions are available.

#### Enable output *xQ*

The enable output *xQ* always indicates the current state of the switching element depending on the inputs and the two options.

#### Indicator - hold-extension *xQET*

The indicator output *xQET* always indicates the active state of the hold-extension.

#### Remaining time - hold-extension *tET*

The indicator output *tET* always indicates the current remaining time of an active hold-extension.\
Immediately after the first download and before the first start of the timer, the value T#0s is always displayed.

#### Option **tEnClockButton**

With this option the button is locked or enabled during the active timer program.\
If the setpoint/parameter **tEnClockButton** TRUE, then the outputs can be switched on and off with the buttons (*xButton* and/or **xButtonVisu**) when the input *xClockchannel*is active, the output *xQ* can be switched off and on.

#### Option **tEnToggle**

If the setpoint / parameter **tEnToggle** TRUE, then in night operation the hold-extension can be turned on and off with the buttons (*xButton* and / or **xButtonVisu**). Otherwise only starting the hold-extension is possible.

#### Scaling / display of the time duration **udiTime**

The indicator output *tTime* permanently shows the current value of the setpoint / parameter **udiTime** in scaled form (**eTimeScale**)\
and absolutely limited by **tMinTime** or **tMaxTime** .

#### Display of the lower time limit *udiMinVisu*

The indicator output *udiMinVisu* permanently shows the current value of the setpoint / parameter **tMinTime** in scaled form (**eTimeScale**)\
and absolutely limited by **tMinTime** or **tMaxTime** .

#### Display of the lower time limit *udiMaxVisu*

The indicator output *udiMaxVisu* permanently shows the current value of the setpoint / parameter **tMaxTime** in scaled form (**eTimeScale**)\
and absolutely limited by **tMinTime** or **tMaxTime** .\
\
CODESYS

InOut:

| Scope       | Name             | Type    | Initial        |
| ----------- | ---------------- | ------- | -------------- |
| Input       | `xClockchannel`  | `BOOL`  |                |
| Input       | `xButton`        | `BOOL`  |                |
| Output      | `xQ`             | `BOOL`  |                |
| Output      | `xQET`           | `BOOL`  |                |
| Output      | `tET`            | `TIME`  |                |
| Output      | `tTime`          | `TIME`  |                |
| Output      | `udiMinVisu`     | `UDINT` |                |
| Output      | `udiMaxVisu`     | `UDINT` |                |
| Input Const | `tMaxTime`       | `TIME`  | TIME#120m0s0ms |
| Input Const | `tMinTime`       | `TIME`  | TIME#0ms       |
| Input Const | `eTimeScale`     | eTime   | eTime.Minute   |
| Input Const | `udiTime`        | `UDINT` | 120            |
| Input Const | `xEnToggle`      | `BOOL`  | TRUE           |
| Input Const | `xEnClockButton` | `BOOL`  | FALSE          |
| Input Const | `xButtonVisu`    | `BOOL`  | FALSE          |
| Input Const | `eManModeB`      | eManBin | eMANBIN.Auto   |


---

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