Siemens SIMATIC S7 400, SIMATIC S7 300 Application Description

Application for Control Technology
SIMATIC S7 CPU 300/400
Application Description
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
Warranty, Liability and Support
We accept no liability for information contained in this document. We do not accept liability, whatever the legal basis, for any damages
arising from the use of examples, notes, programs, configuration and performance data etc. described in this document, except where we are obliged to by the German Product Liability Act or in cases of willful damage or gross negligence, injury to life, body or health, breach of guarantee for the condition of products or items assumed by us, fraudulent concealment of a defect or breach of a substantial contractual obligation. However, claims arising from a breach of a condition which goes to the root of the contract shall be limited to the foreseeable damage which is intrinsic to the contract, unless caused by intent or gross negligence or based on mandatory liability for injury of life, body or health. The above conditions are not meant to change the burden of proof to the detriment of the user.
Copyright © Siemens AG 2005 All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
The application examples do not purport to cover all details or variations in equipment, nor do they provide for every possible contingency. They are not customer-specific solutions. They are only intended to provide support for typical tasks. You are responsible for ensuring that the described products are used correctly. These application examples do not relieve you of the responsibility to use sound practices in application, installation, operation and maintenance. By using this application example you accept that Siemens is not liable for any damages except for those specified in the above liability clause. We reserve the right to make changes in these application examples at any time without prior notice. If there are any deviations between the recommendations provided in this application example and other Siemens publications – e.g. Catalogs – the contents of the other documents have priority.
Copyright© 2005 Siemens A&D. Any form of duplication or distribution of these application examples or excerpts hereof is prohibited without the expressed consent of Siemens Energy & Automation, Inc.
For questions about this document please use the following e-mail address:
mailto:csweb@ad.siemens.de
Rev. B - final 19.07.2002 2/84
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
Foreword
Structure of the document
The documentation of this application is divided into the following main parts.
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
Part Description
Part A1 gives you a general overview of the
A1
contents. You will learn about the components used (standard hardware and software and newly developed software).
The basic function data illustrate the powerful performance of this application.
Part A2 gives you a detailed description of the
A2
function processes of the hardware and software components. Read this part if you want to know what the functions do and how the solution components interact.
Part B takes you step by step through
B
installation and start-up of the application. Part C is of interest if you want to take the
C
software and expand or adapt it to your set-up.
Note
You can skip this part if you only want to test the application using step-by­step instructions.
Rev. B - final 19.07.2002 3/84
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
Table of Contents
Part A1 : Application Description................................................................................ 7
1 Illustrate the performance of the entire applicationThe Automation
Problem - An Overview..............................................................................
8
2 Automation Solution .................................................................................... 12
2.1 Functionality in the S7-CPU............................................................................ 15
2.1.1 Absolute time switching functions...................................................................15
2.1.2 Relative time function ..................................................................................... 16
2.1.3 Additional functions......................................................................................... 16
2.2 Controlling and monitoring..............................................................................18
2.3 Standard components required ...................................................................... 21
2.3.1 Hardware components.................................................................................... 21
2.3.2 Software components..................................................................................... 21
2.4 Application software components required and their "product features" ........ 23
2.5 Installation with simple setup.......................................................................... 25
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
3 Basic performance data............................................................................... 26
Part A2 : Function Mechanisms................................................................................27
4 Examples of Function Mechanisms............................................................ 28
4.1 Introduction..................................................................................................... 28
4.2 Overview of the Structure Elements ...............................................................28
4.3 STEP7 application level..................................................................................29
1.1.1 Absolute time switching functions...................................................................30
4.3.1 One-day time switch.......................................................................................31
4.3.2 Seven-day time switch....................................................................................32
4.3.3 One-month time switch................................................................................... 33
4.3.4 One-year time switch...................................................................................... 34
4.3.5 Relative time switch........................................................................................ 35
4.3.6 Additional functions......................................................................................... 38
Summer/wintertime changeover ................................................................ 38
Holiday recognition..................................................................................... 40
4.4 HMI System....................................................................................................41
4.4.1 Operation at the OP3......................................................................................41
1.1.2 Operation at the TP170A................................................................................ 43
Part B: Installation of the Sample Application.........................................................46
5 Installation of Hardware and Software ....................................................... 47
5.1 Hardware configuration................................................................................... 47
5.2 Software installation........................................................................................ 49
5.2.1 Loading the application software into the S7-CPU.........................................49
Rev. B - final 19.07.2002 4/84
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
5.2.2 Load the application software into the panel .................................................. 51
6 Using the Application................................................................................... 54
6.1 Application case 1: Many time switches........................................................54
6.2 Application case 2: Pulse chain..................................................................... 63
Part C: Program Description ..................................................................................... 70
7 STEP 7 Program............................................................................................ 71
7.1 Absolute time switches...................................................................................71
7.1.1 Seven-day time switch....................................................................................71
7.1.2 One-month time switch................................................................................... 71
7.2 Relative time switch........................................................................................ 73
1.2 Special functions............................................................................................. 74
7.2.1 Summer/wintertime changeover.....................................................................74
7.2.2 Holidays/special days..................................................................................... 75
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
8 HMI Interface ................................................................................................. 77
9 Changes in the STEP 7 Programs............................................................... 77
9.1 What to do if a second time switch of the same type is needed?................... 77
9.2 How can I get several switch-on/off times into one time switch block?........... 78
9.3 What to do if more holidays or special days are needed?.............................. 79
9.4 How can I save on Instance DBs?..................................................................80
Appendix: Connection of the SICLOCK radio clock ............................................... 81
Rev. B - final 19.07.2002 5/84
A
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
Preamble
Many systems in automation technology (e.g. in the field of Heating, Ventilation & Air Conditioning) require a control dependent on time of the day and day of the week. Apart from the time dependent control of certain processes, a monitoring and control function is also necessary for these time switch functions.
We take an everyday automation problem (see chapter 1) and present all required solution elements individually. The solution consists of standard SIMATIC components plus the software blocks developed especially for this application. The blocks are designed so that they can be used directly for concrete problems or they can be adjusted to an individual task by simple expansion/reduction.
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
SIMATIC
Standard
+
pplikatio n
software
components
... Provid ed by you
This application offers a convenient and quick way to implement the "Time switch" key function. A HMI interface is provided allowing the operator to control the application.
... Delive re d with th e a pplicatio n
Rev. B - final 19.07.2002 6/84
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection

Part A1 : Application Description

Objectives of Part A1
Part A1 of this document provides the reader with information on the following topics:
Pinpoint the automation problem
Design a possible solution
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
Rev. B - final 19.07.2002 7/84
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
1 Illustrate the performance of the entire applicationThe
Automation Problem - An Overview
Precise time tuning is necessary in many fields. Even in household technology for example, systems must work dependent on time of the day or day of the week. One possible solution for this problem are electrical and mechanical time switches. The following figure shows examples for electrical time switches:
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
Fig. 1-1 Examples of time switches
These are all hardware clocks which enable solving the time switching problem for example in the field of household technology. These clocks are readily available in many DIY superstores. Operating the devices is so simple that a layperson can use this clock easily.
Apart from these “primitive applications”, time-dependent controls are also required in large areas of automation technology. Some “professional applications” are illustrated in the following table.
Rev. B - final 19.07.2002 8/84
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
Table 1-1 Application examples for professional time switches
Application Illustration
Greenhouse control: Watering and lighting systems of a greenhouse must
be controlled.
Lighting control: Lighting systems are automatically controlled in
residential homes or hotels.
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
Pump control: Pumps for heating of service water are automatically
controlled in residential homes.
Automatic feeding machine: Animals in a stable can be fed via automatic feeding
machines. Similar feeding machines are also available for example for aquariums.
Many industrial applications in the field of automation technology also require exact switching of processes. The problem is illustrated below:
Rev. B - final 19.07.2002 9/84
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
Monitoring and Control unit
S7-CPU
Protocol services
User program
Process area
Fig. 1-2 Problem layout for automation technology
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
A block in the S7-CPU, which sets an output dependent of absolute time or which after a certain event lets a parameterized length of time pass, is required for the temporal design of these or similar processes.
The absolute switch-on and switch-off times for these processes must be configurable at a HMI system and subsequently be available in the S7­CPU. Furthermore, it should be possible to parameterize a certain length of time which will pass dependent on a start event (relative time).
The S7-CPU and the HMI system are connected via MPI. In our example the absolute switch-on and switch-off times are entered at
the HMI system and subsequently compared with the absolute system time of the S7-CPU.
Note
The block principally also functions without HMI interface. Parameterization can be made directly at the input parameters.
Additionaly, the possibility of optionally connecting a radio-controlled clock to the automation system should be offered. This clock is supposed to synchronize the system time with the official time and to conduct the changeover from summer time to winter time and the other way round.
Rev. B - final 19.07.2002 10/84
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
This application was realized with the SIPLUS radio clock. Alternatively the SICLOCK radio clock can be used. This alternative is dealt with in detail in the appendix.
In case you do not want to use a radio-controlled clock the summer/ winter time changeover is automatically conducted at the officially fixed dates by a special function block which is delivered with this application. In this case the system time can certainly not be synchronized with the official time.
Basic data of the requirement
The requirements by the automation problem on the S7-CPU and the HMI interface are listed below:
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
S7 CPU
There are the following blocks:
- One-day, seven-day, one-month, one-year time switches
- Relative time switch
- Summer/wintertime changeover
- Holiday recognition
- Connection with radio-controlled clock
Respectively one switch-on and one switch-off time can be
parameterized for the time switches (one-day, seven-day, one-month, one-year and relative time switch).
Resetting the time switches must be simple.
HMI Interface User interface for the application for
Input for current switch-on and switch-off times
Controlling the sample application:
Starting / resetting time switches
Display of current time switch status (on/off)
Button for selecting mode of summer / winter time changeover: via radio-
controlled clock or via function block (delivered with the application)
Rev. B - final 19.07.2002 11/84
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection

2 Automation Solution

The automation problem described in chapter 1 can be solved with standard hardware and software components (SIEMENS) plus the user's own customized software.
The SIMATIC S7, together with a monitoring and control unit (SIMATIC OP/TP), is useful for executing the automation task.
Based on the used standard HW/SW components, as well as the compiled application software, data are exchanged between S7-CPU and HMI system via an MPI bus system.
Both the diagrams below give you an overview of all the components involved. Figure 2-1 shows you the standard components. Connecting the HVAC devices to the S7-CPU via the distributed I/O was not looked into in this application, and is thus only outlined schematically. Figure 2-2 shows you the user software developed for this application.
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
Fig. 2-1 Standard hardware components
Rev. B - final 19.07.2002 12/84
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
Diagram of user software running on the standard components
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
Fig. 2-2 User software
Description of the complete solution
Solving the task described in chapter 1 requires several blocks (see Chapter 2.1) for time-dependent setting or resetting of an output. In our solution the block parameter are input via an HMI-system (see Chapter 2.2).
However, the parameters can also be input directly at the block.
The application contains function blocks for absolute and relative time switch functions (clocks). Each clock has only one setting option (corresponding to a “cam”), i.e. only respectively one switch-on and one switch-off time can be entered at a block. This way of handling has many advantages:
The function blocks are kept very fine-granular. This enables ideal usage
of the storage requirements of the S7-CPU.
Flexible application of the blocks.
Simple parameterization of the blocks.
Rev. B - final 19.07.2002 13/84
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
Furthermore, the application contains additional functions such as summer/winter time changeover as well as taking holidays into consideration.
The additional function „Summer/winter time changeover“ is conducted by default by the FB103 „summer_winter“. Optionally this changeover can also be controlled by means of a radio-controlled clock. In this case a digital input module is necessary (i.e. SM321), as two digital inputs are required in order to receive the data sent from the clock module.
For each absolute or relative clock (corresponds to a function call of a function block) a view is used in the HMI system.
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
HMI System
View 1
Fig. 2-3 Function scheme
View 4
View 3
View 2
S7-CPU
Rev. B - final 19.07.2002 14/84
t
t
d
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection

2.1 Functionality in the S7-CPU

The following blocks are available in the S7-CPU:

2.1.1 Absolute time switching functions One-day time switch:

This block can detect a time range within 24 hours, e.g. 8 to 12 o‘clock. These switch times are repeated daily.
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
12:00 a.m
11:59:59 p.m
8:00 a.m. 12:00 p.m.
Fig. 2-4 Time range one-day time switch
Seven-day time switch:
This block can detect a time range within 7 days, e.g. each Tuesday from 8 o’clock p.m. to Friday 6 o‘clock a.m.. These switch times are repeated on a weekly basis.
Note: It is also possible to repeat a switch time daily from Monday to Friday.
So 12:00 a.m. Sa 11:59:59 p.m.
Di, 8:00 p.m.
Fr, 6:00 a.m.
Fig 2-5 Time range seven-day time switch
One-month time switch:
This block can detect a time range within 31 days, e.g. each month from
rd
the 3
r
3
, 12 o’clock p.m. to the 7th 21 o‘clock p.m..
s
1
12:00 a.m.
, 12:00 p.m. 7th , 9:00 p.m.
s
31
11:59:59 p.m.
Fig 2-6 Time range one-month time switch
Rev. B - final 19.07.2002 15/84
t
:00 a.m.
t
h
h
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
One-year time switch
This block can detect a time range within 365 days, e.g. from April 13 8 o’clock a.m. to September 28
s
1
Jan.
12
t
13
May, 8:00 28
Fig 2-7 Time range one-year time switch

2.1.2 Relative time function Relative time switch:

The clock is activated on a start signal and remains active until the parameterized time interval has elapsed.
th
12 o‘clock p.m..
t
Sept, 12:00
Parameterized time (e.g.: 3 hours)
th
s
31
Dec.
11:59:59 p.m.
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
Start signal
Fig. 2-8 Relative time switch

2.1.3 Additional functions

Summer/wintertime changeover:
The clock changes the absolute system time in the S7-CPU by plus or minus one hour, depending on whether the time changeover is from winter to summer time, or from summer to winter time.
For this changeover there are two alternatives:
1. Radio-controlled changeover (for this alternative you have to use the radio-controlled clock shown in figure 2-1): The system time is being synchronized after the clock connected to the system has sent the changeover signal.
Rev. B - final 19.07.2002 16/84
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
2. Program controlled changeover: The system time is being adjusted at the officially fixed dates by means of a function block which is included in this application.
Holiday/special day recognition: Data for holidays and special days are stored in a DB in the format day/month/year. The block checks whether a day in this DB coincides with this current date, and sets an output to 1. Otherwise, the output is 0.
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
Rev. B - final 19.07.2002 17/84
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection

2.2 Controlling and monitoring

The HMI system used in this case is an OP3 or alternatively a TP170A. Only a short overview is given here on operation. A detailed description on operation is given in Chapter 6.
The HMI page contains a view on each block in the S7-CPU. Inputs for the respective block are made via this view. The variables in the HMI system are connected with the correct memory space in the S7-CPU, so that inputs are at the correct location and can be evaluated in the S7 program.
Note
Information on setting the time in the HMI system via the S7-CPU or for setting the S7-clock via the HMI system are given on the [ProductSupportPages] under Entry ID 944136 (OP3) or Entry ID 2383397 (TP170A).
ProduktSupportSeiten
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
Rev. B - final 19.07.2002 18/84
p
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
HMI with OP3
The OP3 is a text-based display of the lower performance range. A maximum of 2 lines at 20 characters each can be operated and monitored at once on the device.
An example (one-day time switch) of the HMI interface at OP3 is illustrated below.
The upper section of the illustration gives the input parameter, the lower section the output parameter.
Switch-o n tim e
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
Switch-off time
Control
arameter
Error
Output
Details on
current
system time
Fig. 2-9 HMI interface for the one-day time switch at the OP3
Enable Clock: The parameter is used for enabling or disabling the clock.
Reset Output: The Reset parameter is used for resetting the output of the clock when problems occur.
Rev. B - final 19.07.2002 19/84
p
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
HMI with TP170A
The TP170A is a WindowsCE device of the lower performance range. A graphical user interface of 12 cm x 8 cm can be used for controlling and monitoring.
An example (one-day time switch) of the HMI interface at TP170A is illustrated below.
Switch-on ti m e Switch-off ti me
Control­arameter
Datails on
current
system time
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
Output
Error
Fig. 2-10 HMI interface for the one-month time switch at the OP3
Enable Clock: The parameter is used for enabling or disabling the clock.
Reset Output: The Reset parameter is used for resetting the output of the clock when problems occur.
Rev. B - final 19.07.2002 20/84
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection

2.3 Standard components required

2.3.1 Hardware components

The following hardware components are required to use the application.
Table 2-1 Hardware components required
Component MLFB Description
PS 307 6ES7307-1BA00-0AA0 or similar power supply CPU 315-2 DP 6ES7-315-2AG10-0AB0 or similar CPU PG740 PIII or equal PC OP3
or alternative
TP170A
6AV3 503-1DB10
6AV6 545-0BA15-2AX0
or similar HMI system
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
Optional hardware components (required only when radio-controlled clock is to be used) :
Tabelle 2-2 Optional hardware components
Component MLFB Description
SM 321 6ES7 321-7BH00-0AB0
Radio receiver SIPLUS DCF77
6AG1057-1AA03-0AA0

2.3.2 Software components

The following software components are required to implement our example.
Table 2-3 Software components required
Component MLFB Description
STEP7 V5.2 6ES7810-4CC06-0YX0 ProTool V6.0 6AV6582-2BX06-0XA0
Windows NT 4.0 SP 6a
or alternative
or similar digital input module
or SICLOCK (see appendix)
Windows 2000 SP 2
Rev. B - final 19.07.2002 21/84
Warranty, Liability and Support
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
Optional software components (required only when a radio-controlled clock is to be used):
Tabelle 2-4 Optional software component
Component Description
Dokument-Eigenschaft. All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Copyright © Siemens AG Fehler! Unbekannter Name für
FB77 “DCF77_FB”
This standard function block has already been implemented in this application. It is required only when a radio-controlled clock is to be used.
Regardless of this application a STEP7 project including the function block FB77 is available at the following address:
http://www.ad.siemens.de/siplus/additions/html_00/doku mentation.shtml
Rev. B - final 19.07.2002 22/84
Copyright © Siemens AG 2005 All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection

2.4 Application software components required and their "product features"

