> 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/clock/holiday.md).

# Holiday

## `Holiday` (FB)

FUNCTION\_BLOCK Holiday

### Short description

> Definition of 10 holiday periods (= channels) with switch-on and switch-off dates.\
> Typical application: clock system

### Representation

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

### Interfaces

#### Inputs

| Name  | Data type | Value range | Initial value | Function                                                             |
| ----- | --------- | ----------- | ------------- | -------------------------------------------------------------------- |
| *xEN* | BOOL      |             |               | Enable / block the holiday periods (FALSE = blocked, TRUE = enabled) |

#### Outputs

| Name            | Data type | Value range | Initial value | Function                                                                          |
| --------------- | --------- | ----------- | ------------- | --------------------------------------------------------------------------------- |
| *xActive*       | BOOL      |             |               | State of the holiday periods (FALSE = not active, TRUE = active)                  |
| *datActiveFrom* | DATE      |             |               | Switch-on date of the last active holiday period (Channel 10 = highest priority)  |
| *datActiveTo*   | DATE      |             |               | Switch-off date of the last active holiday period (Channel 10 = highest priority) |

#### Setpoints / Parameters

| Name                  | Data type | Value range | Initial value | Function                                                    |
| --------------------- | --------- | ----------- | ------------- | ----------------------------------------------------------- |
| **xCh10\_Mode**       | BOOL      |             | TRUE          | Enable / block Channel 10 (FALSE = blocked, TRUE = enabled) |
| **datCH10\_DateFrom** | DATE      |             | DATE#2019-1-1 | Switch-on date Channel 10                                   |
| **datCH10\_DateTo**   | DATE      |             | DATE#2019-1-1 | Switch-off date Channel 10                                  |
| **sCH10\_Notice**     | STRING    |             | ‘Notice’      | Label for Channel 10                                        |
| **xCh9\_Mode**        | BOOL      |             | TRUE          | Enable / block Channel 9 (FALSE = blocked, TRUE = enabled)  |
| **datCH9\_DateFrom**  | DATE      |             | DATE#2019-1-1 | Switch-on date Channel 9                                    |
| **datCH9\_DateTo**    | DATE      |             | DATE#2019-1-1 | Switch-off date Channel 9                                   |
| **sCH9\_Notice**      | STRING    |             | ‘Notice’      | Label for Channel 9                                         |
| **xCh8\_Mode**        | BOOL      |             | TRUE          | Enable / block Channel 8 (FALSE = blocked, TRUE = enabled)  |
| **datCH8\_DateFrom**  | DATE      |             | DATE#2019-1-1 | Switch-on date Channel 8                                    |
| **datCH8\_DateTo**    | DATE      |             | DATE#2019-1-1 | Switch-off date Channel 8                                   |
| **sCH8\_Notice**      | STRING    |             | ‘Notice’      | Label for Channel 8                                         |
| **xCh7\_Mode**        | BOOL      |             | TRUE          | Enable / block Channel 7 (FALSE = blocked, TRUE = enabled)  |
| **datCH7\_DateFrom**  | DATE      |             | DATE#2019-1-1 | Switch-on date Channel 7                                    |
| **datCH7\_DateTo**    | DATE      |             | DATE#2019-1-1 | Switch-off date Channel 7                                   |
| **sCH7\_Notice**      | STRING    |             | ‘Notice’      | Label for Channel 7                                         |
| **xCh6\_Mode**        | BOOL      |             | TRUE          | Enable / block Channel 6 (FALSE = blocked, TRUE = enabled)  |
| **datCH6\_DateFrom**  | DATE      |             | DATE#2019-1-1 | Switch-on date Channel 6                                    |
| **datCH6\_DateTo**    | DATE      |             | DATE#2019-1-1 | Switch-off date Channel 6                                   |
| **sCH6\_Notice**      | STRING    |             | ‘Notice’      | Label for Channel 6                                         |
| **xCh5\_Mode**        | BOOL      |             | TRUE          | Enable / block Channel 5 (FALSE = blocked, TRUE = enabled)  |
| **datCH5\_DateFrom**  | DATE      |             | DATE#2019-1-1 | Switch-on date Channel 5                                    |
| **datCH5\_DateTo**    | DATE      |             | DATE#2019-1-1 | Switch-off date Channel 5                                   |
| **sCH5\_Notice**      | STRING    |             | ‘Notice’      | Label for Channel 5                                         |
| **xCh4\_Mode**        | BOOL      |             | TRUE          | Enable / block Channel 4 (FALSE = blocked, TRUE = enabled)  |
| **datCH4\_DateFrom**  | DATE      |             | DATE#2019-1-1 | Switch-on date Channel 4                                    |
| **datCH4\_DateTo**    | DATE      |             | DATE#2019-1-1 | Switch-off date Channel 4                                   |
| **sCH4\_Notice**      | STRING    |             | ‘Notice’      | Label for Channel 4                                         |
| **xCh3\_Mode**        | BOOL      |             | TRUE          | Enable / block Channel 3 (FALSE = blocked, TRUE = enabled)  |
| **datCH3\_DateFrom**  | DATE      |             | DATE#2019-1-1 | Switch-on date Channel 3                                    |
| **datCH3\_DateTo**    | DATE      |             | DATE#2019-1-1 | Switch-off date Channel 3                                   |
| **sCH3\_Notice**      | STRING    |             | ‘Notice’      | Label for Channel 3                                         |
| **xCh2\_Mode**        | BOOL      |             | TRUE          | Enable / block Channel 2 (FALSE = blocked, TRUE = enabled)  |
| **datCH2\_DateFrom**  | DATE      |             | DATE#2019-1-1 | Switch-on date Channel 2                                    |
| **datCH2\_DateTo**    | DATE      |             | DATE#2019-1-1 | Switch-off date Channel 2                                   |
| **sCH2\_Notice**      | STRING    |             | ‘Notice’      | Label for Channel 2                                         |
| **xCh1\_Mode**        | BOOL      |             | TRUE          | Enable / block Channel 1 (FALSE = blocked, TRUE = enabled)  |
| **datCH1\_DateFrom**  | DATE      |             | DATE#2019-1-1 | Switch-on date Channel 1                                    |
| **datCH1\_DateTo**    | DATE      |             | DATE#2019-1-1 | Switch-off date Channel 1                                   |
| **sCH1\_Notice**      | STRING    |             | ‘Notice’      | Label for Channel 1                                         |

