[PULSEPRD] Periodic pulse

Function block PULSEPRD generates impulses in time according to the user configuration.

PULSEPRD generates impulses in time according to the user configuration.

Functioning

Enable and disable the function

If the function is enabled (EnFnct = 1), then the function block gets the controller time and generates impulses according to the user configuration. If the function is disabled, then no impulses are generated. The current controller time is still provided at the outputs.

Configuration

PULSEPRD can generate an impulse at a specific moment in time. This time is configured at inputs [Year], [Month], [Day], [Hour] and [Minute]. PULSEPRD receives the controller time and compares it to the configured time. When the controller time matches the configured time, an impulse is generated at the output [Pulse]. Values at inputs [Year], [Month], [Day], [Hour] and [Minute] are considered in the function block as specific time values if the corresponding pattern inputs [YearPtrn], [MonthPtrn], [DayPtrn], [HourPtrn] and [MinPtrn] have the value "Value at input".
PULSEPRD can periodically generate impulses at the [Pulse] output. Periodic impulses can be achieved by configuring some of the pattern inputs with a value different from "Value at input". For example, if [YearPtrn], [MonthPtrn] and [DayPtrn] have "Any value", [HourPtrn] and [MinPtrn] have "Value at input", [Hour] has value "12" and [Minute] has value "0", then the impulses will be generated at the [Pulse] output every day at 12:00.
The value "Module value = 0" at pattern inputs is used to generate periodic impulses with a period configured by the user. For example, the value "Module value = 0" for [DayPtrn] and value "3" for [Day] triggers an impulse generation every third day.
Generated impulses can be limited by configuring inputs [DayWeek], [WkMonth] and [DayYear]. For example, the value "Monday" at [DayWeek] allows impulses to be generated only when the current day is "Monday". Like the configuration inputs for a specific time, limiting inputs also have corresponding pattern inputs: [DayWkPtrn], [WkMthPtrn] and [DayYrPtrn]. These pattern inputs are used in a similar way as the patterns for specific time configuration.
Impulses generated at the [Pulse] output consider all configuration inputs of the function block.
If all pattern inputs have the value "Any value", then no impulses are generated at the [Pulse] output.

Additional impulses

In addition to the impulses at the [Pulse] output, impulses are also generated at outputs [PlsYear], [PlsMonth], [PlsDay], [PlsHour], [PlsMinute], [PlsDayWk], [PlsWkMth] and [PlsDayYr]. These additional impulses consider only the corresponding configuration inputs. For example, impulses generated at [PlsDay] depend only on the configuration at inputs [Day] and [DayPtrn]. If [DayPtrn] has the value "Any value", the impulse is generated every time the day value in the controller time changes.

Controller time

Outputs [PrYear], [PrMonth], [PrDay], [PrHour], [PrMinute], [PrDayWeek], [PrWkMonth] and [PrDayYear] provide the current controller time as integer values. They are used in control program logic to generate impulses for the cases which cannot be covered by the function block.

info

Due to the time synchronization of controllers, PULSEPRD may not generate all desired impulses, or it may generate an impulse twice.

info

PULSEPRD does not validate its configuration. For invalid configurations, impulses are not generated at the [Pulse] output. For example, the combination of [WkMthPttrn] = "Last week", [DayPtrn] = "Value at input" and [Day] = "1" does not generate impulses at [Pulse].

info

Weeks of month used for the configuration inputs [WkMonth] and [WkMthPtrn] are not Monday-Sunday periods. Weeks for these inputs are considered as seven days period: "first 7 days of the month", "second 7 days of the month" etc.
Example:
1: Day 1 to 7 of month
2: Day 8 to 14 of month
3: Day 15 to 21 of month
4: Day 22 to 28 of month
5: Day 29 to 31 of month

info

Values for all configuration inputs used in combination with "Value at input" patterns are limited to the range specified in the table "Pins". The minimal value for all configuration inputs used in combination with "Modulo value = 0" pattern, is 2.

Examples for the impulse behavior

[Pulse] – No impulses are generated.
[PlsXX] – Impulse when the corresponding value changes.

[Pulse] – Impulse at the beginning of the last day of every month.
[PlsDay] – Impulse at the beginning of the last day of every month.
[PlsXX] – Impulse when the corresponding value changes.

[Pulse] – Impulse every Sunday at 20:00.
[PlsHour] – Impulse at the beginning of the 20th hour every day.
[PlsMinute] – Impulse at the beginning of the first minute every hour.
[PlsDayWk] – Impulse at the beginning of Sunday every week.
[PlsXX] – Impulse when the corresponding value changes.

