Function Block TIMESWITCH_GET

The function block TIMESWITCH_GET returns all information of an event of a timer.

Note: The timer must be stored in the same element.

Input TIMESWITCH

Here, the database of the timer is stored as a string. This must already exist as a function block TIMESWITCH. Also note the order of the program so that this function block is correctly initialized.

Input ID

Defines the ID as a string of the event.

Output ERR

In case of an error, the output is set to true. This can be if the calendar does not exist or the ID was not defined or invalid.

Output TITLE

Returns the title of the event.

Output DT_START

The start time of the event in the format DT# is returned.

Output DT_END

The end time of the event in the format DT# is returned.

Output DIS

If the output is true, the event is deactivated and ignored by the timer program.

Output REPEAT

The output returns the repetitions as a string. These correspond to the helper functions REPEAT_YEARLY, REPEAT_MONTHLY, REPEAT_WEEKLY, REPEAT_DAILY and REPEAT_HOURLY.

The string can be separated by a colon or structured as follows:

w:2:4:135

The first digit (lowercase) defines the time span of the repetition:

Abbreviation Time Span
h Hourly
d Daily
w Weekly
m Monthly
y Yearly

The second digit defines the interval as an integer of the repetition. The smallest value is 1.

The third digit defines the end of the repetition. Here, three different formats can be defined:

  • No value: The repetition is infinite.
  • As a simple integer: The repetition ends after the defined number of repetitions.
  • As a date YYYY-MM-DD: The repetition is stopped before the date.

The fourth digit defines the days of the week on which the repetition occurs. This digit is only used when defining weekly or monthly repetitions.

Weekly Repetitions

It is checked whether the current day of the week is present in the number. Multiple days can be specified one after the other. For example, 135 for Monday, Wednesday and Friday. If no value is specified (0 or an empty string), then it will not be repeated on any day.

Number Day of the Week
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday
7 Sunday
Monthly Repetitions

Defines on which day of the week the event should be repeated. Numbers from -1 to 4 are supported. 0 or no declaration repeats monthly on the same day, regardless of the day of the week. The day of the week is taken from the first date.

Value Description
-1 Repeats on the last day of the week.
0 Repeats on the same day. (Default)
1 Repeats on the first day of the week.
2 Repeats on the second day of the week.
3 Repeats on the third day of the week.
4

Repeats on the fourth day of the week.

Output DT_MODIFY

The output defines the last change in the format DT#. This input can also be undefined if the event was created before version 5.0.