Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

SwitchTimeS

SwitchTimeS (FB)

FUNCTION_BLOCK SwitchTimeS

Short description

Time switch with 5 adjustable time periods and binary output. Each time period is defined by an ON time / OFF time and a date.

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 time periods

todActivatedFrom

TOD

Switch-on time of the last active time period of the current day

todActivatedTo

TOD

Switch-off time of the last active time period of the current day

Setpoints / Parameters

Name
Data type
Value range
Initial value
Function

datCH1_Date

DATE

DATE#2022-01-01

Date of time period 1

todCH1_TimeFrom

TOD

TOD#07:00

Switch-on time of time period 1

todCH1_TimeTo

TOD

TOD#12:00

Switch-off time of time period 1

xCH1_Mode

BOOL

TRUE

Display mode for time period 1

sCH1_Notice

STRING

‘Notice’

Text for time period 1

datCH2_Date

DATE

DATE#2022-01-01

Date of time period 2

todCH2_TimeFrom

TOD

TOD#07:00

Switch-on time of time period 2

todCH2_TimeTo

TOD

TOD#12:00

Switch-off time of time period 2

xCH2_Mode

BOOL

TRUE

Display mode for time period 2

sCH2_Notice

STRING

‘Notice’

Text for time period 2

datCH3_Date

DATE

DATE#2022-01-01

Date of time period 3

todCH3_TimeFrom

TOD

TOD#07:00

Switch-on time of time period 3

todCH3_TimeTo

TOD

TOD#12:00

Switch-off time of time period 3

xCH3_Mode

BOOL

TRUE

Display mode for time period 3

sCH3_Notice

STRING

‘Notice’

Text for time period 3

datCH4_Date

DATE

DATE#2022-01-01

Date of time period 4

todCH4_TimeFrom

TOD

TOD#07:00

Switch-on time of time period 4

todCH4_TimeTo

TOD

TOD#12:00

Switch-off time of time period 4

xCH4_Mode

BOOL

TRUE

Display mode for time period 4

sCH4_Notice

STRING

‘Notice’

Text for time period 4

datCH5_Date

DATE

DATE#2022-01-01

Date of time period 5

todCH5_TimeFrom

TOD

TOD#07:00

Switch-on time of time period 5

todCH5_TimeTo

TOD

TOD#12:00

Switch-off time of time period 5

xCH5_Mode

BOOL

TRUE

Display mode for time period 5

sCH5_Notice

STRING

‘Notice’

Text for time period 5

Functional description

General

The current time (date / time) is permanently compared with the 5 defined time periods. The display output xActive takes the state TRUE if, when the enable input is active (xEn = TRUE), at least one of the 5 time periods is active.

Prerequisite for using the function block SwitchTimeS

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

Enable input xEn

xEn

xActive

todActivatedFrom

todActivatedTo

Note

FALSE

FALSE

unchanged

unchanged

FB deactivated

TRUE

State depending on the 5 time periods

Switch-on time of the last active time period of the current day

Switch-off time of the last active time period of the current day

FB activated

Display output xActive

The display output takes the state TRUE if, when the enable input is active (xEn = TRUE), at least one of the 5 time periods is active.

xActive

xEn

Time period 1

Time period 2

Time period 3

Time period 4

Time period 5

Note

FALSE

FALSE

X

X

X

X

X

FB deactivated

FALSE

TRUE

FALSE

FALSE

FALSE

FALSE

FALSE

No time period active

TRUE

TRUE

FALSE

FALSE

TRUE

FALSE

FALSE

At least one time period active

Switch-on time of the last active time period of the current day todActivatedFrom

This display output takes the value of the switch-on time of the last active time period if, when the enable input is active (xEn = TRUE), the date of the current time matches the date of the time period. In all other situations, it is not changed.

Switch-off time of the last active time period of the current day todActivatedTo

This display output takes the value of the switch-off time of the last active time period if, when the enable input is active (xEn = TRUE), the date of the current time matches the date of time period 5. In all other situations, it is not changed.

Time periods 1 - 5 (X = 1 .. 5)

Each time period is defined by adjustable data (switch-on time todCHX_TimeFrom, switch-off time todCHX_TimeTo and date datCHX_Date) In addition, an operating mode (xCHX_Mode) as well as a descriptive text (sCHX_Notice) can be defined. If the switch-off time is before the switch-on time, then for the check the switch-off time is set to the value of the switch-on time. A time period is active if the current date matches the date of the time period and the time is within the time period (xCHX_Mode = TRUE). A time period is active if the current date matches the date of the time period and the time is outside the time period (xCHX_Mode = FALSE).

Visualization

Representation

Interfaces visualization element

Name
Data type
Type
Initial value
Function

FB_SwitchTimeS

SwitchTimeS

VAR_IN_OUT

Enter FB SwitchTimeS here e.g. PRG.SwitchTimeS

BMS_Active

BOOL

VAR_INPUT

BMS (Building Management System) GLT (building management technology). If BMS_Active = TRUE, input / editing of the clocks is disabled, since they can then only be set via the BMS. Time values can then only be viewed.

DisableInput

BOOL

VAR_INPUT

DisableInpput = TRUE times of the weekly clocks can only be viewed and not edited./// - BMS (Building Management System) GLT (Building Management System). When 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.

Note: VAR_IN_OUT interfaces must be assigned; VAR_INPUT is optional.

CODESYS

InOut:

Scope
Name
Type
Initial

Input

xEn

BOOL

Input Const

datCH1_Date

DATE

DATE#2022-1-1

Input Const

todCH1_TimeFrom

TOD

TIME_OF_DAY#7:0

Input Const

todCH1_TimeTo

TOD

TIME_OF_DAY#12:0

Input Const

xCH1_Mode

BOOL

TRUE

Input Const

sCH1_Notice

STRING

‘Notice’

Input Const

datCH2_Date

DATE

DATE#2022-1-1

Input Const

todCH2_TimeFrom

TOD

TIME_OF_DAY#7:0

Input Const

todCH2_TimeTo

TOD

TIME_OF_DAY#12:0

Input Const

xCH2_Mode

BOOL

TRUE

Input Const

sCH2_Notice

STRING

‘Notice’

Input Const

datCH3_Date

DATE

DATE#2022-1-1

Input Const

todCH3_TimeFrom

TOD

TIME_OF_DAY#7:0

Input Const

todCH3_TimeTo

TOD

TIME_OF_DAY#12:0

Input Const

xCH3_Mode

BOOL

TRUE

Input Const

sCH3_Notice

STRING

‘Notice’

Input Const

datCH4_Date

DATE

DATE#2022-1-1

Input Const

todCH4_TimeFrom

TOD

TIME_OF_DAY#7:0

Input Const

todCH4_TimeTo

TOD

TIME_OF_DAY#12:0

Input Const

xCH4_Mode

BOOL

TRUE

Input Const

sCH4_Notice

STRING

‘Notice’

Input Const

datCH5_Date

DATE

DATE#2022-1-1

Input Const

todCH5_TimeFrom

TOD

TIME_OF_DAY#7:0

Input Const

todCH5_TimeTo

TOD

TIME_OF_DAY#12:0

Input Const

xCH5_Mode

BOOL

TRUE

Input Const

sCH5_Notice

STRING

‘Notice’

Output

xActive

BOOL

Output

todActivatedFrom

TOD

Output

todActivatedTo

TOD

Last updated