[Pulse] – For the year 2023, in every even month, impulses are generated for every odd day.
In these odd days, impulses are generated every 15th minute of every 4th hour, but only in the last week of the months.
[PlsYear] – Impulse at the beginning of the year 2023.
[PlsMonth] – Impulse at the beginning of an even month of every year.
[PlsDay] – Impulse at the beginning of odd days of every month.
[PlsHour] – Impulse at the beginning of every 4th hour of every day.
[PlsMinute] – Impulse at the beginning of every 15th minute of every hour.
[PlsWkMth] – Impulse at the beginning of the last week of every month.
[PlsXX] – Impulse when the corresponding value changes.

[Pulse] – Impulse every 15th minute for the last day of the month.
[PlsDay] – Impulse at the beginning of the last day of every month.
[PlsMinute] – Impulse at the beginning of the 15th minute of every hour.
[PlsXX] – Impulse when the corresponding value changes.

Pins

Input

Description

Data type

Default value
Value range

EnFnct

Enable function

Enables the function.

Boolean

1

0 - The function is disabled.
1 - The function is enabled.

Year

Year

Specific year or modulo value for a year

Integer

1990

1990...2089

YearPtrn

Year pattern

Integer

1: Any value

1: Any value
2: Value at input
3: Odd value
4: Even value
5: Modulo value = 0

Month

Month

Specific month or modulo value for a month

Integer

1: January

1: January
2: February
3: March
4: April
5: May
6: Jun
7: July
8: August
9: September
10: October
11: November
12: December

MonthPtrn

Month pattern

Integer

1: Any value

1: Any value
2: Value at input
3: Odd value
4: Even value
5: Modulo value = 0

Day

Day

Specific day or modulo value for a day

Integer

1

1...31

DayPtrn

Day pattern

Integer

1: Any value

1: Any value
2: Value at input
3: Odd value
4: Even value
5: Modulo value = 0
6: Last day

Hour

Hour

Specific hour or modulo value for an hour

Integer

0

0...23

HourPtrn

Hour pattern

Integer

1: Any value

1: Any value
2: Value at input
3: Odd value
4: Even value
5: Modulo value = 0

Minute

Minute

Specific minute or modulo value for a minute

Integer

0

0...59

MinPtrn

Minute pattern

Integer

1: Any value

1: Any value
2: Value at input
3: Odd value
4: Even value
5: Modulo value = 0

DayWeek

Day of week

Specific day of the week or modulo value for a day of the week

Integer

1: Monday

1: Monday
2: Tuesday
3: Wednesday
4: Thursday
5: Friday
6: Saturday
7: Sunday

DayWkPtrn

Day of week pattern

Integer

1: Any value

1: Any value
2: Value at input
3: Odd value
4: Even value
5: Modulo value = 0

WkMonth

Week of month

Specific week of the month or modulo value for a week of the month

Integer

1: Day 1 to 7 of month

1: Day 1 to 7 of month
2: Day 8 to 14 of month
3: Day 15 to 21 of month
4: Day 22 to 28 of month
5: Day 29 to 31 of month

WkMthPtrn

Week of month pattern

Integer

1: Any value

1: Any value
2: Value at input
3: Odd value
4: Even value
5: Modulo value = 0
6: Last week
7: Not last week
8: Not last 2 weeks
9: Not last 3 weeks

DayYear

Day of year

Specific day of the year or modulo value for a day of the year

Integer

1

1...366

DayYrPtrn

Day of year pattern

Integer

1: Any value

1: Any value
2: Value at input
3: Odd value
4: Even value
5: Modulo value = 0

 

Output

Description

Data type

Default value
Value range

Pulse

Pulse

Boolean

0

PrYear

Present year

Integer

1990

PlsYear

Pulse, year

Boolean

0

PrMonth

Present month

Integer

1: January

1: January
2: February
3: March
4: April
5: May
6: Jun
7: July
8: August
9: September
10: October
11: November
12: December

PlsMonth

Pulse, month

Boolean

0

PrDay

Present day

Integer

1

PlsDay

Pulse, day

Boolean

0

PrHour

Present hour

Integer

0

PlsHour

Pulse, hour

Boolean

0

PrMinute

Present minute

Integer

0

PlsMinute

Pulse, minute

Boolean

0

PrDayWeek

Present day of week

Integer

1: Monday

1: Monday
2: Tuesday
3: Wednesday
4: Thursday
5: Friday
6: Saturday
7: Sunday

PlsDayWk

Pulse, day of week

Boolean

0

PrWkMonth

Present week of month

Integer

1: Day 1 to 7 of month

1: Day 1 to 7 of month
2: Day 8 to 14 of month
3: Day 15 to 21 of month
4: Day 22 to 28 of month
5: Day 29 to 31 of month

PlsWkMth

Pulse, week of month

Boolean

0

PrDayYear

Present day of year

Integer

1

PlsDayYr

Pulse, day of year

Boolean

0