FB_MonthlyScheduler1

Function block for triggering actions on a certain day of the week in certain months.

FB_MonthlyScheduler1 1:

FB_MonthlyScheduler1 2:

The function block triggers switching when the switching time is passed. Subsequent modification of the switching events or the time is therefore not permitted.

VAR_INPUT

arrActiveMonth   : ARRAY[1..12] OF BOOL;
uiActiveWeekday  : UINT;
eStartEnd        : ENUM;
stStartEnd       : TIMESTRUCT;
stSystemtime     : TIMESTRUCT;

arrActiveMonth: Month in which an action is to be triggered - arrActiveMonth[1] => January .. arrActiveMonth[12] => December. Multiple selections are possible.

uiActiveWeekday: Day of the week on which an action is to be triggered in the selected months. 0 = Sunday .. 6 = Saturday. Multiple selections are not possible; the maximum value is 6

eStartEnd: Selection of start/end definition.

TYPE E_StartEnd : ( eSTARTTIME_ENDTIME := 1, eSTARTTIME_DURATION := 2, eSTARTTIME_ENDEVENT := 3, eSTARTEVENT_ENDTIME := 4, eSTARTEVENT_DURATION := 5, eSTARTEVENT_ENDEVENT := 6 ); END_TYPE

eSTARTTIME_ENDTIME: Selection of start/end time. If the start time is equal or greater the end time, the end is allocated to the next day.

eSTARTTIME_DURATION: Selection of start time/duration.

eSTARTTIME_ENDEVENT: Selection of start time/end event.

eSTARTEVENT_ENDTIME: Selection of start event/end time. If the start time is equal or greater the end time, the end is allocated to the next day.

eSTARTEVENT_DURATION: Selection of start event/duration.

eSTARTEVENT_ENDEVENT: Selection of start event/end event.

stStartEnd: Structure with the parameters defining the start and end. Unused variables are ignored internally, e.g. the duration for the selection of start/end time.

TYPE ST_StartEnd : STRUCT todStartTime : TOD; bStartEvent : BOOL; tDuration : TIME; todEndTime : TOD; bEndEvent : BOOL; END_STRUCT END_TYPE

todStartTime: Start time.

bStartEvent: Start event

tDuration: Switching duration.

todEndTime: End time.

bEndEvent: End event.

stSystemtime: current time in TIMESTRUCT format. It is important to count every second.

VAR_OUTPUT

bOut             : BOOL;
bTriggerOn       : BOOL;
bNoEventNextYear : BOOL;
bError           : BOOL;
nErrorId         : UDINT;

bOut: control output that is switched on or off by the start and end event.

bTriggerOn: trigger output for switch-on events. This output is used to detect switch-on events. If two switch-on events occur consecutively they would not be detected via the control output bOut, since this output would remain TRUE. See also time overlaps in the overview.

bNoEventNextYear: no day matching the parameterization was found within the next 366 days.

bError: this output is set to TRUE if the parameterization is faulty. The command-specific error code is contained in nErrorId. Reset to FALSE once the parameterization is correct.

nErrorId: contains the command-specific error code. Reset to 0 once the parameterization is correct. See error codes.