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

# Clock7d1Ch

## `Clock7d1Ch` (FB)

FUNCTION\_BLOCK Clock7d1Ch

### Short description

> Timer switch with 7 weekdays, each with one switch-on / switch-off time and a binary overall output.\
> The operating mode (on period or off period) can be defined for each weekday.\
> Typical application: definition of the night / day operation of zone temperature control.

### Representation

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

### Interfaces

#### Inputs

| Name  | Data type | Value range | Initial value | Function     |
| ----- | --------- | ----------- | ------------- | ------------ |
| *xEn* | BOOL      |             |               | Enable input |

#### Outputs

| Name               | Data type | Value range | Initial value | Function                               |
| ------------------ | --------- | ----------- | ------------- | -------------------------------------- |
| *xActive*          | BOOL      |             |               | Display of active switching periods    |
| *todActivatedFrom* | TOD       |             |               | Switch-on time of the current weekday  |
| *todActivatedTo*   | TOD       |             |               | Switch-off time of the current weekday |

#### Setpoints / Parameters

| Name           | Data type | Value range | Initial value | Function                            |
| -------------- | --------- | ----------- | ------------- | ----------------------------------- |
| **todMonFrom** | TOD       |             | TOD#07:00     | Switch-on time - Monday             |
| **todMonTo**   | TOD       |             | TOD#12:00     | Switch-off time - Monday            |
| **xMonMode**   | BOOL      |             | TRUE          | Mode - switching period - Monday    |
| **todTueFrom** | TOD       |             | TOD#07:00     | Switch-on time - Tuesday            |
| **todTueTo**   | TOD       |             | TOD#12:00     | Switch-off time - Tuesday           |
| **xTueMode**   | BOOL      |             | TRUE          | Mode - switching period - Tuesday   |
| **todWedFrom** | TOD       |             | TOD#07:00     | Switch-on time - Wednesday          |
| **todWedTo**   | TOD       |             | TOD#12:00     | Switch-off time - Wednesday         |
| **xWedMode**   | BOOL      |             | TRUE          | Mode - switching period - Wednesday |
| **todThuFrom** | TOD       |             | TOD#07:00     | Switch-on time - Thursday           |
| **todThuTo**   | TOD       |             | TOD#12:00     | Switch-off time - Thursday          |
| **xThuMode**   | BOOL      |             | TRUE          | Mode - switching period - Thursday  |
| **todFriFrom** | TOD       |             | TOD#07:00     | Switch-on time - Friday             |
| **todFriTo**   | TOD       |             | TOD#12:00     | Switch-off time - Friday            |
| **xFriMode**   | BOOL      |             | TRUE          | Mode - switching period - Friday    |
| **todSatFrom** | TOD       |             | TOD#07:00     | Switch-on time - Saturday           |
| **todSatTo**   | TOD       |             | TOD#12:00     | Switch-off time - Saturday          |
| **xSatMode**   | BOOL      |             | TRUE          | Mode - switching period - Saturday  |
| **todSunFrom** | TOD       |             | TOD#07:00     | Switch-on time - Sunday             |
| **todSunTo**   | TOD       |             | TOD#12:00     | Switch-off time - Sunday            |
| **xSunMode**   | BOOL      |             | TRUE          | Mode - switching period - Sunday    |
| **sNotice**    | STRING    |             | ‘Notice’      | Label - time switch                 |

### Functional description

#### General

#### Weekdays 1 - 7 (Monday … Sunday, XXX = Mon, Tue, Wed, Thu, Fri, Sat, Sun)

Each of the seven weekdays is assigned its own switching period.\
\
Each switching period is defined by configurable data (switch-on time **todXXXTimeFrom** and switch-off time **todXXXTimeTo**) is defined.\
In addition, an operating mode (**xXXXMode**) can be set for each weekday.\
\
If the switch-off time is before the switch-on time, then for the check the switch-off time is set to the value of the switch-on time.\
\
A switching period is active if the current time on weekday XXX is within the switching period of weekday XXX (**xXXXMode** = TRUE).\
A switching period is active if the current time on weekday XXX is outside the switching period of weekday XXX (**xXXXMode** = FALSE).

> **Special case 1: switch-on time = switch-off time = TOD#00:00**
>
> With active on period ( **xXXXMode** = TRUE ) the switching period is not active all day.\
> With active off period ( **xXXXMode** = FALSE ) the switching period is active all day.
>
> **Special case 2: switch-on time = switch-off time = TOD#23:59**
>
> With active on period (**xXXXMode** = TRUE) the switching period is active all day.\
> With active off period (**xXXXMode** = FALSE) the switching period is not active all day.
>
> **Prerequisite for the use of function block Clock7d1Ch**
>
> For correct operation, the use of the TimeRead2 function block is required.

#### On period

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

#### Off period

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

#### Enable input *xEn*

| *xEn* | *xActive*                                                          | *todActivatedFrom*                                            | *todActivatedTo*                                               | Note           |
| ----- | ------------------------------------------------------------------ | ------------------------------------------------------------- | -------------------------------------------------------------- | -------------- |
| FALSE | FALSE                                                              | unchanged                                                     | unchanged                                                      | FB deactivated |
| TRUE  | State depending on the weekday, the time, and the switching period | Switch-on time of the switching period of the current weekday | Switch-off time of the switching period of the current weekday | FB activated   |

#### Display output *xActive*

