FB_WeeklyTimeSwitch

FB_WeeklyTimeSwitch 1:

The parameters tSwitchOnTime and tSwitchOffTime define a period of time, in which bOutput will be set to TRUE. The timer is only active on the selected days of the week. This selection is done by setting the inputs bSunday, bMonday, ..., bSaturday. It is only possible to define one switching-period per timer. Each further switching-period requires a new timer.

VAR_INPUT

bEnable           : BOOL;
tCurrentDateTime  : DATE_AND_TIME;
tSwitchOnTime     : TOD;
tSwitchOffTime    : TOD;
bSunday           : BOOL;
bMonday           : BOOL;
bTuesday          : BOOL;
bWednesday        : BOOL;
bThursday         : BOOL;
bFriday           : BOOL;
bSaturday         : BOOL;

bEnable: Timer-release.

tCurrentDateTime: Actual time and date

tSwitchOnTime: Time, when bOutput will be set to TRUE.

tSwitchOffTime: Time, when bOutput will be set to FALSE.

bSunday: Timer is active on Sunday.

bMonday: Timer is active on Monday.

bTuesday: Timer is active on Tuesday.

bWednesday: Timer is active on Wednesday.

bThursday: Timer is active on Thursday.

bFriday: Timer is active on Friday.

bSaturday: Timer is active on Saturday.

VAR_OUTPUT

bOutput           : BOOL;
bEdgeOn           : BOOL;
bEdgeOff          : BOOL;

bOutput: As long as the actual time lies between the on- and the off-time, this output will be set to TRUE.

bEdgeOn: When bOutput turns to its TRUE-state, this output will be set to TRUE for one PLC-cycle.

bEdgeOff: When bOutput turns to its FALSE-state, this output will be set to TRUE for one PLC-cycle.

Example

The following example shows a blind, which is programmed to go up at 6.30am and to go down at 7.00pm at the weekend. The timer outputs bEdgeOn and bEdgeOff are used to control the blind-function, which needs pulses at the inputs bUp und bDown to move the blind.

FB_WeeklyTimeSwitch 2: