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¶
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)¶
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
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
Switch-on periods¶

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¶
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¶
todActivatedTo switch-off point in time of the switching periods of the current day of the week¶
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