### Functional description

#### General

This function block evaluates up to 10 freely definable holiday periods (= channels).\
If evaluation is generally enabled (*xEN* = TRUE), then for all activated holiday periods (**xChX\_Mode** = TRUE, 0 < X < 11) it is checked whether the current date lies within the holiday period. If this is the case for at least one activated holiday period, the output *xActive* is activated (= TRUE).\
In all other cases, the output *xActive* is deactivated (= FALSE).\
If the switch-off date is before the switch-on date in time (channels 1 - 10), the switch-off date is internally set equal to the switch-on date.\
If the switch-on and switch-off dates of a channel (channels 1 - 10) are identical, this day is evaluated as a holiday.\
At the outputs *datActiveFrom* or *datActiveTo* are available (prerequisite: *xEN* = TRUE) the switch-on date / switch-off date of channel 10 are available.

> **Prerequisite for using the Holiday function block**
>
> For correct operation, the use of the TimeRead2 function block is required.

### Visualization

Suitable visualization element from the HVACV Visu Library: **Holidays**

#### Representation

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

#### Interfaces visualization element

| Name             | Data type | Type         | Initial value | Function                                                                                                                                                                                                                                                                                                    |
| ---------------- | --------- | ------------ | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **FB\_Holiday**  | Holiday   | VAR\_IN\_OUT |               | Enter FB Holiday here e.g. PRG.Holiday                                                                                                                                                                                                                                                                      |
| **BMS\_Active**  | BOOL      | VAR\_INPUT   |               | BMS (Building Management System) GLT (building management system). If BMS\_Active = TRUE, input/editing of the clocks is disabled because they can then only be set via the BMS. Times can then only be viewed.                                                                                             |
| **DisableInput** | BOOL      | VAR\_INPUT   |               | DisableInpput = TRUE the times of the weekly clocks can only be viewed and not edited./// - BMS (Building Management System) GLT (building management system). If BMS\_Active = TRUE, input/editing of the clocks is disabled because they can then only be set via the BMS. Times can then only be viewed. |

