Clock7d2Ch (FB)

FUNCTION_BLOCK Clock7d2Ch

Functional Description

7 weekday time switch, two switch-on / switch-off points in time and a binary total output.
The mode of operation (switch-on period or switch-off period) can be defined per weekday.
Typical application: Defining the night / day operation of a zone temperature control

Portrayal

../_images/Clock7d2Ch_FB.png

Interfaces

Inputs

Name

Datatype

Range

Init-Value

Function

xEn BOOL    

Enable input

Outputs

Name

Datatype

Range

Init-Value

Function

xActive BOOL    

Current Switching periods

todActivatedFrom TOD    

Switch-on point in time 1 of the current weekday

todActivatedTo TOD    

Switch-off point in time 2 of the current weekday

Setpoints / Parameters

Name

Datatype

Range

Init-Value

Function

todMonFrom1 TOD   TOD#07:00

Switch-on point in time 1 - Monday

todMonTo1 TOD   TOD#12:00

Switch-off point in time 1 - Monday

todMonFrom2 TOD   TOD#12:00

Switch-on point in time 2 - Monday

todMonTo2 TOD   TOD#18:00

Switch-off point in time 2 - Monday

xMonMode BOOL   TRUE

Mode - Switching periods - Monday

todTueFrom1 TOD   TOD#07:00

Switch-on point in time 1 - Tuesday

todTueTo1 TOD   TOD#12:00

Switch-off point in time 1 - Tuesday

todTueFrom2 TOD   TOD#12:00

Switch-on point in time 2 - Tuesday

todTueTo2 TOD   TOD#18:00

Switch-off point in time 2 - Tuesday

xTueMode BOOL   TRUE

Mode - Switching periods - Tuesday

todWedFrom1 TOD   TOD#07:00

Switch-on point in time 1 - Wednesday

todWedTo1 TOD   TOD#12:00

Switch-off point in time 1 - Wednesday

todWedFrom2 TOD   TOD#12:00

Switch-on point in time 2 - Wednesday

todWedTo2 TOD   TOD#18:00

Switch-off point in time 2 - Wednesday

xWedMode BOOL   TRUE

Mode - Switching periods - Wednesday

todThuFrom1 TOD   TOD#07:00

Switch-on point in time 1 - Thursday

todThuTo1 TOD   TOD#12:00

Switch-off point in time 1 - Thursday

todThuFrom2 TOD   TOD#12:00

Switch-on point in time 2 - Thursday

todThuTo2 TOD   TOD#18:00

Switch-off point in time 2 - Thursday

xThuMode BOOL   TRUE

Mode - Switching periods - Friday

todFriFrom1 TOD   TOD#07:00

Switch-on point in time 1 - Friday

todFriTo1 TOD   TOD#12:00

Switch-off point in time 1 - Friday

todFriFrom2 TOD   TOD#12:00

Switch-on point in time 2 - Friday

todFriTo2 TOD   TOD#18:00

Switch-off point in time 2 - Friday

xFriMode BOOL   TRUE

Mode - Switching periods - Friday

todSatFrom1 TOD   TOD#07:00

Switch-off point in time 1 - Saturday

todSatTo1 TOD   TOD#12:00

Switch-off point in time 1 - Saturday

todSatFrom2 TOD   TOD#12:00

Switch-off point in time 2 - Saturday

todSatTo2 TOD   TOD#18:00

Switch-off point in time 2 - Saturday

xSatMode BOOL   TRUE

Mode - Switching periods - Saturday

todSunFrom1 TOD   TOD#07:00

Switch-on point in time 1 - Sunnday

todSunTo1 TOD   TOD#12:00

Switch-off point in time 1 - Sunnday

todSunFrom2 TOD   TOD#12:00

Switch-on point in time 2 - Sunnday

todSunTo2 TOD   TOD#18:00

Switch-off point in time 2 - Sunnday

xSunMode BOOL   TRUE

Mode - Switching periods - Sunday

