Clock7d1Ch (FB)

FUNCTION_BLOCK Clock7d1Ch

Functional Description

7 weekday time switch, one 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/Clock7d1Ch_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 of the current weekday

todActivatedTo TOD    

Switch-off point in time of the current weekday

Setpoints / Parameters

Name

Datatype

Range

Init-Value

Function

todMonFrom TOD   TOD#07:00

Switch-on point in time - Monday

todMonTo TOD   TOD#12:00

Switch-off point in time - Monday

xMonMode BOOL   TRUE

Mode - Switching periods - Monday

todTueFrom TOD   TOD#07:00

Switch-on point in time - Tuesday

todTueTo TOD   TOD#12:00

Switch-off point in time - Tuesday

xTueMode BOOL   TRUE

Mode - Switching periods - Tuesday

todWedFrom TOD   TOD#07:00

Switch-on point in time - Wednesday

todWedTo TOD   TOD#12:00

Switch-off point in time - Wednesday

xWedMode BOOL   TRUE

Mode - Switching periods - Wednesday

todThuFrom TOD   TOD#07:00

Switch-on point in time - Thursday

todThuTo TOD   TOD#12:00

Switch-off point in time - Thursday

xThuMode BOOL   TRUE

Mode - Switching periods - Friday

todFriFrom TOD   TOD#07:00

Switch-on point in time - Friday

todFriTo TOD   TOD#12:00

Switch-off point in time - Friday

xFriMode BOOL   TRUE

Mode - Switching periods - Friday

todSatFrom TOD   TOD#07:00

Switch-on point in time 1 - Saturday

todSatTo TOD   TOD#12:00

Switch-off point in time - Saturday

xSatMode BOOL   TRUE

Mode - Switching periods - Saturday

todSunFrom TOD   TOD#07:00

Switch-on point in time - Sunnday

todSunTo TOD   TOD#12:00

Switch-off point in time - 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 to a separate switching periods.

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

If the switch-off point in time is before the switch-on point in time, then the switch-off point in time is set to the value of the switch-on point in time for the test.

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**= TRUE).

Special case 1: Switch-on point in time= Switch-off point in time = 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 1: Switch-on point in time= Switch-off point in time = 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/Clock7d1Ch_Bild_1.png

Switch-off periods

../_images/Clock7d1Ch_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
within the switching periods of weekday XXX (**xXXXMode**= TRUE).
The xActive display output assumes the status TRUE if the time on weekday XXX when the enable input ( xEn = TRUE) is active
outside the switching periods of weekday XXX (**xXXXMode**= FALSE).
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 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.

todActivatedFrom 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 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 02.2017 1.0

Initial version

Programming

Adam Bartod 02.2017 1.0

Initial version

Test Jochen Reu 11.2017 1.0

Initial version

Documentation

Jochen Reu 11.2017 1.0

Initial version

Codesys

InOut:
Scope Name Type Initial Comment
Input xEn BOOL  

Enable input

todMonFrom TOD TIME_OF_DAY#7:0

Switch-on point in time - Monday

todMonTo TOD TIME_OF_DAY#12:0

Switch-off point in time - Monday

xMonMode BOOL TRUE

Mode - Switching periods - Monday

todTueFrom TOD TIME_OF_DAY#7:0

Switch-on point in time - Tuesday

todTueTo TOD TIME_OF_DAY#12:0

Switch-off point in time - Tuesday

xTueMode BOOL TRUE

Mode - Switching periods - Tuesday

todWedFrom TOD TIME_OF_DAY#7:0

Switch-on point in time - Wednesday

todWedTo TOD TIME_OF_DAY#12:0

Switch-off point in time - Wednesday

xWedMode BOOL TRUE

Mode - Switching periods - Wednesday

todThuFrom TOD TIME_OF_DAY#7:0

Switch-on point in time - Thursday

todThuTo TOD TIME_OF_DAY#12:0

Switch-off point in time - Thursday

xThuMode BOOL TRUE

Mode - Switching periods - Friday

todFriFrom TOD TIME_OF_DAY#7:0

Switch-on point in time - Friday

todFriTo TOD TIME_OF_DAY#12:0

Switch-off point in time - Friday

xFriMode BOOL TRUE

Mode - Switching periods - Friday

todSatFrom TOD TIME_OF_DAY#7:0

Switch-on point in time 1 - Saturday

todSatTo TOD TIME_OF_DAY#12:0

Switch-off point in time - Saturday

xSatMode BOOL TRUE

Mode - Switching periods - Saturday

todSunFrom TOD TIME_OF_DAY#7:0

Switch-on point in time - Sunnday

todSunTo TOD TIME_OF_DAY#12:0

Switch-off point in time - Sunnday

xSunMode BOOL TRUE

Mode - Switching periods - Sunday

sNotice STRING

‘Own Notice - click to change.’

Designation - Time switch

Output xActive BOOL  

Current Switching periods

todActivatedFrom TOD  

Switch-on point in time of the current weekday

todActivatedTo TOD  

Switch-off point in time of the current weekday