# Clock7d1Ch

## `Clock7d1Ch` (FB)

FUNCTION\_BLOCK Clock7d1Ch

### Short description

> Timer with 7 weekdays, each having one on/off time and a binary overall output.\
> The mode of operation (on period or off period) can be defined per weekday.\
> Typical application: Definition of night/day operation of a zone temperature controller.

### Representation

<figure><img src="/files/3233a4ac2938a6af15982bff9429e434fb2495ee" 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                 |

### Function 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 adjustable data (switch-on time **todXXXTimeFrom** and switch-off time **todXXXTimeTo**) .\
Additionally, an operating mode (**xXXXMode**) per weekday.\
\
If the switch-off time is earlier than the switch-on time, the switch-off time is set to the value of the switch-on time for evaluation.\
\
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**
>
> When on period is active ( **xXXXMode** = TRUE ) the switching period is not active all day.\
> If the off period is active ( **xXXXMode** = FALSE ) the switching period is active all day.
>
> **Special case 2: switch-on time = switch-off time = TOD#23:59**
>
> When on period is active (**xXXXMode** = TRUE) the switching period is active all day.\
> When off period is active (**xXXXMode** = FALSE) the switching period is not active all day.
>
> **Prerequisite for using the function block Clock7d1Ch**
>
> The use of the TimeRead2 function block is required for correct operation.

#### On period

<figure><img src="/files/4d8326d18170ec50b7f39f914a50124975489725" alt=""><figcaption></figcaption></figure>

#### Off period

<figure><img src="/files/83369704b7535a6d8b1c227139c71038e0bbcc2f" alt=""><figcaption></figcaption></figure>

#### Enable input *xEn*

| *xEn* | *xActive*                                                    | *todActivatedFrom*                                            | *todActivatedTo*                                               | Note        |
| ----- | ------------------------------------------------------------ | ------------------------------------------------------------- | -------------------------------------------------------------- | ----------- |
| FALSE | FALSE                                                        | unchanged                                                     | unchanged                                                      | FB disabled |
| TRUE  | State depending on weekday, time of day and 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 enabled  |

#### Display output *xActive*

The display output *xActive* assumes the state TRUE if, with the enable input active (*xEn* = TRUE) the time on weekday XXX is within the switching period of weekday XXX (**xXXXMode** = TRUE, on period).\
The display output *xActive* assumes the state TRUE if, with the enable input active (*xEn* = TRUE) the time on weekday XXX is 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 disabled           |
| 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 shown.

#### 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 shown, in special case 2 the value TOD#23:59 is shown.

### Visualization

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

#### Representation

>

#### Interfaces Visu-Element

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

Or visual element **Clock7d1Ch\_D** as dialog. Call the dialog e.g. via the visual element **Clock7d1Ch\_Button**

<figure><img src="/files/f89ddfd84d7423922cf2e594d986a2b722605336" alt=""><figcaption></figcaption></figure>

#### Interfaces Visu-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). If BMS\_Active = TRUE the 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 weekday clocks can only be viewed and not edited.                                                                                                                          |

\
Note: VAR\_IN\_OUT interfaces must be assigned, VAR\_INPUT are 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: 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/clock/clock7d1ch.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.