The display output *xActive* assumes the state TRUE if, with active enable input (*xEn* = TRUE) the time on weekday XXX lies within the switching period of weekday XXX (**xXXXMode** = TRUE, on period).\
The display output *xActive* assumes the state TRUE if, with active enable input (*xEn* = TRUE) the time on weekday XXX lies outside the switching period of weekday XXX (**xXXXMode** = FALSE, off period).\
In all other cases the display output *xActive* assumes the state FALSE.

| *xEn* | *xActive* | Switching period XXX | **xXXXMode** - XXX | Note                  |
| ----- | --------- | -------------------- | ------------------ | --------------------- |
| FALSE | FALSE     | X                    | X                  | FB deactivated        |
| TRUE  | FALSE     | FALSE                | TRUE               | On period not active  |
| TRUE  | TRUE      | TRUE                 | TRUE               | On period active      |
| TRUE  | TRUE      | FALSE                | FALSE              | Off period not active |
| TRUE  | FALSE     | TRUE                 | FALSE              | Off period active     |

#### Switch-on time of the switching period of the current weekday *todActivatedFrom*

This output permanently shows the switch-on time of the switching period of the current weekday, if the enable input (*xEn* = TRUE) is active.\
In all other situations it is not changed. In special cases 1 and 2, the value TOD#00:00 is always displayed.

#### Switch-off time of the switching period of the current weekday *todActivatedTo*

This output permanently shows the switch-off time of the switching period of the current weekday, if the enable input (*xEn* = TRUE) is active.\
In all other situations it is not changed. In special case 1, the value TOD#00:00 is always displayed; in special case 2, the value TOD#23:59 is displayed.

### Visualization

Suitable visualization element from the HVACV Visu Library: **FB\_Clock7d1Ch**

#### Representation

>

#### Interfaces visualization element

| Name               | Data type  | Type         | Initial value | Function                                      |
| ------------------ | ---------- | ------------ | ------------- | --------------------------------------------- |
| **FB\_Clock7d1Ch** | Clock7d1Ch | VAR\_IN\_OUT |               | Enter FB Clock7d1Ch here, e.g. PRG.Clock7d1Ch |

Or visualization element **Clock7d1Ch\_D** as a dialog. Call up the dialog, e.g. via the visualization element **Clock7d1Ch\_Button**

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

#### Interfaces visualization element

| Name               | Data type  | Type         | Initial value | Function                                                                                                                                                                                                                    |
| ------------------ | ---------- | ------------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **FB\_Clock7d1Ch** | Clock7d1Ch | VAR\_IN\_OUT |               | Enter FB Clock7d1Ch here, e.g. PRG.Clock7d1Ch                                                                                                                                                                               |
| **ClockNumber**    | INT        | VAR\_INPUT   |               | Clock number. Used only for displaying the title.                                                                                                                                                                           |
| **BMS\_Active**    | BOOL       | VAR\_INPUT   |               | BMS (Building Management System) GLT (building management and control 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   |               | DisableInput = TRUE times of the weekly clocks can only be viewed and not edited.                                                                                                                                           |

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

### CODESYS

InOut:

| Scope       | Name               | Type       | Initial                       |
| ----------- | ------------------ | ---------- | ----------------------------- |
| Input       | `xEn`              | `BOOL`     |                               |
| Input Const | `todMonFrom`       | `TOD`      | TIME\_OF\_DAY#6:0             |
| Input Const | `todMonTo`         | `TOD`      | TIME\_OF\_DAY#18:0            |
| Input Const | `xMonMode`         | `BOOL`     | TRUE                          |
| Input Const | `todTueFrom`       | `TOD`      | TIME\_OF\_DAY#6:0             |
| Input Const | `todTueTo`         | `TOD`      | TIME\_OF\_DAY#18:0            |
| Input Const | `xTueMode`         | `BOOL`     | TRUE                          |
| Input Const | `todWedFrom`       | `TOD`      | TIME\_OF\_DAY#6:0             |
| Input Const | `todWedTo`         | `TOD`      | TIME\_OF\_DAY#18:0            |
| Input Const | `xWedMode`         | `BOOL`     | TRUE                          |
| Input Const | `todThuFrom`       | `TOD`      | TIME\_OF\_DAY#6:0             |
| Input Const | `todThuTo`         | `TOD`      | TIME\_OF\_DAY#18:0            |
| Input Const | `xThuMode`         | `BOOL`     | TRUE                          |
| Input Const | `todFriFrom`       | `TOD`      | TIME\_OF\_DAY#6:0             |
| Input Const | `todFriTo`         | `TOD`      | TIME\_OF\_DAY#18:0            |
| Input Const | `xFriMode`         | `BOOL`     | TRUE                          |
| Input Const | `todSatFrom`       | `TOD`      | TIME\_OF\_DAY#6:0             |
| Input Const | `todSatTo`         | `TOD`      | TIME\_OF\_DAY#18:0            |
| Input Const | `xSatMode`         | `BOOL`     | TRUE                          |
| Input Const | `todSunFrom`       | `TOD`      | TIME\_OF\_DAY#6:0             |
| Input Const | `todSunTo`         | `TOD`      | TIME\_OF\_DAY#18:0            |
| Input Const | `xSunMode`         | `BOOL`     | TRUE                          |
| Input Const | `sNotice`          | `STRING`   | ‘Notice’                      |
| Input Const | `eMode`            | eClockMode | eClockMode.EachModeSeparately |
| Output      | `xActive`          | `BOOL`     |                               |
| Output      | `todActivatedFrom` | `TOD`      |                               |
| Output      | `todActivatedTo`   | `TOD`      |                               |


---

# 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/clock7d1ch.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.