\
Note: VAR\_IN\_OUT interfaces must be assigned; VAR\_INPUT is optional.

### CODESYS

InOut:

| Scope       | Name               | Type     | Initial       |
| ----------- | ------------------ | -------- | ------------- |
| Input       | `xEn`              | `BOOL`   |               |
| Input Const | `sCH1_Notice`      | `STRING` | ‘Notice’      |
| Input Const | `datCH1_DateTo`    | `DATE`   | DATE#2022-1-1 |
| Input Const | `datCH1_DateFrom`  | `DATE`   | DATE#2022-1-1 |
| Input Const | `xCH1_Mode`        | `BOOL`   | TRUE          |
| Input Const | `sCH2_Notice`      | `STRING` | ‘Notice’      |
| Input Const | `datCH2_DateTo`    | `DATE`   | DATE#2022-1-1 |
| Input Const | `datCH2_DateFrom`  | `DATE`   | DATE#2022-1-1 |
| Input Const | `xCH2_Mode`        | `BOOL`   | TRUE          |
| Input Const | `sCH3_Notice`      | `STRING` | ‘Notice’      |
| Input Const | `datCH3_DateTo`    | `DATE`   | DATE#2022-1-1 |
| Input Const | `datCH3_DateFrom`  | `DATE`   | DATE#2022-1-1 |
| Input Const | `xCH3_Mode`        | `BOOL`   | TRUE          |
| Input Const | `sCH4_Notice`      | `STRING` | ‘Notice’      |
| Input Const | `datCH4_DateTo`    | `DATE`   | DATE#2022-1-1 |
| Input Const | `datCH4_DateFrom`  | `DATE`   | DATE#2022-1-1 |
| Input Const | `xCH4_Mode`        | `BOOL`   | TRUE          |
| Input Const | `sCH5_Notice`      | `STRING` | ‘Notice’      |
| Input Const | `datCH5_DateTo`    | `DATE`   | DATE#2022-1-1 |
| Input Const | `datCH5_DateFrom`  | `DATE`   | DATE#2022-1-1 |
| Input Const | `xCH5_Mode`        | `BOOL`   | TRUE          |
| Input Const | `sCH6_Notice`      | `STRING` | ‘Notice’      |
| Input Const | `datCH6_DateTo`    | `DATE`   | DATE#2022-1-1 |
| Input Const | `datCH6_DateFrom`  | `DATE`   | DATE#2022-1-1 |
| Input Const | `xCH6_Mode`        | `BOOL`   | TRUE          |
| Input Const | `sCH7_Notice`      | `STRING` | ‘Notice’      |
| Input Const | `datCH7_DateTo`    | `DATE`   | DATE#2022-1-1 |
| Input Const | `datCH7_DateFrom`  | `DATE`   | DATE#2022-1-1 |
| Input Const | `xCH7_Mode`        | `BOOL`   | TRUE          |
| Input Const | `sCH8_Notice`      | `STRING` | ‘Notice’      |
| Input Const | `datCH8_DateTo`    | `DATE`   | DATE#2022-1-1 |
| Input Const | `datCH8_DateFrom`  | `DATE`   | DATE#2022-1-1 |
| Input Const | `xCH8_Mode`        | `BOOL`   | TRUE          |
| Input Const | `sCH9_Notice`      | `STRING` | ‘Notice’      |
| Input Const | `datCH9_DateTo`    | `DATE`   | DATE#2022-1-1 |
| Input Const | `datCH9_DateFrom`  | `DATE`   | DATE#2022-1-1 |
| Input Const | `xCH9_Mode`        | `BOOL`   | TRUE          |
| Input Const | `sCH10_Notice`     | `STRING` | ‘Notice’      |
| Input Const | `datCH10_DateTo`   | `DATE`   | DATE#2022-1-1 |
| Input Const | `datCH10_DateFrom` | `DATE`   | DATE#2022-1-1 |
| Input Const | `xCH10_Mode`       | `BOOL`   | TRUE          |
| Output      | `xActive`          | `BOOL`   |               |
| Output      | `datActiveFrom`    | `DATE`   |               |
| Output      | `datActiveTo`      | `DATE`   |               |


---

# 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/clock/holiday.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.
