FB_BA_SchedulerWeeklyXXCh
Weekly timer with 1, 7 or 28 timer channels.
The function block FB_BA_SchedulerWeekly07Ch is described as an example.
The function block is used to enter a total of up to 7 switch-on periods.
Each switch-on period can be assigned an switch-on time [hh:mm:ss] and a switch-off time [hh:mm:ss].
The variables bMonday to bSunday can be used to select on which days of the week the switch-on period should be active.
A switch-on period is only active if the variable bEn of the channel is set to TRUE.
For irregular but recurring events, the variable bResetAfterOn can be set to TRUE. This will automatically reset the enable of channel bEn to FALSE after the event has finished.
To facilitate data entry, a rising edge at bAllActive sets bEn and all days of the week (bMonday to bSunday) to TRUE.
The function block is only active if a TRUE signal is present at bEn.
For demand-dependent switch-on optimization, switching on of the output bQ can be brought forward by the time of the variable udiPredictTime_sec.
The switch-on and switch-off points of a channel must be in the same year. The switch-off point must not be earlier than the switch-on point. Otherwise the switch-off point is automatically corrected and set to the same value as the switch-on point. |
VAR_INPUT
bEn : BOOL;
stSysTi : TIMESTRUCT;
udiPredictTime_sec : UDINT;
bEn: General function block enable.
stSysTi: Structure with the local NT system time (see TIMESTRUCT).
udiPredictTime_sec: Precalculated switch-on time. Internally limited to values between 0 and 43200.
VAR_OUTPUT
bQ : BOOL;
bQ: Switching output
VAR_IN_OUT
arrChannel: ARRAY [1..cBA_NumOfChannels] OF ST_BA_SchedulerWeeklyChannel;
arrChannel: Weekly scheduler; with the single-channel function block, the name of the variable is stChannel (see ST_BA_SchedulerWeeklyChannel). Internally limited to the respective number of possible channels via the variable cBA_NumOfChannels.
Requirements
Development environment | Required PLC library |
---|---|
TwinCAT from v3.1.4024.7 | Tc3_BA from v1.1.6.0 |