Time switch based on the S7-300/400 CPUs with simple HMI system
including radio-controlled clock connection
Rev. B - final 19.07.2002 71/84
Copyright © Siemens AG 2005 All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
7 STEP 7 Program
The STEP 7 code will not be explained here line by line. This
documentation will focus on the core points. Detailed information on the
programs may be found in the appropriate sources.
7.1 Absolute time switches
7.1.1 Seven-day time switch
For the seven-day time switch (FB121) it must be checked whether the
function Monday to Friday or Saturday to Sunday has been entered at the
start day. If yes, the same function must be entered at the end day and the
time must be checked specifically.
Table 7-1 Code seven-day time switch
Code Remarks
NETWORK 3:
// function: mo - fr?
L #time_to_check.startday
L 8
==I
SPB s8
// function: sa - su?
L #time_to_check.startday
L 9
==I
SPB s9
L 8
L #time_to_check.endday
==I
SPB err
L 9
==I
SPB err
SPA ess
Function equal Monday to Friday
Function equal Saturday to
Sunday
If function at end day equals Mo
– Fr oder Sa – Su then error and
end
7.1.2 One-month time switch
At the month time switch (FB123) it must be checked whether the function
“last day in the month” is used. If yes, the start day of the end day must be
set to the last day of the respective month.