sNotice STRING  

‘Own Notice - click to change.’

Designation - Time switch

Functional Description

General

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

Each of the seven days of the week are assigned two separate switching periods (Switching period 1, Switching period 2).

Each switching period 1 is defined by adjustable data (todXXXTimeFrom1 Switch-on point in time 1 and todXXXTimeTo1 Switch-off point in time 1).
Each switching period 2 is defined by adjustable data (todXXXTimeFrom2 Switch-on point in time 2 and todXXXTimeTo2 Switch-off point in time 2).
In addition, an operating mode ( xXXXMode) can be defined.

If the switch-off point in time 1 is before the switch-on point in time 1, the switch-off point in time 1 is set to the value of the switch-on point in time 1 for the check.
If the switch-on point in time 2 is before the switch-off point in time 1, the switch-on point in time 2 is set to the value of the switch-off point in time 1 for the check.
If the switch-off point in time 2 is before the switch-on point in time 2, the switch-off point in time 2 is set to the value of the switch-on point in time 2 for the check.

A switching period is active if the current time on weekday XXX is within the switching periods of weekday XXX ( **xXXXMode**= TRUE).
A switching period is active if the current time on weekday XXX is outside the switching periods of weekday XXX ( **xXXXMode**= FALSE).

Special case: Switch-on point in time 1 = Switch-on point in time 2 = Switch-off point in time 1 = Switch-off point in time 2 = TOD#00:00

If the switch-on period (xXXXMode = TRUE) is active, the switching period is inactive the whole day.
If the switch-off period (xXXXMode = FALSE) is active, the switching period is active the whole day.

Special case: Switch-on point in time 1 = Switch-on point in time 2 = Switch-off point in time 1 = Switch-off point in time 2 = TOD#23:59

If the switch-on period (xXXXMode = TRUE) is active, the switching period is active the whole day.
If the switch-off period (xXXXMode = FALSE) is active, the switching period is inactive the whole day.

Switch-on periods

../_images/Clock7d2Ch_Bild_1.png

Switch-off periods

../_images/Clock7d2Ch_Bild_2.png

Enabling input xEN

xEn xActive todActivatedFrom todActivatedTo

Notes

FALSE FALSE

unchanged

unchanged

FB deactivated

TRUE

Condition depending on weekday, time and switching periods

Switch-on point of time the switching period 1 of the current weekday

Switch-off point of time the switching period 2 of the current weekday

FB activated

Display output xActive

The xActive display output assumes the status TRUE if the time on weekday XXX when the enable input ( xEn = TRUE) is active
lies within the switching period 1 or the switching period 2 of the weekday XXX (xXXXMode = TRUE, switch-on period).
The xActive display output assumes the status TRUE if the time on weekday XXX when the enable input ( xEn = TRUE) is active
lies outside the switching period 1 or the switching period 2 of the weekday XXX (xXXXMode = TRUE, switch-off period).
In all other cases, the xActive display output assumes the status FALSE.

xEn xActive

Switching periods XXX

xXXXMode - XXX

Notes

FALSE FALSE X X

FB deactivated

TRUE FALSE FALSE TRUE

Switch-on periods inactive

TRUE TRUE TRUE TRUE

Switch-on periods active

TRUE TRUE FALSE FALSE

Switch-off periods inactive

TRUE FALSE TRUE FALSE

Switch-off periods active

todActivatedFrom switch-on point in time of the switching periods of the current day of the week

This output permanently indicates the switch-on point in time of the switching period 1 of the current day of the week, 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.

todActivatedTo switch-off point in time of the switching periods of the current day of the week

This output permanently indicates the switch-off point in time of the switching period 2 of the current day of the week, 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




Information

Element

Authors

Date

Version

Notes

Function

Adam Bartod XX.xxxx 1.0

Initial version

Programming

Adam Bartod xx.xxxx 1.0

Initial version

Test Jochen Reu 10.2017 1.0

Initial version

Documentation

