> 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/button/button1.md).

# Button1

## `Button1` (FB)

FUNCTION\_BLOCK Button1

### Short description

> Switching element with time program and button.

### Representation

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

### Interfaces

#### Inputs

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

#### Outputs

| Name         | Data type | Value range | Initial value | Function                                      |
| ------------ | --------- | ----------- | ------------- | --------------------------------------------- |
| *xQ*         | BOOL      |             |               | Enable output                                 |
| *xQET*       | BOOL      |             |               | Display operating time extension is active    |
| *tET*        | TIME      |             |               | Remaining runtime of operating time extension |
| *tTime*      | TIME      |             |               | Scaled display from **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 operating button when time program input is active’    |
| **xEnToggle**      | BOOL      |                                             | TRUE          | Option ‘Blocking change of 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**                            |

### Functional description

#### General

The function block is fundamentally used to set the operating modes night operation (*xQ* = FALSE) and day operation (*xQ* = TRUE) depending on the states at the inputs time program (*xClockchannel*) and operating button (*xButton* and/or **xButtonVisu**).\
The operating behavior is influenced by a total of two configurable options.\
In the basic configuration (see below for setting the options), the basic functions are available.

#### Enable output *xQ*

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

#### Operating time extension display *xQET*

The display output *xQET* always displays the active state of the operating time extension.

#### Remaining runtime of operating time extension *tET*

The display output *tET* always displays the current remaining runtime of an active operating time extension.\
Directly after the first download and before the timer is started for the first time, the value T#0s is always displayed.

#### Option **tEnClockButton**

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

#### Option **tEnToggle**

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

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

The display output *tTime* continuously displays the current value of the setpoint / parameter **udiTime** in scaled form (**eTimeScale**)\
and absolutely limited by **tMinTime** or **tMaxTime** to.

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

The display output *udiMinVisu* continuously displays the current value of the setpoint / parameter **tMinTime** in scaled form (**eTimeScale**)\
and absolutely limited by **tMinTime** or **tMaxTime** to.

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

The display output *udiMaxVisu* continuously displays the current value of the setpoint / parameter **tMaxTime** in scaled form (**eTimeScale**)\
and absolutely limited by **tMinTime** or **tMaxTime** to.\
\
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
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/button/button1.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.
