> 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 | Range of values | Initial value | Function                                                                 |
| ----- | --------- | --------------- | ------------- | ------------------------------------------------------------------------ |
| *xEN* | BOOL      |                 |               | Enable / disable of the holiday periods (FALSE = disable, TRUE = enable) |

#### Outputs

| Name            | Data type | Range of values | 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 | Range of values | Initial value | Function                                                     |
| --------------------- | --------- | --------------- | ------------- | ------------------------------------------------------------ |
| **xCh10\_Mode**       | BOOL      |                 | TRUE          | Enable / disable channel 10 (FALSE = disable, TRUE = enable) |
| **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 / disable channel 9 (FALSE = disable, TRUE = enable)  |
| **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 / disable channel 8 (FALSE = disable, TRUE = enable)  |
| **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 / disable channel 7 (FALSE = disable, TRUE = enable)  |
| **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 / disable channel 6 (FALSE = disable, TRUE = enable)  |
| **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 / disable channel 5 (FALSE = disable, TRUE = enable)  |
| **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 / disable channel 4 (FALSE = disable, TRUE = enable)  |
| **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 / disable channel 3 (FALSE = disable, TRUE = enable)  |
| **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 / disable channel 2 (FALSE = disable, TRUE = enable)  |
| **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 / disable channel 1 (FALSE = disable, TRUE = enable)  |
| **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                                          |

### Function description

#### General

This function block evaluates a maximum of 10 freely definable holiday periods (= channels).\
If the 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, then output *xActive* is activated (= TRUE).\
In all other cases, output *xActive* is deactivated (= FALSE).\
If the switch-off date is before the switch-on date (channels 1 - 10), then the switch-off date is internally set equal to the switch-on date.\
If the switch-on and switch-off date of a channel (channels 1 - 10) are identical, then this day is evaluated as a holiday.\
At the outputs *datActiveFrom* or *datActiveTo* are available (requirement: *xEN* = TRUE) the switch-on date / switch-off date of channel 10.

> **Requirement 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>

#### Interface Visu element

| Name             | Data type | Type         | Initial value | Function                                                                                                                                                                                                                                                                                                |
| ---------------- | --------- | ------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **FB\_Holiday**  | Holiday   | VAR\_IN\_OUT |               | Enter the Holiday FB here e.g. PRG.Holiday                                                                                                                                                                                                                                                              |
| **BMS\_Active**  | BOOL      | VAR\_INPUT   |               | BMS (Building Management System) BMS (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 times of the weekly clocks can only be viewed and not edited./// - BMS (Building Management System) BMS (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 are 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 dynamically by asking a question.

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

```
GET https://support.powerio.com/hub/codesys-hvac/en/hvac-library/functionblocks/clock/holiday.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
