# ClockSlave32

## `ClockSlave32` (FB)

FUNCTION\_BLOCK ClockSlave32 EXTENDS Uhr\_Base IMPLEMENTS IUhr

### Short description

> Slave - function block for a clock system with 32 weekly timers, 30 public holidays, 10 holiday periods and 5 special switch times.

### Representation

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

### Function description

#### General

This function block serves as a slave function block for a clock system with 32 weekly timers, 30 public holidays, 10 holiday periods and 5 special switch times.\
It allows the individual activation / deactivation of the 32 weekly timer channels, the public holiday channel, the holiday channel as well as the special switch times channel (FALSE = deactivation, TRUE = activation).\
The connection between the master function block and the slave function blocks is established via the output *itfToClockSlave32* or the inputs *itfFromClockMaster32* established.\
The inputs *sTitle* or *sLine1* allow the specification of the label of the title or line 1 in the visualization.

#### State of the slave channel *xActive*

The output *xActive* (FALSE = not active, TRUE = active) is determined by the current states of the **assigned** weekly timer channels (**xClockCH\_01** to **xClockCH\_32** = TRUE) of the **assigned** public holiday channel (**xPublicHoliday** = TRUE), the **assigned** holiday channel (**xHoliday** = TRUE) or the **assigned** special switch times channel (**xSwitchTimeS** = TRUE) as follows (Note: channels that are not assigned automatically take the state FALSE):

| Weekly timer channels | Public holiday channel | Holiday channel | Special switch times channel | Central activation ( Master ) | Central deactivation ( Master ) | *xActive* | Notes                               |
| --------------------- | ---------------------- | --------------- | ---------------------------- | ----------------------------- | ------------------------------- | --------- | ----------------------------------- |
| FALSE                 | FALSE                  | FALSE           | FALSE                        | FALSE                         | FALSE                           | FALSE     | Normal operation - Off              |
| TRUE                  | FALSE                  | FALSE           | FALSE                        | FALSE                         | FALSE                           | TRUE      | Normal operation - On               |
| X                     | TRUE                   | FALSE           | FALSE                        | FALSE                         | FALSE                           | FALSE     | Public holiday operation - On       |
| X                     | FALSE                  | TRUE            | FALSE                        | FALSE                         | FALSE                           | FALSE     | Holiday operation - On              |
| X                     | X                      | X               | TRUE                         | FALSE                         | FALSE                           | TRUE      | Special switch times operation - On |
| X                     | X                      | X               | X                            | TRUE                          | FALSE                           | TRUE      | Central activation ( Master )       |
| X                     | X                      | X               | X                            | X                             | TRUE                            | FALSE     | Central deactivation ( Master )     |

Legend: X = arbitrary

#### Central cancellation of all assignments **xResetAssignment**

This setpoint / parameter is used for the central cancellation of all assignments made in the slave function block.

### Visualization

#### Representation

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

#### Interfaces Visu-Element

| Name                  | Data type     | Type         | Initial value | Function                                                                                                                                                                                                                     |
| --------------------- | ------------- | ------------ | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **FB\_ClockSlave32**  | ClockSlave32  | VAR\_IN\_OUT |               | Enter FB ClockSlave32 here e.g. PRG.ClockSlave32                                                                                                                                                                             |
| **FB\_ClockMaster32** | ClockMaster32 | VAR\_IN\_OUT |               | Enter corresponding(!) FB ClockMaster32 here e.g. PRG.ClockMaster32                                                                                                                                                          |
| **BMS\_Active**       | BOOL          | VAR\_INPUT   |               | BMS (Building Management System) GLT (building management control). If BMS\_Active = TRUE, the input / editing of the clocks is disabled because they can then only be set via the BMS. Clock times can then only be viewed. |

\
Note: VAR\_IN\_OUT interfaces must be assigned, VAR\_INPUT are optional.

### CODESYS

InOut:

| Scope       | Name                   | Type           | Initial | Inherited from |
| ----------- | ---------------------- | -------------- | ------- | -------------- |
| Input       | `itfFromClockMaster32` | `IUhrProtocol` |         | Uhr\_Base      |
| Input       | `sTitle`               | `STRING`       |         |                |
| Input       | `sLine1`               | `STRING`       |         |                |
| Input       | `sLine2`               | `STRING`       |         |                |
| Input Const | `ClockSlvPara`         | stSlvClockData |         |                |
| Input Const | `xSwitchTimeS`         | `BOOL`         |         |                |
| Input Const | `xPublicHoliday`       | `BOOL`         |         |                |
| Input Const | `xHoliday`             | `BOOL`         |         |                |
| Input Const | `xClockCH_32`          | `BOOL`         |         |                |
| Input Const | `xClockCH_31`          | `BOOL`         |         |                |
| Input Const | `xClockCH_30`          | `BOOL`         |         |                |
| Input Const | `xClockCH_29`          | `BOOL`         |         |                |
| Input Const | `xClockCH_28`          | `BOOL`         |         |                |
| Input Const | `xClockCH_27`          | `BOOL`         |         |                |
| Input Const | `xClockCH_26`          | `BOOL`         |         |                |
| Input Const | `xClockCH_25`          | `BOOL`         |         |                |
| Input Const | `xClockCH_24`          | `BOOL`         |         |                |
| Input Const | `xClockCH_23`          | `BOOL`         |         |                |
| Input Const | `xClockCH_22`          | `BOOL`         |         |                |
| Input Const | `xClockCH_21`          | `BOOL`         |         |                |
| Input Const | `xClockCH_20`          | `BOOL`         |         |                |
| Input Const | `xClockCH_19`          | `BOOL`         |         |                |
| Input Const | `xClockCH_18`          | `BOOL`         |         |                |
| Input Const | `xClockCH_17`          | `BOOL`         |         |                |
| Input Const | `xClockCH_16`          | `BOOL`         |         |                |
| Input Const | `xClockCH_15`          | `BOOL`         |         |                |
| Input Const | `xClockCH_14`          | `BOOL`         |         |                |
| Input Const | `xClockCH_13`          | `BOOL`         |         |                |
| Input Const | `xClockCH_12`          | `BOOL`         |         |                |
| Input Const | `xClockCH_11`          | `BOOL`         |         |                |
| Input Const | `xClockCH_10`          | `BOOL`         |         |                |
| Input Const | `xClockCH_09`          | `BOOL`         |         |                |
| Input Const | `xClockCH_08`          | `BOOL`         |         |                |
| Input Const | `xClockCH_07`          | `BOOL`         |         |                |
| Input Const | `xClockCH_06`          | `BOOL`         |         |                |
| Input Const | `xClockCH_05`          | `BOOL`         |         |                |
| Input Const | `xClockCH_04`          | `BOOL`         |         |                |
| Input Const | `xClockCH_03`          | `BOOL`         |         |                |
| Input Const | `xClockCH_02`          | `BOOL`         |         |                |
| Input Const | `xClockCH_01`          | `BOOL`         |         |                |
| Input Const | `xResetAssignment`     | `BOOL`         | FALSE   |                |
| Output      | `xClockActive`         | `BOOL`         |         |                |
| Output      | `todTodayTON`          | `TOD`          |         |                |
| Output      | `todTodayTOF`          | `TOD`          |         |                |
