ClockMaster32

ClockMaster32 (FB)

FUNCTION_BLOCK ClockMaster32 EXTENDS LAT.Element IMPLEMENTS IUhrProtocol, IUhr

Short description

Master function block for a clock system with 32 weekly timers, 30 public holidays, 10 holiday periods and 5 special switching times. The weekly timers each contain one on- and off-time per weekday (448 switching points). Additionally, 30 public holidays (country-specific), 10 holiday periods (start and end date) and 5 special switching times (on- and off-time as well as date) can be defined.

Representation

Function description

General

This function block serves as the master function block for a clock system with 32 weekly timers, 30 public holidays, 10 holiday periods and 5 special switching times. It allows the user (visualization) to set the time and date values and, taking into account the current time and date, provides the resulting states (weekly timer channel 1 - 32, public holiday channel, holiday channel and special switching times channel) to up to 63 slave function blocks ClockSlave32. In the slave function blocks, the assignment to the channels (weekly timer channel 1 - 32, public holiday channel, holiday channel and special switching times channel) is then done via binary variables (FALSE = not assigned, TRUE = assigned). The connection between the master function block and the slave function blocks is made via the output itfToClockSlave32 or the inputs *itfFromClockMaster32 *. The inputs xAllOn or xAllOff allow (input = TRUE) the central activation / deactivation of all outputs xClockActive of all connected slave function blocks. The input xAllOff is prioritized higher than the input xAllOn for setting the time and date values, the following function blocks are used:

Clock7d1Ch

PublicHoliday

Holiday

SwitchTimeS

Example representation in combination with slave clocks:

Visualization

Representation

The slave clocks are automatically appended in the order in which they are called in the program. The maximum number is limited to 144 slave clocks in the visualization element. In ClockMaster32 the maximum number can be adjusted via the library constant.

Visu-Element interfaces

Name
Data type
Type
Initial value
Function

FB_ClockMaster32

ClockMaster32

VAR_IN_OUT

Enter FB ClockMaster32 here e.g. PRG.ClockMaster32

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 weekly timer times 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

xAllOn

BOOL

Input

xAllOff

BOOL

Input Const

eCountry

eCountryList

eCountryList.DE

Input Const

ActiveClocksVisu

eActiveClocksVisu

eActiveClocksVisu.Activate16Clocks

Output

itfToClockSlave32

IUhrProtocol

THIS^

Output

ctClockSlave32

CAA.COUNT

Last updated