Jochen Reu 10.2017 1.0

Initial version

Codesys

InOut:
Scope Name Type Initial Comment
Input xEn BOOL  

Enable input

todMonFrom1 TOD TIME_OF_DAY#7:0

Switch-on point in time 1 - Monday

todMonTo1 TOD TIME_OF_DAY#12:0

Switch-off point in time 1 - Monday

todMonFrom2 TOD TIME_OF_DAY#12:0

Switch-on point in time 2 - Monday

todMonTo2 TOD TIME_OF_DAY#18:0

Switch-off point in time 2 - Monday

xMonMode BOOL TRUE

Mode - Switching periods - Monday

todTueFrom1 TOD TIME_OF_DAY#7:0

Switch-on point in time 1 - Tuesday

todTueTo1 TOD TIME_OF_DAY#12:0

Switch-off point in time 1 - Tuesday

todTueFrom2 TOD TIME_OF_DAY#12:0

Switch-on point in time 2 - Tuesday

todTueTo2 TOD TIME_OF_DAY#18:0

Switch-off point in time 2 - Tuesday

xTueMode BOOL TRUE

Mode - Switching periods - Tuesday

todWedFrom1 TOD TIME_OF_DAY#7:0

Switch-on point in time 1 - Wednesday

todWedTo1 TOD TIME_OF_DAY#12:0

Switch-off point in time 1 - Wednesday

todWedFrom2 TOD TIME_OF_DAY#12:0

Switch-on point in time 2 - Wednesday

todWedTo2 TOD TIME_OF_DAY#18:0

Switch-off point in time 2 - Wednesday

xWedMode BOOL TRUE

Mode - Switching periods - Wednesday

todThuFrom1 TOD TIME_OF_DAY#7:0

Switch-on point in time 1 - Thursday

todThuTo1 TOD TIME_OF_DAY#12:0

Switch-off point in time 1 - Thursday

todThuFrom2 TOD TIME_OF_DAY#12:0

Switch-on point in time 2 - Thursday

todThuTo2 TOD TIME_OF_DAY#18:0

Switch-off point in time 2 - Thursday

xThuMode BOOL TRUE

Mode - Switching periods - Friday

todFriFrom1 TOD TIME_OF_DAY#7:0

Switch-on point in time 1 - Friday

todFriTo1 TOD TIME_OF_DAY#12:0

Switch-off point in time 1 - Friday

todFriFrom2 TOD TIME_OF_DAY#12:0

Switch-on point in time 2 - Friday

todFriTo2 TOD TIME_OF_DAY#18:0

Switch-off point in time 2 - Friday

xFriMode BOOL TRUE

Mode - Switching periods - Friday

todSatFrom1 TOD TIME_OF_DAY#7:0

Switch-off point in time 1 - Saturday

todSatTo1 TOD TIME_OF_DAY#12:0

Switch-off point in time 1 - Saturday

todSatFrom2 TOD TIME_OF_DAY#12:0

Switch-off point in time 2 - Saturday

todSatTo2 TOD TIME_OF_DAY#18:0

Switch-off point in time 2 - Saturday

xSatMode BOOL TRUE

Mode - Switching periods - Saturday

todSunFrom1 TOD TIME_OF_DAY#7:0

Switch-on point in time 1 - Sunnday

todSunTo1 TOD TIME_OF_DAY#12:0

Switch-off point in time 1 - Sunnday

todSunFrom2 TOD TIME_OF_DAY#12:0

Switch-on point in time 2 - Sunnday

todSunTo2 TOD TIME_OF_DAY#18:0

Switch-off point in time 2 - Sunnday

xSunMode BOOL TRUE

Mode - Switching periods - Saturday

sNotice STRING

‘Own Notice - click to change.’

Designation - Time switch

Output xActive BOOL  

Current Switching periods

todActivatedFrom TOD  

Switch-on point in time 1 of the current weekday

todActivatedTo TOD  

Switch-off point in time 2 of the current weekday