This application was produced using the following application software components:
Table 2-2 STEP 7 application software
Serial No. Name Function description Technical data Ambient Conditions
1 Day (FB120)
2 Week (FB121)
3 Month (FB122)
4 Year (FB123)
The FB “DAY” checks, whether the current system time in the S7 CPU is within the parameterized time range at the input parameters of the block. If this is the case, the output is set to “1”. Otherwise the output is “0”.
The FB “Week” checks, whether current system time and current day of the week in the S7 CPU are within the parameterized time range at the input parameters of the block. If this is the case, the output is set to “1”. Otherwise the output is “0”.
The FB “Month” checks, whether current system time and current day in the month in the S7 CPU are within the parameterized time range at the input parameters of the block. If this is the case, the output is set to “1”. Otherwise the output is “0”.
The FB “Year” checks, whether current system time and current date in the S7 CPU are within the parameterized time range at the input parameters of the block. If this is the case, the output is set to “1”. Otherwise the output is “0”.
Language STL Storage
requirements: 610 bytes
– Instance DB: DB120
52 bytes
Language STL Storage
requirements: 4750 bytes
– Instance DB: DB121
48 bytes
Language STL Storage
requirements: 1054 bytes
– Instance DB: DB122
56 bytes
Language STL Storage
requirements: 956 bytes
– Instance DB: DB123
56 bytes
– S7-CPU – OB1
– S7-CPU – OB1
– S7-CPU – OB1
– S7-CPU – OB1
Rev. B - final 19.07.2002 23/84
Copyright © Siemens AG 2005 All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection
Serial No. Name Function description Technical data Ambient Conditions
5 Relative (FB124)
The FB “Relative” sets the output to “1”, if at the input “Enable” a positive edge is identified. The output stays on “1” until the parameterized time has elapse. Additionally it can be parameterized, whether the parameterized time restarts at any positive edge, or whether only the first edge change is reacted to.
6 Summer_winter (FB103)
The FB “Summer_winter” changes the current system time in the S7­CPU by plus or minus 1 hour, depending on whether the time changeover has occurred from winter to summer or from summer to winter time
Language STL Storage
requirements: 598 bytes
– Instance DB: DB124
58 bytes
Language STL Storage
requirements: 382 bytes
– S7-CPU – OB1
– S7-CPU – OB1
– Instance DB: DB103
44 bytes
7 Holidays (FC100)
The FC “Holidays” checks whether a date stored in this checked DB coincides with the current system date in the S7-CPU and sets its output to “1” accordingly.
Language STL Storage
requirements:
– S7-CPU – OB1
310 bytes
Rev. B - final 19.07.2002 24/84
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection

2.5 Installation with simple setup

The entire application software available for downloading has been compressed in the “timefunc.exe” file. Copy the “timefunctions.exe“ file to a separate folder and launch by double clicking on it. The project is automatically extracted into the specified path including all respective sub­directories. Subsequently the extracted STEP7 project can be opened with the SIMATIC Manager.
S7 project name
OP3-
Copyright © Siemens AG 2005 All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
TP170A project
Fig. 2-11 SIMATIC Manager
The project contains both ProTool projects for OP3 and TP170A. They can be opened by double click in the SIMATIC Manager, providing ProTool has been installed on the computer.
The hardware components for the S7 station may have to be adjusted in the STEP7 project (if you are using different hardware components from those given here) and is then be loaded into the S7 CPU.
Rev. B - final 19.07.2002 25/84
Time switch based on the S7-300/400 CPUs with simple HMI system including radio-controlled clock connection

3 Basic performance data

The basic data for the S7 blocks are available in the following table:
Table 3-1 Basic data for the function blocks
One-day
time
switch
No. Input
parameter
3 2 24h 1 1s 23:59:59
No. Output
parameter
Cycle
No. Time intervals
Smallest
settable
interval
Largest
settable
interval
Copyright © Siemens AG 2005 All rights reserved
BID21669756_Zeitschaltuhr_einfach_DOKU_v20_e.doc
Seven-day
time
switch
3 2
7
days
1 1s
6 days,
23:59:59
One-
month
time
3 2
31
days
1 1s
30 days, 23:59:59
switch
One-year
time
3 2
switch
Relative
time
5 2 - 1 1s
switch
365
days
1 1s
364 days,
23:59:59
23 days, 23:59:59
The basic data for the radio receiver SIPLUS DCF77 are as follows:
Table 3-2 Basic data for the radio receiver
Radio frequency 77,5kHz Protection class IP65 Dimensions
(W x H x D) 75 x 125*) x 75 mm
*) plus 25mm für screw connection plus bending radius for cable
Voltage feed 24Vdc (20,4 ... 28,8Vdc) Current consumption 50mA (typ.)
Rev. B - final 19.07.2002 26/84
Loading...
+ 58 hidden pages