Clock7d1Ch

Clock7d1Ch (FB)

FUNCTION_BLOCK Clock7d1Ch

Short description

Time switch 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: defining night/day operation of a zone temperature control.

Representation

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’

Designation - time switch

Function description

General

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

Each of the seven weekdays has its own switching period assigned. Each switching period is defined by adjustable data (switch-on time todXXXTimeFrom and switch-off time todXXXTimeTo ) defined. In addition, an operating mode ( xXXXMode ) per weekday. If the switch-off time is earlier than 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

When an on period is active ( xXXXMode = TRUE ) the switching period is not active for the whole day. When an 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 an on period is active ( xXXXMode = TRUE ) the switching period is active all day. When an off period is active ( xXXXMode = FALSE ) the switching period is not active all day.\

Prerequisite for using the function block Clock7d1Ch

For correct operation the use of the function block TimeRead2 is required.\

On period

Off period

Enable input xEn

xEn

xActive

todActivatedFrom

todActivatedTo

Note

FALSE

FALSE

unchanged

unchanged

FB disabled

TRUE

State depending on weekday, time 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 takes the state TRUE if, with 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 takes the state TRUE if, with 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

Visu element interfaces

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

Visu element interfaces

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) BMS (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

Last updated