Post on 16-Oct-2014
transcript
1. The SIMATIC S7 System Family
2. The SIMATIC Manager
3. Training Units
4. Hardware Configuration
5. Editing Blocks
6. Binary Operations
7. Digital Operations
8. Symbols
9. Test Functions
10. Data Storage in Data Blocks
11. Functions and Function Blocks
12. Troubleshooting
13. Organization Blocks
14. Analog Value Processing
15. Documenting, Archiving, Saving
16. Communication via MPI
17. Solutions
18. Technical Data and Special Features of the S7-400
19. Totally Integrated Automation
20. What’s Next?
Information and Training Automation and Drives
SIMATIC S7 Programming 1 Course ST-7PRO1 AL: N ECCN: N
Export Regulations AL Number of European resp. German export list. Goods with labels not equal to ”N” are subject to export authorization. ECCN Number of US export list (Export Control Classification Number). Goods
with labels not equal to ”N” are subject to re-export authorization for export to certain countries.
Indication Goods labeled with ”AL not equal to N” (here: technical documentations) are subject to European or German export authorization when being exported out of the EU.
Goods labeled with ”ECCN equal to N” (here: technical documentations) are subject to US re-export authorization.
Even without a label, or with label ”AL:N” or ”ECCN:N”, authorization may be required due to the final whereabouts and purpose for which the goods are to be used. Decisive are the export labels stated on order acknowledgements, delivery notes and invoices.
This document was produced for training purpose. Siemens assumes no responsibility for its contents. The reproduction, transmission or use of this document or its contents is not permitted without express written authority. Offenders will be liable to damages. All rights, including rights created by patent grant or registration of a utility model or design, are reserved. © SIEMENS AG 2005
Name: ___________________________ Course: from ____________ to ____________ Instructor:
Infoline Tel: 01805 23 56 11 Fax: 01805 23 56 12 Internet: http://www.ad.siemens.de/training ID-Nr.: Release A5.1 (for STEP7 Version 5.x)
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC S7 System FamilyPage 1
Contents Page
SIMATIC Overview .............................................................................................................................. 2S7-200 ................................................................................................................................................. 3S7-200: Modules ........................................................................................................................... 4S7-200: CPU Design .......................................................................................................................... 5S7-300 ................................................................................................................................................. 6S7-300: Modules ........................................................................................................................... 7S7-300: CPU Design .......................................................................................................................... 8S7-400 ................................................................................................................................................. 9S7-400: Modules ........................................................................................................................... 10S7-400: CPU Design (Part 1) .............................................................................................................. 11S7-400: CPU Design (Part 2) .............................................................................................................. 12Programming Devices........................................................................................................................... 13PG/PC Requirements for Installing STEP 7 ………........................................................................... 14Installing the STEP 7 Software ........................................................................................................... 15Result of Installation ...................................................................................................................... 16
Date: 05.12.2005File: PRO1_01E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
The SIMATIC S7 System Family
SIMATICWinCC
SIMATIC PC
SIMATIC DP
SIMATIC Controller
SIMATIC HMI
SIMATIC NET
SIMATICPCS 7
SIMATIC Software
SIMATIC
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC S7 System FamilyPage 2
Date: 05.12.2005File: PRO1_01E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
SIMATIC Overview
SIMATIC Controller
SIEMENS
SIMATIC
SFRUNSTOP
Q0.0Q0.1Q0.2Q0.3Q0.4Q0.5
I0.0I0.1I0.2I0.3I0.4I0.5
I0.6I0.7
S7-200
CPU 212
SIMATIC PGSIMATIC PC
PG 740
SIEMENS
7 8 9
4 5 6
1 2 3
0
.D E F
A B C I N SD E L
S H I F T H E L P
E S C
E N T E R
A C K
S I M A T I C O P 1 7
S H I F T
H E L PK 1 K 5 K 6 K 7 K 8K 2 K 3 K 4
K 9 K 1 0 K 11 K 1 2 K 1 3 K 14 K 1 5 K 1 6
SIMATIC HMI
ASIFM
SV
SIMATIC DP
SIMATIC NET
PROFIBUS-DP
Industrial Ethernet PROFIBUS
MPI - Network SIMATIC NET
Introduction The introduction of electronics has resulted in great changes in industrial control engineering. Together with automated machinery, whose application possibilities were expanded through electronic controls, these changes have also led to new technologies and branches.
Controllers In addition to the energy supply, control elements are required for the operation of machines and processes in almost all areas of manufacturing. It must be possible to initiate, control and monitor the operation of any given machine or process.In the past, control tasks were solved with conventional control technology by individually - that is, dependent on the task - wiring contacts and relays. Today programmable logic controls are largely used to solve automation tasks.
Totally Integrated In order for companies to remain competitive, it is not enough to isolatedlyAutomation automate only individual processing stations or machines. The demand for more
flexibility with higher productivity can only then be fulfilled when the individual machines are integrated in the entire system. The information flow between all components is essential for the functioning of the entire system.Production processes are no longer seen as individual partial processes, but rather as integral components of an entire production process. Also, the entire process is also no longer structured centrally as hierarchical. Now the process is structured as distributed and autonomous individual elements.The total integration of the entire automation environment is today made possible with the help of:• common configuring and programming of individual partial
systems• common data management• common communication between all participating automation components.
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC S7 System FamilyPage 3
Features • Modular small control system for the lowest performance range,• Performance-graded range of CPUs,• Extensive selection of modules,• Expandable with up to 7 modules,• Backplane bus integrated in the modules,• Can be networked with - RS 485 communication interface or
- PROFIBUS,• Central PG connection with access to all modules,• No slot restrictions,• Own software,• “Total Package” with power supply, CPU, I/O in one unit,• "Micro PLC" with integrated functions.
Date: 05.12.2005File: PRO1_01E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
S7-200
SIEMENS
SIMATIC S7-200
CPU 214SFRUNSTOP
I1.0I1.1I1.2I1.3I1.4I1.5
I0.0I0.1I0.2I0.3I0.4I0.5I0.6I0.7
Q1.0Q1.1
Q0.0Q0.1Q0.2Q0.3Q0.4Q0.5Q0.6Q0.7
EM 221
DI 8 x DC24V
I.0
I.1
I.2
I.3
I.4
I.5
I.6
I.7
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC S7 System FamilyPage 4
Expansion • Digital input modules:Modules (EM) - 24V DC
- 120/230V AC• Digital output modules:
- 24V DC- Relais
• Analog input modules:- Voltage- Current- Resistance- Thermocouple
• Analog output modules:- Voltage- Current
Communications The CP 242-2 can be used to connect the S7-200 as Master to an AS-Interface. Processors (CP) As a result, up to 248 binary elements can be controlled via 31 AS-Interface Slaves.
This significantly increases the number of inputs and outputs for theS7-200.
Accessories Bus connector
Date: 05.12.2005File: PRO1_01E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
S7-200: Modules
EM EM
CP242 - 2
CP
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC S7 System FamilyPage 5
Mode Selector For manual mode selection:STOP = Stop mode; the program is not executed.TERM = Program execution, read/write access possible from PG.RUN = Program execution, read-only access possible from PG.
Status Indicators SF = Group error; internal CPU error(LEDs) RUN = Run mode; green
STOP = Stop mode; yellowDP = Distributed I/O ( only CPU 215)
Memory Card Slot for memory card. A memory card saves the program contents in the event of a power outage without the need for a battery.
PPI Connection The programming device / text display or another CPU is connected here.
Date: 05.12.2005File: PRO1_01E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
SIEMENS
SIMATIC
SFRUNSTOP
Q0.0Q0.1Q0.2Q0.3Q0.4Q0.5
I0.0I0.1I0.2I0.3I0.4I0.5
I0.6I0.7
S7-200
CPU 212
Potentiometer
Outputs
Inputs Status Indicators for integrated DI/DO
PPI Connection
Mode SelectorMemory Card
Status Indicators
S7-200: CPU Design
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC S7 System FamilyPage 6
Features • Modular small control system for the lowest performance range• Performance-graded range of CPUs• Extensive selection of modules• Expandable with up to 32 modules• Backplane bus integrated in the modules• Can be networked with - Multipoint interface (MPI),
- PROFIBUS or- Industrial Ethernet.
• Central PG connection with access to all modules• No slot restrictions• Configuration and parameter setting with the help of the "HWConfig“ tool.
Date: 05.12.2005File: PRO1_01E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
S7-300
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC S7 System FamilyPage 7
Signal Modules • Digital input modules: 24V DC, 120/230V AC(SM) • Digital output modules: 24V DC, Relay
• Analog input modules: Voltage, current, resistance, thermocouple
• Analog output modules: Voltage, current
Interface Modules The IM360/IM361 and IM365 make multi-tier configurations possible.(IM) They loop the bus through from one tier to the next.
Dummy Modules The DM 370 dummy module reserves a slot for a signal module whose parameters(DM) have not yet been assigned. It can also be used, for example, to reserve a slot for
installation of an interface module at a later date.
Function Modules Perform “special functions": (FM) - Counting
- Positioning- Closed-loop control.
Communication Provide the following networking facilities:Processors (CP) - Point-to-Point connections
- PROFIBUS- Industrial Ethernet.
Accessories Bus connectors and front connectors
Date: 05.12.2005File: PRO1_01E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
S7-300: Modules
PS(optional)
CPU IM(optional)
SM:DI
SM:DO
SM:AI
SM:AO
FM:- Couting- Positioning- Closed-loop
control
CP:- Point-to-Point- PROFIBUS- Industrial Ethernet
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC S7 System FamilyPage 8
Mode Selector MRES = Modul Reset functionSTOP = Stop mode; the program is not executed.RUN = Program execution, read-only access possible from PG.RUN-P = Program execution, read/write access possible from PG.
Status Indicators SF = Group error; internal CPU fault or fault in module with diagnostics(LEDs) capability.
BATF = Battery fault; Battery empty or non-existent.DC5V = Internal 5 V DC voltage indicator.FRCE = FORCE; indicates that at least one input or output is forced.RUN = Flashes when the CPU is starting up, shows a steady light in Run
mode.STOP = Shows a steady light in Stop mode.
Flashes slowly for a memory reset request, Flashes quickly when a memory reset is being carried out,Flashes slowly when a memory reset is necessary because a
memory card has been inserted.
Memory Card A slot is provided for a memory card. The memory card saves the program contents inthe event of a power outage without the need for a battery.
Battery Compartment There is a receptacle for a lithium battery under the cover. The battery provides backup power to save the contents of the RAM in the event of a power outage.
MPI Connection Connection for a programming device or other device with an MPI interface.
DP Interface Interface for direct connection of distributed I/Os to the CPU.
Date: 05.12.2005File: PRO1_01E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
CPU314SIEMENS
SFBATFDC5VFRCERUNSTOP
RUN-PRUNSTOPM RES
SIMATICS7-300
Batterie MPI
CPU315-2 DPSIEMENS
RUN-PRUNSTOPM RES
SIMATICS7-300
Batterie DP
SFBATFDC5VFRCERUNSTOP
MPI
SF DPBUSF
S7-300: CPU Design
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC S7 System FamilyPage 9
Features • The Power PLC for the mid to upper performance range,• Performance-graded range of CPUs,• Extensive selection of modules,• Can be expanded by over 300 modules,• Backplane bus integrated in the modules,• Can be networked with - Multipoint interface (MPI),
- PROFIBUS or- Industrial Ethernet,
• Central PG connection with access to all modules,• No slot restrictions,• Configuration and parameter setting with the help of the "HWConfig“ tool,• Multicomputing (up to 4 CPUs can be used in the central rack ).
Date: 05.12.2005File: PRO1_01E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
S7-400
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC S7 System FamilyPage 10
Signal Modules • Digital input modules: 24V DC, 120/230V AC(SM) • Digital output modules: 24V DC, Relay
• Analog input modules: Voltage, current, resistance, thermocouple• Analog output modules: Voltage, current.
Interface Modules The IM460, IM461, IM463, IM467 interface modules provide the connection(IM) between various racks:
• UR1 (Universal Rack) with up to 18 modules• UR2 (Universal Rack) with up to 9 modules • ER1 (Extension Rack) with up to 18 modules • ER2 (Extension Rack) with up to 9 modules.
Function Modules Perform “special functions":(FM) • Counting
• Positioning• Closed-loop control.
Communication Provide the following networking facilities:Processors (CP) • Point-to-Point connections
• PROFIBUS• Industrial Ethernet.
Date: 05.12.2005File: PRO1_01E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
S7-400: Modules
PS CPU SM:DI
SM:DO
SM:AI
SM:AO
CP FM SM IM
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC S7 System FamilyPage 11
Mode Selector MRES = Modul RESetSTOP = STOP mode, i.e. no program execution and
output disabled ( "OD“ mode= Output Disabled). RUN = Program execution, read-only access possible from PG.RUN-P = Program execution, read/write access possible from PG.
Start-up Type Switch CRST = When you start the CPU with the mode selector STOP / RUN,a “complete restart" is performed (Cold ReSTart).
WRST = When you start the CPU with the mode selector STOP / RUN, a “restart" is performed (Warm ReSTart) The CPU requests the start-up type via the Status LED (selectable with the CRST/WRST switch).
Date: 05.12.2005File: PRO1_01E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
S7-400: CPU Design (Part 1)
EXT.-BATT.
5...15V DC
X3
X1
414 - 2XG00 - 0AB0
CPU 414-2X 2 3 4
INTFEXTF
STOPRUN
CRSTFRCE
CRSTWRST
RUN-PRUN
STOPCMRES
INTFEXTFBUSF
DP
EXT.-BATT.
5...15V DC
X1
421 - 1BL00 - 0AA0
DI 32xDC24VX 2 3 4
INTFEXTF
STOPRUN
CRSTFRCE
CRSTWRST
RUN-PRUN
STOPCMRES
Start-up Type Switch
Mode Selector
e.g. CPU412-1 e.g. CPU416-2DP
* for further CPUs please see catalog
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC S7 System FamilyPage 12
EXT-BATT Additional external battery voltage supply (DC 5...15V to backup the RAM, e.g. when the power supply is being replaced).
MPI Connection For the programming device or another device with MPI interface.
DP Interface The 413-2DP, 414-2DP, 416-2DP and 417-2DP CPUs have an integrated DP interface for direct connection of distributed I/Os to the CPU.
Slot for In the S7-400 CPUs you can, depending on your requirements, insert RAM orMemory Cards Flash EPROM cards as external load memory:
• RAM cards with a capacity of: 64KByte, 256KByte, 1MByte, 2MByte.The contents are backed up via the CPU battery.
• Flash EPROM cards with a capacity of:64KByte, 256KByte, 1MByte, 2MByte, 4MByte, 8MByte, 16MByte.The contents are backed up on the integrated EEPROMs.
Date: 05.12.2005File: PRO1_01E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
S7-400: CPU Design (Part 2)
EXT.-BATT.
5...15V DC
X3
X1
414 - 2XG00 - 0AB0
CPU 414-2X 2 3 4
INTFEXTF
STOPRUN
CRSTFRCE
CRSTWRST
RUN-PRUN
STOPCMRES
INTFEXTFBUSF
DP
EXT.-BATT.
5...15V DC
X1
421 - 1BL00 - 0AA0
DI 32xDC24VX 2 3 4
INTFEXTF
STOPRUN
CRSTFRCE
CRSTWRST
RUN-PRUN
STOPCMRES
Fault LEDs for general CPU faults
Slot for Memory Card
MPI interface
External battery supply
Fault LEDs for integrated DP interface
DP interface
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC S7 System FamilyPage 13
PG 720 is an industry-standard programming device, powerful and easy to use, especially for maintenance and service, but also for programming and configuration - the ideal tool for shopfloor applications.Features:• Measurements in Notebook format,• Independent of power supply,• AT-compatible,• Powerful hardware,• Equipped with all necessary SIMATIC interface ports.
PG 740 is a portable programming device, ideal for all applications in an automation project, as wellas being an extremely powerful, industry-standard PC.Features:• High-level system performance,• Excellent expansion facilities,• TFT- Farbdisplay,• Highly rugged design,• Equipped with all the necessary SIMATIC interface ports.
PG 760 is a multi-functional desktop programming device for all configuring and programming tasks in the engineering office.Its high-level system performance, flexible expansion capability and comprehensive facilities make it the ideal office tool for all automation projects.
Note A hand-held programming device is also available for programming the S7-200 in STL(PG702 = approx. 230 grams, 144 x 72 x 27mm, 2 x 20-character LC display).
Date: 05.12.2005File: PRO1_01E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Programming Devices
PG720
PG740
PG760
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC S7 System FamilyPage 14
Requirements New PGs of the SIMATIC S7 series provide the optimum conditions for the STEP 7software. An MPI card can be installed in PCs which meet the requirements listed above, or they can be connected to the COM interface with the PC-Adapter.
MPI Multi-Point Interface.
Date: 05.12.2005File: PRO1_01E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Hardware/Software Requirements
• Processor 80 486 or higher, Pentium recommended
• Hard Disk (free) Min. 300 MB (for Windows, Swap File, STEP7, Projects)
• RAM >= 32 MB, 64 MB recommended
• Interfaces CP 5611 or MPI card or PC-AdapterProgramming Adapter for Memory Card
• Mouse Yes
• Operating System Windows 95/98/NT
PG/PC Requirements for Installing STEP 7
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC S7 System FamilyPage 15
Installation 1. Activate “Setup.exe” by selecting “Add/Remove Programs” in the “Win95->Control Panel”.
2. Choose Options. 3. Choose Language.4. Authorization disk when prompted. 5. Re-boot when prompted.
Notes: 1. As of STEP 7 V4.0, the software is only available on CD-ROM.2. Software Service Packs can also be downloaded from
the Internet.
Software Protection The STEP 7 software is copy-protected and can only be used on one programming device at a time.When you have installed the software, you cannot start using it until you have transferred the authorization to the hard disk from the authorization disk.
Note As of STEP 7 V5.0, the software can also be started without authorization. After aspecific time period has run out, the user will be requested to install an authorization.
Be sure to read the notes in the README.TXT file on the authorizaiton disk. If you donot observe these instructions, you risk losing your authorization.
Service Packs Free-of-ChargeSoftware Service Packs can be downloaded from the Internet via http://www.ad.siemens.de/simatic-cs.
Date: 05.12.2005File: PRO1_01E.15
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
PG 740
SIEMENS
Installing the STEP 7 Software
or
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC S7 System FamilyPage 16
Introduction The main tool in STEP 7 is the SIMATIC Manager. There are two ways in which to activate it:
1. via Task bar -> Start -> SIMATIC -> STEP7 -> SIMATIC Manager
2. via the icon "SIMATIC Manager“.
Date: 05.12.2005File: PRO1_01E.16
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Result of Installation
Double-click on Icon
Activate via Start menu
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 1
Contents Page
From Process to Project ...................................................................................................................... 2STEP 7 Tools ……............................................................................................................................... 3Starting the SIMATIC Manager ........................................................................................................... 4SIMATIC Manager Menus and Toolbars ............................................................................................. 5The Toolbar in the SIMATIC Manager ............................................................................................... 6STEP 7 Project Structure ……………….............................................................................................. 7Offline/Online View in the SIMATIC Manager ..................................................................................... 8Storage Location for Projects .............................................................................................................. 9Creating a Project …........................................................................................................................... 10Inserting an S7 Program …................................................................................................................. 11Inserting an S7 Block ……................................................................................................................... 12STEP 7- Help System …..................................................................................................................... 13Context Sensitive Help in STEP 7........................................................................................................ 14Standard Libraries ............................................................................................................................... 15Exercise: Creating a Project ................................................................................................................ 16Exercise: Inserting an S7 Program ...................................................................................................... 17Exercise: Inserting an S7 Block ........................................................................................................... 18Exercise: CPU Memory Reset ............................................................................................................. 19
Date: 05.12.2005File: PRO1_02E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
The SIMATIC Manager
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 2
Date: 05.12.2005File: PRO1_02E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
From Process to Project
FB21
Hardware
Software
Project Management
Process
OB1
SIMATIC Manager
I1.0 I1.1 Q4.0
Process When you take a closer look at a process you want to automate, you will find that it is made up of a multitude of smaller sections and sub-processes, which are all interlinkedand dependent on one another.The first task is therefore to break down the automation process as a whole into separate sub-tasks.
Hardware and Each sub-task defines certain hardware and software requirements which mustSoftware be fulfilled by the automation system:
• Hardware:- Number and type of inputs and outputs- Number and type of modules- Number of racks- Capacity and type of CPU - HMI systems- Networking systems
• Software:- Program structure- Data management for the automation process- Configuration data- Communication data- Program and project documentation.
Project In SIMATIC S7 all the hardware and software requirements of an automation process are managed within a project. A project includes the necessary hardware (+ configuration), network (+ configuration), all the programs and the entire data management for an automation solution.
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 3
Date: 05.12.2005File: PRO1_02E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
STEP 7 Tools
SIMATIC Manager The SIMATIC Manager manages the STEP 7 projects. It is the main program and also appears on the WINDOWS 95 desktop.
Notes "STEP 7 - Readme" provides detailed information about the version, installation procedure, etc.
LAD, STL, FBD Tool for writing STEP 7 user programs in the “Ladder Diagram", “Statement List" or"Function Block Diagram“ programming languages.
Memory Card You can save your user programs on EPROM cards by either using the Parameter programming device or an external prommer.Assignment. Different drivers are required, depending on the application.
Configuring Network configuration is discussed in the chapter on “Communication“.Networks
Setting the PG-PC This tool is used for setting the local node address, the transmission speedInterface and the highest node address in the MPI network.
PID Control The basic STEP 7 software package also includes blocks for solving PIDParameter (closed-loop) control problems. You choose "PID Control ParameterAssignment Assignment" to start the program for assigning parameters to the closed-loop control
blocks.
Converting S5 Files STEP5 programs can be converted into the corresponding STEP 7 programs with the help of the S5/S7 converter.
Configure SIMATIC This option provides facilities for configuring multi-user systems.Workspace
Converting TI Files SIMATIC TI programs can be converted into the corresponding STEP 7 program with the help of the TI/S7 converter.
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 4
Date: 05.12.2005File: PRO1_02E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Starting the SIMATIC Manager
or
Introduction The SIMATIC Manager is a graphic user-interface for online/offline editing of S7 objects(projects, user program files, blocks, hardware stations and tools).With the SIMATIC Manager you can:
• manage projects and libraries,• activate STEP 7 tools,• access the PLC online,• edit memory cards.
Starting the There is an icon "SIMATIC Manager" on the Windows 95 desktop and aSIMATIC Manager "SIMATIC Manager" program item under SIMATIC in the Start menu.
You activate the program just like all other Windows 95 applications by double-clicking on the icon or via the Start menu
START -> SIMATIC ->
User-interface After installation, the main tool is available as an icon on the Windows 95 desktop. TheSIMATIC Manager manages the S7 objects such as projects and user programs.By opening an object, the associated tool for editing is started. A double-click on a program block starts the Program Editor and a block can be edited (object-oriented start)
Note You can always obtain online help for the current window by pressing the F1 function key.
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 5
Date: 05.12.2005File: PRO1_02E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
SIMATIC Manager Menus and Toolbars
Titlebar
Menubar
Toolbar
Statusbar
Taskbar
Titlebar The titlebar contains the window title and the buttons for controlling the window.
Menubar Contains all the menus available for the current window.
Toolbar Contains the most frequently used tasks as symbols. These symbols are self-explanatory.
Statusbar Displays the current status and further information.
Taskbar The taskbar contains all open applications and windows as buttons.The taskbar can be positioned on either side of the screen by using the right mouse button.
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 6
Date: 05.12.2005File: PRO1_02E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
The Toolbar in the SIMATIC Manager
Windows 95 Symbols STEP 7 Symbols
Display Accessible Nodes
S7 Memory Card
Download (to the PLC)
Define Filter
Activate Filter
Simulate Modules (S7-PLCSIM)
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 7
Date: 05.12.2005File: PRO1_02E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
STEP 7 Project Structure
Project Structure Data is stored in a project in the form of objects. The objects in a project are arranged in a tree structure (project hierarchy). The tree structure displayed in the project window is similar to that in the Windows 95 Explorer. Only the icons for the objects are different.
Project Hierarchy 1st. Level: The first level contains the project icon. Each project represents adatabase where all the data relevant to the project is stored.
2nd. Level: • Stations (e.g. S7-300 Station) are where information about the hardware configuration and parameter assignment data
of modules is stored. Stations are the starting point for configuring the hardware.
• S7 Program folders are the starting point for writing programs. All the software for a parameter-assignable
module from the S7 range is stored in an S7 Program folder. This contains further folders for the blocks and source files of the program.
• Subnets (MPI,Profibus, Industrial Ethernet) are part of an overall network.
3rd. and subsequent levels: Depends on the object type of the next-higher level.
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 8
Date: 05.12.2005File: PRO1_02E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Offline / Online View in the SIMATIC Manager
Offline The offline view displays the project structure stored on the hard disk of the programming device. It displays this in the project window of the SIMATIC Manager.The "S7 Program“ folder contains the objects “Source Files" and "Blocks".The "Blocks" folder contains the system data created with HWConfig and the blocks created with the LAD/STL/FBD Editor.
Online The online view displays the project structure stored in the CPU. It displays this in the project window of the SIMATIC Manager.The "S7 Program" folder only contains the object "Blocks".The "Blocks" folder contains:• system data blocks (SDB)• user blocks (OB, FC, FB)• system-own blocks (SFC, SFB).
Switch-over Switching between offline and online view takes place:• via the menu items View -> Offline or View -> Online or• with the corresponding symbol in the toolbar:
Online
Offline.
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 9
Date: 05.12.2005File: PRO1_02E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Storage Location for Projects
Menu Options SIMATIC Manager -> Options -> Customize
“Language" Tab • Language: You can select the language you want to use for the SIMATICManager, menus, dialog boxes, help, etc.Only the languages that have been installed appear in the list.
• Mnemonics: You can select the mnemonics you want to use for programming the S7 blocks.
"General" Tab Basic settings for editing projects and libraries:• Storage location for projects is where you specify the directory in which you want to store your user projects.• Storage location for libraries is where you specifiy the directory in which you want to store your user libraries.• Further options for inserting objects, opening projects and for window
arrangement will be dealt with later.• Deactivated system messages
By pressing the button “Activate“ you can reactivate all system messages that were switched-off in a window when the option “Always display this message….“was chosen.
"View" Tab This is where you specify what is to appear in the online display.
"Columns" Tab This is where you specify which columns are to be displayed when the Detail view is switched-on (see “Help“).
"Archive" Tab The archiving of projects will be discussed in the Chapter “Documenting, Saving, Archiving“.
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 10
Date: 05.12.2005File: PRO1_02E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Creating a Project
Enter project name hereand confirm with "OK"
Creating a Project Select the menu options File -> New or the symbol in the toolbar to open the "New" dialog box for creating a new project or a new library.Enter the project name in the "Name" box and confirm by clicking the "OK“ button.
Notes 1. The “Storage location (path)“ displays the path that was preset in the SIMATIC Manager under Options -> Customize.
2. As of STEP 7 V3.2, there is the 'New Project‘ Wizard to help you create a new project.
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 11
Date: 05.12.2005File: PRO1_02E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Inserting an S7 Program
Inserting a Program Select the menu options Insert -> Program -> S7 Program to insert a new program into the current project.When you insert an object, the system automatically gives it a relevant name, e.g. "S7 Program(1)". You can then change this name if you like.
Note You use the method described above to create a hardware-independent program.Programs assigned to particular hardware are dealt with in the Chapter "Hardware Configuration".
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 12
Date: 05.12.2005File: PRO1_02E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Inserting an S7 Block
Inserting a Block Select the menu options Insert -> S7 Block to display a list of block types:• Organization blocks (OB) are called by the operating system.
They form the interface between operating system and user program.
• Functions (FC) and function blocks (FB) contain the actual user program. They enable a complex program to be divided into small, easy-to-follow units.
• Data blocks contain user data.
After you have chosen the type of block you want, the "Properties" dialog box opens so that you can enter the block number and the programming language you want to use (LAD, STL or FBD).There are other settings you can make, depending on the type of block, but these will be discussed later. When you have made your settings and confirmed them by clicking the "OK" button, the new block is inserted in the current program.
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 13
Date: 05.12.2005File: PRO1_02E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
STEP 7 Help System
Obtaining Help There are various ways of obtaining help:1. The general help is activated via the menu options Help - > Contents.2. The context-sensitive help can be started with the F1 function key or via the
symbol in the toolbar.
Tabs • “Contents" - Displays a list of help topics under general headings.• "Index" - Allows you to access the help information by displaying a list
of terms available in alphabetical order.• “Find" - Enables you to look for certain words or expressions in the
help topics.
Hot words Certain words are hi-lighted in green and are underlined with a broken line in the help texts (so-called "Hot words"). A mouse click on these "Hot words" leads to a further help text with detailed information.
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 14
Date: 05.12.2005File: PRO1_02E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Context-Sensitive Help in STEP 7
Context-Sensitive The context-sensitive help gives application-specific information about hi-lighted objects, blocks, menu commands, dialogs etc.You can jump from the context-sensitive help to the general help via the button "Help on STEP 7".
Note You can find additional information on STEP 7 in the electronic manuals. These can be opened when you choose the menu options Start -> Simatic -> S7 Manuals .
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 15
Date: 05.12.2005File: PRO1_02E.15
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Standard Libraries
Introduction Libraries are used to store blocks without project assignment. These blocks can be created in the library, can be copied into and out of it, but cannot be tested. The library structure is set up as hierarchical just as the project structure.
Standard STEP 7 contains a Standard Library, that was stored in the STEP 7 SoftwareLibrary folder e.g. C:\Siemens\Step7\S7libs\stlib30 after STEP 7 was installed. You can access
these standard blocks from the SIMATIC-Manager with “Open->Libraries".
Communication FCs for communication between the CPU and the distributed I/O viaBlocks communication processors with S7-300.
Organization Blocks Organization blocks (OBs).
S5-S7 Converting Blocks for converting STEP 5 programs.Blocks
TI-S7 Converting Generally usable standard functions such as analog value scalingBlocks
IEC Function Blocks for IEC functions (IEC: International Electrotechnical Commission),Blocks such as for processing time and date, for comparison operations, for string processing
and for selecting maximum and minimum.
PID Control Blocks Function blocks (FBs) for PID closed-loop controls.
System Function System functions (SFCs) and System function blocks (SFBs).Blocks
Note Additional libraries are added when option software are installed.
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 16
Date: 05.12.2005File: PRO1_02E.16
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Creating a Project
Enter project name here and confirmwith "OK"
Remember! A project contains all the programs and data for the entire automation task. It can contain one or more programs which can be used in one or more CPUs.
Goal To delete an existing project and create a new one.
What to Do 1. Open the SIMATIC-Manager.2. Select the menu options File -> Delete -> Projects.3. Select “My Project“ from the list of projects and confirm with OK.4. After the project has been deleted, select the menu options
File -> New -> New Project.5. In the box provided enter the project name "My Project".
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 17
Date: 05.12.2005File: PRO1_02E.17
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Inserting an S7 Program
Remember! An S7 program is a combination of program blocks, data blocks, comments andsymbols which are all connected with an application. When you create a program you create a structure that includes all these program sections.
What to Do 1. In the project "My Project“, select the menu options Insert -> Program -> S7 Program.or (instead of point 1.):
1a.Click the right mouse button. In the menu that appears, select the options Insert New Object -> S7 Program to insert a new program.2. A new S7 program with the name "S7 Program 1“ is created.3. Change the name of the program to “My Program“.4. In the “My Program“ folder you will find the S7 program itself with the objects:
Blocks (user program), Source Files (source programs) and Symbols(symbol table).
Results A new S7 program is created within the project "My Project“. In the SIMATIC Manager you can see the subdirectory “My Program“ in the directory"My Project".An empty OB1 block is automatically created in the user program:
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 18
Date: 05.12.2005File: PRO1_02E.18
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Inserting an S7 Block
Remember! In simple terms, a block in a CPU is a program section that has a particular function and a particular structure. Block OB1 is called cyclically by the operating system and provides access to the S7 program. It can contain both program statements and calls to other blocks.
Goal Inserting an empty block (FC1).
What to Do 1. Select the user program (Blocks) in which you want to create the new block.2. Select the menu options Insert -> S7 Block ->Function.
or (instead of point 2.)2a.Click the right mouse button. In the menu that appears, select the options Insert New Object -> Function to insert a new function.3. Enter the block number in the “Name" box (in this case: FC1), and enter the programming language you want to use (LAD/STL/FBD) in the “Language”box. 4. Enter any additional information, such as Author etc., if required.5. Check all entries and confirm with OK.
Result You have created a new, empty block called FC1.
Training Centerfor Automation and Drives
ST-7PRO1The SIMATIC ManagerPage 19
Date: 05.12.2005File: PRO1_02E.19
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: CPU Memory Reset
Manual
RequestMemoryReset
PerformMemoryReset
1. Mode selectorin “STOP” position
2. Hold mode selectorin “MRES” positionuntil the “STOP”LED flashestwice (slowly)
3. Release mode selector (returnsautomatically to the“STOP” position)
1. Hold mode selectorin “MRES” position(“STOP” LED flashesquickly)
2. Release modeselector (returnsautomatically to the“STOP” position)
From the PG
1. Mode selectorin “RUN-P” position
2. Menu options:PLC -> OperatingMode -> Stop
3. Menu options:PLC -> Clear/Reset
1. Confirm MemoryReset by clicking the “OK” button
After inserting a Memory Card
1. Mode selectorin “STOP” position
2. Insert Memory Card
3. “STOP” LED flashesslowly
1. Hold mode selectorin “MRES” position(“STOP” LED flashesquickly)
2. Release modeselector (returnsautomatically to the “STOP” position)
General Before you download the user program to the S7 PLC, you should reset the CPUmemory to make sure there are no “old” blocks left in the CPU.The following takes place during a memory reset:• All user data are erased
(with the exception of the MPI parameter assignment).• Hardware test and initialization• If an EPROM memory card is inserted, the CPU copies the contents of the
EPROM back into the internal RAM after memory reset.• If no memory card is inserted, the set MPI address is retained. If, however, a
memory card is inserted, the MPI address entered on the card is loaded.• The contents of the diagnostic buffer (can be viewed on the PG) are
retained.
Note The CPU must be in the STOP mode for a memory reset:• Mode selector in “STOP” or• Mode selector in “RUN-P” and mode changed to STOP by selecting the menu options PLC -> Operating Mode -> Stop.
Exercise Perform a memory reset of the CPU (with the keyswitch or from the PG).You can check if the memory reset was performed successfully by checking the contents of the block folder in the Online view. Only system blocks (SDB, SFC and SFB) should now exist.
Training Centerfor Automation and Drives
ST-7PRO1Training UnitsPage 1
Contents Page
Setup of a Training Area with S7-300 ……………………..................................................................... 2Configuration of the Training Unit S7-300 ............................................................................................ 3Setup of a Training Area with S7-400 ……………................................................................................ 4Configuration of the Training Unit S7-400 …......................................................................................... 5The Simulator ………........................................................................................................................... 6The Conveyor Model …….................................................................................................................... 7
Date: 05.12.2005File: PRO1_03E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Training Units
V
Training Centerfor Automation and Drives
ST-7PRO1Training UnitsPage 2
Date: 05.12.2005File: PRO1_03E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Setup of a Training Area with S7-300
Contents of the The training kit consists of the following components:Training Kit • An S7-300 programmable logic controller with CPU 314 or CPU 315-DP
• Digital input and output modules, analog modules• Simulator with digital and analog sections• Conveyor model
Note:It is quite possible that your training area is not equipped with the conveyor model shown in the slide above, but rather with the conveyor model pictured below.
Training Centerfor Automation and Drives
ST-7PRO1Training UnitsPage 3
Date: 05.12.2005File: PRO1_03E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Configuration of the S7-300 Training Unit
PS1
CPU2
DI 1640
DI 1654
DO 1668
DO 16712
DI 16816
DO 169
20
AI/AO410
352
Module -->Slot No. -->I/O Address -->
Version A(16 channelI/O modules)
PS1
CPU2
DI 3240
DO 3254
DI8/DO868
AI 27
304
Module -->Slot No. -->I/O Address -->
Version B(32 channelI/O modules)
Configuration The programmable controller is configured with the following modules:of Version A Slot 1: Power Supply 24V/5A
Slot 2: CPU 314 or CPU 315-2 DPSlot 4: Digital input 16x24V Inputs from the simulatorSlot 5: Digital input 16x24V Pushwheel buttonsSlot 6: Digital output 16x24V 0.5A Outputs from the simulatorSlot 7: Digital output 16x24V 0.5A Digital displaySlot 8: Digital input 16x24V Conveyor model inputsSlot 9: Digital output 16x24V 0.5A Conveyor model outputsSlot 10: Analog module 4 AI/4 AO Adjustable from the simulator
Configuration The programmable controller is configured with the following modules:of Version B Slot 1: Power Supply 24V/5A
Slot 2: CPU 314 or CPU 315-2 DP Slot 4: Digital input 32x24V Inputs from the simulator
and pushwheel buttonsSlot 5: Digital output 32x24V/0.5A Outputs from the simulator
and digital displaySlot 6: Digital input and output Conveyor model
module 8X24V/ 8x24V 0.5ASlot 7: Analog input 2 AI Analog section from simulator
Addresses Fixed slot addressing is used for the S7-300 (CPU 312-314). The module addressesare shown in the slide.
The starting addresses of the modules can be set by parameter assignment on the CPU 315-2DP and for S7-400.
Training Centerfor Automation and Drives
ST-7PRO1Training UnitsPage 4
Date: 05.12.2005File: PRO1_03E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Setup of a Training Area with S7-400
Contents of the The training kit consists of the following components:Training Kit • An S7-400 programmable logic controller with CPU 412 or CPU 413-2DP
• Digital input and output modules, analog modules• Simulator with digital and analog sections• Conveyor model
Note:It is quite possible that your training area is not equipped with the conveyor model shown in the slide above, but rather with the conveyor model pictured below.
Training Centerfor Automation and Drives
ST-7PRO1Training UnitsPage 5
Date: 05.12.2005File: PRO1_03E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Configuration of the Training Unit S7-400
PS
Default Address:
CPU DI32
28
181716151413121110987654321Slot No.
DI32
32
DO32
36
DO32
40
AI8
1216
Design You can see the design of the training unit S7-400 in the slide above.
Configuration The UR 1 mounting rack is configured with the following modules:Slot 1: Power supply 24V and 5V/20ASlot 2: - " -Slot 3: - " -Slot 4: CPU 412 or otherSlot 5: vacant (when the CPU only has a single width)Slot 6: vacantSlot 7: vacantSlot 8: Digital input 32x24V (from Simulator) Slot 9: Digital input 32x24V (from Conveyor Model) Slot 10: Digital output 32x24V 0.5A (to Simulator)Slot 11: Digital output 32x24V 0.5A (to Conveyor Model)Slot 12: Analog input 8X13 Bit (from Poti on the Simulator)Slot 13: vacantSlot 14: vacant Slot 15:
vacantSlot 16: vacantSlot 17: vacantSlot 18: vacant
Addressing You have the default addresses, as shown in the slide above, as long as no configuration or parameter settings have been carried out.
Training Centerfor Automation and Drives
ST-7PRO1Training UnitsPage 6
Date: 05.12.2005File: PRO1_03E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
The Simulator
V
0 8 1 5 AI1 AI2 AO1 AO2
AI2AI1
-15V...+15V -15V...+15VAI1
AI2 AO1AO2
V
DI DO
.0
.1
.2
.3
.4
.5
.6
.7
.0
.1
.2
.3
.4
.5
.6
.7
.0
.1
.2
.3
.4
.5
.6
.7
.0
.1
.2
.3
.4
.5
.6
.7
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........
Design The Simulator is connected to the S7-300 or S7-400 training unit by two cables. It is in three sections:
• Binary section with 16 switches/momentary-contact switches and 16 LED's
• Digital section with 4 pushwheel buttons and a digital display. These operate with BCD values,
• Analog section with a voltmeter for displaying the values at analog channels 0 and1 or the analog outputs 0 and 1. You use the selector switch to choose the voltage value you want to monitor. There are two separate potentiometers for setting the values for the analog inputs.
Addressing You use the following addresses to address the inputs and outputs in your user program:
Sensor / Actuator
Switch / M.C. Sw.
LEDs
Pushwheel buttons
Digital display
Analog channels
Version A(DI16, DQ16)
IW 0
QW 8
IW 4
QW 12
PIW 352/354
Version B(DI32, DQ32)
IW 0
QW 4
IW 2
QW 6
PIW 304/306
S7-400(Default addresses)
IW 28
QW 36
IW 30
QW 38
PIW 1216/1230
Training Centerfor Automation and Drives
ST-7PRO1Training UnitsPage 7
Date: 05.12.2005File: PRO1_03E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
The Conveyor Model
INI 1 to INI 3 (Proximity switches)
M 1 (Motor)
H 1, H 2, H 3, H 4(LEDs)
S 1, S 2, S 3, S 4 (Acknowledgement buttons)
LB1Light barrier
Design The slide shows a diagram of the conveyor model with its sensors and actuators.
Addresses S7-300 S7-300 S7-400Ver. A Ver. B (w/o Sensor / Actuator Symbol(DI16, (DI32, HW DO16) DO32) Config)
I 16.0 I 8.0 I 32.0 Light barrier LB 1 LB1I 16.1 I 8.1 I 32.1 Ackn. switch, Loc 1 S1I 16.2 I 8.2 I 32.2 Ackn. switch, Loc 2 S2I 16.3 I 8.3 I 32.3 Ackn. switch, Loc 3 S3I 16.4 I 8.4 I 32.4 Ackn. switch, Final Assy S4 I 16.5 I 8.5 I 32.5 Proximity switch 1 INI1I 16.6 I 8.6 I 32.6 Proximity switch 2 INI2I 16.7 I 8.7 I 32.7 Proximity switch 3 INI3
Q 20.1 Q 8.1 Q 40.1 LED at Location 1 H1Q 20.2 Q 8.2 Q 40.2 LED at Location 2 H2Q 20.3 Q 8.3 Q 40.3 LED at Location 3 H3Q 20.4 Q 8.4 Q 40.4 LED at Final Assembly H4Q 20.5 Q 8.5 Q 40.5 Conveyor oper. to right K1_CONVRQ 20.6 Q 8.6 Q 40.6 Conveyor oper. to left K2_CONVLQ 20.7 Q 8.7 Q 40.7 Horn HORN
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 1
Contents Page
Memory Concept of the S7-300 ........................................................................................................................ 2Memory Concept of the S7-400 ........................................................................................................................ 3Loading Blocks into /out of Flash EPROM Memory Card .............................................................................. 4Hardware Configuration and Parameter-assignment ...................................................................................... 5Inserting a Station ............................................................................................................................................ 6Starting HW Config ........................................................................................................................................... 7Generating a Hardware Preset Configuration ............................................................................................... 8Module Address Overview ............................................................................................................................. 9CPU Properties .............................................................................................................................................. 10CPU Properties: General …............................................................................................................................ 11CPU Properties: Startup ................................................................................................................................ 12CPU Properties: Retentive Memory .................................................................................................................. 13CPU Properties: Cycle / Clock Memory .......................................................................................................... 14CPU Properties: Protection .............................................................................................................................. 15CPU Properties: Diagnostics / Clock ................................................................................................................ 16Saving the HW Preset Configuration and Downloading in Module ............................................................... 17Uploading the HW Actual Configuration to the PG ........................................................................................... 18Displaying Hardware Diagnostics in the SIMATIC Manager ............................................................................. 19Possible Problems with Configuration ............................................................................................................ 20Variable Addressing ......................................................................................................................................... 21Accessing the Symbol Table ............................................................................................................................. 22Exercise: Reading Out and Adapting the Actual Configuration ........................................................................ 23Exercise: Assign Parameters to Clock Memory and Test It ............................................................................. 24
Date: 05.12.2005File: PRO1_04E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Hardware Configuration and Memory Concept
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 2
Load Memory The load memory is part of a programmable module. It contains load objects created on the programming device ( logic blocks, data blocks, additional information).The load memory can either be a plug-in memory card or an integrated RAM.
Work Memory The work memory contains only the data relevant at run time. The RAM work memory is integrated in the CPU and is backed up through the battery.
System Memory The system memory contains the memory areas for:• Process image input and output tables (PII, PIQ)• Bit memories (M)• Timers (T)• Counters (C)• L stack (L).
Retentive Memory The retentive memory is a non-volatile RAM used for backing up bit memories, timers, counters and data blocks even if there is no backup battery. You specify the areas to be backed up when assigning the CPU parameters.
Inserting a When you insert a memory card, the operating system requests a memoryMemory Card reset.(STOP LED flashes slowly). You perform the memory reset by turning the mode
selector to the "MRES" position. The sections of the program relevant for execution are then transferred from the memory card (with load memory function) to the work memory.
The memory card must remain inserted while the program is being executed.
Date: 05.12.2005File: PRO1_04E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Memory Concept of the S7-300
Comments
Symbols
Blocks:• Logic blocks(OB,FC,FB)
• Data blocks(DB)
Flash EPROM Memory Card in PG(subsequently inserted in CPU)
Blocks:• Logic blocks(OB,FC,FB)
• Data blocks(DB)
Additional info.
System memory:• PII, PIQ• M, T, C
• RetentiveM, T, C
• Retent. data blocks
Retentive memory:
With PowerOFF withoutbattery backup
n. reten. reten.
with PowerON without batterybackup
RAM
Blocks:• Logic blocks(OB,FC,FB)
• Data blocks(DB)
Additional info.
Load memory:
Flash-EPROM
Work memory:• OB,FC,FB• DB
n. reten. reten.
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 3
Load Memory The load memory can either be a plug-in memory card or an integrated RAM. In the S7-400, the memory card (RAM or Flash EPROM) expands the integrated load memory. A memory card is always required, since the integrated load memory only has a limited size.
Work Memory The work memory contains only the data relevant at run time. The RAM work memory is integrated in the CPU and is backed up through the battery.
System Memory The system memory contains the memory areas for:• Process image input and output tables (PII, PIQ)• Bit memories (M)• Timers (T)• Counters (C)• L stack (L).
Memory Card When a RAM memory card is used, the system must be operated with a battey. This is so that the memory card data and those of the internal RAM are backed up if there is a power failure.When an FEPROM memory card is used, the user program is stored in the memory card, power failure safe. The data found in the internal RAM are backed up through the battery.The "Restart" mode is only possible in a backed up system.
Inserting a When you insert a memory card, the operating system requests a memory resetMemory Card (STOP LED flashes slowly). You perform the memory reset by turning the mode
selector to the "MRES" position. The sections of the program relevant for execution are then transferred from the memory card (load memory) to the work memory. The memory card must remain inserted while the program is being executed.
Date: 05.12.2005File: PRO1_04E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Memory Concept of the S7-400
Comments
Symbols
Blocks:• Logic blocks(OB,FC,FB)
• Data blocks(DB)
Flash EPROM Memory Card in PG(subsequently inserted in CPU)
Blocks:• Logic blocks(OB,FC,FB)
• Data blocks(DB)
Additional info.
RAM
Blocks:• Logic blocks(OB,FC,FB)
• Data blocks(DB)
Additional info
Load memory:
Flash-EPROM
System memory:• PII, PIQ• M, T, C
Work memory:• OB,FC,FB• DB
Backupvia battery
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 4
Introduction When you use an FEPROM card, it is possible to operate the CPU without battery backup. The program is stored in the FEPROM, power failure safe.You can define retentive areas in the HW Configuration. In the S7-300, the retentive data (timers, counters, bit memories, data areas) are stored in a retentive memory area of the CPU (non-volatile RAM).
Insert / Remove When you remove or insert a memory card, the CPU requests a memory reset. When you insert a RAM card, the user program must be reloaded from the PG. When you insert anFEPROM card, its contents are copied into the work memory.
Power Failure After a Power Off without battery backup, the blocks are copied from the memory card into the work memory and with the S7-300, the retentive data are supplied from the non-volatile RAM. Data areas in DBs, that were defined as retentive (only with the S7-300), resume the state they had before power failure. Non-retentive data areas are set to the original values that are stored in the memory card.
Changing the When you make block corrections, the modified blocks are stored in the workProgram memory. When you upload the blocks into the PG, these are retrieved from the work
memory.After a power failure (without battery), the work memory (RAM) is erased. So that the corrected blocks are available once more after a Power On, they have to be:1. saved on the hard disk when you operate without EPROM memory card, 2. saved on the hard disk or on a memory card when you operate with EPROM memorycard.
Loading the You either transfer the blocks onto the memory card (inserted in the PG) throughMemory Card the SIMATIC Manager per drag and drop or with some CPUs, you can write directly into the
CPU using the menu options PLC -> Download to EPROM Memory Card on CPU. The memory card must be erased first. Individual blocks can be reloaded but cannot be deleted or overwritten.
Date: 05.12.2005File: PRO1_04E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Loading Blocks into /out of Flash EPROM Memory Card
Load memoryinternal RAM
"Load"
Load memoryFlash EPROM
"Load in EPROM"
Work memoryRAM
After insertingthe memorycard:memory resetrequestand copyingin workmemorySections
relevant for execution
"Load in PG"
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 5
Date: 05.12.2005File: PRO1_04E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Hardware Configuration and Parameter Assignment
Actual configuration Actual configuration and parameter assignment of an existing hardware.
Parameter-assignment Establishing the characteristics of parameter-assignable blocks, e.g: startup characteristics, retentive areas, etc.)
Preset configuration Planned hardware configuration and parameter assignment.
Configuration Assignment of racks, blocks and distributed I/O in the Station window of HW Config.You can select the components from a hardware catalog.
HW Configuration The modules are supplied from the factory with preset parameters. If these default settings are OK, a hardware configuration is not necessary.A configuration is necessary:• if you want to modify preset parameters or addresses of a module (e.g.
enable the hardware interrupt of a module)• if you want to configure communication connections• with stations with distributed peripherals (PROFIBUS-DP)• with S7-400 stations with several CPUs (multicomputing) or expansion racks • with fault-tolerant programmable logic controllers (option package).
Preset When you configure a system, a so-called preset configuration is created. ItConfiguration contains a hardware station with the planned modules and the associated parameters.
The PLC system is assembled according to the preset configuration and during commissioning, the preset configuration is downloaded into the CPU.
Actual Configuration In an assembled system, the actual existing configuration and parameter assignment of the modules can be read out of the CPU. A new HW station is thereby set up in the project. This is necessary, for example, if the project structure does not exist locally at the PG. After the actual configuration is read out, the set parameters can be checked and then stored in a project.
Notes With the S7-400, the CPU can be assigned parameters in such a way, that when there are differences between the preset configuration and the actual configuration, the startup of the CPU is interrupted.To call the HW Config tool, a hardware station must exist in the SIMATIC Manager.
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 6
Insert StationYou insert a new station in the current project by selecting the menu options Insert -> Station -> SIMATIC 300 Station or SIMATIC 400 Station.The name automatically given to this station "SIMATIC 300 (1)" can then be changed by you.
Date: 05.12.2005File: PRO1_04E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Inserting a Station
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 7
HW Config This tool helps you to configure, assign parameters to and diagnose the hardware.
Starting HW Config To start the HW Config tool:• select a hardware station in the SIMATIC Manager and choose the menu
options Edit --> Open Object or• double-click on the Hardware object.
"Hardware This is a window of the "HW Config“ application which you use for insertingConfiguration" components from the "Hardware Catalog" window.
The title bar of this window contains the name of the project and the station name.
"Hardware Catalog" To open the catalog:• select the menu options View -> Catalog or• click on the icon in the toolbar.If “Standard” is selected as the catalog profile, all racks, modules and interface modules are offered for selection in the "Hardware Catalog" window.You can create your own catalog profiles containing frequently used elements by selecting the menu options Options -> Edit Catalog Profiles.
Profibus Slaves, that do not exist in the catalog, can be added after the fact. To do so, you use so-called GSE files that are supplied by the manufacturer of the slave device.The GSE file contains a description of the device. To include the slave in the hardware catalog, use the menu options Options -> Install New GSE Files and then Options -> Update Catalog. You will find the new devices in the catalog under Profibus additional field devices.
Date: 05.12.2005File: PRO1_04E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Starting HW Config
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 8
Generating a This means specifying how the modules are to be arranged in the rack. ThisPreset configuration specified by you is referred to as the preset configuration. Configuration
Rack For example, you open a SIMATIC 300 station in the Hardware Catalog. Catalog "RACK-300" contains the icon for a DIN rail. You can insert this in the "Hardware Configuration" window by double-clicking on it (or using drag&drop).Two rack component lists then appear in the two-part window: a plain list in the top part and a detailed view with order numbers, MPI addresses and I/O addresses in the bottom part.
Power Supply If a load current power supply is required, you insert, with a double click or per drag&drop, the appropriate "PS-300" module from the catalog in slot no.1 in the list.
CPU You select the CPU from the "CPU-300" catalog, for example, and insert it in slot no. 2.
Slot No. 3 Slot no. 3 is reserved as the logical address for an interface module (for multi-tier configurations).If this position is also to be reserved in the actual configuration for the later installation of an IM, you must insert a dummy module DM370 (DUMMY).
Signal Modules From slot no. 4 onwards, you can insert a choice of up to 8 signal modules (SM), communications processors (CP) or function modules (FM). You insert modules in the list by selecting the slot and then double-clicking on the module you want in the catalog.You can insert modules anywhere in the list by using drag&drop.
Date: 05.12.2005File: PRO1_04E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Generating a Hardware Preset Configuration
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 9
R Rack numberS Slot number of the relevant moduleDP only relevant when using Distributed Peripherals (I/O)IF Interface module ID when programming the M7 system (in C++).
Free Address When the CPU 315-2DP is used, you can assign addresses to the modules Assignment independently of the slots in which they are installed:
1. Open HW Config2. Double-click on the module whose address you want to change. The
"Properties" window opens.3. Set the starting address you want on the "Addresses" tab page.
The end address is automatically updated by the system.
Date: 05.12.2005File: PRO1_04E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Module Address Overview
“Address Overview”
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 10
Assigning You assign parameters to the modules to adapt them to the requirements of theParameters process.
What to do:1. Select a module in the station window.2. Double-click the selected module to open the "Properties" dialog window.3. This dialog window contains 9 tabs in which you can assign parameters
for the various CPU characteristics (see next pages).
Date: 05.12.2005File: PRO1_04E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
CPU Properties
2x
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 11
"General" Tab The "General" tab page provides information about the type of module, its location and, in the case of programmable modules, the MPI address.
MPI Address If you want to network several PLCs via the MPI interface, you must assign a different MPI address to each CPU.Click the "Properties" button to open the "Properties - MPI Node" dialog window, which contains the two tabs: "General" and "Parameters".
Date: 05.12.2005File: PRO1_04E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
CPU Properties: General
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 12
Startup The S7-300 and S7-400 CPUs have different startup characteristics.Characteristics For the moment, we shall only look at the startup characteristics of the S7-300. The
special features of the S7-400 will be discussed in a later chapter.
Complete Restart The S7-300 only recognizes the "Complete restart" type of startup. Newer S7-CPUs also have the "Cold restart" startup version .
Monitoring Times • "Ready message from modules (x100ms):"Maximum time for all modules to issue a Ready message after power ON. If the modules do not send a Ready message to the CPU within this time, theactual configuration is not equal to the preset configuration.For example, in a multi-tier configuration, all power supplies can be switched on within this time without paying attention to a particular sequence.
• "Transfer of parameters to modules (x100ms):"Maximum time for "distributing" the parameters to the parameter-assignablemodules (timing begins after "Ready message from modules").If, after the monitoring time has run out, all modules have not been assigned parameters, then the actual configuration is not equal to the preset configuration.
Startup if Preset Only with CPUs with integrated DP interface (and S7-400) can you use theConfiguration Not "Startup if preset configuration not equal to actual configuration" checkbox to Equal to Actual decide whether the CPU should startup if the preset configuration is not theConfiguration same as the actual configuration (number and type of modules installed).
The other S7300 CPUs go into RUN when the preset configuration is not the same as the actual configuration.
Date: 05.12.2005File: PRO1_04E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
CPU Properties: Startup
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 13
Retentive Memory The "Retentive Memory" tab page is used for specifying the memory areas to be retained after a power failure or on transition from STOP to RUN.A "complete restart" is performed in both cases on the S7-300.
Complete Restart On complete restart, the blocks stored in the battery-backed RAM (OB, FC,with FB, DB) as well as the bit memories, timers and counters defined as retentiveBackup Battery are retained. Only the non-retentive bit memories, timers and counters are reset.
Complete Restart If the RAM is not battery-backed, the information in it is lost. Only the bit without memories, timers and counters defined as retentive and the retentive data blockBackup Battery areas are saved in the non-volatile RAM area.
After a complete restart, the program must be downloaded again:• from the memory card (if inserted) or• from the PG (if no memory card exists).
Date: 05.12.2005File: PRO1_04E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
CPU Properties: Retentive
Only relevant if CPU has no backupbattery
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 14
Cycle • "Scan cycle monitoring time (ms):"- If this time is exceeded the CPU goes into the STOP mode.
Possible causes why this time is exceeded: Communications processes, frequently from interrupt events, errors in the CPU program.
- If you have programmed an error OB 80, the scan cycle time is doubled. After that, the CPU also goes into the STOP mode.
• "Cycle load from communication (%):"- Communication (e.g. data transmission to another CPU via MPI or test
functions, that was triggered by PG) is restricted to the specified percentage of the current scan cycle time.
- Restricting the cycle load can slow down communication between CPU and PG.- Example: Restricting communication to 20% results in a maximum
communication load of 20ms for a scan cycle time of 100ms.
Size of the With the CPU 318-2 and several S7-400 CPUs, you can specify the size of theProcess Image process image (in bytes). The process image area always begins with input or output
byte 0.
Clock Memory Clock memories are bit memories that change their binary value periodically (mark-to-space ratio 1:1). Each bit in the clock memory byte is assigned a particular period/frequency.Example of a flashing light with a flashing frequency of 0.5Hz:(Period = 2s, light ON = 1s, light OFF = 1s).
Date: 05.12.2005File: PRO1_04E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
CPU Properties: Cycle / Clock Memory
Clock memory bit 7 6 5 4 3 2 1 0
Frequency (Hz) 0.5 0.62 1 1.25 2 2.5 5 10
Period (s) 2 1.6 1 0.8 0.5 0.4 0.2 0.1
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 15
Preset Option Preset characteristics (protection level 1; no password assigned):The position of the keyswitch on the CPU determines the protection:• Keyswitch in RUN-P position or STOP: no restrictions• Keyswitch in RUN position: read-only access possible!
Password If a protection level was assigned with a password (only valid until a memory reset), a "person who knows the password" has reading and writing access."The person who doesn‘t know the password" has the following restrictions:• protection level 1: corresponds to the preset characteristics• protection level 2: read-only access possible, irregardless of the keyswitch
setting • protection level 3: neither reading nor writing access possible, irregardless
of the keyswitch setting.
Characteristics of a Password-protected Module in OperationExample: if you want to execute the function "Modify Variable", you must enter the password for a module that has been assigned the protection level 2 parameter.
Access Rights You can also enter the password for a protected module in the SIMATICManager:1. Select the protected module or its S7 program2. Enter the password by selecting the menu options PLC -> Access Rights. The access rights, after a password has been entered, is only valid until the last S7 application is completed.
Operation The cycle load for test functions is regulated with this.In Process operation, test functions such as "Monitor" or "Monitor/Modify Variable" are restricted in such a way that the permitted scan cycle time increase that is set cannot be exceeded. Testing with breakpoints and single-step (program execution) cannot be performed.In Test operation, all test functions through the PG/PC can be used without restrictions,even if they cause the scan cycle time to be greatly increased.
Date: 05.12.2005File: PRO1_04E.15
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
CPU Properties: Protection
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 16
System Diagnostics If the "Record cause of CPU STOP" checkbox is deactivated (not checked), no message is sent to the PG / OP when the CPU goes into Stop mode ("CPU Messages").The cause of the stop is still entered in the diagnostic buffer.
Clock The possibilities of synchronizing the clocks in a device network are discussed in the chapter "Troubleshooting".It is, however, also possible to automatically adjust the time on the clock of a stand-alone device by a specified correction factor.
Correction Factor The correction factor is used for correcting an inaccuracy of the clock over 24 hours.The correction factor can be either positive or negative.Example: If the clock is 3 seconds fast after 24 hours, this can be corrected with the factor "-3000ms".
Note The "Interrupts", "Time-Of-Day Interrupts" and "Cyclic Interrupt" are discussed in the chapter "Organization Blocks".
Date: 05.12.2005File: PRO1_04E.16
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
CPU Properties: Diagnostics / Clock
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 17
Save You select the menu options Station->Save to save the current configuration in the current project (without generating system data blocks).
Save and Compile When you select the menu options Station->Save and Compile or click theicon in the toolbar, the configuration and parameter assignment data isalso saved in system data blocks.
Consistency Check You select the menu options Station -> Consistency Check to check whether it is possible to generate configuration data from the entries made.
Download in Module You select the menu options PLC -> Download or click the icon in the toolbar to download the selected configuration to the PLC.The PLC must be in "STOP" mode!
System Data Blocks The SDBs are generated and modified when you configure the hardware.System data blocks (SDBs) contain configuration data and module parameters. They are stored in the work memory of the CPU on downloading.This makes it easier to replace modules, because the parameter assignment data is downloaded to the new module from the system data blocks on startup.In the programming device, the system data blocks are saved under: Project \ Station \CPU \ S7_program \ Blocks \ System_data.You double-click the My Briefcase iconto open the list of system data blocks.
If you use a memory card as Flash EPROM, you should save the SDBs there as well.That way, the configuration is not lost if you operate without battery backup and there is a power failure.
Date: 05.12.2005File: PRO1_04E.17
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Saving the HW Preset Configuration and Downloading it in Module
Download(only when CPUis in STOP mode)
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 18
Introduction A configuration is only necessary in the following cases:• if you want to modify the basic settings of the modules• for stations with distributed I/O• for S7-400 with several CPUs or with expansion racks.
It is possible to read out the actual configuration from the CPU, to look at the set parameters in an existing system.
Actual Configuration During startup, the CPU generates an actual configuration, that is, it saves the arrangement of the modules and allocates the addresses in accordance with a fixed algorithm. If no parameters have been assigned, the default parameters defined at the factory are used.The system stores this actual configuration in system data blocks.
Uploading to PG There are two ways of uploading the actual configuration to the PG:1. In the SIMATIC Manager:
by selecting the menu options PLC -> Upload Station.2. In the HW Config tool:
by selecting the menu options PLC -> Upload or by clicking the icon.
Storage on PG The actual configuration read from the hardware is inserted as a new station in the selected project on the PG.
Note When you read out the actual configuration, the order numbers of the modules cannot be completely identified. For this reason, you should check the configuration and if required, insert the exact module type of the existing modules. To do so, choose the module, and then select the menu options Options -> Specify Module.
Date: 05.12.2005File: PRO1_04E.18
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Uploading the HW Actual Configuration to the PG
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 19
Introduction With this function, you obtain a quick overview of the state of the PLC. If, for example, there is a hardware fault in a diagnostics-capable module, you can identify, through the use of a symbol, which module is faulty and where it is located. When you double-click on the faulty module, additional information is displayed.
Opening the Tool Select the menu options PLC->Diagnose Hardware in the SIMATIC Manager. A second possibility is to open the station online in the HW Config tool or you can click on the
icon in the toolbar.
Description When you open the system diagnostics, the hardware configuration is read out from the CPU (see left-hand screenshot). In this view, all the modules present (including those in expansion racks or distributed I/O) are displayed.If the CPU is in STOP mode or if there is a fault in a module, this is indicated with symbols.You can double-click the CPU or a faulty module to obtain further diagnostic information (see right-hand screenshot). In the example, there is a power failure in the analog module.
Note If you have selected the menu options Options -> Customize -> View in the SIMATIC Manager and activated (checked) the "Display Quick View when Diagnosing Hardware" checkbox, only a list of faulty modules will be displayed instead of the full "Diagnosing Hardware" window.
Date: 05.12.2005File: PRO1_04E.19
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Displaying Hardware Diagnostics in the SIMATIC Manager
2x
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 20
Date: 05.12.2005File: PRO1_04E.20
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Possible Problems with Configuration
Configuration cannot be compiledIn S7-300, gaps in configuration
Situation Result/Remedy
CPU goes in Stop mode because of a parameter assignment errorAnalog module in incorrect slot
Analog module signals group errorbecause of incorrect parameterassignment
Incorrect measuring range for analog module
Reload configurationAfter a memory reset, different parameter assignment of modules
Create HW station or "Upload Station"Not possible to open HW Config.
Open the station offlineModule parameters cannot be modified
Configuration cannot be downloadedIncorrect CPU (e.g. CPU 315-2DP instead of CPU 314)
General In the slide you can see several examples of errors that can occur with configuration.
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 21
Date: 05.12.2005File: PRO1_04E.21
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Variable Addressing
2x
Slot dependent The modules are assigned fixed slot-dependent addresses with the S7-300Addressing (CPUs without DP interface) and S7-400 (without hardware configuration).
Variable With the S7-300 (CPUs with integrated DP interface) and with the S7-400, youAddressing can assign parameters to the starting addresses of the modules.
What to Do When you double-click on a digital or an analog module, the parameter assignment screen is opened. After you choose the "Addresses" tab, you can deselect "System default". You can now define the starting address in the "Start" box. If the address is already used, an error message is triggered.Part process images can only be defined in the S7-400. That way, specific inputs and outputs (e.g. time-critical signals) can be combined into one group. A system function triggers the updating of a part process image in the user program.
Note After a CPU memory reset, the parameters, and therefore also the addresses are lost.This means that with the S7-300 the slot-dependent addresses and with the S7-400 the default addresses are valid once more.
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 22
Date: 05.12.2005File: PRO1_04E.22
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Accessing the Symbol Table
Once with right
Symbols Symbolic addressing and the editing of symbol tables is discussed in detail in the chapter "Symbols".It is also possible to access the symbol table of the HW station from the "HW Config" tool. The symbol table can be supplemented or modified.After you click the module with the right mouse button, you can open the symbol table by selecting the menu option Edit Symbolic Names … .
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 23
Task Since a HW station does not yet exist in the project "My Project", you are to read out the actual configuration, check it, and save it in the project.
Step 7 Adjust the following addresses:
Module Slot Address
DI 8 0DI 9 8DO 10 4DO 11 8AI 12 304
Date: 05.12.2005File: PRO1_04E.23
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Reading Out and Adapting the Actual Configuration
Start the SIMATIC Manager
Step What to Do Result
1 The tool is started
2 Open the project "My Project" The project structure is displayed
3 Download the actual configuration withPLC -> Upload
A new HW station is created
4Check whether the correct modules (order numbers) are entered ???
5 Enter the correct order numbers for the modules
The parameter blocks of the CPU are displayed
6Save the configuration as"My Station" and download the configuration
7 If you have an S7-400 training unit,adapt the addresses (see text)
The addresses are the same as theS7-300 training unit, version B
Training Centerfor Automation and Drives
ST-7PRO1HW Configuration and Memory ConceptPage 24
Task With the help of a small program test the flashing frequencies preset in the system!
Date: 05.12.2005File: PRO1_04E.24
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Assign Parameters to Clock Memory and Test It
In the CPU assign parameters to a clock memory MB 10
Step What to Do Result
1
3Check the function by programming an OB 1 with the statementsL MB 10, T QB 9 (QB 5)
QB9 (QB5) on thesimulator should flash
Save and download the configuration in the CPU2
MB 10 flashes
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 1
Contents Page
The STEP 7 Programming Languages ………….......................................................................... 2Starting the LAD/STL/FBD Editor ...................................................................................................... 3Components of the LAD/STL/FBD Editor ........................................................................................ 4Selecting the Programming Language ............................................................................................ 5Programming in LAD/FBD ............................................................................................................... 6Programming in STL ...................................................................................................................... 7Saving a Block ............................................................................................................................. 8Calling a Block in OB1 .................................................................................................................. 9Downloading Blocks into the PLC ……………............................................................................... 10Simple Program Debugging ............................................................................................................ 11Downloading and Saving Modified Blocks ....................................................................................... 12Exercise: Selecting the Mnemonics ............................................................................................... 13Exercise: Opening and Editing FC 1 .................................................................................................. 14Exercise: Changing the Programming Language ............................................................................ 15Exercise: Saving FC 1...................................................................................................................... 16Exercise: Downloading a Block into the PLC .................................................................................... 17Exercise: Calling FC 1 in OB 1 ....................................................................................................... 18Exercise: Debugging FC 1 (in LAD) ................................................................................................. 19Exercise: Expanding the Program in the FC 1 Block ....................................................................... 20Editor Customization: "Editor" Tab ………..................................................................................... 21Editor Customization : "STL" Tab ……….......................................................................................... 22Editor Customization : "LAD/ FBD" Tab ………................................................................................ 23Editor Customization : "Create Block" Tab ………..…...................................................................... 24Editor Customization : "Source Files" Tab ………. ............................................................................ 25Editor Customization : "Symbol Selection" Tab ………...................................................................... 26
Date: 05.12.2005File: PRO1_05E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Editing Blocks
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 2
Introduction There are several programming languages in STEP 7 that can be used depending on preference and knowledge. By adhering to specific rules, the program can be created in Statement List and can then be converted into another programming language.
LAD Ladder Diagram is very similar to a circuit diagram. Symbols such as contacts and coils are used. This programming language appeals to those who ‚grew up‘ with contactors.
STL The Statement List consists of STEP 7 instructions. You can program fairly freely with STL (sometimes to the point of being unable to follow it anymore). This programming language is preferred by programmers who are already familiar with other programming languages.
FBD The Function Block Diagram uses “boxes” for the individual functions. The character in the box indicates the function (e.g. & --> AND Logic Operation). This programming language has the advantage that even a “non-programmer” such as a process engineer can work with it. Function Block Diagram is available as of Version 3.0 of the STEP7 Software.
Date: 05.12.2005File: PRO1_05E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
The STEP7 Programming Languages
A I0.0A I0.1= Q8.0
STL
&Q8.0
=
I0.0
I0.1
FBD
I0.0 I0.1 Q8.0
LAD
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 3
Starting the Editor You can start the LAD/STL/FBD Editor by selecting Start -> Simatic -> STEP 7 -> LAD,STL,FBD - Programming S7 Blocks. The following quicker way of starting the Editor is recommended :1. Select the "Blocks" object in the project window of the SIMATIC Manager.2. Double-click any block to open the Editor.
Program When using the LAD and FBD programming languages you can insert simpleElements graphical program elements directly into the program from the toolbar.
You can click the "Program Elements" icon to open another window containing more program elements. The contents of this window depend on the programming language selected (LAD/FBD/STL).
Date: 05.12.2005File: PRO1_05E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Starting the LAD/STL/FBD Editor
2x
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 4
Components When you start the LAD/STL/FBD Editor, two windows are automatically opened: the declaration table and the code section. The user can also open a third "Program Elements" window.
Declaration Table The declaration table belongs to the block. It is used for declaring variables and parameters for the block. The declaration table is discussed in detail in the chapter ”Functions and Function Blocks".
Code Section The code section contains the program itself, divided into separate networks if required. Entries are checked for correct syntax.
Program The contents of the "Program Elements" window depends on the programmingElements language selected.
You can double-click elements in the list ("browser") to insert them into the program at the cursor position.You can also insert elements by drag&drop.
Date: 05.12.2005File: PRO1_05E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Components of the LAD/STL/FBD Editor
Browser
DeclarationTable
Code Section
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 5
View You choose the View menu to switch from one STEP 7 programming language to another:• LAD (Ladder Diagram)• FBD (Function Block Diagram)• STL (Statement List).
LAD/FBD => STL You can convert program sections that have been written in the graphical programming languages into STL. You should, however, be aware that the result of this conversion is not always the most efficient solution in Statement List.
STL => LAD/FBD It is not always possible to convert program sections written in STL into LAD or FBD. The sections of the program that cannot be converted are left in STL. No sections of the program are lost on conversion.
Date: 05.12.2005File: PRO1_05E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Selecting the Programming Language
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 6
Elements Frequently used LAD and FBD elements appear as icons in the toolbar. You click them with the mouse to insert them at the selected position in the program.
Toolbar icons in LAD:
Toolbar icons in FBD:
You can insert other program elements from the browser in the "Program Elements" window:• in any position with drag&drop • in a selected position by double-clicking the element in the browser.
Networks When you click the "New Network“ icon in the toolbar, a new network is added after the current network.
Note If you want to insert a new network before NW1, you must select the block name ("FC1: Plant" in the example above) before you click the "New Network" icon.
Empty Box You can use the Empty Box to insert LAD or FBD elements more quickly. The elements can be inserted directly without having to select them from the browser.
After you have selected the position in the network where you want to insert an element, click on the “Empty Box“ icon in the toolbar.
By entering the first letters of an element name, a list with the elements which start with these letters appears and you can make a selection.
Date: 05.12.2005File: PRO1_05E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Programming in LAD/FBD
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 7
Statements The user needs to know the statements for writing a program in STL. You can obtain information about the syntax and functionality from the on-line help: Help -> Help on STL.The following information is available:
"Statement List Instructions", a description of all the statements thatexist in this programming language"Working with Statement List", a description of
Statement List View and General SyntaxEntering and Viewing Constant Data Types of BlocksSwitch Contacts and Signal States
Program Elements When you are using the STL Editor, the "Program Elements" window contains only a list of the existing blocks which can be called from the current block.
Networks Networks are inserted in the same way as in the LAD/FBD Editor (see previous page).
Making Changes You use the "Insert" key to toggle between "Overwrite" and "Insert" mode. The current setting appears in the status bar.
Date: 05.12.2005File: PRO1_05E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Programming in STL
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 8
Saving a Block When you have finished editing a block, you can save it on the hard disk of the programming device:• by selecting the menu options File -> Save or • by clicking the disk icon in the toolbar.
.
Date: 05.12.2005File: PRO1_05E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Saving a BlockCurrent project directory with name of block
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 9
Date: 05.12.2005File: PRO1_05E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Calling a Block in OB1
Cyclic So that a newly created block is integrated in the cyclic program execution of theExecution CPU, it must be called in OB1.
The simplest way of inserting the block call is through the browser (see picture above).
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 10
Downloading You download the blocks into the PLC with the SIMATIC Manager by:• clicking the icon or• selecting the menu options PLC -> Download.
Before you do this, you must select the blocks you want to download:• All blocks: Select the "Blocks" object in the left-hand pane of the
project window.• Several blocks: Hold down the CTRL key and select the blocks you
want.• One block: Select the block.
Date: 05.12.2005File: PRO1_05E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Downloading Blocks into the PLC
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 11
Requirements Before you can activate the monitoring mode, you must open the block you want to monitor either offline or online with the LAD/STL/FBD Editor.Note: In order to test a block in the offline mode, it must first be downloaded
into the PLC.
Activation / There are two ways of activating/deactivating the “Monitor" test function:Deactivation
• click the “Spectacles“ icon• select the menu options Debug -> Monitor.
View The program status is displayed in different ways depending on the programming language selected (LAD/STL/FBD).When the monitoring function is activated, you cannot change the programming language in which the block is viewed (LAD/FBD/STL)..
Note You will find more information about testing programs in the chapter "Test Functions".
Date: 05.12.2005File: PRO1_05E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Simple Program Debugging
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 12
Date: 05.12.2005File: PRO1_05E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Downloading and Saving Modified Blocks
Open offline
Open online
Save
Download
(Q8.0)
Making Corrections You can make corrections to blocks that have been opened either online orto Blocks offline; however, not in the test mode.
• You normally download the modified block to the PLC, test it, make furthercorrections if necessary and finally save it on the hard disk when it has beenfully debugged.
• If you do not want to test the program straight away, you can just save thechanges on the hard disk to start with. The old version of the block is thenerased in this case.
• If you make corrections to a number of blocks and don't want to overwrite the original version of the program yet, you can download the changed blocks to the CPU first without saving them on the hard disk of the PG.You can save them on the hard disk of the PG when you have tested the whole program successfully.
Insert/Over-write The insert mode is set by default for LAD or FBD. By pressing the „Insert (Ins)“ key, you activate the over-write mode. After that, you can, for example, modify the type of timer for a timer (e.g. change ON delay to OFF delay), without rewiring the inputs and outputs.
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 13
Remember ! You can select the language and the mnemonics you want to use in the SIMATICManager.
Goal To select the desired mnemonics.
What to Do 1. Start the SIMATIC Manager, if it is not already open.2. Select the menu options Options -> Customize.3. Choose the language and the desired mnemonics in the “Language” tab and
confirm with “OK”.
Result You will use one of the following representations when writing your program.Example of an STL statement with German mnemonics:
U E 1.0 // UND Eingang 1.0Example of an STL statement with English mnemonics:
A I 1.0 // AND Input 1.0
Date: 05.12.2005File: PRO1_05E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Mnemonics German English (International)
…select the languagefor editing inLAD/STL/FBD
Before you open a program block or a program ...
Exercise: Selecting the Mnemonics
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 14
Remember ! You must open the FC 1 block before you can start editing it. So that the block can be executed, it must be called in OB 1.
Goal To open FC 1, which was created in the S7 program "My Program" and to enter the following logic operations in the code section of the block.
What to Do 1. In the SIMATIC Manager, double-click on the “Blocks” folder in the program“My_Program” to open it.
2. Select the menu options View -> Offlineor alternatively:
2a.Click on the Offline icon in the toolbar.3. Open FC 1 (and the LAD/STL/FBD Editor) by double-clicking its block icon.4. Select the menu options View -> LAD in the LAD/STL/FBD Editor.5. Enter the program shown below
in Ladder Diagram using the iconsin the toolbar.
Editing Tips To position the first element, move the cursor to the network line.Position the cursor above the symbol concerned (using the mouse or the TAB key) to enter the addresses.You can use the TAB key to jump from one element to another.
Result I 0.0 I 0.1 Q 8.0 (Q 4.0)
Date: 05.12.2005File: PRO1_05E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Opening and Editing FC 1
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 15
Remember ! After you have opened a block for editing or testing, you can choose one of the programming languages LAD, STL or FBD. If you write your program in LAD/FBD and switch to STL view, all your entries will be converted into a list of statements. This method does not always produce the most efficient program code.
Goal To select the programming language for editing a block.
What to Do 1. Open the FC1 block in the LAD/STL/FBD Editor.2. Select your programming language from the View menu.
Result Your program will be displayed in one of the following programming languages:
LAD:I 0.0 I 0.1 Q 8.0 (Q 4.0)
STL: A I 0.0AN I 0.1= Q 8.0 (Q4.0)
FBD:I 0.0 &
Q 8.0 (Q4.0)I 0.1 =
Date: 05.12.2005File: PRO1_05E.15
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
After you have opened a block ...
…choose the programming languageyou want to use.
Exercise: Changing the Programming Language
• Ladder Diagram (LAD)• Statement List (STL)• Function Block Diagram (FBD)
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 16
Remember ! After you have created a program block, you should save it on diskette or on the hard disk to prevent it from being lost. You do this with the normal Windows "Save“ facility, using one of the two methods shown above.If you use the menu options File => Save As, you must specify the project, program and block name you want to use. After you have saved the block, you can select, in the SIMATIC Manager, the project/program directory in which the block was saved. When the block is displayed, you can use the SIMATIC Manager like the "Explorer“ to copy the block to severalCPUs or to move it somewhere else.
Goal To save a program block.
What to Do 1. Select the menu options File -> Save or click the “Save” iconor
2. Select the menu options File -> Save As and enter the details.
Result 1. The program block is saved with the block name you specified when you opened it.
2. With Save As, the program block is saved with the new name you enter.
Note When you save a program it is not copied to the CPU.(You do this with the Download option)
Date: 05.12.2005File: PRO1_05E.16
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
To save a block or a filewithout changing the name... select themenu options File -> Save
...or click
Exercise: Saving FC 1
To save a block with a different name or in a different place: File -> Save As
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 17
Remember ! After you have created and edited a block, you must transfer it to the CPU in order to be able to test it. You can download the just opened block into the PLC with the LAD/STL/FBD Editor.With the SIMATIC Manager, you can download blocks without opening them.
Goal To download a block (FC 1) with the LAD/STL/FBD Editor.
What to Do With the LAD/STL/FBD Editor open ....1. Select the menu options PLC -> Download or click on the “Download”
icon
2. Answer the question in the dialog box:
If you answer “Yes", the block already in the CPU will be overwritten and lost. If you answer "No", the old block will remain in the CPU and the new one will not be downloaded.Choose “Yes" for this exercise, so that you can then test the block you have edited.
Result Your new program block is written to the CPU.
Date: 05.12.2005File: PRO1_05E.17
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Downloading a Block into the PLC
...or click theDownloadicon...
To transmit a block to the CPU...
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 18
Date: 05.12.2005File: PRO1_05E.18
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Calling FC 1 in OB 1
Remember ! The FC 1 function must be called in OB 1 so that it can be executed cyclically.
Goal To call FC 1 in the organization block OB 1.
What to Do 1. In the LAD/STL/FBD Editor, open the OB 1 block from the S7 Program "My Program".2. Select a location in the rung of Network 1.3. Open the "Program Elements" browser by clicking on the icon.
4. Open the "FC Blocks" entry in the browser and using the mouse drag FC 1 to Network 1 in OB 1.5. Save the FC 1 block.6. Download the block to the CPU.
Result The OB 1 block is cyclically executed in the CPU; and therefore also the FC 1 function.
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 19
Remember ! To monitor the program execution of a block, it must be open online or offline. If the block is open offline, it must be downloaded to the PLC before you can test it.
Display If the result of a check is positive, the relevant symbol is displayed with solid lines. If not, it is displayed with dashed lines.If the RLO=1, the rung is shown as a solid line. If not, it appears as a dashed line. You can change the thickness and color of the lines in the LAD/STL/FBD Editor by selecting the menu options Options => Customize => LAD/FBD.
Goal To test a block while it is being executed in the CPU.
What to Do 1. Open FC 1 offline. 2. Select the menu options Debug -> Monitor or click on the
“spectacles” icon
Result Depending on the switch settings at inputs I 0.0 and I 0.1, you will see one of the displays shown in the slide.
Date: 05.12.2005File: PRO1_05E.19
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Testing FC 1 (in LAD)
Signalstate
Resultof checkInput
I 0.0
I 0.1
I 0.0
I 0.1
I 0.0
I 0.1
I 0.0
I 0.1
0
0
1
1
1
0
0
1
0
1
1
0
1
1
0
0
I 0.0 I 0.1 Q 8.0 (Q 4.0)
I 0.0 I 0.1 Q 8.0 (Q 4.0)
I 0.0 I 0.1 Q 8.0 (Q 4.0)
I 0.0 I 0.1 Q 8.0 (Q 4.0)
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 20
Remember ! You can only make program corrections after the program status has been completed. So that the program corrections can take effect, you have to download the block once more to the CPU.
Goal To expand and test the program in FC 1.
What to Do 1. Deactivate the program status by clicking on the “spectacles“ icon.2. Select the location between the first and the second contact.3. Insert a branch using the icon4. Insert a contact in the parallel branch.5. Close the parallel branch using the icon6. Save the block.7. Download the block in the CPU.8. Test the block with the test function "Program Status".
Result The output can also be controlled with the condition in the parallel branch.
Date: 05.12.2005File: PRO1_05E.20
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Expanding the Program in the FC 1 Block
(Q4.0)
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 21
Text You select the font and the size of the text to be used for programming here.
View You can display blocks:• with symbolic or absolute addressing• with or without symbol information• with or without block and network comments• in the language in which they were written or in a preset language
(LAD/STL/FBD).
Data Blocks You can display data blocks in the following views:• declaration view or• data view .
New Block You use the “STL”, “LAD”, “FBD” buttons to select the language in which you want to write a new block.Multi-instance function blocks are discussed in an advanced programming course.
Date: 05.12.2005File: PRO1_05E.21
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Editor Customization : "Editor" Tab
(Q4.0)
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 22
Status Fields When you monitor the status of a block in STL, only the status fields you activate in this dialog box will be displayed. The following options are available:• Status Bit The status bit is displayed. • RLO The result of logic operation (RLO) is displayed.• Standard Status A timer word, counter word or the contents of ACCU 1 are
displayed - depending on the operation used. • Address The address registers are used with indirect addressing.
Registers *)
• Accumulator 2 The contents of ACCU 2 are displayed.• DB Registers *) The contents of the relevant data block register are
displayed.• Indirect *) This display is only possible with memory-indirect
addressing.• Status Word The status word is displayed.• Default The “Default” button selects the standard system setting for
the Status field.The status bit, RLO and standard status are displayed.
• Activate New Breakpoints ImmediatelyThis option is only relevant for the the test function
“Breakpoint”.Note*) The topics “Indirect Addressing” , “DB Registers” and the structure of the status word
are discussed in an advanced programming course.
Date: 05.12.2005File: PRO1_05E.22
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Editor Customization : "STL" Tab
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 23
Layout Here you select the print format:• DIN A4 Portrait• DIN A4 Landscape• maximum size.
Width of Address You can set the limit for the maximum number of characters in an address nameField to a number between 10 and 24. This changes the width of the program element in LAD
and FBD. With symbolic representation, a line break takes place according to the Width of Address Field.
Element The program elements can be displayed in different ways:Representation • 2-dimensional or
• 3-dimensional.
Line/Color You use this box to choose how you want the following to be displayed• Selected Element (color)• Contacts (line)• Status Fulfilled (color and line)• Status Not Fulfilled (color and line)
Type Check When you edit a block, the type of address entered in bit logic instructions is always checked.You can deactivate the Type Check for Addresses for comparisons, mathematical operations etc. ( for experienced users only! ).
Date: 05.12.2005File: PRO1_05E.23
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Editor Customization : "LAD/FBD" Tab
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 24
Generate When you modify blocks and save them, the reference data is automaticallyReference Data updated, if the “Generate Reference Data" option in the “Create Block" tab is checked.
If this option is not checked, the reference data is not updated at first. But the next time you open the “Displaying S7 Reference Data" window, you must decide whether you want to update the reference data and for which blocks.Note: The topic "Reference Data" is discussed in detail in the Chapter“Troubleshooting".
Include The "Include System Attribute S7_server" option is only relevant in conjunctionSystem Attribute... with a process control system (PCS7) and is not dealt with in this course.
Store Process The "Store Process Diagnostics Data" option is only relevant when using theDiagnostics Data "PDIAG" option package and is not dealt with in this course.
Date: 05.12.2005File: PRO1_05E.24
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Editor Customization : "Create Block" Tab
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 25
Note Compiling source code blocks is discussed in more detail in the Chapter “Functions and Function Blocks".
Date: 05.12.2005File: PRO1_05E.25
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Editor Customization : "Source Files" Tab
Training Centerfor Automation and Drives
ST-7PRO1Editing BlocksPage 26
Note Here you select the structure of the symbol selection list.You can activate and deactivate the display of the list when you make entries using the menu options View -> Display ->Symbol Selection in the Program Editor.If the Symbol Selection is activated, a list with the current symbols from the symbol table is displayed when you enter variables in LAD and FBD. In the list that is displayed, the symbol is marked that is best suited to the character chain at the cursor position. It can be accepted by pressing the Return key.
Date: 05.12.2005File: PRO1_05E.26
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Editor Customization : "Symbol Selection" Tab
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 1
Contents Page
Cyclical Program Execution …........................................................................................................... 2Process Images .................................................................................................................................... 3Program Structure ................................................................................................................................ 4Types of Program Blocks ................................................................................................................... 5Normally Open and Normally Closed Contacts. Sensors and Symbols............................................... 6Exercise .............................................................................................................................................. 7Addressing of S7-300 Modules ………................................................................................................ 8DI/DO Addressing in Multi-Tier Configurations ................................................................................. 9Binary Logic Operations: AND, OR ................................................................................................... 10Binary Logic Operations: Exclusive OR (XOR) ................................................................................ 11Result of Logic Operation, First Check. Examples…............................................................................. 12Assignment, Setting, Resetting............................................................................................................. 13Setting / Resetting a Flip Flop ........................................................................................................... 14Connector ............................................................................................................................................. 15Instructions that Affect the RLO …………............................................................................................ 16Master Control Relay Function ............................................................................................................ 17Unconditional Jump (Independent of RLO)........................................................................................... 18Conditional Jump (Dependent on RLO) .............................................................................................. 19RLO Edge Detection …........................................................................................................... ........... 20Signal Edge Detection ….................................................................................................................... 21Exercise: Program for a Bottling Plant (Mode Selection) ………….................................................... 22
Date: 05.12.2005File: PRO1_06E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Binary Operations
I0.0 I0.1 Q 8.0
Q 8.1
SRS Q
R
I1.2
I1.3
M0.0Q 9.3
I 1.0
( MCR< )
(MCRA)
Q 8.0
I 0.0
I 1.1( )
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 2
Starting The CPU carries out a complete restart (with OB100) when switching on or when switching from STOP --> RUN. During a complete restart, the operating system deletes the non-retentive bit memories, timers and counters, deletes the interrupt stack and block stack, resets all stored hardware interrupts and diagnostic interrupts and starts the scan cycle monitoring time.
Scan Cycle The cyclical operation of the CPU consists of three main sections, as shown in the diagram above:
• The CPU checks the status of the input signals and updates the process-image input table.
• It executes the user program with the respective instructions.
• It writes the values from the process-image output table into the output modules.
Date: 05.12.2005File: PRO1_06E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Execution of the program in OB1 (cyclical execution)
Events (time-of-day interrupt, hardware interrupts etc.) call other OBs, FBs, FCs, etc.
Cyclical Program Execution
OutputModule
A I 0.1A I 0.2= Q8.0
BlockOB 1
Start of the cycle monitoring time
Start-up block (OB 100)Execution once after e.g. power on
Reading the signal states from the modules and saving the data in the process image (PII)
Writing the process-image output table(PIQ) to the output modules
CPU
Cyc
leInputModule
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 3
Introduction The CPU checks the status of the inputs and outputs in every cycle. There are specific memory areas in which the module‘s binary data are stored: PII and PIQ. The programaccesses these registers during processing.
PII The process-image input table is found in the CPU‘s memory area. The signal state ofall inputs is stored there.
PIQ The process-image output table contains the output values that result from the program execution. These are sent to the actual outputs (Q) at the end of the cycle.
User Program When you check inputs in the user program with, for example, A I 2.0, the last state from the PII is evaluated. This guarantees that the same signal state is always delivered when there is multiple checking of the input within one cycle.
Date: 05.12.2005File: PRO1_06E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Process Images
Byte 0Byte 1Byte 2:::
CPU Memory Area
Byte 0Byte 1Byte 2:::
PII PIQ
UserProgram
CPU Memory Area
::
A I 2.0= Q 4.3
::::
1
1
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 4
Linear Program The entire program is found in one continuous program block. This model resembles a hard-wired relay control, that was replaced by a programmable logic controller. The CPU processes the individual instructions one after the other.
Partitioned The program is divided into blocks, whereby every block only contains the Program program for solving a partial task. Further partitioning through networks is possible
within a block. You can generate network templates for networks of the same type.The organization block OB 1 contains instructions that call the other blocks in a defined sequence.
Structured A structured program contains blocks with parameters, so-called parameter Program assignable blocks. These blocks are designed in such a way that they can be used
universally. When a parameter assignable block is called, it is given current parameters (the exact addresses of inputs and outputs as well as parameter values).Example:• A "pump block" contains instructions for the control of a pump.• The program blocks, that are responsible for the control of special pumps, call the "pump block" and give it information about which pump is to be controlled with which parameters.• When the "pump block" has completed the execution of its instructions, the
program returns to the calling block (e.g. OB 1), which continues with the processing of its instructions.
Date: 05.12.2005File: PRO1_06E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Program Partitioned into Areas Structured Program
Program Structure
All instructions arefound in one block(normally in the organization block OB 1)
The instructions for the indi-vidual functions are found inindividual blocks. OB 1 calls the individual blocks one after theother.
Reuseable functions are loaded into individual blocks.OB 1 (or other blocks) callthese blocks and pass on the pertinent data.
OB 1 OB 1
Recipe A
Recipe B
Mixer
Outlet
OB 1Pump
Outlet
Linear Program
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 5
User Blocks User blocks contain the program code and the user program data.In a structured user program, some blocks are called and processed cyclically, others only as required.
System Blocks System blocks are pre-defined functions or function blocks that are integrated in theCPU‘s operating system. These blocks do not occupy additional space in the user memory. System blocks are called from the user program. These blocks have the same interface, the same identifier and the same number throughout the entire system. The user program is thus easily transportable between various CPUs or programmable controllers.
Date: 05.12.2005File: PRO1_06E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Types of Program Blocks
Error FB
FB
FB
FC
SFC
SFB
FB with instancedata block
Legend:
OB
OrganizationBlocks
Cycle
Time
Process
OB = Organization BlockFB = Function BlockFC = FunctionSFB = System Function BlockSFC = System Function
Operating System
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 6
Process The use of normally open or normally closed contacts for the sensors in a controlled process depends on the safety regulations for the process.Normally closed contacts are always used for limit switches and safety switches, so that dangerous conditions do not arise if a wire break occurs in the sensor circuit. Normally closed contacts are also used for switching off machinery for the same reason.
Symbols In LAD, a symbol with the name "NO contact" is used for checking for signal state "1" and a symbol with the name "NC contact" to check for signal state "0".It makes no difference whether the process signal “1” is supplied by an activated NO contact or a non-activated NC contact.
Example The result of check for the "NO contact" symbol is "1" if an NC contact in the machine is not activated.
Date: 05.12.2005File: PRO1_06E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Normally Open and Normally Closed Contacts, Sensors and Symbols
Signalstateat input
Check for signal state “1”
Symbol /Instruction
Result ofcheck
Check for signal state “0”
Symbol /Instruction
Result ofcheck
Yes
Voltagepresent atinput?
No
Yes
No
1
0
1
“Yes“1
LAD:
“NO contact”
0&
FBD:
A I x.y
STL:
AN I x.y
STL:
&
FBD:
LAD:
“NC contact”
“No”0
“Yes”1
“No”0
“No”0
“Yes”1
“Yes”1
“No”0
Process Interpretation in PLC program
activated
notactivated
The sensoris ...
activated
notactivated
NOcontact
The sensoris a ...
NCcontact
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 7
Exercise Complete the programs above to obtain the following functionality: When switch S1 is activated and switch S2 is not activated, the light should be ON in all three cases.
Note ! The terms "NO contact" and "NC contact" have different meanings depending on whether they are used in the process hardware context or as symbols in the software.
Date: 05.12.2005File: PRO1_06E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
ExerciseTask: In all three examples the light should be on when S1 is activated and S2 is not activated!
I1.0 I1.1 Q 4.0 I1.0 I1.1 Q 4.0
....... I1.0
....... I1.1
....... Q 4.0
Q 4.0
I 1.0
I1.1
&
Q 4.0
I1.0
I1.1
&
Q 4.0
I1.0
I1.1
&
....... I1.0
....... I1.1
....... Q 4.0
....... I1.0
....... I1.1
....... Q 4.0
Software
I1.0
S1
I1.1
S2
I1.0
S1
I1.1
S2
I1.0
S1
I1.1
S2
Q 4.0Programmable controller
LightLight Light
Q 4.0Programmable controller
Q 4.0Programmable controller
FDB
STL
LAD
Hardware
I 1.0 I 1.1 Q 4.0
I 1.0 I 1.1 I 1.0 I 1.1 I 1.0 I 1.1
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 8
Slot Numbers The slot numbers in the rack of an S7-300 simplify addressing within the S7-300 environment. The first address on a module is determined by the position of the module in the rack.
Slot 1 Power supply. This is the first slot by default. A power supply module is not absolutely essential. An S7-300 can also be supplied with 24V direct.
Slot 2 Slot for the CPU.
Slot 3 Logically reserved for an interface module (IM) for multi-tier configurations using expansion racks. Even if no IM is installed, it must be included for addressing purposes.You can physically reserve the slot (e.g. for installation of an IM at a later date) by inserting a DM370 dummy module.
Slots 4-11 Slot 4 is the first slot that can be used for I/O modules, communications processors (CP) or function modules (FM). Addressing examples:• A DI module in slot 4 begins with the byte address 0 .• The top LED of a DO module in slot 6 is called Q8.0 .
Note 4 byte addresses are reserved for each slot. When using 16-channel DI/DO modules, two byte addresses are lost in every slot!
Date: 05.12.2005File: PRO1_06E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Addressing of S7-300 Modules
PS CPU SM SM SM SM SM SM SMModules
1 2 4 5 6 7 8 9 10Slot No.
Address 0.0Address 0.7Address 1.0Address 1.7
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 9
Multi-Tier The slots also have fixed addresses in a multi-tier configuration.Configurations
Examples:• Q7.7 is the last bit of a 32-channel DO module plugged into slot 5 of rack 0.• IB105 is the second byte of a DI module in slot 6 of rack 3.• QW60 is the first 2 bytes of a DO module in slot 11 of rack 1.• ID80 is all 4 bytes of a 32-channel DI module in slot 8 in rack 2.
Date: 05.12.2005File: PRO1_06E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
DI/DO Addressing in Multi-Tier Configurations
Rack0
Slot 1 2 3 4 5 6 7 8 9 10 11
Rack3
96.0to99.7
100.0to
103.7
104.0to
107.7
108.0to
111.7
112.0to
115.7
116.0to
119.7
120.0to
123.7
124.0to
127.7
IM(Receive)
PS
Rack2
64.0to67.7
68.0to70.7
72.0to75.7
76.0to79.7
80.0to83.7
84.0to87.7
88.0to91.7
92.0to95.7
IM(Receive)
PS
Rack1
IM(Receive)
32.0to
35.7
36.0to
39.7
44.0to
47.7
48.0to
51.7
52.0to
55.7
56.0to
59.7
60.0to
63.7
40.0to
43.7
PS
0.0to3.7
20.0to
23.7
24.0to
27.7
28.0to
31.7
12.0to
15.7
16.0to
19.7
4.0to7.7
8.0to
11.7
IM(Send)
CPUPS
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 10
Logic Tables
AND I 0.0 I 0.1 Q 8.0
0 0
0 1
1 0
1 1
OR I 0.2 I 0.3 Q 8.2
0 0
0 1
1 0
1 1
Date: 05.12.2005File: PRO1_06E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
L1(Q 8.0)
S1 (I 0.0)
S2 (I 0.1)
L2 (Q 8.1)
Circuit Diag.
Binary Logic Operations: AND, OR
I 0.2
I 0.3>=1
=Q 8.2 O I0.2
O I0.3= Q 8.2
I0.0 I0.1 Q 8.0
Q 8.1
LAD
=Q 8.0&I 0.0
I 0.1
=Q 8.1
FBD
A I0.0A I0.1= Q 8.0= Q 8.1
STL
I0.2
I0.3
Q 8.2
L3 (Q 8.2)
S3(I 0.2)
S4(I 0.3)OR
AND
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 11
Logic Table
XOR I 0.4 I 0.5 Q 8.0
0 0
0 1
1 0
1 1
Rule The following rule is valid for the logic operation of two addresses after XOR: the output has signal state "1", when one and only one of the two checks is fulfilled("one and only one of two" ).
Attention! This rule cannot be generalized to "one and only one of n" ! for the logic operation of several addresses after XOR !!As of the third XOR instruction, the old RLO is gated with the new result of check after XOR.
Date: 05.12.2005File: PRO1_06E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Binary Logic Operations: Exclusive OR (XOR)
X I0.4X I0.5= Q8.0
I 0.4
I 0.5XOR
=Q 8.0
I0.4 I0.5
I0.4 I0.5
Q 8.0
LAD
>=1=
Q 8.0&I 0.4
I 0.5
&I 0.4
I 0.5
FBD STL
A I0.4AN I0.5OAN I0.4A I0.5= Q8.0
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 12
Signal State A logic operation is made up of a series of instructions to check the states of signals (inputs (I), outputs (Q), bit memories (M), timers (T), counters (C) or data bits (D) ) and instructions to set Q,M,T,C or D.
Result of Check When the program is executed, the result of check is obtained. If the check condition is fulfilled, the result of check is “1”. If it is not fulfilled, the result of check is “0”.
First Check The result of the first check is stored as the result of logic operation (RLO).
Result of Logic When the next check instructions are executed, the result of logic operation isOperation gated with the result of check and a new RLO is obtained.
When the last check instruction in a logic operation has been executed, the RLO remains the same. A number of instructions using the same RLO can follow.
Note The result of the first check is stored without being subjected to a logic operation. It therefore makes no difference whether you program the first check with an AND or an OR instruction in STL. To enable your program to be converted into one of the other programming languages, you should, however, always program using the correct instruction.
Date: 05.12.2005File: PRO1_06E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Result of Logic Operation, First Check. Examples
A I 1.0
AN I 1.1
A M 4.0
= Q 8.0
= Q 8.1
A I 2.0
Example 1
Sig
nalS
tate
0
0
0
0
Res
ult o
fChe
ck
Res
ult o
f Log
icO
pera
tion
Firs
t Che
ck
Sig
nalS
tate
Res
ult o
fChe
ck
Res
ult o
f Log
icO
pera
tion
Firs
t Che
ck
1
Example 2
1
1
1
Sig
nalS
tate
Res
ult o
fChe
ck
Res
ult o
f Log
icO
pera
tion
Firs
t Che
ck
1
Example 3
0
1
0
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 13
Assignment An assignment passes the RLO on to the specified address (Q, M, D). When the RLO changes, the signal state of that address also changes.
Set If RLO= "1", the specified address is set to signal state "1" and remains set until it is reset by another instruction.
Reset If RLO= "1", the specified address is reset to signal state "0" and remains in this state until it is set again by another instruction.
Date: 05.12.2005File: PRO1_06E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Assignment, Setting, Resetting
(S)Q 8.1I 1.2 I 1.3
I 1.2 &
SQ 8.1
I 1.3
A I 1.2A I 1.3S Q 8.1
Set
(R)Q 8.1I 1.4
I 1.4 >=1
RQ 8.1
I 1.5
O I 1.4O I 1.5R Q 8.1Reset I 1.5
( )Q 8.0I 1.0 I 1.1
I 1.0 &
=Q 8.0
I 1.1
A I 1.0A I 1.1= Q 8.0Assignment
LAD FBD STL
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 14
Flip Flop A flip flop has a Set input and a Reset input. The memory bit is set or reset, depending on which input has an RLO=1.If there is an RLO=1 at both inputs at the same time, the priority must be determined.
Priority In LAD and FBD there are different symbols for Dominant Set and Dominant Reset functions. In STL, the instruction that was programmed last has priority.
Note If an output is set with a Set instruction, it is reset on a complete restart of the CPU.If M 0.0 in the example above has been declared retentive, it will remain in the set state after a complete restart of the CPU and the reset output Q 9.3 will be be assigned the set state again.
Date: 05.12.2005File: PRO1_06E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Setting / Resetting a Flip Flop
SR
R Q
SI1.2
I1.3
M0.0
=
Q9.3DominantReset
SRS Q
R
I1.2
I1.3
M0.0Q 9.3 A I 1.2
S M 0.0A I 1.3R M 0.0A M 0.0= Q 9.3
RS
S Q
RI1.3
I1.2
M0.0
=
Q9.3
DominantSet
RSR Q
S
I1.3
I1.2
M0.0Q 9.3 A I 1.3
R M 0.0A I 1.2S M 0.0A M 0.0= Q 9.3
LAD FBD STL
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 15
Connector A connector is an intermediate assignment element that stores the current RLO at a specified address.When connected in series with other elements, the "Connector" instruction is inserted in the same way as a contact.A connector must never:• be connected to a power rail• directly follow a branch• be used at the end of a branch.You can program a negated connector with the "NOT" element.
Date: 05.12.2005File: PRO1_06E.15
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Connector
LAD
I 1.0 I 1.1
( )M0.0 I 2.0 I 2.1
( )M 1.1
NOT ( )Q 4.0
A I 1.0A I 1.1= M 0.0A M 0.0A I 2.0A I 2.1NOT= M 1.1A M 1.1= Q 4.0
STL
I 1.0
I 1.1
&
&
I 2.0
I 2.1
M0.0
M1.1 Q 4.0
=
FBD
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 16
NOT The NOT instruction inverts the RLO.
CLR The CLEAR instruction changes the RLO to "0" (only available in STL at present!).
SET The SET instruction changes the RLO to "1" (only available in STL at present!).
SAVE The SAVE instruction saves the RLO as "BR" in a register (status word).
BR The statement “A BR" can be used to recheck the saved RLO.
Date: 05.12.2005File: PRO1_06E.16
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Instructions, that Affect the RLOLAD FBD STL
A I0.0 A I0.1 NOT = Q8.0
=Q8.0&I0.0
I0.1( ) Q8.0
NOTI0.0 I0.1NOT
Status word15 8 1
BR RLO
not available not availableCLR CLR
not available not availableSET SET
I1.6( SAVE ) SAVE&I1.6SAVE A I1.6
SAVE
=Q8.1
BRBR
( )Q8.1
BR A BR= Q 8.1
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 17
MCR The Master Control Relay is a logical master switch for activating and deactivating power flow. An interrupted path represents a sequence that writes a zero value in place of a calculated value or a sequence that does not change the existing memory value.
Examples If the MCR condition is not fulfilled:• "0" is assigned via the output coils• the "Set Coil" and "Reset Coil" instructions do not change the existing value• the “MOVE” instruction transfers the value zero to the specified destination.
MCRA The MCRA instruction activates the Master Control Relay function.
MCR( “MCR(“ opens an MCR area and triggers an instruction that shifts the RLO to (for STL) the MCR stack. The stack can have up to eight entries. This means that up to eight
individual control areas can be nested between the “MCRA” and “MCRD” instructions.
)MCR The “)MCR“ instruction marks the end of an MCR area. (for STL)
MCRD The "Deactivate Master Control Relay” instruction deactivates the MCR function. No more MCR areas can be opened until another “MCRA” instruction is given.
Date: 05.12.2005File: PRO1_06E.17
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Master Control Relay Function
MCR<&A0.0
MCRA
S&A0.4Q16.0
MCR>
& =M5.5 M69.0I4.7
MCRD
& =A0.7Q8.5
M0.6=
FBD
MCRA // Activated
A I0.0 // Enable MCRMCR( // Open MCR
A I0.7 // NO Contact= Q8.5 // Output Coil= M0.6 // Output Coil
A I0.4 // NO ContactS Q16.0 // Set Output
)MCR // Close MCR
AN M5.5 // Emerg.ContactAN I4.7 // Emerg.Contact= M69.0 // Output Coil
MCRD // Deactivate
STLLAD
( MCRA )
I0.7( )Q8.5
( )M0.6
I0.4( S )Q16.0
( )M69.0 I4.7M5.5
( MCR< )
( MCRD )
( MCR> )
I0.0
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 18
Jump Instruction In LAD/FBD, the label is entered as an identifier above the coil symbol or assignment symbol. In STL it comes after the Jump instruction. The label can have up to four characters, the first of which must be a letter or the “_”character.The label marks the point where execution of the program is to continue. Any instructions or networks between the jump instruction and the label are not executed.Jumps can be made both forwards and backwards. The jump instruction and the jump destination must both be in the same block (max. jump length = 64kbyte). The jump destination must only be present once in the block.Jump instructions can be used in FBs, FCs and OBs.
Inserting In LAD aund FBD, you use the Program Elements browser to insert a label:a Label Program Elements -> Logic Control / Jump -> Label.
In STL, you enter the label to the left of the statement, from which program exeuction is to continue.
JMP An unconditional jump instruction causes a program jump to a label regardless of the RLO.
Date: 05.12.2005File: PRO1_06E.18
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Unconditional Jump (Independent of RLO)
( JMP )NEW1
Network 1
Network 2::::Network x
NEW1
( )M69.0I4.7M5.5
LAD
NEW1JMP....
NEW1
&M5.5I 4.7 =
M69.0
Network 1
Network 2::::Network x
FBD
Network 1
JU NEW1
Network 2::::Network x
NEW1: AN M5.5AN I4.7= M69.0
STL
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 19
JC The conditional jump “JC” is only executed if the RLO is “1”.If the RLO is “0”, the jump is not executed, the RLO is set to “1” and program execution continues with the next instruction.
JCN The conditional jump “JCN” is only executed if the RLO is "0".If the RLO is "1", the jump is not executed and program execution continues with the next instruction.
Note STL provides additional jump operations, which are discussed in another programming course.
Date: 05.12.2005File: PRO1_06E.19
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Conditional Jump (Dependent on RLO)
A I0.0A I0.1JC NEW1
NEW1I 0.0 I 0.1 &I0.0
I0.1 JMPNEW1
(JMP)Jump ifRLO=1
A I0.2A I0.3JCN NEW2JMPN
I0.2
I0.3NEW2NEW2I 0.2 I 0.3Jump if
RLO=0(JMPN)
&
LAD FBD STL
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 20
RLO Edge An "RLO edge" is when the result of a logic operation changes.
Positive Edge When the RLO changes from “0” to “1”, the "FP" check instruction results in signal state "1" (e.g. at M 8.0) for one cycle. To enable the system to detect the edge change, the RLO must also be saved in an FP bit memory, or data bit (e.g. M 1.0).
Negative Edge When the RLO changes from “1” to “0”, the "FN" check instruction results in signal state “1” (e.g. at M 8.1) for one cycle. To enable the system to detect the edge change, the RLO must also be saved in an FN bit memory, or data bit (e.g. M 1.1).
Date: 05.12.2005File: PRO1_06E.20
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
RLO - Edge Detection
PI1.0 I1.1 M1.0 M8.0
NI1.0 I1.1 M1.1 M8.1
LAD
I1.0
I1.1 P =
& M1.0 M8.0
I1.0
I1.1 N =
& M1.1 M8.1
FBD
A I1.0A I1.1FP M1.0= M8.0
A I 1.0A I 1.1FN M1.1= M8.1
STL
I1.0
I1.1
RLO
M1.0
M8.0M8.1
M1.1
OB1-Cycle
Example
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 21
Signal Edge A "signal edge" is when a signal changes its state.
Example Input I 1.0 acts as a static Enable. Input I 1.1 is to be monitored dynamically and every signal change is to be detected.
Positive Edge When the signal state at I 1.1 changes from “0” to “1”, the "POS" check instruction results in signal state "1" at output Q for one cycle, provided input I 1.0 also has signal state "1" (as in the example above).To enable the system to detect the edge change, the signal state of I 1.1 must also be saved in an M_BIT (bit memory or data bit) (e.g. M 1.0).
Negative Edge When the signal state at I 1.1 changes from “1” to “0” , the "NEG" check instruction results in signal state "1" at output Q for one cycle, provided input I 1.0 has signal state "1" (as in the example above).To enable the system to detect the edge change, the signal state of I 1.1 must also be saved in an M_BIT (bit memory or data bit) (e.g. M 1.1).
Date: 05.12.2005File: PRO1_06E.21
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Signal - Edge Detection
I1.1
=M8.0POS
M_BITM1.0
&I1.0
I1.1
=M8.1NEG
M_BITM1.1
&I1.0
FBD
A I1.0A ( A I1.1FP M1.0)= M8.0A I1.0A (A I1.1FN M1.1)= M8.1
STL
I1.1M8.0
POS
M_BITM1.0
Q
I1.0
I1.1M8.1
NEG
M_BITM1.1
Q
I1.0
LAD
Example
I1.0
I1.1
M1.0
M8.0
M8.1
M1.1OB1-Cycle
Training Centerfor Automation and Drives
ST-7PRO1Binary OperationsPage 22
Task Write a mode section of a program for a bottling plant to meet the following specifications:• Input I 0.0 (momentary-contact switch with NO function) switches the plant ON.• Input I 0.1 (momentary-contact switch with NC function) switches the plant
OFF.• When the plant is ON, the indicator at output Q 8.1 (Q 4.1) is lit.• When the plant is ON, the operating mode can be selected:
- Manual mode is selected when I 0.4=0 and automatic mode when I 0.4=1.
- The selected mode is adopted with a pulse at input I 0.5 .• The indicators for the selected mode are as follows:
Manual = Q 8.2 (Q 4.2), Automatic = Q 8.3 (Q 4.3).• When the mode is changed or the plant is switched off, the mode previously
selected must be deselected. • In manual mode, the conveyor can be jogged forwards with the momentary-
contact switch I 0.2 (Q 20.5 / Q 8.5) and backwards with I 0.3(Q 20.6 / Q 8.6).
What to Do 1. Draft out the program for controlling the operating modes. Use the I/O addresses and field devices shown in the diagram.
2. Create an S7 program with the name "FILL" in the project "My Project".3. Write the mode section of the program for the bottling plant in block FC 15.4. Open (off-line) the OB1 and enter a call to FC15
(in STL with the statement “CALL FC 15”).5. Save your program, download it and test it on the training unit.
Result It should work.
Date: 05.12.2005File: PRO1_06E.22
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Program for a Bottling Plant (Mode Selection)
Q 20.5 (Q 8.5) Conveyor forwardsQ 20.6 (Q 8.6) Conveyor backwards
BottlesensorI 16.6 (I 8.6)
I 0.0 =I 0.1 =
Start (Mom.-cont. switch with NO function)Stop (Mom.-cont. switch with NC function)
Plant ON/OFF:
I 0.4 = Manual/Automatic (Switch)Adopt mode (Momentary-contact switch, NO function)
Manual/Automatic mode:
I 0.5 =
I 0.2 = Jog forward (M-C sw., NO funct.)Jog backward (M-C sw., NO func.)I 0.3 =
M
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 1
Contents Page
Number Formats (16 Bits) ................................................................................................................... 2Number Formats (32 Bits) .................................................................................................................. 3Loading and Transferring Data (1) ……............................................................................................ 4Loading and Transferring Data (2) ……............................................................................................ 5Loading and Transferring Data (3) ……............................................................................................ 6Timers: Time Formats for S5 Timers in STEP 7 ................................................................................. 7Timers: ON Delay (SD) …………....................................................................................................... 8Timers: Stored ON Delay (SS) …………………................................................................................ 9Timers: OFF Delay (SF) …………..................................................................................................... 10Timers: Pulse (SP) ............................................................................................................................. 11Timers: Extended Pulse (SE) …......................................................................................................... 12Timers: Bit Instructions ….................................................................................................................. 13Exercise .............................................................................................................................................. 14S5 Counters in STEP 7 ...................................................................................................................... 15Counters: Bit Instructions ................................................................................................................ 16Counters: Function Diagram ............................................................................................................ 17Exercise: Program for a Bottling Plant (Filling Cycle and Bottle Count) ………….............................. 18Conversion Operations BCD <-> Integer …...................................................................................... 19Conversion Operations I -> DI -> REAL ……..................................................................................... 20Comparision Operations .................................................................................................................... 21Digital Logic Operations .................................................................................................................... 22Basic Mathematical Functions ……………......................................................................................... 23Exercise: Program for a Bottling Plant (Production Data) …….......................................................... 24Exercise: Program for a Bottling Plant (Number of Packaging Units) ……………............................. 25Shift Operations (Word / Doubleword) …........................................................................................... 26Shift Signed Integer to the Right ……………………........................................................................... 27Doubleword Rotation Operations ....................................................................................................... 28
Date: 05.12.2005File: PRO1_07E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Digital Operations
CMP ==I
IN1IN2
IW0IW2
M0.0 Q 9.7
T4S_ODT
TV
S Q
BCD
BI
R
I0.7
I0.5S5T#35s
Q8.5
MW0
QW12
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 2
BCD Code Each digit of a decimal number is encoded in four bit positions. Four bits are used because the highest decimal digit, 9, requires at least four bit positions in binary code ( 1001).The decimal digits from 0 to 9 are represented in BCD code in the same way as the binary numbers from 0 to 9.
INTEGER The data type INT is an integer (16 bits). The sign (bit 15) indicates whether the number is positive or negative ("0" = positive, "1" = negative). A 16-bit integer can be between -32 768 and +32 767. In binary format, the negative form of an integer is represented as the twos complement of the positive integer. (The twos complement is obtained by reversing the bit pattern and then adding 1.)In evaluating the bit pattern of a negative number, the zero positions are weighted, then 1 is added to the result and a minus sign is placed in front.
Date: 05.12.2005File: PRO1_07E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Number Formats (16 Bits)
BCD
INTEGER
BCD
28
= 256 +
0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
25
= 32 +
23
= 8 = 296
0 0 0 0 0 0 1 0 1 0 0 1 0 1 1 0
2 9 6Sign (+)
1 1 1 1 0 1 0 0 0 0 0 1 0 0 1 1
4 1 3Sign (-)W#16#F413
27
= 128 +
1 1 1 1 1 1 1 0 0 1 1 0 0 0 1 1
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
23
= 8+
22
= 4 = 412
28
= 256+
24
= 16+
- (412 + 1) = - 413
NegativeNumbers
INTEGER
PositiveNumbers
W#16#296
+296
-413
PG CPU
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 3
DINT 32-bit integers with sign are also referred to as "double integers” or “long integers”.They cover the range from L# -2147483648 to L#+2147483647.
REAL A real number (also known as a floating-point number) is a positive or negative number in the range from -1.175495•10-38 to 3,402823•1038 .Examples: +10.339 or +1.0339E1
-234567 or -2.34567E5. In exponential representation the exponent is specified as a power of 10.A real number takes up two words in memory. The most significant bit indicates the sign. The other bits represent the mantissa and the exponent to the base 2.
Note: The representation of real numbers in STEP 7 is in accordance with the IEEEstandard.
Date: 05.12.2005File: PRO1_07E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Number Formats (32 Bits)
Real No = +1,5 * 2 126-127 = 0,75
DW#16#296
+296
+0.75or
+7.5 E-1
0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 031 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
28
= 256 +
25
= 32 +
23
= 8 = 296Integer (32 Bit) =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 1 1 1 1 1 1 0 1 0 0 0 0 0
Sign ofReal No
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 031 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
e = Exponent (8 Bit) f = Mantissa (23 Bit)
General Format of a Real Number = (Sign) • (1.f) • (2e-127)
2021222324252627 2-232-1 2-2 2-4 .....2-3
0 0 0 0
0 0 0Sign (+)
00 0 0 0 0 1 0 1 0 0 1 0 1 1 0
2 9 60
0 0 00 0 00 0 0 0 0 0
BCD
DINT
REAL
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 4
MOVE (LAD/FBD) If the EN input is active, the value at input “IN” is copied to the address at output “OUT”. “ENO” has the same signal state as “EN”.
L and T (STL) Load and Transfer instructions are executed regardless of the RLO. Data is exchanged via the accumulator. The Load instruction writes the value from the source address right-justified into accumulator 1 and pads the remaining bits (32 bits in all) with "0"s.The Transfer instruction copies some or all of the contents of the accumulator to the specified destination (see next page).
Date: 05.12.2005File: PRO1_07E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Examplesof Load
Loading and Transferring Data (1)
L +5 // 16-bit constant (Integer)
L L#523123 // 32-bit constant (DoubleInteger)
L B#16#EF // byte in hexadecimal form.
L 2#0010 0110 1110 0011 // 16-bit binary value
L 3.14 // 32-bit constant (Real)
MOVE
EN
IN
OUT
ENO
MB5
5
FBD
L +5
T MB5
STL
MOVE
EN
OUT
ENO
MB5
LAD
IN5
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 5
ACCU1 ACCU 1 is the central register in the CPU. When a Load instruction is executed, the value to be loaded is written into ACCU 1; for a Transfer instruction the value to be transferred is read from ACCU 1, and the results of the mathematical functions, Shift and Rotate operations, etc. are also entered in ACCU 1.
ACCU2 When a Load instruction is executed, the old contents of ACCU 1 are first shifted to ACCU 2 and ACCU 1 is cleared (reset to “0”) before the new value is written into ACCU 1.
ACCU 2 is also used for comparison operations, digital logic operations, mathematical and Shift operations. These operations will be discussed in detail later on.
Date: 05.12.2005File: PRO1_07E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Loading and Transferring Data (2)
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
::L W#16#CAFE
L W#16#AFFE:::
X X X X X X X XC A F E
A F F E
Content ofACCU2
Content ofACCU1Programm
Y Y Y Y Y Y Y YX X X X X X X X
0 0 0 0 C A F E
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 6
General Accumulators are auxiliary memories in the CPU for data exchange between various addresses and for comparison and mathematical operations.The S7-300 has 2 accumulators with 32 bits each and the S7-400 has 4 accumulators with 32 bits each.
Load The Load instruction loads the contents of the specified byte, word or double word into ACCU 1.
Transfer When a Transfer instruction is executed, the contents of ACCU 1 are retained. The same information can therefore be transferred to different destinations. If only one byte is transferred, the eight bits furthest to the right are used (see diagram).
RLO In LAD and FBD you can use the Enable input (EN) of the MOVE box to make Load and Transfer operations dependent on the RLO. In STL Load and Transfer operations are always executed, regardless of the RLO, but you can implement RLO-dependent load and transfer by using conditional jumps to skip the Load / Transfer instructions.
Date: 05.12.2005File: PRO1_07E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Loading and Transferring Data (3)
31 23 15 7 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 MB0
31 23 15 7 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 MB1MB0
31 23 15 7 0
MB3MB2MB0 MB1
Load
L MB 0
Program
T QD 4
QD 4
QW 4
QB 4
Transfer
Contents of ACCU1
L MW 0
L MD 0
T QW 4
T QB 4
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 7
Time Specifications 1. Fixed time values specified as time constants (e.g.: S5T#100ms, S5T#35s, S5T#5m2s200ms, S5T#2h2m2s50ms).
2. Time values to be changed by the machine operator using pushwheel buttons.3. Process or recipe-dependent time values in memory words or data words.
Timer Cell A special area of memory is reserved for timers in your CPU. This area containsa 16-bit word for each timer address. Bits 0 to 9 of the timer word contain the time value in binary code. When the timer is updated, the time value is decremented by one unit at the interval defined by the time base.
Time Base Bits 12 and 13 of the timer word contain the time base in binary code:0 = 10 ms1 = 100 ms2 = 1 s3 = 10 s.
The time base defines the interval at which the time value is to be decremented by one unit. When the time is specified as a constant (S5T#...), the time base is assigned automatically by the system. If the time is to be specified using pushwheelbuttons or via a data interface, the user must also specify the time base.
L / BI The address at the “BI” output contains the time value in the form of a 10-digit binary number (without time base!).
LC / BCD The address at the “BCD” output contains both the time value as a 3-digit BCD number (12 bits) and the time format (bits 12 and 13).
Note IEC-compliant timers can also be implemented in STEP7.The use of system function blocks for implementing IEC timers is dealt with in an advanced programming course.
Date: 05.12.2005File: PRO1_07E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Timers: Time Formats for S5 Timers in STEP 7
Format for time specifications
Timer cell in system data memory
ACCU contents after “LC T...”
ACCU contents after “L T...”
Time base
102 101 100
Time value (BCD code)
Time base Time value (Binary number)
Time base
102 101 100
Time value (BCD code)
Time value (Binary number)
X X X X
X X
X X X XX X
X X
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 8
Start The timer starts when the RLO at the "S" input changes from “0” to “1”. The timer runs starting with the time value specified at the TV input as long as the signal state at input S =1.
Reset When the RLO at Reset input "R" is "1", the current time value and the time base are deleted and output Q is reset.
Digital Outputs The current time value can be read as a binary number at the BI output and as a BCD number at the BCD output. The current time value is the initial value of TV minus the value for the time that has elapsed since the timer was started.
Binary Output The signal at the "Q" output changes to "1" when the timer has expired without error and input "S" has signal state "1".If the signal state at the "S" input changes from "1" to "0" before the timer has expired, the timer stops running. In this case output “Q” has signal state "0".
Date: 05.12.2005File: PRO1_07E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Timers: ON Delay (SD)LAD
T4S_ODT
TV
S Q
BCD
BI
R
I0.7
I0.5S5T#35s
Q8.5
MW0
QW12
FBD
S_ODT
TV
Q
BI
R
I0.7
I0.5
S5T#35s
MW0
QW12
T4
BCD
=Q8.5
S
STL
A I0.7L S5T#35sSD T4A I0.5R T4L T4T MW0LC T4T QW12A T4= Q8.5
Example
RLO at S
RLO at R
Timeroperation
Q
Time value: 0 . . . 999
0,01s <--0,1s <--
1s <--10s <--
0 00 11 01 1
Data type“S5TIME”
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 9
Start The timer starts when the RLO at the "S" input changes from "0" to "1". The timer runs starting with the time value specified at input TV and continues to run even if the signal at input "S" changes to "0" during that time.If the signal at the Start input changes from “0” to “1” again while the timer is still running, the timer starts again from the beginning.
Reset When the RLO at Reset input "R" is "1", the current time value and the time base are deleted and output Q is reset.
Binary Output The signal state at output Q changes to "1" when the timer has expired without error, regardless of whether the signal state at the "S" input is still "1".
Date: 05.12.2005File: PRO1_07E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Timers: Stored ON Delay (SS)
STL
A I0.7L S5T#35sSS T4A I0.5R T4L T4T MW0LC T4T QW12A T4= Q8.5
LAD
T4S_ODTS
TV
S Q
BCD
BI
R
I0.7
I0.5S5T#35s
Q8.5
MW0
QW12
FBD
S_ODTS
TV
Q
BI
R
I0.7
I0.5
S5T#35s
MW0
QW12
T4
BCD
=Q8.5
S
Example
RLO at S
RLO at R
Timer operation
Q
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 10
Start The timer starts when the RLO at the "S" input changes from “1” to “0”. When the timer has expired, the signal state at output Q changes to "0". If the signal state at the "S" input changes from “0” to “1” while the timer is running, the timer stops and the next time the signal state changes from "1" to "0" it starts again from the beginning.
Reset When the RLO at Reset input "R" is "1", the current time value and the time base are deleted and output Q is reset. If both inputs (S and R) have signal state “1”, output “Q” is not set until the dominant Reset is deactivated.
Binary Output Output "Q" is activated when the RLO at the "S" input changes from “0” to “1”. If input “S” is deactivated, output “Q” continues to have signal state “1” until the programmed time has expired.
Date: 05.12.2005File: PRO1_07E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Timers: OFF Delay (SF)
STL
A I0.7L S5T#35sSF T4A I0.5R T4L T4T MW0LC T4T QW12A T4= Q8.5
LAD
T4S_OFFDT
TV
S Q
BCD
BI
R
I0.7
I0.5S5T#35s
Q8.5
MW0
QW12
FBD
S_OFFDT
TV
Q
BI
R
I0.7
I0.5
S5T#35s
MW0
QW12
T4
BCD
=Q8.5
S
Example
RLO at S
RLO at R
Timer operation
Q
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 11
Start The timer starts when the RLO at the “S” input changes from “0” to “1”. Output “Q” isalso set to “1”.
Reset Output “Q” is reset when: • the timer has expired, or • the Start signal changes from “1” to “0”, or• the Reset input “R” has signal state “1”.
Date: 05.12.2005File: PRO1_07E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Timers: Pulse (SP)
FBD
S_PULSE
TV
Q
BI
R
I0.7
I0.5
S5T#35s
MW0
QW12
T4
BCD
=Q8.5
S
RLO at S
RLO at R
Timer operation
Q
Example
STL
A I0.7L S5T#35sSP T4A I0.5R T4L T4T MW0LC T4T QW12A T4= Q8.5
MW0
LAD
T4S_PULSE
TV
S Q
BCD
BI
R
I0.7
I0.5S5T#35s
Q8.5
QW12
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 12
Start The timer starts when the RLO at the "S" input changes from “0” to “1”. Output "Q" is also set to “1”. The signal state at output “Q” remains at “1” even if the signal at the "S" input changes to “0”.If the signal at the Start input changes from “0” to “1” again while the timer is running, the timer is restarted.
Reset Output “Q” is reset when: • the timer has expired, or • the Reset input "R" has signal state "1".
Date: 05.12.2005File: PRO1_07E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Timers: Extended Pulse (SE)LAD
T4S_PEXT
TV
S Q
BCD
BI
R
I0.7
I0.5S5T#35s
Q8.5
MW0
QW12
FBD
S_PEXT
TV
Q
BI
R
I0.7
I0.5
S5T#35s
MW0
QW12
T4
BCD
=A8.5
S
RLO at S
RLO at R
Timer Operation
Q
Example
STL
A I0.7L S5T#35sSE T4A I0.5R T4L T4T MW0LC T4T QW12A T4= Q8.5
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 13
Bit Instructions All timer functions can also be started with simple bit instructions. The similarities and differences between this method and the timer functions discussed so far are as follows:• Similarities:
- Start conditions at the "S" input- Specification of the time value- Reset conditions at the “R” input- Signal response at output “Q”
• Differences (for LAD and FBD):- It is not possible to check the current time value (there are no BI and
BCD outputs).
Date: 05.12.2005File: PRO1_07E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Timers: Bit Instructions
I0.0 T4SD
S5T#5s
T4 Q 8.0
I0.1 T4R
Network 1:
Network 2:
Network 3:
LAD
& SD
T4
I0.0
S5T#5s
& =Q 8.0
T4
&I0.1
TV
RT4
FBD
A I0.0L S5T#5sSD T4
A T4= Q 8.0
A I0.1R T4
STL
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 14
Date: 05.12.2005File: PRO1_07E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise
T4S_PEXT
STVR
BIBCD
Q
I 0.7S5T#5s
I 0.5 Q 8.0
I 0.7
I 0.5
Q8.0
T4S_PULSE
STVR
BIBCD
Q
I 0.7S5T#5s
I 0.5 Q 8.0
I 0.7
I 0.5
Q8.05s
T4S_ODT
STVR
BIBCD
Q
I 0.7S5T#5s
I 0.5 Q 8.0
I 0.7
I 0.5
Q8.0
T4S_ODTS
STVR
BIBCD
Q
I 0.7S5T#5s
I 0.5 Q 8.0
I 0.7
I 0.5
Q8.0
I 0.7
I 0.5
Q8.0
T4S_OFFDT
STVR
BIBCD
Q
I 0.7S5T#5s
I 0.5 Q 8.0
Exercise Complete the function diagrams of the timers in the above slide!
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 15
Counter Value A 16-bit word is reserved for each counter in the system data memory. This is used for storing the counter value for the counter (0...999) in binary code.
Count Up When the RLO at the “CU” input changes from “0” to “1” the current counter reading is incremented by 1 (upper limit = 999).
Count Down When the RLO at the “CD” input changes from “0” to “1” the current counter reading isdecremented by 1 (lower limit = 0).
Set Counter When the RLO at the "S" input changes from “0” to “1” the counter is set to the value at the “CV” input.
Reset Counter When RLO = 1 the counter is set to zero. If the Reset condition is fulfilled, the counter cannot be set and counting is not possible.
PV The preset value (0...999) is specified in BCD at the „PV“ input:• as a constant (C#...)• in BCD format via a data interface.
CV / CV_BCD The counter value can be loaded as a binary number or BCD number into the accumulator and transferred from there to other addresses.
Q The signal state of the counter can be checked at output “Q”:• Count = 0 -> Q = 0• Count >< 0 -> Q = 1
Types of Counter • S_CU = Up counter (counts up only)• S_CD = Down counter (counts down only)• S_CUD = Up/Down counter.
Date: 05.12.2005File: PRO1_07E.15
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
S5 Counters in STEP 7STL
A I0.4CU C5A I0.5CD C5A I0.3L C#20S C5A I0.7R C5L C5T MW4LC C5T QW12A C5= Q8.3
LAD FBD
QI 0.4
I 0.5
CU
I 0.7
C#20
S_CUD
CD
SI 0.3
PV
R
Q 8.3
CV
CV_BCD
MW 4
QW 12
C5
Q
Q
I 0.4
I 0.5
CU
I 0.7
C#20
S_CUD
CD
SI 0.3
PV
R
Q 8.3
CV
CV_BCD
MW 4
QW 12
C5
=Q
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 16
Bit Instructions All counter functions can also operate with simple bit instructions. The similarities and differences between this method and the counter functions discussed so far are as follows:• Similarities:
- Setting conditions at the "SC" input- Specification of the counter value- RLO change at the "CU" input- RLO change at the "CD" input
• Differences:- It is not possible to check the current counter value
(there are no BI and BCD outputs).- There is no binary output Q in the graphical representation.
.
Note IEC-compliant counters can also be implemented in STEP 7. The use of system function blocks for implementing IEC counters is dealt with in an advanced programming course.
Date: 05.12.2005File: PRO1_07E.16
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Counters: Bit InstructionsSTL
A I0.0L C#20S C5
A I0.1CU C5
A I0.2CD C5
A C5= Q 4.0
LAD
I0.0 C5SC
C#20
Network 1:
C5
Network 2:
I0.1CU
Network 3:
I0.2 C5CD
Network 4:
C5 Q 4.0
FBD
SCC5
I0.0
C#20 CV
CUC5
I0.1
CDC5
I0.2
=Q 4.0
C5
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 17
Notes If the counter reaches the value 999 during up counting, or the value 0 during downcounting, then the count remains unchanged even in the case of further counting pulses.
If up counting and down counting is lined up at the same time, the count remains the same.
Date: 05.12.2005File: PRO1_07E.17
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Counters: Function Diagram
CU
CD
S
R
Q
Count
5
4
3
2
1
0
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 18
Goal To add new functions to the bottling plant program. In addition to the already programmed manual mode (FC15), a program for the automatic mode is to be created.
Conveyor Control When the conveyor belt motor (Q 20.5 / Q 8.5) is switched on in automatic mode, in Automatic Mode it remains on until it is switched off with the Stop switch (I 0.1) or until the sensor
(I 16.6 / I 8.6) detects a bottle. When the bottle has been filled, the conveyor must automaticallly start moving again and keep moving until another bottle is detected or theStop switch is operated.
Bottle Filling When a bottle is detected under the filling funnel (I 16.6 / I 8.6 =1), filling begins. Filling is simulated for 3 seconds and indicated at output Q 9.0 (Q 5.0).
Bottle Counting Another two sensors are provided for registering the full and empty bottles. Bottle sensor I 16.5 (I 8.5) registers the empty bottles and bottle sensor I 16.7 (I 8.7) registers the full bottles.Both the empty bottles and the full bottles are to be counted from the time when the plant is switched on (C 1 for the empty bottles and C 2 for the full bottles) and the number of full bottles is to be displayed on digital display QW 12 (QW 6).
What to Do 1. Write the program in block FC 16 and program a call to FC 16 in OB 1 (project "MyProject", "FILL“ program).
You must also modify the network in FC 15 containing the “Jog Conveyor Forwards” program.
2. Test your solution on the training unit.
Result It should work.
Date: 05.12.2005File: PRO1_07E.18
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Maincontainer
Q 9.0 (Q 5.0)Filling funnelBottle
sensorI 16.6 (I 8.6)Bottle sensor
I 16.5 (I 8.5)
Bottle sensorI 16.7 (I 8.7)
Exercise: Program for a Bottling Plant (Filling Cycle and Bottle Count)
Q 20.5 (Q 8.5) Conveyor forwardsQ 20.6 (Q 8.6) Conveyor backwards
I 0.0 = Start (NO contact, mom-cont. switch)I 0.1 = Stop (NC contact)
Plant ON/OFF:
I 0.4 = Manual /AutomaticI 0.5 = Adopt mode
Manual/Automatic mode:
I 0.2 = Jog forwards
I 0.3 = Jog backwards
M
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 19
Example A user program is to perform mathematical functions using values entered withpushwheel buttons and display the result on a digital display. Mathematical functions cannot be performed in BCD format, so the format must be changed.
Conversion The instruction set of the S7-300/400 supports a multitude of conversionInstructions facilities. The instructions all have the same format:
EN, ENO If RLO is =1 at Enable input EN, the conversion is performed. Enable output ENO always has the same signal state as EN. If this is not the case, it is clearly indicated inthe corresponding instructions.
IN When EN=1, the value at IN is read into the conversion instruction.
OUT The result of the conversion is stored at the address at the OUT output.
BCD_I / BTI (Convert BCD to integer) reads the contents of the IN parameter as a three-digit BCD number (+/- 999) and converts it to an integer value (16 bits).
I_BCD / ITB (Convert integer to BCD) reads the contents of the IN parameter as an integer value(16 bits) and converts this value to a three-digit BCD number (+/- 999). If an overflow occurs, ENO = 0.
BCD_DI / BTD Converts a BCD number (+/- 9999999) to a double integer (32 bits).
DI_BCD / DTB Converts a double integer to a seven-digit BCD number (+/- 9999999). If an overflow occurs, ENO = 0.
Date: 05.12.2005File: PRO1_07E.19
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Conversion Operations BCD <-> Integer
IN
BCD_IEN
ENO
OUT
INIW4
MW20
IN
I_BCDEN
ENO
OUT
INMW10
QW12
FBD
L IW4BTIT MW20
L MW10ITBT QW12
STL
0 8 1 5Numberentered in BCD
Numberdisplayedin BCD
ConversionBCD->Integer
Task
ConversionBCD<-Integer
User program withinteger mathoperations
0 2 4 8
IN
BCD_IEN ENO
OUTINIW4 MW20
I_BCD
IN
EN ENO
OUTMW10 QW12
LAD
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 20
Example A user program that works with integers also needs to perform division, which is likely to result in values less than 1. Since these values can only be represented as real numbers, conversion to real numbers is necessary. To do this, the integer must first be converted to a double integer.
I_DI / ITD Converts an integer to a double integer.
DI_R / DTR Converts a double integer to a real number.
Note Other conversion instructions, such as:• INV_I / INVI• NEG_I / NEGI• TRUNC / TRUNC• ROUND / RND• CEIL / RND+• FLOOR / RND-• INV_DI / INVD• NEG_DI / NEGD• NEG_R / NEGR• CAW, CADare discussed in an advanced programming course.
Date: 05.12.2005File: PRO1_07E.20
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Conversion Operations I -> DI -> REAL
AWL
L MW12ITDDTRT MD26
IN
I_DIEN
ENO
OUT
INMW12
MD14
IN
DI_REN
ENO
OUT
INMD14
MD26
FBD
Mathprogramwithreal numbers
Conversion fromdouble integerto real number
Conversion frominteger todouble integer
Task
Data in integer format(16 bits)
LAD
IN
DI_REN ENO
OUTMD14 MD26ININ
I_DIEN ENO
OUTMW12 MD14IN
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 21
CMP You can use comparison instructions to compare the following pairs of numerical values:I Compare integers (on the basis of 16 bit fixed-point number)D Compare integers (on the basis of 32 bit fixed-point number)R Compare floating-point numbers (on 32 bit real number basis =
IEEE floating-point numbers).If the result of the comparison is “True", then the RLO of the operation "1", otherwise"0".The values at inputs IN1 and IN2 are compared for conformity with the specified condition:== IN1 is equal to IN2<> IN1 is not equal to IN2> IN1 is greater than IN2< IN1 is less than IN2>= IN1 is greater than or equal to IN2<= IN1 is less than or equal to IN2.
Date: 05.12.2005File: PRO1_07E.21
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Comparison Operations
STL
A M0.0A (L IW0L IW2==I)= Q9.7
LAD
CMP ==I
IN1IN2
IW0IW2
M0.0 Q 9.7
FBD
IN1
IN2
M0.0
IW0
IW2&
=Q9.7
CMP ==I
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 22
WAND_W The "AND Word" operation gates the two digital values at inputs IN1 and IN2 bit by bit in accordance with the AND truth table. The result of the AND operation Is stored at the address at output OUT. The instruction is executed when EN = 1. Example: Masking out the 4th decade of the pushwheel buttons :IW4= = 0100 0100 1100 0100W#16#0FFF = 0000 1111 1111 1111MW30 = 0000 0100 1100 0100
WOR_W The "OR Word" operation gates the two digital values at inputs IN1 and IN2 bit by bit in accordance with the OR truth table. The result of the OR operation is stored at the address at output OUT.The instruction is executed when EN = 1. Example: Setting bit 0 in MW32 :MW32 = 0100 0010 0110 1010W#16#0001 = 0000 0000 0000 0001MW32 = 0100 0010 0110 1011
WXOR_W The "Exclusive OR Word" operation gates the two digital values at inputs IN1 and IN2 bit by bit in accordance with the XOR truth table. The result of the OR operation is stored at the address at output OUT. The result of the XOR operation is stored at the address at output OUT. The instruction is executed when EN=1. Example: detecting signal changes in IW0 :IW0 = 0100 0100 1100 1010MW28 = 0110 0010 1011 1001MW24 = 0010 0110 0111 0011
Date: 05.12.2005File: PRO1_07E.22
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Digital Logic Operations
L IW 0
L W#16#5F2A
AW / OW / XOW
T MW10
015
IW0 =
W#16#5F2A =
WAND_W
WXOR_W
WOR_W
EN ENO
IN2 OUTW#16#5F2A MW10
IN1IW0
0 1 1 1 10 0 0 0 0 0 0 0 0 0 0
0 1 1 1 10 0 0 0 0011 1 1 1
XOR
MW10 nach “XOW” 1 1 1 1 1 1 1 0 00000000
OR
MW10 after “OW” 0 1 1 10 0 0 0 01 1 1 1 1 1 1
AND
MW10 after “AW” 0 1 1 10 0 0 0 0 0 0 0 0 0 00
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 23
General The instruction set of the S7-300/400 supports a multitude of mathematical functions. All the instructions have the same format :
EN The instruction is executed if RLO is =1 at Enable input EN.ENO If the result is outside the permissible range for the data type concerned, overflow bits
OV=“Overflow” and OS=“Stored Overflow” are set and Enable output ENO=0. This prevents subsequent operations dependent on ENO from being executed.
IN1,IN2 The value at IN1 is read in as the first address and the value at IN2 as the second.
OUT The result of the mathematical operation is stored at the address at output OUT.
Instructions Addition: ADD_I Add integerADD_DI Add double integerADD_R Add real number
Subtraction: SUB_I Subtract integerSUB_DI Subtract double integerSUB_R Subtract real number
Multiplication: MUL_I Multiply integerMUL_DI Multiply double integerMUL_R Multiply real number
Division: DIV_I Divide integerDIV_DI Divide double integerDIV_R Divide real number
Note The advanced mathematical functions (ABS, SQR, SQRT, LN, EXP, SIN, COS, TAN, ASIN, ACOS, ATAN) are discussed in an advanced programming course.
Date: 05.12.2005File: PRO1_07E.23
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
LAD FBD STLBasic Mathematical Functions
Subtrac-tion
Multipli-cation
Division
AdditionL MW4L MW10+ IT MW6MW10
ADD_I
IN2
EN ENO
OUTIN1MW4
MW6 MW10
ADD_I
IN2
EN
ENO
OUTIN1MW4
MW6
SUB_I
IN2
EN ENOIN1MW5
MW11 MW7OUT MW11
SUB_I
IN2
EN
ENO
OUTIN1MW5
MW7L MW5L MW11- IT MW7
MD6MD12
MUL_REN ENOIN1
MD66IN2 MD12
MUL_R
IN2
EN
ENO
OUTIN1MD6
MD66L MD6L MD12* RT MD66
MD40
MD4
EN ENOIN1IN2 MD32OUT
DIV_R
MD4
DIV_R
IN2
EN
ENO
OUTIN1MD40
MD32 L MD40L MD4/ RT MD32
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 24
Goal To extend the function of the bottle counting program.The maximum number that can be counted with a counter is 999. To count larger numbers, you would have to connect a number of counters in series.You should therefore use mathematical operations here for counting. The production data shown in the diagram are also required for management.
What to Do 1. Delete the networks for the “bottle counting” function in FC 16 (FILL program).
2. Write an FC 18 for the counting function. When the plant is switched on, the values in MW 100/102/104 are deleted.
When an edge is detected at I 16.5 (I 8.5) or I 16.7 (I 8.7), the bottle count is incremented by adding 1.
The difference between the number of full bottles and the number of empty bottles is stored in MW 104.
3. Program a call to FC18 in OB1.4. Download all the blocks of the S7 program FILL to the CPU and test your
program.
Date: 05.12.2005File: PRO1_07E.24
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Program for a Bottling Plant (Production Data)
Full bottles
Empty bottles
"Broken" bottles
MW 100
MW 102
MW 104
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 25
Goal To make the following addition to the program for the production data of the bottling plant :• The full bottles are packed in units of 6. The number of packs required is to
be calculated and displayed at QW12 (QW6).• The program for this task is to be written in FC19.
What to Do 1. Write a program in FC 19 (S7-Program FILL) for dividing the number of full bottles (MW102) by the integer 6.
2. Convert the result to BCD.3. Transfer the BCD value to the digital display (QW12 / QW6).4. In FC 18, delete the network for displaying the full bottles.5. Program a call as well to FC 19 in OB 1.6. Save the program, then download it and test it.
Result The number on the digital display (number of packs required ) is increased by 1 for each multiple of 6 (bottles).
Date: 05.12.2005File: PRO1_07E.25
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise : Program for a Bottling Plant(Number of Packaging Units)
Program entered in STL
Program converted to STL
Program entered in LAD
(QW 6)
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 26
Shift The instruction is executed if RLO = 1 at Enable input EN.
SHL_W / SLW The SHL_W operation shifts bits 0 to 15 of ACCU 1 bit-by-bit to the left by the number of places specified at input “N”. The bits on the right are padded with zeros.
SHR_W / SRW The SHR_W operation shifts bits 0 to 15 of ACCU 1 bit-by-bit to the right by the number of places specified at input “N”. The bits on the left are padded with zeros.
ACCU1-H Bits 16 to 31 are not affected.
OUT The result of the shift operation is stored at the address at output OUT.
N The permissible range for N=0...15. If N>=16, OUT=0.
ENO If the instruction is executed (EN = 1), ENO indicates the signal state of the last bit shifted. This means that other instructions dependent on ENO (cascading) are not executed if the signal state of the last bit shifted is "0".
SHL_DW / SLD The procedure for the SHL_DW or SHR_DW operations is the same as that for theSHR_DW / SRD SHL_W or SHR_DW operations, except that the entire contents of ACCU1 ( bits 0 to 31) are
shifted bit-by-bit to the left or right by the specified number of bits.
Date: 05.12.2005File: PRO1_07E.26
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Shift Operations (Word / Doubleword)
L MW8L MW4SLW T MW12
SHL_W
EN
N OUT
ENO
MW12
INMW4
MW8= +2
L MW4SLW 2T MW12
or:
0 0
1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 0 0 0 0 0 0 0 0 0 0 0 0 1
OUT
IN
Shift Left Word:
0 0
OUT
1 1 1 0 0 0 0 0 0 0 0 0 0 0
11 1 0 0 0 0 0 0 0 0 0 0 0 0 1
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
IN
Shift Right Word:
EN0 =1 EN0 = 0
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 27
SHR_I / SSI The Shift Right Signed Integer operation shifts only ACCU1-L (bits 0 to 15) bit by bit to the right. The bits that are vacated are filled with the contents of the sign bit (bit 15).Bits 16 to 31 are not affected. Input N specifies the number of bit positions by which the number is to be shifted. If N is greater than 16, N = 16 is assumed.
EN/ENO If the instruction is executed (EN = 1), ENO indicates the signal state of the bit last shifted (this bit corresponds to the CC1 and RLO bits in the status word). This means that other instructions dependent on ENO (cascading) are not executed if the signal state of the last bit shifted is "0".
SHR_DI / SSD The Shift Right Signed Double Integer operation shifts the entire contents of ACCU 1 (bits 0 to 31) to the right by the specified number of bits.Permissible values for N: 0 to 32.
Note The shift operations are discussed in more detail in an advanced programming course.
Date: 05.12.2005File: PRO1_07E.27
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Shift Right Signed Integer
SHR_I
EN
N OUT
EN0
MW12
INMW4
MW8= +3
L MW8L MW4SSI T MW12
L MW4SSI 3T MW12
or:
Shift a Signed Integer to the Right:
1 1 1
1
1 0 1 0 0 0 0 0 0 0 0 0 1
01 1 0 0 0 0 0 0 0 0 0 1 0 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OUT
INEN0 = 0
0 0 0
1
0 1 1 0 0 0 0 0 0 0 0 0 1
10 1 0 0 0 0 0 0 0 0 0 1 1 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OUT
INEN0 = 1
Training Centerfor Automation and Drives
ST-7PRO1Digital OperationsPage 28
ROL_DW / RLD The Rotate Left Doubleword operation rotates the entire contents of ACCU 1 to the left. The vacated bits are filled with the signal states of the bits that are pushed out.The last bit rotated is loaded in condition code bit 1 of the status word and also stored at output ENO. This means that other instructions dependent on ENO (cascading) are not executed if the signal state of the last bit rotated is "0".
ROR_DW / RRD Rotate Right Doubleword.
Note The rotation operations are discussed in more detail in an advanced programming course.
Date: 05.12.2005File: PRO1_07E.28
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Doubleword Rotation Operations
OUT
ROL_DW
EN
N OUT
ENO
MD12
INMD2
MW6= +4
L MW6L MD2RLD T MD12
L MD2RLD 4T MD12
or:
Rotate 4 placesto the left :
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 11 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 031 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
IN:
1 0 1 10 0 0 0 0 0 0 0 0 0 1 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0OUT:
Training Centerfor Automation and Drives
ST-7PRO1SymbolsPage 1
Contents Page
Absolute and Symbolic Addressing …........................................................................................... 2Symbolic Addressing - Overview …............................................................................................... 3Opening the Symbol Table ................................................................................................................ 4Edit: Find and Replace ……............................................................................................................. 5View: Filter ….................................................................................................................................... 6View: Sort ……................................................................................................................................ 7Symbol Table: Export ...................................................................................................................... 8Symbol Table: Import ....................................................................................................................... 9Edit Symbols (in the LAD/STL/FBD Editor) ……............................................................................... 10Symbol Information (in the LAD/STL/FBD Editor) ............................................................................. 11Symbol Selection (in the LAD/STL/FBD Editor) ............................................................................... 12“Leading Symbol" ......................................................................................................................... 13Exercise: Creating a Symbol Table for FC 15 .................................................................................. 14
Date: 05.12.2005File: PRO1_08E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Symbols
Training Centerfor Automation and Drives
ST-7PRO1SymbolsPage 2
Absolute In absolute addressing, you specify the address (e.g. input I 1.0) direct. In thisAddressing case you don‘t need a symbol table, but the program is harder to read.
Symbolic In symbolic addressing, you use symbols (e.g. MOTOR_ON) instead of the Addressing absolute addresses.
You store the symbols for inputs, outputs, timers, counters, bit memories and blocks in the symbol table.
Note When you enter symbol names, you don‘t have to include quotation marks. The Program Editor adds these for you.
Date: 05.12.2005File: PRO1_08E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Absolute and Symbolic Addressing
A I 0.0
= Q8.0
A I 0.4
= Q20.5
Call FC18
A “PLANT_ON"
= “ON_INDIC"
A "M_FORW"
= "MOTOR_FORW"
Call “COUNT"
Symbol Address Data Type Comment
MOTOR_FORW
COUNT
PLANT_ON
ON_INDIC
M_FORW
Q20.5
FC18
I 0.0
Q8.0
I 0.4
BOOL
FC18
BOOL
BOOL
BOOL
Motor forwards
Count bottles
Switch on plant
Indicator: Plant is “On”
M.-con. switch: Motor forwards
(max. 24 characters) (max. 80 characters)
Training Centerfor Automation and Drives
ST-7PRO1SymbolsPage 3
Global Symbols Global symbols declared in the symbol table can be used in all blocks of a program.The name in the symbol table must be unique, that is, a symbolic name must only appear once in the table.
Local Symbols Local symbols are declared in the declaration part of a block. They can only be used within that block.The same symbolic name can be used again in the declaration part of another block.
Date: 05.12.2005File: PRO1_08E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Local Block Data: Declaration part of Program Editor- Block parameters the block- local / temporary data
Jump Labels Code section of Program Editorthe block
Symbolic Addressing - Overview
Where are symbols used? Where are they stored? With what are they created?
Global Data: Symbol Table Symbol Editor- Inputs- Outputs- Bit mem., timers, counters- Peripheral I/O
Data Block Components Declaration part of the DB Program Editor
Block Names: Symbol Table Symbol Editor- OB- FB- FC- DB- VAT- UDT
Training Centerfor Automation and Drives
ST-7PRO1SymbolsPage 4
Symbol Table You open the symbol table by selecting the menu options Options -> Symbol Table in the LAD/STL/FBD Editor.You can also open the symbol table from the SIMATIC Manager: Select the program in the left-hand pane of the project window and double-click the “Symbols” object.
Table Structure When you open a symbol table, an additional window is opened. It consists of columns for the symbol name, the address, the data type and a comment for a symbol. Each symbol occupies one line of the table. A blank line is automatically added at the end of the table for defining a new symbol.
Note The symbol table is a common database and can be used by different tools:• LAD/STL/FBD Editor• Monitoring and Modifying Variables• Display Reference Data
Date: 05.12.2005File: PRO1_08E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Opening the Symbol Table
Training Centerfor Automation and Drives
ST-7PRO1SymbolsPage 5
Find and Replace A number of options are available for finding and replacing text in the current window:• Find what:
Enter the text you are looking for.• Replace with:
Enter the replacement text. • From cursor down:
Searches downwards to the last line in the symbol table.• From cursor up:
Searches upwards to the first line in the symbol table.• Match case:
Only searches for the specified text with identical use of upper-case and lower-case letters.
• Find whole words only:Searches for the specified text as a separate word, not as part of a longer word.
• All:Searches through the whole symbol table, starting from the cursor position.
• Selection:Searches only the selected symbol lines.
Note When you are looking for addresses, you should insert a wildcard after the address identifier, otherwise the address cannot be found.
Example of Find and Replace (replace all outputs with address 8. with address 4.):
Find what: Replace with:Q*8.* Q 4.
Date: 05.12.2005File: PRO1_08E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Edit: Find and Replace
Training Centerfor Automation and Drives
ST-7PRO1SymbolsPage 6
Filter Only the symbols which meet the active filter criteria (“symbol properties") are displayed in the current window. You can apply several criteria at once. The specified filter criteria are linked with one another.
Symbol You can select various filters and link them according to the following properties:Properties Name, Address, Data type, Comment, Operator control and monitoring,
Communication, Message.
Permissible wildcards are * and ?.
Examples Name: M*Only the names that begin with "M“, and that contain any number of additional characters, are displayed in the symbol table.
Name: SENSOR_?Only the names that begin with "SENSOR_" and that contain one other character, are displayed in the symbol table.
Address: E*.*Only the inputs are displayed.
Valid, Invalid The symbols must be unique, that is, a symbol or an address must only exist once in the symbol table.If a symbol or an address appears more than once, the lines in which it appears are displayed in “Bold". If your symbol table is long, and you want to find such ambiguous symbols or addresses more quickly, you can display only these lines of the symbol table by selecting the menu options View -> Filter and the attribute “Invalid".
Date: 05.12.2005File: PRO1_08E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
View: Filter
Training Centerfor Automation and Drives
ST-7PRO1SymbolsPage 7
Sort The entries in the symbol table can be displayed in alphabetical order. You use the menu options View -> Sort to specify the column to be used as the point of reference for sorting in the current window.There is an alternative way to sort:1. Click on the column heading for sorting in ascending order in this column.2. Click on the column heading once more for sorting in descending order in this column.
Date: 05.12.2005File: PRO1_08E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
View: Sort
Training Centerfor Automation and Drives
ST-7PRO1SymbolsPage 8
General The menu option Symbol Table -> Export enables you to store symbol tables in a different file format so that you can work on them with other programs. You can select the following file formats:• ASCII Format (*.ASC)
- Notepad- Word
• Data Interchange Format (*.DIF)- EXCEL
• System Data Format (*.SDF)- ACCESS
• Assignment List (*.SEQ)- STEP 5 assignment list
Date: 05.12.2005File: PRO1_08E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Symbol Table: Export
Where do you want to store the table ?
In which format do you want to store the table?
Training Centerfor Automation and Drives
ST-7PRO1SymbolsPage 9
General The menu option Symbol Table -> Import enables you to import symbol tables that were created with other user programs.What to do:1. Activate the menu options Symbol Table -> Import.2. Select the file format in the “Import” dialog window.
You will find the same formats as for Export.3. Select the directory path in the “Find in:" list box.4. Enter the file name in the “File Name:" box5. Confirm with "OK" .
File Types You can import the following file formats:• ASCII Format (*.ASC)
- Notepad- Word
• Data Interchange Format (*.DIF)- EXCEL
• System Data Format (*.SDF)- ACCESS
• Assignment List (*.SEQ)- STEP 5 assignment list
Date: 05.12.2005File: PRO1_08E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Symbol Table: Import
Select directory path here
Enter file name
Select file format
Training Centerfor Automation and Drives
ST-7PRO1SymbolsPage 10
Edit Symbols The menu option Edit -> Symbol, or a click with the right mouse button on the addressand then the menu option Edit Symbol, enables you to assign symbolic names to absolute addresses later on. The assigned names are automatically entered in the symbol table.Names that are already in the symbol table are displayed in a different color. They cannot be used again in the symbol table.
Date: 05.12.2005File: PRO1_08E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Editing Symbols (in the LAD/STL/FBD Editor)
Training Centerfor Automation and Drives
ST-7PRO1SymbolsPage 11
Addressing In the LAD/STL/FBD Editor you can choose to display the addresses in one of the following two ways by selecting the menu options View -> Display -> Symbolic Representation:
• Symbolic Addressing or• Absolute Addressing .
You can display the symbolic and absolute address assignments used in the network by selecting the menu options View -> Display -> Symbol Information.The assignments are found under the network in LAD/FBD and in STL they are found in the statement line.
Note If you position the mouse pointer on an address, a "Tooltip" appears with the symbol information for this address.
Date: 05.12.2005File: PRO1_08E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Symbol Information (in the LAD/STL/FBD Editor)
Training Centerfor Automation and Drives
ST-7PRO1SymbolsPage 12
Date: 05.12.2005File: PRO1_08E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Symbol Selection (in the LAD/STL/FBD Editor)
Introduction You can use the menu options View -> Display -> Symbol Selection to simplify the writing of a symbolic program.
When you label the adddress, a section of the symbol table pops up, as soon as you enter the first letter of a symbol name. This section contains all symbols which begin with this letter. By clicking on the desired symbol it is taken into your program.
Training Centerfor Automation and Drives
ST-7PRO1SymbolsPage 13
Introduction If you want to change the assignments in the symbol table of an already existing program, you can also decide whether the absolute address or the symbolic address has priority.
Selection In the SIMATIC Manager, select, with the right mouse button, the "Blocks" object of an S7 program. Select the menu option Properties and then the "Blocks“ tab.You can choose between "Absolute Value" or "Symbol" in the “Priority" field.
Priority: With this setting, the absolute address of an operand does not change, if youAbsolute Value change the address assignment in the symbol table later on.
In the example above, the output Q8.0 (symbol name “Plant On") was changed to output Q4.0 in the symbol table. With the “Priority: Absolute Value" setting, the program continues to use the output Q8.0.
Priority: Symbol With this setting, the absolute address of the operand is changed to the new entry in the symbol table.In the example above, the output Q8.0 (symbol name “Plant On") was changed to output Q4.0 in the symbol table. With the “Priority: Symbols“ setting, the address is changed from Q8.0 to Q4.0 throughout the entire program.The changed address also keeps its symbol name. That way you can change the absolute addresses in an existing symbolic user program.
Date: 05.12.2005File: PRO1_08E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
"Leading Symbols"
Symbol Table
Old Entry:Plant ON = Q8.0
New Entry:Plant ON = Q4.0
Priority: Absolute Value
Priority:Symbols
Training Centerfor Automation and Drives
ST-7PRO1SymbolsPage 14
Goal To create a symbol table representing the first part of the filling application.
What to Do Create a symbol table for the FC 15 function in the S7 program "FILL":1. Open the Symbol Editor in the LAD/STL/FBD Editor by selecting the menu
options Options -> Symbol Table.2. Edit the symbol table, as is shown in the screen above. 3. Save the symbol table by selecting the menu options Symbol Table ->
Save and return to the LAD/STL/FBD Editor.4. Open the FC 15 block5. Select the menu options View -> Display -> Symbolic Representation or click the icon in the toolbar.
6. Look at your program in symbolic representation and then select the menu options View -> Display -> Symbol Information.
Result The symbolic names are now displayed for all the addresses in the program to which you have assigned names. You can return to absolute addresses by deactivating the Symbolic Representation selection in the View menu.
Date: 05.12.2005File: PRO1_08E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Creating a Symbol Table for FC 15
Plant OnManual ModeAutomatic ModeConveyor ForwardConveyor BackwardStartStopJog ForwardJog BackwardAutomatic/ManualEnter Mode
Q 8.1Q 8.2Q 8.3Q 20.5Q 20.6I 0.0I 0.1I 0.2I 0.3I 0.4I 0.5
Q 4.1Q 4.2Q 4.3Q 8.5Q 8.6I 0.0I 0.1I 0.2I 0.3I 0.4I 0.5
Symbol Address(Version A)
Address(Version B)
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 1
Contents Page
Debug - Monitor (Status) ............................................................................................................... 2Program Status Modes of Operation ................................................................................................ 3Use of Trigger Points with Program Status …..………..................................................................... 4Selecting the Display Information of the Program Status ............................................................... 5Activating the “Monitor/Modify Variables" Tool ……………........................................................... 6Entering a Variable Table ................................................................................................................ 7Monitoring and Modifying Variables ................................................................................................ 8Setting Trigger Points .................................................................................................................... 9Saving a Variable Table ................................................................................................................ 10Opening a Variable Table ................................................................................................................ 11Establishing a Connection to the CPU ............................................................................................ 12Modifying Outputs in the Stop Mode ............................................................................................... 13Forcing ............................................................................................................................................. 14Breakpoints (Part 1) ......................................................................................................................... 15Breakpoints (Part 2) ......................................................................................................................... 16Exercise: Monitoring and Modifying Variables .............................................................................. 17Exercise: Modifying Variables in the Stop State .............................................................................. 18Exercise: Using Trigger Points for the Modify Variables Function .................................................... 19Exercise: Forcing ........................................................................................................................... 20Exercise: Combining Program Status and Monitor Variable ..................................................... 21
Date: 05.12.2005File: PRO1_09E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Test Functions
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 2
Monitor You can activate the “Monitor" ("Status") test mode for the block which is currently open by clicking the Spectacles icon with the mouse or by selecting the menu options Debug -> Monitor. In the test mode, the elements in LAD / FBD are displayed in different colors. You define these by selecting the menu options Options -> Customize.E.g.: • Status fulfilled -> "Element is displayed in green"
• Status not fulfilled -> "Element is displayed in blue"
Notes 1. When the “Monitor" test mode is activated, you cannot make any changes to the program. You cannot change the view of the block (LAD, STL, FBD) either.
2. The status can only be displayed when the instructions are being executed.The status is not displayed when the CPU is in the STOP mode or when the block is not called.
Date: 05.12.2005File: PRO1_09E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Debug - Monitor (Status)
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 3
Debug-> Operation There are two modes of operation for the test mode, which differ in their effect on the scan cycle time of the user program:• Process operation and • Test operation.
Process Operation In process operation, the test functions are restricted so that the permissible scan cycle time increase that you select is not exceeded.The status of programmed loops is only determined the first time they are executed.The test functions “Breakpoint” and “Single-step (program execution)” cannot be executed.
Test Operation In test operation, all test functions can be performed without restrictions.The status of programmed loops is determined every time they are executed. The scan cycle time can be increased considerably due to the updating of the test function “program status” with every loop execution.
Parameter The above information only applies if the mode of operation has not alreadyAssignment been defined in the hardware configuration.
The mode of operation can be defined on the “Protection” tab page when assigning the CPU parameters. This setting can then no longer be changed in the “Operation” dialog box.
Date: 05.12.2005File: PRO1_09E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Program Status Modes of Operation
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 4
Date: 05.12.2005File: PRO1_09E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Use of Trigger Points with Program Status
Trigger Points After you have selected the menu options Debug -> Call Environment, a dialog box pops up (see slide above). Here you can enter a Call path. This is helpful if a block is called several times in a program and you want to monitor only one specific call.You can also specify data blocks as trigger conditions. The status display of the block begins from the point when the specified DB is opened.
Call Path In the example, FC 1 is called three times (see program structure). So that you can specifically monitor a call, enter the three blocks that are found immediately before the status block. A requirement for this is that the call takes place through different blocks. So that you can monitor the third call, enter in the exampleFC 30 at 3rd Block.
Open Data Blocks In the example, FB 1 is called several times by the same FC 40 block. In this case, the Call path cannot be used for testing. Here you use the opened data block as a trigger for testing. Since, as a rule, an instance DB is also used with an FB, you can use this instance DB in the DB2-number field as the trigger condition. In the example, DB 1 was used for the first call, DB 2 for the second call and DB 3 for the third call. You have to enter DB 2 in order to see the second call.
Note The "Test Operation" mode is a prerequisite for testing with the Call path.
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 5
Date: 05.12.2005File: PRO1_09E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Selecting the Display Information of the Program Status
LAD/STL/FBD Editor -> Options ->Customize ... or with running status: right mouse click
on
Introduction In the block status, you can select which information is to be displayed on the screen. By default, you see Status Bit, RLO, and Standard status.If you want to display additional information, select the menu options Options ->Customize -> STL.
Dialog Box In the screen you can see the dialog box for putting together the information.In addition to the information displayed by default, the following is also possible:
• AR1 Address register 1, only meaningful with register indirect addressing• AR2 Address register 2, only meaningful with register indirect addressing• Accumulator 2• DBR1 Data block register 1 (global or first DB opened)• DBR2 Data block register 2 (local or second DB opened)• Indirect, meaningful with memory indirect addressing (shows the contents of MD and DD e.g. with the instruction L IW [MD 100] ).
Note With a running program status, you can hide and show additional information, you can change the representation (decimal, hexadecimal, real) or display separators. To do so, click with the right mouse button on the title RLO, STA .. and choose the menu option you want (see screen).
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 6
General “Monitor/Modify Variables" is another STEP 7 tool which enables you to monitor the variables of a program in selectable formats.It also allows you to modify the status or contents of variables in the CPU.
Toolbar You can change the toolbar by selecting the menu options View -> Toolbar. There are three different toolbars which you can activate/deactivate:
• Standard
• View
• Variable
View You can adjust the number of columns in the variable table by selecting the menu optionsView -> Symbol / Symbol Comment / Monitor Format / Monitor Value / Modify Valueor by using the “View" toolbar.
Date: 05.12.2005File: PRO1_09E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Activating the "Monitor/Modify Variables" Tool
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 7
Creating a VAT There are two different ways of creating a variable table:1. in the LAD/STL/FBD Editor, by selecting the menu options PLC ->
Monitor/Modify Variables. You can work directly online with this table.2. in the SIMATIC Manager, by selecting the menu options Insert New Object -> Variable Table when the “Blocks” folder is open. This table is created
offline. You can save it and open it again later, switch to online mode and then test it.
Table Each address to be monitored or modified takes up one line of the variable table.The meanings of the columns of the variable table are as follows:
Address The variable‘s absolute address is found in this column.
Symbol The variable‘s symbolic name (identifier) is found here. It is identical to the name entered in the symbol table.
Symbol Comment The symbol comment from the symbol table is displayed in this column.
Monitor Format This column contains a standard setting, e.g. HEX. You can change the format as follows:• click an entry in the format column with the right mouse button. The list of
formats pops up.• or keep clicking on the entry in the format column with the left mouse button
until the format you want appears.
Monitor Value The contents of the variable at the last update is displayed here.
Modify Value You enter the new value for the variable (the modify value) in this column.
Date: 05.12.2005File: PRO1_09E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Entering a Variable Table
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 8
Monitor You can monitor variables in two ways:• The monitor values can be updated once by selecting the menu options
Variable -> Update Monitor Values or by clicking on the icon.
• The monitor values can be updated every cycle by selecting the menu options Variable -> Monitor or by clicking on the icon
Modify Procedure for modifying variables:1. With the left mouse button, click the line in the “Modify Value” column for
the variable that you want to modify.2. Enter the value in the correct form for the data type. 3a. To activate the modify values once, select the menu options Variable ->
Activate Modify Values or click the icon (or item 3b).
3b. To activate the modify values every cycle, select the menu options Variable -> Modify or click the icon.
4. Use the “Monitor” test function to check whether the modify value has been entered in the variable.
Modify Value Valid You can make the modify value entered in the table invalid by clicking on the icon.
The invalid value is optically displayed like a comment. You make the modify value “valid” again by clicking on the icon again.Only valid modify values can be activated.
Date: 05.12.2005File: PRO1_09E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Monitoring and Modifying Variables
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 9
Trigger You set the trigger points in the “Monitoring and Modifying Variables” tool by selecting the menu options Variable -> Set Trigger... or by clicking the icon.
Trigger Points The “Monitor Trigger Point” specifies when the values of the variables being monitored are to be updated.The “Modify Trigger Point” specifies when fixed values are to be assigned to the variables being modified.
Trigger Frequency The “Monitor Trigger Frequency” specifies whether the values are to be updated once only when the trigger point is reached or every cycle (every time the trigger point is reached). The “Modify Trigger Frequency” specifies whether the new values are to be assigned to the variables being modified once only or every cycle.
Attention ! When the “Monitor Trigger Frequency” is set to “Once”, a click on the icons orhas the same effect: the values are updated once.
When the “Modify Trigger Frequency” is set to “Once”, a click on the icons orhas the same effect: the values are activated once.
When the trigger frequencies are set to “Every Cycle”, the above-mentioned icons have the different effects previously described.
When the same trigger points are set for Monitor and Modify, Monitor has priority, that is, monitoring is done first.
Note For some CPU versions (e.g. CPU 314-1AE03), the modify function is not carried out with every cycle when the “Modify Trigger Frequency" is set to “Every cycle". Remedy: Using the test function "Force".
Date: 05.12.2005File: PRO1_09E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Setting Trigger Points
Start of cyclic program execution
End of cyclicprogram execution
Transition: RUN --> STOP
Cyclicprogramexecution
PII
PIQ
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 10
Save When you cancel or finish a test phase, you can save the variable table.The name of a variable table consists of the letters "VAT" followed by a number from 0to 65535 (with no space in between), e.g. "VAT5".
Date: 05.12.2005File: PRO1_09E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Saving a Variable Table
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 11
What to Do 1. Activate the menu options Table -> Open.2. Choose the project name in the “Open" dialog window.3. Select the relevant program in the project pane underneath and click the “Blocks” folder.4. Select the table you want in the right-hand pane.5. Confirm with "OK".
Date: 05.12.2005File: PRO1_09E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Opening a Variable Table
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 12
PLC The variables in a VAT are variable parts of a CPU program. Before you can monitor or modify the variables, you must establish a connection to the CPU concerned. It is possible to connect each variable table to a different CPU. You select the menu options PLC -> Connect To . . . or click the appropriate icons in the toolbar to establish a connection to one of the following CPUs: • Configured CPU• Direct CPU • Accessible CPU . . .
Configured CPU The variables of the CPU, in whose S7 program (H/W Station) the variable table is stored, are displayed.
Direct CPU The variables of the CPU, which are directly connected to the PG, are displayed.
Accessible CPU The variables of the CPU, which are selected in the dialog box, are displayed.You select the menu options PLC -> Connect To -> Accessible CPU... to establish a connection to an accessible CPU.Thus, you can establish a connection to every CPU in the network.
Date: 05.12.2005File: PRO1_09E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Establishing a Connection to the CPU
ConfiguredCPU
(VAT fromHW Station "Station 2")
Station 2Directly
connectedCPU
Station 1
PG
Station 3
Accessible CPUs
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 13
Date: 05.12.2005File: PRO1_09E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Modifying Outputs in the Stop Mode
Overview The “Enable Peripheral Outputs" function switches off the output disable of the peripheral outputs (PQ). This enables you to modify the peripheral output when the CPU is in the STOP mode.
Selection To enable the peripheral outputs, proceed as follows: 1. Select the menu options Table -> Open to open the variable table (VAT) that
contains the peripheral outputs you want to modify, or, activate the window for the relevant variable table.
2. Select the menu options PLC -> Connect to to establish a connection to the CPU you want, so that you can modify the peripheral outputs of the active variable table.3. Select the menu options PLC -> Operating Mode to open the Operating Mode dialog box and switch the CPU to the STOP mode.4. Enter the appropriate values for the peripheral outputs you want to modify in the “Modify Value" column.
Examples: PQB 7 Modify Value: 2#0001000011PQW 2 W#16#0027PQD 4 DW#16#0001
5. You switch on the “Enable Peripheral Outputs" mode by selecting the menu options Variable -> Enable Peripheral Outputs.
6. You modify the peripheral outputs by selecting the menu options Variable -> Activate Modify Values. The “Enable Peripheral Outputs" remains active until you
select the menu options Variable -> Enable Peripheral Outputs again to switch off this function. 7. To assign new values, start again with step 4.
Note • If the CPU changes its operating mode and goes from STOP to RUN orSTARTUP, for example, a message pops up.
• If the CPU is in the RUN mode and the “Enable Peripheral Outputs" function is selected, a message also pops up.
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 14
Date: 05.12.2005File: PRO1_09E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Forcing
Forcing You can establish predefined values for user program variables with the Force function. With the S7-400, inputs, outputs, bit memories and peripherals can be forced. With the S7-300, only inputs and outputs.
Notes for Forcing You can only open one Force Values window for a CPU.
• You will find the name of the variable table for the current online connection in the titlebar of the Force Values window.• You will find the date and time of the current force task in the CPU in the
statusbar.• You cannot monitor and modify variables when the Force Values window is
active.
Before you start the "Force" function, you should make sure that no one else is carrying out this function at the same time on the same CPU. You can only cancel or end a force job by selecting the menu options Variable > Stop Forcing.
You cannot cancel the force task by closing the Force Values window or by exiting the “Monitor/Modify Variables" application.
You cannot undo "Forcing" with the menu options Edit -> Undo. Take the time to find out about the differences between forcing variables and modifying variables.
Attention! Please note, that incorrect handling when executing the "Force" function can
• endanger the life or the health of persons or• cause damage to a machine or the entire system.
Note This function is only possible as of a specific version of the CPU(e.g. CPU 314-1AE03).
!
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 15
Date: 05.12.2005File: PRO1_09E.15
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Breakpoints (Part 1)
Breakpoints With the help of this test function, you can test a program you have created in the STL programming language in single-step mode. This is only necessary in program creation so that you can, for example, test programmed loops.You can set several breakpoints, depending on the CPU.
Breakpoint You can choose the breakpoint functions in the Program Editor by selecting theFunctions menu option "Test" or through the Breakpoint Bar.
Breakpoint Bar You can activate the breakpoint bar by selecting the menu options View -> Breakpoint Bar in the Program Editor.
Note In order to carry out these test functions, you must have fulfilled the following requirements:
• The "Test Operation" mode must have been assigned parameters.• The block to be tested must be opened online.
Attention! If a breakpoint is activated, the CPU stops at this statement. The outputs are deactivated for safety reasons.
Note This function is only possible as of a specific version of the CPU(e.g. CPU 314-1AE03).
!
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 16
Date: 05.12.2005File: PRO1_09E.16
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Break-point
Breakpoints (Part 2)
Next state-ment
Breakpoint BarSet/Delete Breakpoint Breakpoints Active
Show Next Breakpoint
Execute Call
Delete All Breakpoints Resume Next Statement
Set/Delete Breakpoint With “Set/Delete Breakpoint" you determine where the program execution is to be halted. The breakpoint‘s statement is not executed.
Breakpoints Active With “Breakpoints Active" you activate all breakpoints; not only those already set but also those still to be set.
Show Next With “Show Next Breakpoint“, the Editor jumps to the next selected breakpoint,Breakpoint without executing the program.
Resume With “Resume“, the program runs until the next active breakpoint.
Next Statement With "Next Statement“, you execute the program in single-step. If you reach a block call, you jump to the first statement after the block call with "Next Statement".
Execute Call Here, when you reach a block call you branch into the block with “Execute Call". At the end of the block you jump back to the next statement after the block call.
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 17
Goal You have already worked with the conveyor model. Now you are to check all the sensors and actuators on the conveyor model.
What to Do • In the S7 program "My Program“ insert a variable table VAT 1. • Enter the addresses that you see in the slide above into the table. The
symbols are only for orientation and are not displayed for you, since you have not as yet created a symbol table for this S7 program.
Note: to save typing, you can use the menu options Insert -> Block, to enter eight lines for e.g. the inputs I 8.0 to I 8.7 in the table.• Save the variable table.• Establish a connection to the CPU.• As the trigger point for monitor and modify select “Start of cycle" and as the
trigger frequncy select “Every cycle".• Activate the “Monitor Variable“ function.• Check all the sensors on the conveyor model.• Exit the monitor function.• With the outputs, enter "1" one after the other in the Modify Value column.
Activate the “Modify“ function. Now you have checked all actuators on the conveyor model.
Result You now know if your conveyor model is fully functional. If it is not, please let your instructor know.
Date: 05.12.2005File: PRO1_09E.17
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Monitoring and Modifying Variables
32 channel Training Unit
16 channel Training Unit
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 18
Date: 05.12.2005File: PRO1_09E.18
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Modifying Variables in the Stop Mode
Goal The CPU has gone into the Stop mode because of a fault. Now, your system is to be transitioned into a defined state. You are to move the conveyor model up to the light barrier by using the modify function while in the Stop mode.
What to Do • Switch the CPU to STOP.• In the variable table VAT 1, enter a new line with the address PQB 20
(PQB 8).• Switch the Monitor Format to "BIN".• Enter "00100000" as the Modify Value for the new address.• Use the menu options Variable -> Enable Peripheral Outputs.• Trigger the monitoring function by using the menu options Variable ->
Activate Modify Values.• Move the conveyor model to the right until the bottle reaches the light barrier.• When the light barrier is reached press the "Esc" button to end the modifying of the conveyor model.
Result You can carry out the modify function in the Stop state.
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 19
Date: 05.12.2005File: PRO1_09E.19
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Using Trigger Points for the Modify Variables Function
(Q 4.6)
Additional network in OB 1 of the S7 program "My Program"
(Q 4.6)
Goal You are to understand the meanings of the trigger points while using Modify Variables.
What to Do • Enter a new network in OB 1 of the S7 program "My Program" (see slide).• Transfer all blocks from the S7 program "My Program".• Switch the CPU to RUN, if it is still in the STOP mode from the last exercise.• In the variable table VAT 1, enter the additional address Q 8.6 (Q 4.6).• Set the Modify Trigger Point as shown in the slide.• Try to modify the output to "0".• If this is not possible, try it with another trigger point.
Result You now know how the trigger points operate with the Modify Variable function.
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 20
Date: 05.12.2005File: PRO1_09E.20
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Forcing
Goal Sensor signals have failed in the system. You are to simulate these using the "Force" test function.
What to Do • In the “Monitor and Modify Variable" tool select the menu options Variable -> Display Force Values.
• In the "Force Values" window, enter the addresses I 0.0 to I 0.2 with the force values (see slide).• Trigger the force function by selecting the menu options Variable -> Force.• Close the "Force Values“ window.• Determine how the CPU behaves.
Result The force values are now assigned to the input signals.
Training Centerfor Automation and Drives
ST-7PRO1Test FunctionsPage 21
Date: 05.12.2005File: PRO1_09E.21
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Combining Program Status and Monitor Variable
Goal You are to carry out several test functions at the same time.
What to Do • In one window, open the “Monitor and Modify Variable" tool and in another window open the LAD/STL/FBD Editor (with an open FC 1 block, S7 program "My Program").
• Arrange the two windows so that they are both visible at the same time.• In the “Monitor and Modify Variable" window add the addresses I 0.0 to I0.2.• Activate the Monitor Variable function.• In the “LAD/STL/FBD Editor" window activate the program status.• Determine what effect the "Force" test function has on the program in the
FC 1 block.• Cancel the force task by selecting the menu options Variable -> Display Force Values and then Variable -> Stop Forcing.
Result You have now become familiar with working with several windows. This could be helpful in troubleshooting.
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 1
Contents Page
Storage Areas for Data …………...................................................................................................... 2Data Blocks (DBs) ….......................................................................................................................... 3Overview of Data Types in STEP 7 ................................................................................................. 4Elementary Data Types in STEP 7 .................................................................................................... 5Complex Data Types ………........................................................................................................... 6Example of a Structure ...................................................................................................................... 7Example of an Array .......................................................................................................................... 8Creating a New Data Block ............................................................................................................ 9Entering, Saving, Downloading and Monitoring a Data Block ............................................................ 10Addressing Data Elements …......................................................................................................... 11Accessing Data Elements ............................................................................................................. 12Validity of an Open DB ……............................................................................................................. 13User-Defined Data Type (UDT) …..................................................................................................... 14Entering a UDT Block ..................................................................................................................... 15Creating a Data Block Referencing a Data Type ............................................................................ 16Example: Array from UDTs .............................................................................................................. 17Exercise: Program for a Bottling Plant - Data Storage ……............................................................ 18
Date: 05.12.2005File: PRO1_10E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Data Storage in Data Blocks
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 2
Overview Apart from program blocks, a user program also consists of data containing information about process states, signals, etc., which are then processed according to the instructions in the user program.Data is stored in variables of the user program, which are uniquely identified by:• Storage location (address: e.g. P, PII, PIQ, bit memory, L stack, DB)• Data type (elementary or complex data type, parameter type) Depending on the accessibility, a distinction is also made between:• Global variables, which are declared in the global symbol table or in global
data blocks• Local variables, which are declared in the declaration part of OBs, FBs and
FCs.Variables can have a permanent storage location in the process image, bit memory area or in a data block or they can be created dynamically in the L stack when a block is being executed.
Local Data Stack The local data stack (L stack) is an area for storing:• temporary variables of a logic block, including OB start information• actual parameters to be passed when calling functions• intermediate logic results in LAD programsThis topic is dealt with in the chapter "Functions and Function Blocks".
Data Blocks Data blocks are blocks used by the logic blocks of the user program for storing values. Unlike the temporary data, the data in data blocks is not overwritten when execution of the logic block is completed or when the DB is closed.
Date: 05.12.2005File: PRO1_10E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Bit memories
PIQ
PII
Storage Areas for Data
Data blocks
DBx
DBy
DBz
. . .
I/O area
L stack
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 3
Overview Data blocks are used for storing user data. Like the logic blocks, data blocks take up space in the user memory. The data blocks contain variable data (e.g. numeric values) that is used in the user program.The user program can access the data in a data block with bit, byte, word ordoubleword operations. Symbolic or absolute addresses can be used.
Uses You can use data blocks in different ways, depending on their contents. You differentiate between:• Global data blocks: These contain information that can be accessed by all
the logic blocks in the user program.• Instance data blocks: These are always assigned to a particular FB. The
data in each DB should only be used by the assigned FB.Instance data blocks are dealt with in more detail in the chapter "Functions and
Function Blocks“.
Creating DBs You can create global DBs either using the Program Editor or with a “user-defined data type" that you have already created.Instance data blocks are created when an FB block is called.
Registers The CPU has two data block registers, the DB and DI registers. Thus, you can have two data blocks open at the same time.You will find further information in an advanced programming course.
Date: 05.12.2005File: PRO1_10E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Data Blocks (DBs)
FunctionFC10
FunctionFC20
FunctionblockFB1
OB1Global data
DB20
Accessible to all blocks
Instance data
DB5
Instance DB for FB1
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 4
Overview Data types determine the properties of data, i.e. the way the contents of one or more associated addresses are to be represented and the permissible range of values.The data type also determines which operations can be used.
Elementary Elementary data types are predefined in accordance with IEC 1131-3. The dataData Types type determines the amount of memory space required. For example, the Word data
type takes up 16 bits in the user memory. Elementary data types are never more than 32 bits long and can be loaded into the accumulators of the S7 processor in full and processed with elementary STEP 7 instructions.
Complex Complex data types can only be used in conjunction with variables declared inData Types global data blocks. Complex data types cannot be completely loaded into the
accumulators with load instructions. You use standard blocks from the library ("IEC" S7 Program) to process complex data types.
User-Defined A user-defined data type can be used for data blocks or as a data type in a Data Types variable declaration table.
You create UDTs with the Data Block Editor.The structure of a UDT can contain groups of elementary and/or complex data types.
Date: 05.12.2005File: PRO1_10E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Overview of Data Types in STEP 7
Elementarydata types(up to 32 bits)
Complexdata types(longer than 32 bits)
User-defined data types(longer than 32 bits)
• Bit data types (BOOL, BYTE, WORD, DWORD, CHAR)
• Mathematical data types (INT, DINT, REAL)
• Time types (S5TIME, TIME, DATE, TIME_OF_DAY)
• Time (DATE_AND_TIME)
• Array (ARRAY)
• Structure (STRUCT)
• Character chain (STRING)
Data type UDT (User Defined Type)
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 5
BOOL, BYTE, WORD Variables of the data type BOOL consist of one bit, variables of data typesDWORD, CHAR BYTE, WORD, DWORD are sequences of 8, 16 and 32 bits respectively. The individual
bits are not evaluted in these data types.Special forms of these data types are the BCD numbers and the count value used in conjunction with the count function, as well as the data type CHAR, which represents a character in ASCII code.
S5TIME Variables of the data type S5TIME are required for specifying timer values in timer functions (S5 Timer functions). You specify the time in hours, minutes, seconds ormilliseconds. You can enter the timer values with an underline (1h_4m) or without an underline (1h4m).Functions FC 33 and FC40 from the library convert S5TIME to TIME format and TIME to S5TIME format.
INT, DINT, REAL Variables of these data types represent numbers which can be used in mathematical operations.
TIME A variable of data type TIME takes up a doubleword. This variable is used, for example, for specifying timer values in IEC timer functions. The contents of the variable are interpreted as a DINT number in milliseconds and can be either positive or negative(e.g.: T#1s=L#1 000, T#24d20h31m23s647msw = L#214748647).
DATE A variable of data type DATE is stored in a word in the form of an unsigned integer. The contents of the variable represent the number of days since 01.01.1990 (e.g.: D#2168-12-31 = W#16#FF62).
TIME_OF_DAY A variable of data type TIME_OF_DAY takes up a doubleword. It contains the number of milliseconds since the beginning of the day (0:00 o‘clock) in the form of an unsigned integer. (e.g.: TOD#23:59:59.999 = DW#16#05265B77).
Date: 05.12.2005File: PRO1_10E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Elementary Data Types in STEP 7
BOOL 1 1 or 0BYTE 8 B#16#A9WORD 16 W#16#12AFDWORD 32 DW#16#ADAC1EF5CHAR 8 ' w '
S5TIME 16 S5T#5s_200ms
INT 16 123DINT 32 65539REAL 32 1.2 or 34.5E-12
TIME 32 T#2D_1H_3M_45S_12MSDATE 16 D#1993-01-20TIME_OF_DAY 32 TOD#12:23:45.12
Keyword Length (in bits) Example of a constant of this type
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 6
Complex Complex data types (arrays and structures) consist of groups of elementary or Data Types complex data types.
They enable you to create data types to suit your problem, with which you can structure large quantities of data and process it symbolically.Complex data types cannot be processed with STEP 7 instructions all at once (longer than 32 bits), but only one element at a time.Complex data types are predefined. The data type DATE_AND_TIME has a length of 64 bits. The lengths of the data types ARRAY, STRUCT and STRING are defined by the user.Variables of the complex data types can only be declared in global data blocks and as parameters or local variables of logic blocks.
User-Defined User-defined data types represent a self-defined structure. This is stored inData Type UDT blocks (UDT1 ... UDT65535) and can be used as a “template" in another
variable‘s data type.You can save typing time when inputting a data block if you require the same structure several times.Example: You require the same structure 10 times in a data block. First, you define the structure and save it as UDT 1, for example.In the DB, you define a variable "Addresses" as an array with 10 elements of the typeUDT1:
Addresses array[1..10]UDT 1
Thus, you have created 10 data ranges with the structure defined in UDT 1 without additional “typing".
Date: 05.12.2005File: PRO1_10E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Complex Data Types
Keyword Length (in bits) Example
DATE_AND_TIME 64 DT#97-09-24-12:14:55.0
STRING 8 * (number of ´This is a string´(character string with characters +2) ´SIEMENS´max. 254 characters)
ARRAY user-defined Measured values: ARRAY[1..20](Group of elements INT of the same data type)
STRUCT user-defined Motor: STRUCT(Group of elements Speed : INTof different data types) Current: REAL
END_STRUCT
UDT UDT as block UDT as array element(User Defined Data Type = user-defined“Template" consisting of STRUCT Drive: ARRAY[1..4]elementary or complex Speed : INT UDT1data types Current: REAL
END_STRUCT
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 7
Structure The slide shows an example of a structure with the name "Motor_data". The structure consists of several elements of different data types. The individual elements of a structure can be elementary or complex data types.The access to the individual elements of a structure contains the structure name. The program is thus easier to read.In order to be able to access the elements symbolically, the data block must be given a symbol name, for example, “Drive_1".Examples of accessing individual elements of a structure:
L “Drive_1".Motor_data.rated_current orL “Drive_1".Motor_data.operating_speed
“Drive_1" is the symbol name of the data block, that contains the structure. The structure name is given (separated by a dot) after the symbol name. An element name of the structure follows (separated by a dot) after the structure name.
Define Structure The keyword for a structure is "STRUCT". The end of a structure is indicated in DB by "END_STRUCT". A name is defined for the structure (in the example: "Motor_data").
Date: 05.12.2005File: PRO1_10E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Example of a Structure
Display in the Program Editor (Data block DB 1):
Operating Speed, data type Integer
Rated Current, data type Real
Startup Current, data type Real
Turning Direction, data type Bool
Structure with the name "Motor_data"(several elementswith different data types)
Motor_data
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 8
Date: 05.12.2005File: PRO1_10E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Example of an Array
1. Measuring_point, data type Real
2. Measuring_point, data type Real
3. Measuring_point, data type Real
10. Measuring_point, data type Real
Array with the name "Measuring_point"(several elementsof the same data type) •
••
Display in the Program Editor (Data block DB 2):
Measuring_point
Array An array consists of several elements of the same data type. In the slide above, you can see the array "Measuring_point" with 10 elements of the data type REAL.Later, various measured values are to be stored in this array.
Define Array in DB The keyword for an array is "ARRAY[n..m]". The first (n) and the last element (m) is specified in the square brackets. In the example, [1..10] means 10 elements, whereby the first element is addressed with the index [1] and the last with the index [10]. Instead of [1..10] you could, for example, define [0..9]. This only affects access to the elements.
Note To create an empty data block, you define an array with the data type you want.
Data View To see which values are stored in the individual elements, you select the menu optionsView -> Data View to switch to another display. In "Data View“, you will find the values stored presently in the column "Actual Value".
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 9
Program Editor You can open an existing data block or create a new one with the LAD/STL/FBD Editor.
"New" Dialog Box When you click the icon for "New“, the "New" dialog box is displayed. You select the project and the user program and then enter, for example, DB4 for "Object name" (Data Block or All Editable should be selected as the Object type). When you confirm your entries by clicking the "OK" button, the "New Data Block" dialog box appears.
"New Data Block" In this dialog box, you select the type of data block to be created:Dialog Box • Data Block (global data block)
• Data Block Referencing a User-Defined Data Type (creates a data block using the same structure as a UDT block)• Data Block Referencing a Function Block (creates an instance DB for an FB). This item is explained in more detail in the chapter "Functions and Function Blocks".
Date: 05.12.2005File: PRO1_10E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Creating a New Data Block
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 10
Entering Data You enter the individual data elements in the table. To do so, you select the first empty line in the "Name" column and enter the element‘s description. You can jump to the other columns - Type, Initial Value and Comment - by using the Tab key.
Columns The meanings of the columns are as follows:
• Address - is entered by the Program Editor when you save.It is the first byte address occupied by the variable in the
data block.• Name - symbolic name of the element.• Type - data type (you select this with the right mouse button).• Initial Value - is used for setting a default value for an element. If you do
not make an entry here, zero will be inserted as the initial value. • Comment - for documenting the data element (optional).
Save You save the data block on the hard disk of the programming device using the "Diskette" icon.
Download Just as the logic blocks, you also have to download the data blocks to the CPU.
Monitor To monitor the current values in the data block, you first of all have to switch to the "Data View" view. You can monitor the data block by using the "spectacles" icon in the toobar (permanent display of the actual values of the DB in the CPU).
Date: 05.12.2005File: PRO1_10E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Entering, Saving, Downloading and Monitoring a Data Block
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 11
Date: 05.12.2005File: PRO1_10E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Addressing Data Elements
078 Bits
Data Byte 0 DBB 0
Data Byte 1 DBW 0
Data Byte 8191
DBD 8188
DBW 8190DBB 8191
Data Byte 2 DBD 0
Data Byte 3
DBX 4.1
General You address the data elements of a data block byte-by-byte, just as you do bit memories.You can load and transfer data bytes, data words or data doublewords. When using data words, you specify the first byte address (e.g. L DBW 2) with the operation. Two bytes are loaded as of this address. With doublewords, 4 bytes are loaded as of the byte address that you enter.
Number, Length The number of data blocks depends on the CPU you use. The maximum block length is 8KByte for the S7-300 and 64KByte for theS7-400.
Note If you access non-existent data elements or data blocks, the CPU goes into the Stopmode, if you did not program an error OB.
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 12
Opening a DB The instruction “OPN DB..." opens a global data block. If a global DB was already open, it is automatically closed.If a symbol name (e.g: “Values") was defined for the DB, the data block can also be opened with the instruction OPN “Values" .
Accessing a DB The instructions for read (Load) or write (Transfer) access to a DB are shown in the slide.If the DB was already opened, the simple Load or Transfer instruction is enough.The combined instruction, for example, L DB19.DBW2 includes the DB you want. The instruction contains the opening of the data block.
Symbolic Access A symbolic access is only possible if the following requirements are fulfilled: 1. The DB was given a symbolic name in the symbol table.2. The individual data elements in the data block were given symbolic names with the LAD/STL/FBD Editor.Example: The instruction L “Values".Number opens the DB with the name‘Values' and loads the data element with the name ‘Number'.
Note As a rule, you should use the symbolic access of DBs. This has the following advantages:• the program is easier to read,• it guarantees that the correct DB is accessed,• it is easier to make corrections to the data structure in the DB later on.
With absolute accesses to the DB, you must manually correct all program locations with DB accesses. With symbolic accesses, it is easy to make adjustments using a source program.Working with Source Programs is dealt with in an advanced programming course.
Date: 05.12.2005File: PRO1_10E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Accessing Data Elements
0123456789
DB 19(Symbol name: Values)
Data bit 0.0 with theelement name "Start"
or A DB19.DBX0.0 or A “Values".Start
or L DB19.DBW2 or L “Values".Number
or L DB19.DBB5 or L “Values".Loop
TraditionalAccess
symbolic
Fully-qualified Access
1)
OPN DB19L DBW2
Number
OPN DB19A DBX 0.01)
OPN DB19L DBB5
Loop
absolute
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 13
Date: 05.12.2005File: PRO1_10E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Validity of an Open DB
OB 1
OPN DB 4L DBW2 DB 4
T DBW 2 DB 4
FC 1
DB 4
CALL FC 1
T DBW 4
DB 5OPN DB 5L DBB6
DB 5L DBW 0
T DBW 8
CALL FC 2
FC 2
DB 5
DB 6
OPN DB 6
L DBB6
DB 2T DB2.DBB 0
DB 2L DBW 4
L DBW 10 DB ??
FB 1
CALL FB1, DB1
???!
Introduction An open data block remains open until a new DB is opened or until a combined instruction (e.g. L DB4.DBW6) accesses another DB.
FC Block Calls If an OB block or an FC block is exited because another function is called, the current data block remains valid. When you return to the calling FC, the data block that was valid when you exited is reopened.
FB Block Calls A function block call is different. An instance DB is always assigned to an FB (more information in the chapter "Functions and Function Blocks"). With the call of a function block, the asssigned instance DB is automatically opened. When you return to the calling block, the previously opened global DB is no longer valid. This means that after FB calls, you must reopen the required global DB.
Note You can open a DB by using the relevant instruction e.g. OPN DB. You can also open the DB by passing parameters to parameter-assignable blocks. Thus, you can use "DB 4.DBW6", for example, as the actual parameter. In this case, DB 4 is opened.
Recommendation: If possible, use the fully-qualified access to data blocks.
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 14
Use User-defined data types are used for:• creating structured data blocks,• creating arrays, that contain the same structure several times,• creating local variables in FC, FB with a given structure (see the chapter
"Functions and Function Blocks").
The user-defined data types are stored as UDT blocks on the hard disk. They are used as “templates", to save you typing when you create a data block.
User-Defined User-defined data types are made up of elementary data types or other user-Data Type (UDT) defined data types.
These data types cannot be stored in the PLC.Example: Storing recipe data (see next pages).
Date: 05.12.2005File: PRO1_10E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Global DB (Example)UDT block as Template
User-Defined Data Type (UDT)
Flour
Milk
Eggs
Yeast
Sugar
Recipe 2
Flour
Milk
Eggs
Yeast
Sugar
Recipe3
Flour
Milk
Eggs
Yeast
Sugar
Flour
Milk
Eggs
Yeast
Sugar
DB created according to UDT
Recipe1
Flour
Milk
Eggs
Yeast
Sugar
Array with3 elementsof type UDT
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 15
Entering a Data Type You create a UDT in the LAD/STL/FBD Editor by selecting the menu options File - > New and the Object name UDT.. .You then enter the data structure you want.You must fill in the "Name" and "Type" columns, but you can leave the “Initial Value"and “Comment" columns blank.
Saving a Data Type Finally, you save the data structure (mouse click on the "Save“ icon).
Date: 05.12.2005File: PRO1_10E.15
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Entering a UDT Block
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 16
Creating a DB When you have defined a data type and saved it as a UDT block, you can create several data blocks with the same data structure.
What to DO 1. Select the menu options File - > New in the Program Editor.2. Select the project and user program and a DB.3. Activate the option "Data block referencing a user-defined data type".4. Select the UDT block you want in the “Reference" box.5. Save the data block.
Date: 05.12.2005File: PRO1_10E.16
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Creating a Data Block Referencing a Data Type
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 17
Example If you need the same structure several times in one data block, you can use a UDT as a data type, in an array, for example.If the data block DB11 was assigned the symbol name “Cake" in the symbol table, a symbolic access from the user program can appear as follows:
L "Cake".Recipe[2].Eggs
Load the “Number of Eggs" from the second recipe from the data block “Cake“.
Notes You have to switch to "Data View" to be able to change the amount of the ingredients. You can then overwrite the initial values in the "Actual Value“ column with the amounts you want.
To change the structure of a UDT block later on, you have to re-create the data blocks that contain UDTs. As well, all accesses to this data block must be updated. The easiest way to do this is by using a source program.
You can also give UDT blocks symbol names.
Date: 05.12.2005File: PRO1_10E.17
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Example: Array of UDTs
Declaration View
Data View
Training Centerfor Automation and Drives
ST-7PRO1Data Storage in Data BlocksPage 18
Goal In an earlier exercise, you stored the production data (full, empty and broken bottles) in memory words.These memory words are not retentive. The production data is lost if a complete restart is carried out. To prevent this from happening, you should store the production data in a data block.
What to Do 1. Create a data block DB 5 in the S7 program "FILL" containing the specified variables and the data type INT.
2. Change the FC 18 block in such a way, that the production data (full, empty and broken bottles) is stored in memory words in DB 5 instead.
3. Download the blocks and test your solution on the training unit.
Result It should work.
Date: 05.12.2005File: PRO1_10E.18
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Program for a Bottling Plant - Data Storage
Full bottles (MW102)
Empty bottles (MW 100)
"Broken" bottles (MW 104)
Data block DB5
Variable: full
Variable: empty
Variable: broken
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 1
Contents Page
Introduction .................................................................................................................................... 2Temporary Variables ........................................................................................................................ 3Local Data Stack Size …............................................................................................................... 4Byte Requirement of a Block in the Local Data Stack ................................................................. 5Total Occupation in the Local Data Stack ...................................................................................... 6Exercise: Use of Temporary Variables …………........................................................................... 7Example of a Message Display Indicating a Problem in the Process ............................................ 8Parameter-assignable Blocks ......................................................................................................... 9Declaration of the Formal Parameters ........................................................................................... 10Editing a Parameter-assignable Block ....................................................................................... 11Calling a Parameter-assignable Block ......................................................................................... 12Using the EN/ENO Parameters with Block Calls ……….............................................................. 13Exercise: Creating a Parameter-assignable FC Block ................................................................... 14Exercise: Calling a Parameter-assignable FC Block ...................................................................... 15Function Blocks (FBs) ................................................................................................................. 16Function Blocks for Message Display …….................................................................................. 17Generating Instance Data Blocks …............................................................................................ 18The Multiple Instance Model .......................................................................................................... 19Inserting/Deleting Block Parameters Later On ……………............................................................ 20Corrections when Calling Modified Blocks ……......................................................................... 21Exercise: Editing a Function Block ................................................................................................ 22Calling a Function Block and Testing It .......................................................................................... 23Converting an FC to an FB using a Source Program (1) .............................................................. 24Converting an FC to an FB using a Source Program (2) .............................................................. 25Exercise: Recognizing Types of Variables ................................................................................... 26Summary: Block Calls …………………....................................................................................... 27
Date: 05.12.2005File: PRO1_11E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Functions and Function Blocks
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 2
Date: 05.12.2005File: PRO1_11E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Introduction
Temporary Variables• are deleted after the associated block is executed
• temporary storage in L stack
• useable in OBs / FCs / FBs
Static Variables• are retained even afterthe block is executed
• permanent storage in DBs
• can only be used in FBs
Local Variables / Data(only valid in one block)
Global Variables / Data(valid in the entire program)
• PII / PIQ
• I/ O
• M / T / C
• DB areas
symbolicabsolute
Access
General Up until now, the inputs and outputs in the bottling plant were addressed with their actual parameters. You could not assign parameters to the blocks.You would choose this procedure, for example, for the creation of a program that is only used once with a special machine.For frequently recurring functions in larger systems, you create universally useable, parameter-assignable blocks (FC, FB). These have formal input and output parameters, that are assigned actual parameters when the block is called. The adjustment of block functionality to the hardware takes place with the parameter assignment when the block is called; the “inner life" of the block does not change.
Local Variables Up until now you have used global variables (bit memories and data blocks) to store production data, for example. In this chapter you will find out more about data storage in local variables.
Temporary Variables Temporary variables are variables that are only stored while the block is being executed. They can be used in all blocks (OB, FC, FB).
Static Variables If the data are to be retained even after the block is executed, they must be stored instatic variables.Static variables can only be used in function blocks.
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 3
General Temporary variables can be used in all blocks (OB, FC, FB). They are used to temporarily store information while the block is being executed. The data are lost when the block is exited.The data are stored in the L stack (local data stack). It is a separate memory area in the CPU.
Declaration You define the variables in the declaration table of the block. In the line "temp" you enter a variable name and the associated data type.You cannot predefine a start value here.After you have saved the block, the memory location in the L stack is displayed in the "Address" column.
Access In Network 1, you see an example of the symbolic access to a temporary variable.The result of subtracting is stored in the temporary variable “result".You can also make an absolute access (T LW0). You should, however, try to avoid this since the program is difficult to read.
Note Variable names that begin with the special character # are local variables which# are only valid within the block in which they are declared in the declaration table.
The Program Editor automatically enters the special character.
Date: 05.12.2005File: PRO1_11E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Temporary Variables
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 4
Local Data Stack The local data stack (L stack) is a memory area that contains the temporary variables(replacement for scratchpad memories in SIMATIC S5) of the blocks.
Local Data Stack When the operating system calls an OB, an L stack area of 256 bytes is openedSize up while the OB and the blocks called in it are executed.
Every priority class is assigned 256 bytes. The L stack of the 313..316 CPUs has a total of 1536 bytes (1.5kByte).
Priority Classes There are a total of eight priority classes with the S7-300. However, no more than 6 priority classes can be active at the same time. If, for example, OB 100 is active (withpriority class 27), then OB1 (priority class 1) can never be active. Furthermore, the error OBs 80 to 87 for asynchronous errors can only then have priority class 28, if the fault occurs in the startup program. In other words, when they interrupt OB100. More information can be found in the chapter "Organization Blocks".
S7-400 With the S7-400 CPUs, you can decide what the size of the local data stack is for the individual priority classes (Tool: HW Config.). You can deselect the priority classes which you do not need. That way, you can make more local data available to the other priority classes.
Date: 05.12.2005File: PRO1_11E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Execution
Local Data Stack Size
For S7-300:
L stack sizePriority class
256 bytes1
27
Entire size:1.5 Kbyte
(CPU 313..316)
Entire size:1.5 Kbyte
(CPU 313..316)
Startup (one-time execution)
Cyclic execution
256 bytes
256 bytes
256 bytes12
3
2Time-controlledexecution
Time-of-Day Interrupt
Time-Delay Interrupt
Cyclic Interrupt
Error handling in scan cycle
256 bytes16
28
26256 bytes
Event-driven execution
Hardware Interrupt
Error handling in startup
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 5
Displaying the You can see the exact number of bytes a block requires in the local data stackByte Requirement by going into the block properties.
Activate 1. In the SIMATIC Manager, select the block with the right mouse button and then -> Object Properties. or
2. In the SIMATIC Manager, select the block with the left mouse button and then the menu options Edit -> Object Properties.
Notes The sum of local data for an execution level (OB) is a maximum of 256 bytes with the S7-300. Every OB itself always takes up 20 or 22 bytes.This means that a maximum of 234 bytes can be used in an FC or FB.
If more than 256 bytes of local data are defined in a block, the block cannot be downloaded into the CPU. The transmission is interrupted with an error message “The block could not be copied". Within this error message is a "Details" button. If you click on it, a message box appears with an explanation “Incorrect local data length".
Date: 05.12.2005File: PRO1_11E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Byte Requirement of a Block in the Local Data Stack
rechts
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 6
Total Occupation in You can display the number of bytes an entire program requires in the localLocal Data Stack data stack with the "Reference Data" tool. You will become familiar with this tool in the
chapter “Troubleshooting".The total occupation of the local data stack and the number of bytes required per call path is displayed on the screen.
Activate In the SIMATIC Manager you select the block folder and then the menu optionsReference Data Options -> Reference Data -> Display.
Note If the maximum number of local data is exceeded during program execution in the CPU, the CPU goes into the Stop mode. “STOP caused by error when allocating local data" is entered as the cause of error in the diagnostics buffer.
Date: 05.12.2005File: PRO1_11E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
256
Byt
es
Event
Occupation in the L stack
1
OB1
OB 1
1
Operatingsystem
Total Occupation in the Local Data Stack
FC 2
with temp.variables
OB1
FC2
FC1
3
3
OB1
FC1
4
4
OB1
FC1
6
6
FC 3
with temp.variables
OB1
FC3
FC1
5
5
FC 1
with temp.variables
2
OB1
FC1
2
7
OB1
7
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 7
Date: 05.12.2005File: PRO1_11E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Use of Temporary Variables
Replace by the temporary variable
"Packages"
Goal You are not to use any bit memories as temporary storage in the FC 19 block of the S7 program "Fill". These are to be replaced by a temporary variable “Packages".If you wrote a program for the block in LAD or FBD, the bit memories were necessary to connect the output of the divider with the input of the code converter. Even if you wrote a program for the block in STL (where no bit memories are necessary) insert the temporary variable “Packages" for storing.
What to Do • Open the FC 19 block in the S7 program "FILL" . • Define a temporary variable with the name “Packages" and the data type
"Integer“ in the declaration table.• Store the number of packages in the temporary variable.• Download the changed program and test it.
Result You now know the use of temporary variables.
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 8
Description Problems (disturbances) that occur are to be displayed by an LED on the operator console. When the problem (I1.3) occurs, the LED (Q8.3 or Q4.3) is to flash with 2Hz. The problem is detected at the acknowledge input I 1.2. If the problem is corrected, the LED stops flashing. If the problem continues, the LED switches to a steady light until the problem is corrected.
Program So that even problems that only exist for a short time are not lost, a dominant set flip flop (M40.0) is used. An RLO edge detection of the message signal is also carried out, since the memory is otherwise immediately reset when an existing problem is acknowledged. If the report memory is set (message has not yet been acknowledged), the upper AND logic operation causes the LED to flash. With this, the bit memory M10.3, that was defined as a clock memory when parameter assignment was made in the CPU, is gated. The lower AND logic operation is used to cause a steady light for a problem that is acknowledged but still exists.
Date: 05.12.2005File: PRO1_11E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Example of a Message Display Indicating a Problem in the Process
Disturbance
LED
Acknowledge
Report Memory
Edge Mem. Bit
Disturb. Input
Acknowl.
Flash Freq.
Disturb. Input
Display
RS
&
=
>=1&QS
RP
Report Memory
Report Memory
Solution Suggestion
Task
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 9
Introduction You can use parameter-assignable blocks for frequently recurring program sections. This has the following advantages:• the program only has to be created once• the block is only stored in the user memory once and you can call it as often
as you like • the block can be programmed with formal parameters (input, output or in/out
parameters) and only when the block is called is it given the “real“ addresses(actual parameters).
Example When the block is executed, the statement “A Disturbance input" is checked to see which actual parameters are assigned to the formal parameter “Disturbance input". If, when the block is called, I 1.4 is lined up as the actual parameter, then the statement “A I 1.4" is carried out.
FC / FB Parameter-assignable blocks can either be FCs or FBs.
Parameter- In the example, the message display is required ten times in the system. assignable FC20 It is created as a parameter-assignable FC 20 block and is then called ten times with
different actual parameters.
Date: 05.12.2005File: PRO1_11E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Disturb.input
Reportmemory
Acknowledge
Edge mem.bitDisplay
Flash freq.
FC 20
Call
Parameter-Assignable Blocks
A I 1.2
R M 40.0
A I 1.3
FP M 40.1
S M 40.0
A M 40.0
A M 10.3
O
ANM 40.0
A I 1.3
= Q 8.3
Non-parameter-assignable block
Formal parameters
M 40.0
M 40.1I 1.3
I 1.2 A 8.3M 10.3
Actual parameters
A #Acknowledge
R #Report Memory
U #Disturb. input
FP #Edge mem. bit
S #Report memory
A #Report memory
A #Flashing freq.
O
AN #Reportmemory
A #Disturb. input
= #Display
Parameter-assignable block
Program
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 10
Date: 05.12.2005File: PRO1_11E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Declaration of the Formal Parameters
Use Graphic Display
Read only To the left of the blockWrite only To the right of the block
Type of parameter
Input parameterOutput parameterIn/out parameter
Declaration
inoutIn_out Read / write To the left of the block
Formal parameters
Declaration table of the FC 20 block
Formal Addresses Before you can create the program for the parameter-assignable block, you have to define the formal parameters in the declaration table.
Type of Parameter In the table in the slide, you can see three possible types of parameters and their uses. Please make sure that when you have a reading and writing access to a formal address that you use an in/out parameter.
Example of the FC20 In the lower section of the slide, you can see the declaration table for the message display (see previous page). Since the report memory is to be accessed reading (set/reset) as well as writing (query), it has to be defined as an in/out parameter.
Notes There is only one row for every type of parameter in the declaration table. Should you need several input parameters, you have to use the "Return" key when you end your inputs in the first row. An additional row for this type of parameter is then opened up. After you have selected a declaration row, you can also use the menu options Insert -> Declaration Row -> Before Selection / After Selection to insert an additional row.
Attention! If you want to insert or delete declaration rows later - after the block has already been called - , you have to update the block calls !
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 11
Date: 05.12.2005File: PRO1_11E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Editing a Parameter-assignable Block
Here was, e.g., with a non-parameter-assignable FC:• with absolute addressing: I1.3• with symbolic addressing: “End_left"
Notes It doesn‘t matter whether the names of the formal parameters are written with capital or small letters. The "#" character in front of the name is automatically inserted by the PG. This is to indicate to you that it is a local variable that was defined in the variable declaration table of this block.
It is possible, that when you write the program in LAD / FBD, that the name is not completely displayed in one row. This depends on how you customized the settings in the Program Editor (Options -> Customize -> "LAD/FBD" tab -> Width of address field).
Symbols 1. If you use a symbolic name when you edit a block, the Editor searches the variable declaration table. If it is there, the symbol with the # in front of it is accepted in the program as a local variable.
2. If it cannot be found as a local variable, the Editor searches the symbol tablefor global symbols.If it is found there, the symbol is placed in quotation marks and is accepted in the program.
3. If you specified the same symbolic name as global (in the symbol table) as well as local (in the variable declaration table), the Editor will always insert the
local variable.If, however, you want to work with the global symbol, you must place the symbol name in quotation marks when you make the entry.
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 12
Date: 05.12.2005File: PRO1_11E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Calling a Parameter-assignable Block
Network 3: First Call
Network 4: Second Call
Disturb.input
Acknowledge
Flash freq.
Report memory
Edge mem. bit
Display
M40.1
“Positionerror"
ENO
EN
“End left"
....
“Acknow.button"
M10.3
M40.0
FC20
Disturb.input
Acknowledge
Flash freq.
Report memory
Edge mem. bit
Display
M40.3
Q9.4
ENO
EN
“End right"
A8.1
“Acknow.button"
M10.3
M40.2
FC20
symbolic
absolute
Addressing
Symbols Local Symbols --> Formal parameters
Symbol-table
Global Symbols
Call In LAD/FBD, you can select the call from the "Program Elements" browser. Question marks (??.?) are displayed at the input, output and in/out parameters of the block. Here you insert the actual parameters you want.
Note When you call a parameter-assignable FC block, you must assign all block parameters(with the exception of EN and ENO).
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 13
Standard FCs The following rules exist for the execution of standard FCs:• If EN=0, the block is not executed and ENO is also =0. • If EN=1, the block is exeucted and if it is executed without errors ENO is also
=1.If an error occurs while the block is being executed, ENO becomes =0.
User FCs It doesn‘t matter whether a user block was written in LAD, FBD or STL, when it is called in LAD/FBD, the parameters EN and ENO are added as well. Thus it is possible to pass on the RLO.EN/ENO do not exist in STL. You can, however, emulate them.You must program -irregardless of the programming language- an error evaluation.
Interconnection In LAD/FBD, several boxes can be grouped together one after the other and linked logically with EN / ENO.
Date: 05.12.2005File: PRO1_11E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
LAD/FBD STL
Using the EN/ENO Parameters with Block Calls
CALL FC 1 NOP 0
Example
?? . ?
FC 1
EN ENO
FC 2
EN ENO
FC 3
EN ENO =
FC 1
EN ENO?? . ?Unconditional call
A I 0.1 JNB _001 CALL FC 1
_001: A BR = Q 9.0
FC 1EN ENOI 0.1 =
Q 9.0
Conditional call
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 14
Task Write the program for a message display as a parameter-assignable block. In the slide you can see the declaration table with the input and output parameters and the beginning of the program.
What to Do • Insert an FC 20 block in the S7 program "My Program" .• Write the program in FC 20.• Save FC 20.
Date: 05.12.2005File: PRO1_11E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Declaration table of the FC 20 block
Exercise: Creating a Parameter-assignable FC Block
Non-parameter-assignable block
Parameter-assign-able FC 20 block
A I 1.2R M 40.0A I 1.3FP M 40.1S M 40.0A M 40.0A M 10.3OAN M 40.0A I 1.3= Q 9.3(Q5.3)
A #AcknowledgeR #Report memoryA #Disturb. ...::::::::
2.
1.
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 15
Task Call FC 20 in OB 1 twice (with different absolute addresses). Test the functionality of the program.
What to Do • Insert two networks into the OB 1 from the S7 program "My Program".• Create the two calls to FC 20, as given in the slide,• Download the FC20 and OB 1 blocks,• Test the function.Note: During HW Config, you used MB10 for parameter-assignment of the clock memory byte. If you have performed a memory reset in the meantime, you must download the HW configuration once again to cause the M10.3 to flash.
Date: 05.12.2005File: PRO1_11E.15
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Calling a Parameter-assignable FC Block
Disturb. input
Report memory
AcknowledgeEdge mem. bit
Display
Flash freq.Parameter-assignment of FC20 in the 1st. call
M 40.0
M 40.1I 1.3I 1.2 Q 9.3 (Q 5.3)M 10.3
FC 20
Disturb. input
Report memory
AcknowledgeEdge mem. bit
Display
Flash freq.M 40.2
M 40.3I 1.4I 1.2 Q 9.4 (Q 5.4)M 10.3
FC 20
Parameter-assignment of FC20 in the 2nd. call
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 16
Special Features Unlike functions (FCs), function blocks (FBs) have a (recall) memory. Thatof FBs means that a local data block is assigned to the function block, the so-called instance
data block. When you call an FB, you also have to specify the number of the instance DB, which is automatically opened. An instance DB is used to save static variables. These local variables can only be used in the FB, in whose declaration table they are declared. When the block is exited, they are retained.
Parameters When the function block is called, the values of the actual parameter are stored in the instance data block. If no actual parameters are assigned to a formal parameter in a block call, then the last value stored in the instance DB for this parameter is used in the program execution.You can specify different actual parameters with every FB call. When the function block is exited, the data in the data block is retained.
FB Advantages • When you write a program for an FC, you must search for empty bit memory address areas or data areas and you must maintain them yourself. The static variables of an FB, on the other hand, are maintained by the STEP 7 software.
• When you use static variables you avoid the risk of assigning bit memory address areas or data areas twice.
• Instead of the formal parameters “Report memory" and “Edge memory marker" of the FC20, you use the static variables “Report memory" and “Edge memory marker" in the FB. This makes the block call simpler since the two formal parameters are dropped.
Date: 05.12.2005File: PRO1_11E.16
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Function Blocks (FBs)
FB 2EN
Disturb. input
Acknowledge Display
Flash freq. ENO
DB 2
OB 1
Declaration table of the function block
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 17
Message Display In an earlier exercise you created a parameter-assignable FC 20 block fordisplaying a message (indicating a problem). Instead of bit memories, that were used in the FC20 to save the message signal and its RLO edge detection, you can use so-called static variables in an FB. They are stored in the instance DB referencing the FB.
Instance DB When a DB is generated and references an FB, STEP7 creates the dataStructure structure of the data block using the structure specified in the local declaration table for
the function block. After you save the DB, the data block is created and can then be used as an instance DB.
Date: 05.12.2005File: PRO1_11E.17
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Function Block for Message Display
Declaration table of the functionblock
Instancedata block
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 18
Generating an There are two ways of generating a new instance DB: Instance DB • When you call an FB, you specify with which instance DB the FB is to work. The
following message then pops up:"Instance data block DB x does not exist. Do you want to generate it?".
• When you create a new DB, you select the option "Data block referencing a function block".
Notes One instance DB can only reference one FB. However, one FB can be referenced by a different instance DB every time it is called.If you modify the FB (by adding parameters or static variables), you must then also generate the instance DB again.
Date: 05.12.2005File: PRO1_11E.18
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Generating Instance Data Blocks
1. Generate instance DB with FB call 2. Create new instance DB
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 19
Multiple Instance Up until now, you had to use a different instance data block for every call of a Model function block. The number of data blocks is limited however, and for that reason there
is a method that allows you to use a common instance DB for several FB calls.
The multiple instance model now enables you to use a single DB for several calls. To do this, you need an additional FB to manage these instances. For every FB call (FB 20), you define a static variable in the higher-level FB (FB 100). With the block call Call Dist_1, you do not then have to specify an instance DB.
The higher-level FB (FB 100) is called, for example, in OB1, the common instance DB(DB 100) is only generated once.
Note Multiple instances are discussed in an advanced programming course.
Date: 05.12.2005File: PRO1_11E.19
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
The Multiple Instance Model
DB10
The Instance Model
FB20
OB 1
Call FB20, DB10Disturb._Input:=Acknowledge:=Flash_Freq:=Display:=
DB11
FB20
Call FB20, DB11Disturb._Input:=Acknowledge:=Flash_Freq:=Display:=
DB12
FB20
Call FB20, DB12Disturb._Input:=Acknowledge:=Flash_Freq:=Display:=
The Multiple Instance Model
FB 100
DB100
Call FB100, DB100OB 1
stat Dist_1 FB20
stat Dist_2 FB20
Parameters andstatic variablesof the 2nd. call of FB20
Call Dist_2Disturb._Input:=Acknowledge:=Flash_Freq:=Display:=
Parameters andstatic variablesof the 1st. call of FB20
Call Dist_1Disturb._Input:=Acknowledge:=Flash_Freq:=Display:=
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 20
Date: 05.12.2005File: PRO1_11E.20
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Inserting/Deleting Block Parameters Later On
Save
The Problem When you add additional block parameters later on to a block already called in the program, you must also update the block call. Otherwise, the CPU would either go into Stop or the block function could not be guaranteed since the additional parameters still have to be supplied with actual parameters in the call.In the example, an additional input parameter “Check_lights" was inserted.
Updating the Call When you save the block in which the declaration table was modified, a message pops up warning you of possible problems.
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 21
Date: 05.12.2005File: PRO1_11E.21
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Corrections when Calling Modified Blocks
When the calling block is opened:
Once with the right
Updating the Call When the calling block is opened, the following message pops up“Time stamp conflict with at least one block call" and the call is displayed in red.With the right mouse button, click on the block call and select the menu option “Update Call". The block call is then redisplayed and contains, in our example, the additional input parameter “Check_light“. This parameter can then be assigned. In the case of function blocks, the instance DB is then regenerated.
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 22
Date: 05.12.2005File: PRO1_11E.22
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Editing a Function BlockDeclaration table of the FB 20 block1.
Program section of FB 20A #AcknowledgeR #Report memoryA #Disturb. ...::
2.
Task The program for displaying a message (indicating a problem) is now to be implemented in a function block. For saving the edge memory bit and the report memory you are to use static variables that are stored in the instance DB of the FB. That way, you do not require any bit memories for saving.In the slide you can see the declaration table with the input and output parameters and the beginning of the program.
What to Do • Insert an FB 20 block into the S7 program "My Program".• Write the program in the FB 20.• Save the FB 20.
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 23
What to Do In the S7 program "My Program":• delete both networks by calling the FC20.• write a program for the two calls to the FB 20, as given in the slide.• download the FB20, DB20, DB21 and OB 1 blocks.• test the functionality of the program.
FC -> FB In our example, FB20 was rewritten, even though an FC20 with the same contents already existed. It was not hard to do.If an FC with an extensive program is to be converted into an FB, you go about it differently:1st. possible solution:
• insert a new FB• copy the declaration table of the FC block into the FB and adjust it• copy the networks from the FC into the FB• save the FB.
2nd. possible solution:• generate a source file from the FC block• make the adjustments in the source file• generate a new FB from the source file (see next page).
Date: 05.12.2005File: PRO1_11E.23
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Calling a Function Block and Testing It
(Q 5.3)
(Q 5.3)
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 24
Introduction Just as with higher-level programming languages, you can also create blocks using a source program (text file). When you compile this source program, executable blocks are generated. By the same token, a source file can be generated from existing blocks.You are to make use of this to create, with the least amount of work (typing), an FB 20 from an FC 20 block.
What to Do 1. Open a block.2. In the LAD/STL/FBD Editor, choose the menu options Options ->
Customize, then the "Editor“ tab. In the “View" box select the option"Symbolic representation".
3. In the LAD/STL/FBD Editor select the menu options File -> Generate Source File...4. In the "New" window, you can enter a name of your choice for the source file
to be generated in the "Object name" box.5. In the “Generate Source File" window that then appears, select the program
blocks that are to be compiled one after the other in the “Unselected Blocks“window.
6. Click "OK" to start the compilation of the blocks into source code.The compiled blocks are then found in the source file which you named previously, in the “Source Files" folder of the S7 program.
Date: 05.12.2005File: PRO1_11E.24
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Converting an FC to an FB using a Source Program (1)
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 25
Sources, What For? • for automatic rewiring using symbols
• for assigning block attributes, for example, block protection
• as data protection of the entire program
• more freedom in editing and processing blocks:- modifying block type- insert / delete network separations- merging program elements and comments into new blocks- creating program sources in other text editors (WORD, WordPad), without having to install STEP7 in the PC- complete symbolic programming without syntax check, etc.
Source Program In the left-hand section of the slide you can see the source program for the FC 20 block. On the right-hand side, the source file is displayed for the program as FB 20. Here, the associated keywords for a function block were entered. In addition to that, static variables for the report memory and the edge memory marker are defined.After a compilation run, an executable FB 20 exists once more.
Note If you do not know the key words, you can insert a block template using the menu options Insert -> Block Template -> FB.
The subject of “Source Files" is discussed in greater detail in an advanced programming course.
Date: 05.12.2005File: PRO1_11E.25
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Converting an FC Block to an FB using a Source Program (2)
::
::
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 26
Date: 05.12.2005File: PRO1_11E.26
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Recognizing Types of Variables
Absolute Symbolic Temporary Static ParameterL #Number_1
T #Max_value
T MW 40
Statement
L #Number_2
L #Intermediate_resultL “Number_1"
T #Number_2
Global Local
Goal You are to recognize the differences between the various types of variables.
What to Do In the table, mark the associated data type with an X.
Answer the following question:What is not correct in the statement T#Number_2 ?
.................................................................................
Result You can recognize and use the types of variables.
Training Centerfor Automation and Drives
ST-7PRO1Functions and Function BlocksPage 27
CALL The "CALL" instruction is used for calling program blocks (FC, FB, SFC, SFB), regardless of the RLO or any other conditions.If you call an FB or SFB with "CALL“, you must also specify the relevant instance DB.You can use either the absolute or the symbolic name for the program block. For example: "CALL FB2, DB2" or "CALL valve, level".The "CALL" operation saves the return address, deactivates dependence on the MCR and creates the local data area for the block to be called.
UC The "UC" instruction is an unconditional call of a block of the type FC or FB without parameter assignment."UC" is otherwise identical to "CALL".
CC The "CC" instruction calls a block of the type FC or FB without parameters if RLO=1."CC" is otherwise identical to "CALL".
Parameters Parameters declared in the declaration table are known as “formal parameters". The addresses or values specified in the call are referred to as “actual parameters".Static and temporary variables are not specified in the call.
Date: 05.12.2005File: PRO1_11E.27
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Summary: Block Calls
• CALL FC1• UC FC1• CC FC1
STL
LAD
FBDFC1
EN
ENO
FC1EN ENO
FC1
( CALL )
FB
W/o param., w/o inst. DB
• UC FB1• CC FB1
FB1EN
ENO
FB1EN ENO
CALL
With parameters
• CALL FC2Par1: ...Par2: ...Par3: ...
FC2EN ENO
Par3
Par1
Par2
FC2EN
ENO
Par1
Par2
Par3
With param., with inst.DB
• CALL FB2, DB3Par1: ...Par2: ...Par3: ...
FB2EN ENO
Par3
Par1
Par2
DB3
FB2EN
ENO
Par3
Par1
Par2
DB3
Without parametersLan-guage
FC
FC1
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 1
Contents Page
System Diagnostics - Overview ...................................................................................................... 2Searching for Errors, that Cause the CPU to go into Stop ............................................................. 3-13Logical Errors ................................................................................................................................. 14-27Sporadic Errors ........................................................................................................................... 28-38System Information ........................................................................................................................ 39-46
Date: 05.12.2005File: PRO1_12E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Troubleshooting
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 2
What is Diagnostics? Diagnostics is the integral detecting functions and recording functions of the CPU. The area in which the error information is recorded is called the diagnostic buffer. The size of this buffer depends on the type of CPU (e.g. CPU 314 = 100 messages).
What Happens, when When an error or an event, for example a change of operating mode, occurs, thean Error Occurs? following happens:
• A message stamped with the date and time is entered in the diagnostic buffer. The most recent message is stored at the beginning of the buffer. If the
memory is full, older entries are deleted.• Entry of the event in the system status list.• If necessary, the event activates a relevant error OB (Organization block).
Types of Errors With the help of the CPU diagnostics, the following types of errors can be identified:• System error in the CPU or error in a module• Program errors in the CPU.
Troubleshooting In troubleshooting, a distinction is made between the following error classes:• Errors, that cause the CPU to go into the Stop mode.
Troubleshooting with the "Module Information" tool.• Logical errors, that is, the CPU executes the program, but the function is not
fulfilled.Troubleshooting with the "Referece Data" and "Program Status" tools.
• Sporadic errors, that only occur in particular system states. These can either cause the CPU to go into Stop or occur as a logical error.
Troubleshooting with the "CPU Messages" tool or by creating "your own trigger point".
Date: 05.12.2005File: PRO1_12E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
System Diagnostics - Overview
PG 740
SIEMENS
CPU I/O-ModuleCPU diagnostics detectsa system error
CPU diagnostics detectsan error in the user program
ErrorOB
Diagnosticbuffer
CPUmessages
Diagnostics-capable moduledetects anerror andgenerates adiagnosticinterrupt
Diagnosticinterrupt
Systemstatus list
SFC
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 3
Date: 05.12.2005File: PRO1_12E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Searching for Errors, that Cause the CPU to Stop
CPU
Contents Page
Calling the "Module Information" Tool ……................................................................................... 4Module Information Tab: "Diagnostic Buffer" ................................................................................. 5Interpreting Error Messages .......................................................................................................... 6Opening a Block Containing an Error .............................................................................................. 7Diagnostics with I Stack, B Stack, L Stack ...................................................................................... 8B Stack ............................................................................................................................................. 9I Stack ............................................................................................................................................. 10L Stack ............................................................................................................................................. 11Exercise: Finding Stop Errors and Eliminating Them …................................................................. 12Exercise: Troubleshooting with I Stack, B Stack .............................................................................. 13
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 4
Introduction The information that you need for troubleshooting is stored in all tools in the functionPLC -> Module Information. You can open this function, for example, from the SIMATICManager or through the Program Editor.
SIMATIC Manager If the project structure is not available on the PG, you click on the "Accessible Nodes"icon and then on MPI=x (x = MPI address on the connected CPU).Now select the menu options PLC -> Module Information.If you have opened a project on the hard disk with the SIMATIC Manager, you can select the menu options PLC -> Module Information after you have chosen the S7 program.
Program Editor As soon as you open a block, the information function for troubleshooting appears.
Date: 05.12.2005File: PRO1_12E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Calling the "Module Information" Tool
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 5
Diagnostic Buffer The diagnostic buffer is is a FIFO buffer in a battery-backed memory area in the CPUthat cannot even be deleted by a memory reset. It contains all diagnostic events in the order in which they occurred. All events can be displayed on the programming device in plain text and in the sequence in which they occur.
Details on Event When you select an event, additional information is supplied in the "Details on Event" box: • Event ID and event number,• additional information, depending on the event, such as the address of the
instruction that caused the event,• etc.
Help on Event When you click on the box, help on the event selected in the list is opened.(Example: a programming error has occured, the relevant OB (OB121) is not loaded or activated, however.)
Open Block When you click on the box, the block in which the error occurred can be opened in the CPU. (in the above example: "FC number: 10").
Opening the Tool You open the diagnostic buffer by selecting the menu options PLC --> Module Information --> Diagnostic Buffer tab in the SIMATIC Manager or Program Editor.
Date: 05.12.2005File: PRO1_12E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Module Information Tab: "Diagnostic Buffer"
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 6
General The last entry appears at the top of the list. The time shows you which error messages belong together (event no. 1 and 2 in the slide).
Interpreting Errors In our example, a complete restart was performed before the error occurred (event no. 3 to 5). After the restart, the error occurred and caused entries no. 1 and 2.Event no. 1: The CPU went into Stop mode because no error OB was
programmed. The "Details on event" box shows the execution level (priority class), e.g. OB1 (cycle) and the location of the error in the program (FC 10, module address 24).
Event no. 2: The actual cause of the error appears here, e.g. BCD conversion error. The "Details on event" box shows that there is an incorrect
value in accumulator 1 and which error OB is responsible for it (OB 121).
Error OBs Type of error Example Error OB
Programming Error Called block not in the CPU OB 121
Access Error Direct access to module that is eitherfaulty or not present
OB 122
Time error Maximum scan cycle time exceeded OB 80
Power supply fault Backup battery failure OB 81
Diagnostic interrupt Wire break at input of diagnostics-capablemodule
OB 82
CPU hardware fault Incorrect signal level at the MPI interface OB 84 1)
Program execution error Error in updating the process image (modulefaulty)
OB 85
Rack failure Distributed rack or DP Slave failure OB 86
Communication error Incorrect frame ID OB 87
Date: 05.12.2005File: PRO1_12E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Interpreting Error Messages
1) only forS7-400
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 7
Opening a Block You can open the block containing the error directly by clicking the "Open Block"button. The block is opened online. In STL, the cursor is positioned in front of the instruction where the error occurred. In LAD/FBD, the network containing the error is displayed.
In our example, we tried to convert the value from the pushwheel buttons from BCD to Integer. An invalid BCD number was presumably in accumulator 1. In this case, reading out the I stack (see following pages) will help you to make a more exact error analysis.
The error occurred in FC 10, Network 3.
Date: 05.12.2005File: PRO1_12E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Opening a Block Containing an Error
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 8
Introduction To obtain additional information about the error location, you can read out the stack contents (I Stack, B Stack, L Stack). This enables you to determine, for example, which values were stored in the accumulators before the CPU went into the Stop state.
B Stack The B Stack contains a list of all blocks executed up to the transition to the Stop state.
I Stack The I Stack contains the data of the registers at the interrupt location, such as:
• contents of the accumulators and address registers• which data blocks are open• status word contents• program execution level (e.g. cycle)• interrupted block specifying the network and instruction number • next block to be executed
L Stack The L Stack contains the values of the temporary variables of the blocks. You need some experience to evaluate this data.
Date: 05.12.2005File: PRO1_12E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Diagnostics with I Stack, B Stack, L StackProgram structure Block containing error
Error location
You see the contents of the accumulators, registers, status wordetc. (up to time of interruption) in the I Stack.
You see the values of thetemporary variables up totime of interruption in the L Stack.
Error location
You see the blocks executed up to the errorin the B Stack.
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 9
Stacks In order to display the stack information, the CPU must have gone into the STOP mode:• because of a program error• because of a STOP instruction• on reaching a breakpoint.
B Stack The block stack (B Stack) is a graphic representation of the call hierarchy, that is, the sequence and nesting of the called blocks up to the interrupt location. The B Stack contains all interrupts through interrupt OBs and error OBs as well as the open DBs. You will find the direct cause of the STOP mode in the block that is displayed last.
In our example, you can see that the error occurred in the first call of the FC 10 block.
Open Block To open a block online, you select the block in the B Stack list and then click on the "Open Block" button. You can then edit this block. The cursor is located after the faulty instruction (at the beginning of the next instruction).
Date: 05.12.2005File: PRO1_12E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
B Stack
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 10
I Stack The interrupt stack (I Stack) always refers to an execution level. Before you can open the I Stack, the organization block concerned must be selected in the B Stack.
Register The contents of all relevant registers at the time of the interruption are displayed in the I Stack screen:• Accumulators
You can select the numbers format for displaying the accumulator contents in the "Display format" list.
• Address registerYou can select the numbers format for displaying the address register contents in the "Display format" list.
• Status wordBits 0 to 8 of the status word are displayed. They are identified with abbreviations according to their meaning.
Point of Interruption The "Point of Interruption" field gives you information about:• the interrupted block, with the option of opening it directly (the cursor is then
located directly in front of the faulty instruction),• the priority class of the OB, whose execution level was interrupted,• open data blocks with their number and size.
Error Example From our example, you can see that the hexadecimal number 0000 000F is stored in accumulator 1. This is not a valid BCD number and for this reason a conversion error occurred during the conversion from BCD to Integer (BTI instruction). This error can occur during the switching of the pushwheel button due to the mechanical contacts. To remedy this, confirm the input by pressing a momentary-contact switch before carrying out the conversion.
Date: 05.12.2005File: PRO1_12E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
I Stack
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 11
L Stack The current values of the temporary variables for blocks not ended at the time of interruption are contained in the L Stack.The local data displayed in the L Stack window refer to the block selected in the B Stack. The blocks not yet ended when the CPU switched to the STOP mode are listed in the block stack (B Stack).
Error Example In our example, the two temporary variables, variable1 and variable2 are defined in the FC 10 block.
The declaration table of the FC 10 block shows the relative address in the L Stack in the address column. The variable, variable1 is stored in byte 0 and 1 of the L Stack andthe variable, variable2 in byte 2 and 3.
Thus the variable variable1 contains the value 78H, which corresponds to the Integer number 120. The variable was described in the program with the instructions L 120, T variable1 .The variable, variable2 has the value 08H and this is the result of the last error-free conversion from BCD to Integer.
In the following picture, you can see the relevant program section of the FC 10 block:
Date: 05.12.2005File: PRO1_12E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
L Stack
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 12
Goal Troubleshooting a faulty program.
What to Do 1. Carry out a CPU memory reset.
2. Copy the S7 program "ERROR" from the project "ERROR_16" or"ERROR_32" into the HW station "My Station".
3. Download all the blocks from the S7 program "ERROR" from the project "My Project" into the CPU.
4. Perform a complete restart.5. Read out the diagnostic buffer by selecting PLC -> Module Information.
You must select the project "My Project" and the S7 program "ERROR", so that the correct comments are displayed.6. Determine the errors and eliminate them.
Result You are now familiar with the diagnostic facilities for troubleshooting. The CPU executes the program, but the function is not yet fulfilled. The logical errors are eliminated in a later exercise.
Date: 05.12.2005File: PRO1_12E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Finding Stop Errors and Eliminating Them
ResultWhat to DoStep
The CPU memory is reset.Carry out a CPU memory reset.1
Copy the S7 program"ERROR" from the project"ERROR _16" ("ERROR _32") into theHW-Station "My Station".
The project structure is displayed.2
The faulty program is downloaded.Download all the blocks from the S7 program "ERROR" into the CPU.3
The CPU goes into STOP mode.Perform a complete restart.4
The CPU remains in RUN.Find and eliminate the errors,that lead to the Stop state.5
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 13
Task You are to determine additional error information by reading out the Stacks.
What to Do Carry out the steps in the slide above and answer the following questions:
Date: 05.12.2005File: PRO1_12E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Troubleshooting with I Stack, B Stack
ResultWhat to DoStep
The CPU goes into STOP once more.Switch on the inputs I 1.0 to I 1.2 in sequence.1
Answer the questions in the tablebelow.
Clarify the cause of the error with thehelp of the diagnostic buffer and theStacks.
2
The CPU remains in RUN.Switch the inputs I 1.0 toI 1.2 off again.3
Error 1Questions Error 2 Error 3In which block and at whichinstruction did the erroroccur?
What is the cause of the error?
Which blocks were executedup to the error?
Which values were in the accumulators at the errorlocation?
Why did the error occur?
Which data blocks wereopen?
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 14
Contents Page
Displaying Reference Data ............................................................................................................... 15Filtering Reference Data ................................................................................................................... 16Cross References ............................................................................................................................ 17Filtering Cross References .............................................................................................................. 18Reference Data: Find ....................................................................................................................... 19Block Correction using Cross References ........................................................................................ 20Go to Location ………….................................................................................................................. 21Assignment of I,Q,M,T,C ................................................................................................................... 22Unused Symbols / Addresses without Symbols ….......................................................................... 23Program Structure ............................................................................................................................. 24Comparing Blocks (1) ......................................................................................................................... 25Comparing Blocks (2) ... .................................................................................................................. 26Exercise: Eliminating Logical Program Errors .................................................................................. 27
Date: 05.12.2005File: PRO1_12E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Logical Errors
??
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 15
Introduction For logical errors, you use the "Program Status" and "Reference Data" tools intensively. In the Program Status you have, for example, recognized that a bit memory is not fulfilled as a condition. Using the Reference Data, you can determine where this bit memory is created.A frequent cause of errors is the multiple assignment of addresses. This means that an address is assigned from several locations in the program. Such errors are easy to find when you use the "Reference Data" tool.
Reference Data The Display Reference Data is triggered in the SIMATIC Manager (with the "Blocks" folder opened offline) by selecting the menu options Options -> Reference Data -> Display or ->Filter…. .
Filter The reference data are displayed as filtered data (regardless of whether the item Display or Filter… was selected in the menu Options.The narrower you define the filter, the faster the reference data is displayed.When you open the Display Reference Data, a message pops up that filtered data will be displayed. For this reason, check how the filter is currently set.
Lists The Reference Data can be found in 6 different lists:
• Cross References• Assignment of I/Q/M• Assignment of T/C• (User) Program Structure• Unused Symbols• Addresses without Symbols
Date: 05.12.2005File: PRO1_12E.15
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Displaying Reference Data
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 16
Filter You can open the window for filtering the reference data two different ways:1. In the SIMATIC Manager by selecting the menu options Options ->
Reference Data -> Filter….2. In the SIMATIC Manager by selecting the menu options Options ->
Reference Data -> Display and in the "Display Reference Data" window selecting the menu options View -> Filter or by clicking on theFilter icon
"Customize" Window After you open the tool, the "Customize" window appears.In it, you can select which of the 6 reference data lists are to be opened first.
Date: 05.12.2005File: PRO1_12E.16
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Filtering Reference Data
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 17
Cross References You open the cross references in the "Display Reference Data" window by selecting the menu options View -> Cross References or by clicking on the relevant icon.The Cross References is a list of used addresses pertaining to a user program:
- inputs,- outputs,- bit memories,- counters,- timers, etc.(see next page)
Table The cross references list is structured as a table. It has the following columns:Column Contents / Meaning --------------------------------------------------------------------------------------------------------• Address absolute address of the operand(address)• Symbol symbolic name of the address• Block blocks in which the address is used• Type read-only (R) or write-only (W) access• Language programming language in which the block was created • Details instruction with which the address is addressed
Cross Reference When you select an address in the cross references list, you can open a newfor Address window by selecting the menu options View -> Cross Reference for Address. This
window contains only the cross references for the selected address.
Date: 05.12.2005File: PRO1_12E.17
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Cross References
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 18
Addresses You determine which type of address is to be listed by activating the appropriate checkbox.
Filter Area The filter area establishes the address area to be displayed. You can also enter several part areas. The filter area entry "10-50; 70; 100-130" means that the address 70 and the address areas from 10 to 50 and from 100 to 130 are to be displayed.
Access Type In the standard setting, all access types are displayed. You can also choose the option"Selected" and then select the access type, for example, W, write-only access, with the checkboxes.
Columns You determine the number and the contents of the columns for the tabular structure of the cross references list using check boxes.
Standard If the settings you have planned are to be accepted for the next start of the application "Display Reference Data", you must activate the checkbox "Save as standard".The basic setting or what you have saved as standard are reproduced using the "Default" button.
Date: 05.12.2005File: PRO1_12E.18
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Filtering Cross References
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 19
Find While reference data are displayed, you can start a search for a character string. The window can be found in one of the following views:• Cross References• Assignment• Unused Symbols• Addresses without Symbols.
Note The search is a pure text search, that is, the entries must be "exact - including every dot, dash and space". Additional settings are:• search for address, symbol, block or language,• the character string entered as search term is a whole word or part of a word,• capital/small letters are to be taken into account or ignored,• the search range and the direction of the search can be specified.
Date: 05.12.2005File: PRO1_12E.19
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Reference Data: Find
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 20
What to Do With a double-click on an address in the cross references list, you open the LAD/FBD/STL Editor and display the block where the selected address is used. The cursor is located in the network in which the address is used.
Note Please note that the reference data are only formed from the blocks in the offline data management. For that reason, modified blocks are always to be saved.
Date: 05.12.2005File: PRO1_12E.20
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Block Correction using Cross References
2x
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 21
Date: 05.12.2005File: PRO1_12E.21
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Go to Location
1xright
Introduction In troubleshooting, it is often only necessary to determine where one address is used or assigned in the program. In this case, it makes more sense to use the "Go to Location" function instead of the cross references list. The Go to Location is called directly from the Program Editor and gives you an excerpt from the cross references list for the specific address.
Handling Select an address in the Program Editor and click on it with the right mouse button. Then choose the menu option Go to Location. In the "Go to Location" window, all program locations are displayed where this address is used in the program. In the "Details" column, you can see whether the address is queried or assigned. In the example, the program location where the output Q 8.2 is set and reset is of interest. After selecting the relevant line, you can jump to this program location by selecting the "Go To" button. By selecting the "Starting Point" button, you return to the starting point.
Access Type By default, all accesses to the address are displayed. By selecting the "Selected"button, you can, for example, display write-only accesses (assignment, set, reset).With the "Overlapping access to memory areas" option, word-by-word accesses to the address are displayed as well, for example.
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 22
Assignment I/Q/M You open the Assignment of I/Q/M by selecting the menu options View -> Assignment -> Inputs, Outputs and Bit Memory or by clicking on the relevant icon.This assignment list gives you an overview of which bit is used in which byte of the memory areas input (I), output (Q) and bit memory (M). Every line contains a byte of the memory area, in which the eight bits are identified according to access. You can also see whether the access is byte-oriented, word-oriented or doubleword-oriented.Meanings of the IDs in the Assignment List I/Q/M:
• - the address is not addressed and therefore still free• o bit-oriented access• x byte-, word- or doubleword-oriented access
Assignment T/C You open the Assignment of T/C by selecting the menu options View -> Assignment -> Timers and Counter or by clicking on the relevant icon.This assignment list gives you an overview of which timers and counters are used in the program.Ten timers or counters are displayed in every line.
Filter By selecting "Filter", you can choose the memory areas to be listed and restrict the individual address areas.The same rules as for filtering in the Cross References list apply.
Date: 05.12.2005File: PRO1_12E.22
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Assignment of I,Q,M,T,C
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 23
Unused Symbols When you select the menu options View -> Unused Symbols or click on therelevant icon, a list of addresses appears. These addresses are defined in the symbol table but are not used in the S7 user program.
Addresses When you select the menu options View -> Addresses without Symbols or clickwithout Symbols on the relevant icon, a list of addresses appears. These addresses have been used in
the S7 user programm but are not defined in the symbol table.A line consists of the address and the number of times it was used.
Filter You use "Filter" to make selections of detailed information for the display of unused symbols (see slide).
Date: 05.12.2005File: PRO1_12E.23
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Unused Symbols / Addresses without Symbols
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 24
Program Structure The program structure describes the call hierarchy of the blocks in an S7 user program.
Filter Depending on the settings of the filter, the program paths are displayed in a Tree structure (see slide) or as "Parent/child structure" (in each case the calling and the called block are displayed).
Symbols The following symbols are only possible in the tree structure display:< maximum : nnn > • the maximum memory requirement (in bytes) of the local data is given in the root
of the tree structure.[ nnn ] • per path, the maximum memory requirement (in bytes) of the local data is
stated at the last block of every program path.
Date: 05.12.2005File: PRO1_12E.24
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Program Structure
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 25
Date: 05.12.2005File: PRO1_12E.25
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Comparing Blocks (1)
...see next page
Introduction You can compare blocks between online and offline data management or between two user programs on the hard disk of the PG.With this function, you can determine whether, for example, program corrections were made in the CPU later on and in which network the blocks differ.
What to Do • With the right mouse button, select the block folder of an S7 program.• Select the menu option Compare Blocks.• Choose whether you want to compare online/offline or between 2 offline
programs and acknowledge with the "OK" button.• In the follow-up screen, the blocks that differ are listed.• Select the line in which a difference was determined and then select the
"Details" button.• In the "Compare Blocks - Details" window you can ascertain when the block was modified and if the block length was changed.• After selecting the "Go To..." button, the differing block, for example, is
opened online and offline in two windows and the network, in which the first difference was determined is displayed.
Note: Program corrections can only be made in the offline window.
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 26
Date: 05.12.2005File: PRO1_12E.26
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Comparing Blocks (2)
Differences After selecting the "Go To..." button (see previous page), the Program Editor is opened with two windows side-by-side, in which the network with the first difference is displayed.
Example In the above example, M8.5 is used in the offline block and M8.6 is used in the online block as the auxiliary memory marker for the RLO edge detection of I 8.5. That means, that after the block was downloaded into the CPU, a correction was made either to the offline or to the online block.You can identify which of the two blocks was modified last by reading out the the time stamp in the "Compare Blocks - Results" screen (see previous page).
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 27
Date: 05.12.2005File: PRO1_12E.27
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Eliminating Logical Program Errors
• Can you select the "Manual" mode?
• Can the conveyor belt be traversed in jog mode?
• Switch on the Automatic mode !
• Does the bottle stop at the bottle sensor for filling?
• Is there a message when the minimum level was exceeded?
• Is the number of packaging units displayed on the digital display?
Goal So far you have corrected all the errors which caused the CPU to go into the Stop mode.Now you are to check the function of the bottling plant and eliminate any remaining logical errors. You are to use the checklist in the slide to do so.The functioning of the plant corresponds to the program which you yourself have created up until now.
What to Do Check the functions of the bottling plant according to the checklist and eliminate the remaining errors. Use the program for troubleshooting (Errors that lead to the Stop mode), which can still be found in the CPU and eliminate the errors.
Result The bottling plant is fully functional.
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 28
Contents Page
Displaying CPU Messages ............................................................................................................ 29Writing User Messages in the Diagnostics Buffer ......................................................................... 30Configuring Your Own Message Texts ............................................................................................ 31Calling the SFC 52 Block ................................................................................................................. 32Structure of the EVENTN Parameter of the SFC 52 Block .............................................................. 33Diagnostics-Capable Modules ......................................................................................................... 34Displaying the Hardware Diagnostics in the SIMATIC Manager .............................................. 35Exercise: Enabling Diagnostic Messages ........................................................................................ 36Exercise: Outputting User Messages ............................................................................................. 37Exercise: Enabling Diagnostic Interrupts and Simulating Hardware Faults .................................. 38
Date: 05.12.2005File: PRO1_12E.28
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Sporadic Errors
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 29
CPU Messages With this function you can immediately display an error message for sporadic errors in the system on a programming device or an HMI device. A message window pops up on the PG or OP as soon as the connected CPU goes into Stop because of an error (see bottom left of the slide).User messages can also be output with a system function.
Registered Modules The list contains all CPUs called in the SIMATIC Manager with the menu optionsPLC -> CPU Messages. The list is divided into four columns:1. In the first column, an icon displays whether a connection was interrupted by the external partner.2. In the column "W", system diagnostic and user diagnostic messages are
activated /deactivated.3. In the column "A", interrupt messages are activated / deactivated. The"CPU Messages" application checks if the module in question even supports diagnostic and interrupt messages. If this is not the case, a message is output.4. In the column "Module", the name of the module or the path of the S7 program is entered.
Incoming Messages • Top: As soon as a message is received, the "CPU Messages" window pops up on top, the message is displayed and at the same time it is entered in the message archive.
• Background: The receiving of the messages takes place in the background.Messages are displayed in the window, but the window remains in the background. The messages are archived and can be displayed as required.
• Ignore: Messages are neither displayed nor archived.
Archive You can modify the size of the archive (40 to 2000 messages) or empty the archive by selecting the "Archive" button.
Date: 05.12.2005File: PRO1_12E.29
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Displaying CPU Messages
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 30
Introduction The FC 52 system function permits you to write your own messages, for example, lower limit for hydraulic pressure violated, in the diagnostic buffer. Parallel to this, the message can also be displayed on the programming device or OP. The diagnostics messages must be enabled for this purpose.
Program The SFC 52 system function is called and assigned parameters in the user program. Certain standard texts are stored in the CPU. A parameter of SFC selects these texts. You will find more information in the Standard and System Functions manual, or in theOnline Help.
Example SFC 52 is called in the program example, if the analog value of peripheral input word352 exceeds the value of 2000 units. The message is output only once as a result of logic edge detection. The block is assigned parameters in such a way that a diagnosticmessage is also output on the PG (SEND = TRUE). The EVENTN parameter determines the text to be output.
L PIW 352 // Read in analog valueL 2000 // analog value >2000>IFP M 30.1 // RLO edge detectionJCN nonecall SFC 52 // User entry in the diagnostic buffer
SEND: TRUEEVENTN: W#16#9B83 // external, incoming, limit value exceededINFO1: MW 100 // Additional information 1INFO2: MD 102 // Additional information 2RETVAL: MW 31 // Return value with error information
none: BE
Date: 05.12.2005File: PRO1_12E.30
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Writing User Messages in the Diagnostic Buffer
SEND =TRUE
1 2
Send buffer
Diagnostic buffer
Sendingasynchronousto user program
Node
e.g. PG, OP
CPU
SFC 52
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 31
Date: 05.12.2005File: PRO1_12E.31
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Configuring Your Own Message Texts
Aufruf With the right mouse button, click on an S7 program and select the menu optionsSpecial Object Properties -> Message.
Configuring Message You begin with the "New Message" button. The next free message number, for example, A003 is suggested. In the "Text" tab, you can enter the message text for incoming and outgoing messages.You can change the message number in the "Identification" tab.
Wildcards Up to two wildcards can be inserted in the message text. These values are passed via the parameter "INFO1/INFO2" of the SFC 52.In the example, the value of INFO 2 is output as a real number.To insert a wildcard, you begin with the @ character. This is followed by 1 or 2, depending on whether you want to display the value from INFO1 or INFO2. The format declaration then follows with, for example, %e.
The following format declarations are possible:
• %ix hexadecimal number with i places• %iu unsigned decimal number with i places• %id signed decimal number with i places• %e normalized floating-point number, signed value of the form• %E normalized floating-point number, as for format %e, but an upper-case
letter stands before the exponent (E instead of e)
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 32
Date: 05.12.2005File: PRO1_12E.32
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Calling the SFC 52 Block
Network 2: User message when limit value exceeded
ENO
RET_VAL #error_sfc52
SFC 52
EN
SEND
EVENTN
INFO 1
INFO 2#analog value_normalized
#dummy
W#16#A901
M 0.1
M 0.1
P
#analog value_normalized
5.000000e+003
CMP>R
IN1
IN2
>=1
M 90.1
Introduction In the slide you can see a program example, in which a user message is entered in the diagnostic buffer and is displayed through the CPU messages.
Description The SFC 52 block is called conditionally through the input "EN" if the analog value exceeds the limit value of 5000.The "SEND" input has the signal state "1" and as a result, the message is sent to a PG logged-in with CPU Messages.At input "EVENTN" it was specified that the first message of group A is to be displayed as an incoming event.You can enter wildcards in the message text through the inputs "INFO1/INFO2". In the example, the analog value is to be displayed as well.The "RET_VAL" output delivers an error message if:• the message cannot be sent because no node is logged-in or the buffer is full, or• the SFC52 was assigned parameters with invalid values or formats in the call.
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 33
Date: 05.12.2005File: PRO1_12E.33
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Structure of the EVENTN Parameter of the SFC 52 Block
Event class
15 14 13 12EVENTN
1..9 are standard texts for the different events(see the Standard and System Functions manual)
A..B free texts, that are specified using Message Configuration
C..F reserved for expansions in the future
Event class
11 10 9 8
Identification
Specifies if it is an incoming or an outgoing event, or, an internalor an external event, for example:
Bit 8= "1" --> incoming messageBit 8= "0" --> outgoing messageBit 10= "1" --> internal faultBit 11= "1" --> external fault
Identification
7 6 5 4 3 2 1 0
Event number
Continuous message number from 1 to 255 within anevent classEvent number
General You can see the structure of the EVENTN parameter in the slide. It is an input parameter of the SFC 52 block, with which you specify which message text is to be entered in the diagnostic buffer.
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 34
General The signal modules also have modules with diagnostics capability. Errors on the module or external errors such as wirebreak, are identified and indicated by an "SF"LED on the module. In case of an error, the module triggers a diagnostic interrupt OB 82 on the CPU. You can refer to the technical data in the ST 70 catalog or the manuals to determine which modules have diagnostics capability.
Parameter To activate the diagnostics on a module, click on the box in front of DiagnosticAssignment Interrupt when assigning parameters and specify which channels are to be monitor.
Then the fields with the errors to be monitored, for example, wirebreak, are enabled. The slide shows the example of the diagnostics capable analog module 335, which is used in Version A of the training unit.
Diagnostic Interrupt If no OB 82 is present in the CPU, the CPU goes to the Stop state if there is a module error.The start information for OB 82 contains additional information about the error cause,which can be evaluated by the software (see Online help).
Date: 05.12.2005File: PRO1_12E.34
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Diagnostics-Capable Modules
Assigning parameters for a diagnostics-capable module:
... trigger a diagnosticsinterrupt OB 82when an error occurs
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 35
Introduction With this function, you obtain a quick overview of the state of the PLC system. If, for example, there is a hardware fault in a diagnostics-capable module, you can identify, through the use of a symbol, which module is faulty and where it is located. When you double-click on the faulty module, additional information is displayed.
Opening the Tool Select the menu options PLC -> Diagnose Hardware in the SIMATIC Manager or in the HW Config tool, by opening the station online with a click on the icon in the toolbar.
Description When you open the system diagnostics, the hardware configuration is read out from the CPU (see left-hand screenshot). In this view, all modules present (even those in expansion racks or distributed I/O) are displayed. If the CPU is in Stop mode or if there is a fault in a module, this is indicated with symbols.You can double-click the CPU or a faulty module to obtain further diagnostic information(see right-hand screenshot). In the example, there is a power failure in the analog module.
Note If you have selected the menu options Options -> Customize -> View in the SIMATIC Manager and activated (checked) the "Display Quick View when Diagnosing Hardware"checkbox, only a list of faulty modules will be displayed instead of the full "Diagnosing Hardware" window.
Date: 05.12.2005File: PRO1_12E.35
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Displaying Hardware Diagnostics in the SIMATIC Manager
2x
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 36
Goal When the CPU goes into STOP because of a sporadic error, a message is to appear immediately on the PG. You then have the chance to carry out an error analysis right away.
What to Do • Switch over to the SIMATIC Manager and choose the S7 program "MyProgram" from the "My Project" project and select the menu options PLC => CPU
Messages.• In the window that now appears "Customize - CPU Messages", activate the "W" option in front of the project.• Now, using the keyswitch, switch the CPU to STOP and monitor the reaction on the PG.
Result A screen pops up with the cause of the Stop.
Date: 05.12.2005File: PRO1_12E.36
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Enabling Diagnostic Messages
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 37
Goal A system is to be monitored as to whether and when manual operation was switched on. A message is to be entered in the diagnostics buffer for an edge at the "Manual" flip-flop.
What to Do • Use the reference list for the S7 program "FILL" to determine which output is used as the memory for the manual operating mode.• Insert a new network at the end of FC 15 (S7 program "FILL").• Create a program that enters a message in the diagnostics buffer when the
manual operating mode is switched on (RLO edge detection).The assignment of the SFC 52 system function is shown in the slide (with the
exception of the call condition).• Download the FC 15 to the CPU and test the program.
Result A message is entered in the diagnostic buffer when the manual operating mode is switched on. If the "CPU Messages" tool is still active, the user message is also displayed on the PG.
Date: 05.12.2005File: PRO1_12E.37
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Outputting User Messages
SFC 52
SEND
EVENTN
INFO1
INFO2
RET_VALTRUE
W#16#9101
MW 54
MD 56
MW 52
???*
*
* a contact must be connected to the EN for programming in LAD !
EN
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 38
Goal The diagnostics are to be activated at the analog module so that hardware faults, such as power supply failure, can be detected.
What to Do Carry out the steps given in the slide.
Result You obtain additional information about hardware faults through the "Diagnose Hardware" tool.
Date: 05.12.2005File: PRO1_12E.38
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Enabling Diagnostic Interrupts and Simulating HardwareFaults
Step What to Do Result
Enable the diagnostic interrupt at the analog module ! (HW Config.)1 The hardware diagnostic is activated
2 Download the configuration in the CPU
3 Remove the front connector on theanalog module !
The "SF" LED on the analog moduleindicates a hardware fault
4 The configuration is opened onlineActivate the "Diagnose Hardware"tool !
5 The message "Power supply failure" is given as the cause of the error
Clarify the cause of the error with the tool !
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 39
Contents Page
System Information - Overview ........................................................................................................ 40Module Information: "Memory" Tab …............................................................................................. 41Module Information: "Scan Cycle Time" Tab ..................................................................................... 42Module Information: "Time System" Tab ........................................................................................ 43Module Information: "Performance Data" Tab ................................................................................. 44Performance Data: Blocks .............................................................................................................. 45Exercise: Reading Out System Information ..................................................................................... 46
Date: 05.12.2005File: PRO1_12E.39
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
System Information
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 40
Module Information The display of system information is started in the SIMATIC Manager or in theLAD/STL/FBD Editor by selecting the menu options PLC -> Module Information... . Information about module information is summarized in the following tabs:• General• Diagnostic Buffer• Memory• Scan Cycle Time• Time System• Performance Data• Communication• Stacks
"General" Tab This tab gives you information about:• Module data (Version, Order No.)• Location• Module Status
Date: 05.12.2005File: PRO1_12E.40
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
System Information - Overview
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 41
Load Memory The load memory is integrated in the CPU (RAM). The usage is displayed in the left bar graph.If a memory card is inserted in the CPU, the middle bar graph is relevant.Additional information is also stored in the load memory. For that reason, the usage of the load memory is always higher than that of the work memory.
Work Memory Only the information required for program execution in the CPU is stored in the work memory.
Compressing Gaps that exist in the work memory can be eliminated by selecting the "Compress"button.These gaps are caused by program corrections in the CPU. With block corrections, the old blocks are not overwritten, rather they are only declared as invalid. The modified blocks are added to the free end of the memory and thus occupy new memory after every correction.
Compressing is only required with the S7-400. The work memory is automatically compressed with the S7-300.
Date: 05.12.2005File: PRO1_12E.41
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Module Information: "Memory" Tab
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 42
General Scan cycle time is defined as the time that the CPU requires to update the process image tables, execute the user program, carry out all diagnostic functions, andcommunicate with the programming devices.
"Scan Cycle Time" The "Scan Cycle Time" tab gives you the following information about cyclicTab program execution:
• Longest cycle time duration since the last switch from STOP to RUN,• Shortest cycle time duration since the last switch from STOP to RUN,• Current / previous cycle time duration,• Display of the Configured scan cycle monitoring time (maximum scan cycle time)and• Display of the Configured minimum scan cycle time (only for S7-400).
That way, you can implement constant cycle times. A new cycle always begins when the minimum scan cycle time has run out.
Date: 05.12.2005File: PRO1_12E.42
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Module Information: "Scan Cycle Time" Tab
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 43
Clock This box only displays the data from the integrated real-time clock in the CPU. (See below for notes on setting the time.)
Correction Factor The correction factor for adjusting the clock is entered in the "HW_Config" window (see the chapter "Hardware Configuration").
Clock There are several ways of synchronizing the clock:Synchronization • within a PLC system, for example, with multicomputing,
• on the MPI network between Master and Slave• with MFI (multifunctional interface) for point-to-point connection.
Run-time meter For measuring the operating time of an apparatus.The following system functions exist in the CPU for a run-time meter:• SFC2 set to a default value• SFC3 starting and stopping• SFC4 reading out the current elapsed hours.
The number of run-time meters depends on the type of CPU (max. 8). The value range lies between 0 and 32767 hours.
Set Date and Time There are two ways of setting the date and time on the module:1. In the SIMATIC Manager by selecting the menu options PLC -> Set Date and Time2. Using the system function SFC0 to set the date and time.
Date: 05.12.2005File: PRO1_12E.43
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Module Information: "Time System" Tab
... in the SIMATIC Manager:PLC -> Set Date and
Time
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 44
Application The information on the available memory lets you determine before you download your program, whether the program you developed offline can be executed by the target CPU.
Performance Data This tab page contains the following information:• size of the work memory• size of the integrated load memory• size of the maximum slot-in load memory• size of the address areas: process image inputs, process image outputs, bit
memory, timers, counters and local data
Properties You can determine how much memory the user program requires in the CPU by"Block Folder" selecting the Properties of the block folder in the SIMATIC Manager.
Date: 05.12.2005File: PRO1_12E.44
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Module Information: "Performance Data" Tab
... in the SIMATIC Manager:• Blocks folder-> Properties
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 45
Blocks When you click on the "Blocks" button, the Performance Data tab also gives you information about which blocks can be downloaded into the available CPU. The following information is displayed:• Organization blocks• System functions• the maximum possible number of FCs, FBs, DBs, and• the maximum length of the blocks.
Date: 05.12.2005File: PRO1_12E.45
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Performance Data: Blocks
Training Centerfor Automation and Drives
ST-7PRO1TroubleshootingPage 46
Goal Becoming familiar with the available system information using the menu options PLC -> Module Information.
What to Do 1. In the SIMATIC Manager or in the LAD/STL/FBD Editor, select the menu options PLC -> Module Information.
2. Choose the tab page you want.3. Ascertain how much memory is still available in the work memory.4. Determine what the longest scan cycle time has been up until now.
Result You become familiar with a tool that will give you important diagnostic information when dealing with faults.
Date: 05.12.2005File: PRO1_12E.46
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Reading Out System Information
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 1
Contents Page
Overview of the Organization Blocks ……...................................................................................... 2Startup OBs ........................................................................................................................................ 3Interrupting the Cyclic Program …………....................................................................................... 4Time-of-Day Interrupt (OB10) ........................................................................................................... 5Cyclic Interrupt (OB35) ...................................................................................................................... 6Hardware Interrupt (OB40) ................................................................................................................ 7Time-Delay Interrupt (OB20) .............................................................................................................. 8Diagnostic Interrupt, Asynchronous Error Interrupt (OB81...87) ....................................................... 9Asynchronous Error OBs .................................................................................................................. 10Synchronous Errors .......................................................................................................................... 11System Functions for Controlling Interrupt OBs ............................................................................... 12Start Information of OBs .................................................................................................................. 13Exercise: Determing the Type of Startup in OB100 .......................................................................... 14Exercise: Setting the System Time ................................................................................................... 15Exercise: Creating a Flashing Light with Cyclic Interrupt .................................................................. 16Exercise: Writing a Program for a Time-of-Day Interrupt ................................................................. 17
Date: 05.12.2005File: PRO1_13E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Organization Blocks
Operatingsystem
OB1
FC
FB
SFC
SFB
OtherOBs
FC
FB
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 2
Date: 05.12.2005File: PRO1_13E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
OB 10...17(Time-of-dayinterrupts)
OB 80...87(Asynchronous errors)
OB 20...23(Time-delay interrupts)
Overview of the Organization Blocks
Periodicprogramexecution
OB 30...38(Cyclic interrupts)
Event-drivenprogramexecution
OB 40...47(Hardware interrupts)
Startup
OB 102
OB 100
OB 101
Cyclicprogramexecution
OB 1
OB 121, 122(Synchronous errors)
Interrupt OBs Error OBs
Startup A startup program is carried out before the cyclic program execution after a power recovery, or a change of operating mode (through the CPU‘s mode selector or by the PG). OB 100 to OB 102 are available for this. In these blocks you can, for example, preset the communications connections.
Cyclic Program The program that is to be continuously executed is stored in the OrganizationExecution Block OB 1. After the user program has been completely executed in OB 1, a new cycle
begins with the updating of the process images and the processing of the first statement in OB 1. The scan cycle time and the response time of the system is a result of these operations. The response time is the total of the executing time of the CPU‘s operating system and the time it takes to execute all of the user program.The response time, that is, how quickly an output can be switched dependent on an input signal, is equal to scan cycle time x 2.
Periodic Program With periodic program execution, you can interrupt the cyclic program executionExecution at fixed intervals. With cyclic interrupts, an OB 30 to OB 37 organization block is
executed after a preset timing code has run out, every 100 ms for example. Control-loop blocks with their sampling interval are called, for example, in these blocks. With time-of-day interrupts, an OB is executed at a specific time, for example every day at 17:00 hours (5:00 p.m.), to save the data.
Event-driven The hardware interrupt can be used to quickly respond to a process event. After Program the event occurs, the cycle is immediately interrupted and an interrupt programExecution is carried out.
The time-delay interrupt reponds after a delayed time period to a process event.With the error OBs you can determine how the system is to behave, for example, if the backup battery fails.
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 3
Start Organization blocks are started exclusively by the operating system. There are various starting events that lead to a start of the associated organization blocks in the corresponding priority class.Organization blocks can contain a normal control program, and also a declaration table.
Priorities Every OB program execution can be interrupted by a higher priority event (OB) at command boundaries. Priorities are graduated from 0-27, whereby 0 has the lowest priority and 26 has the highest priority. OBs of the same priority do not interrupt each other, but are started one after the other in the sequence they are recognized.
Startup The S7-300 has the complete restart type of startup. With it, the process images and the non-retentive timers, counters and bit memories are deleted. Program execution in OB 1 starts with the first statement.The S7-400 also has the restart type of startup. All data (bit memories, timers, counters, process images) are retained. Program execution resumes from the point where the interruption occurred.With a complete restart, OB 100 is executed and with a restart, OB 101 is executed.
Cold Restart The 318-2 and 417-4 CPUs also have the cold restart type of startup. You can specify this additional type of startup for a power failure. It is made with the HW Configuration when you assign parameters to the CPU. With a cold restart, all bit memories, timers, counters and the process images are deleted. The data blocks retain their preset values and the program resumes with the first statement in OB 1 after the OB 102 startup block is executed.
Date: 05.12.2005File: PRO1_13E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Read in PII
Execute OB1
Output PIQ
Complete restart
automatic manual
S7-300 / 400
Power ON
S7-300
STOP->RUN
S7-400
STOP->RUN+ CRST
Deleting the process images,non-retentive M, T, C
Execution of OB 100
Enable outputs
Read in PII
Enable outputs
STOPyes
no
Monitoring timefor restart exceeded ?
Delete PIQ (parameter-assignable)
Process residual scan cycle
Execution of OB 101
Execute OB1
Restart (manual)
• only for S7-400 (according to setting in HW Config):STOP -> RUN + WRST
Startup OBs
Output PIQ
CYCLE
CYCLE
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 4
OBs Organization blocks (OBs) are the interface between the operating system of the CPU and the user program. OB1 either contains the cyclic program itself or organizes it (by calling other blocks).
Calling Organization blocks cannot be called by other blocks. They are called by the operating system in response to certain events, e.g. :• on CPU startup• at a set time of day• at constant intervals• when a set period of time has elapsed• when errors occur• when hardware interrupts occur
Priority Organization blocks are executed in the order of priority assigned to them (1 = lowest and 29 = highest priority).
Interrupting When another OB is called by the operating system, cyclic program execution isthe Cyclic Program interrupted because OB1 has the lowest priority. Any other OB can therefore interrupt
the main program and execute its own program. Afterwards, execution of OB1 is resumed at the point of interruption.If an OB with a higher priority that the one currently being executed is called, this is interrupted after the current statement has been completed. The operating system then saves the entire register stack for the interrupted block. This register information is restored when the operating system resumes execution of the interrupted block.
Date: 05.12.2005File: PRO1_13E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
E.g. OB82 (Prio.26) =Error handling.Executed in event ofwire break at analoginput PIW 352
E.g. OB10 (Prio.2) =Time-of-day interrupt.Executed once a minute from 9:30
OB1is executed continu-ously .....
OB 1
3Time-of-day interrupt
Cyclic interrupt
1
16Error handling
Cyclic program
Time-delay interrupt
Hardware interrupt
2
12
26 / 28
OB 20
OB 40
OB 10
OB 35
OB 82
OB No. OB Type Priority
E.g. OB20 (Prio.3) =Time-delay interrupt.Execution starts 3.25s after a part is detected.
Interrupting the Cyclic Program
...... until it is interruptedby another OB
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 5
Date: 05.12.2005File: PRO1_13E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Time-of-Day Interrupt (OB10)
Time-of-Day Time-of-day interrupts are used for executing a certain program called in OB 10 Interrupts either once only at a certain time or periodically (once a minute, hourly, daily, weekly,
monthly, yearly) starting at that time.You configure time-of-day interrupts with the "HW Config" tool. To select when and how OB10 is to be activated choose the menu options CPU -> Object Properties ->-> “Time-of-Day Interrupts" tab.
"Active" If you check the "Active" checkbox, the time-of-day interrupt OB is executed on every complete restart of the CPU.
Note Time-of-day interrupts can also be controlled by system functions at run time. The following system functions are available:• SFC 28 "SET_TINT" Set starting date, time and period• SFC 29 "CAN_TINT" Cancel time-of-day interrupt• SFC 30 "ACT_TINT" Activate time-of-day interrupt • SFC 31 "QRY_TINT" Query time-of-day interrupt.
S7-400 There are up to eight different time-of-day interrupt OBs (OB 10 to 17) for the S7-400 PLC.
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 6
Cyclic Interrupt Cyclic (watchdog) interrupts are used for executing blocks at fixed intervals. The cyclic interrupt OB for the S7-300 is OB 35. The default call interval for OB 35 is 100ms. You can change this to a value within the permitted range from 1ms to 1 minute.
Starting Time When you activate a time-controlled interrupt, you specify the interval in relation to the "starting time". The starting time begins every time the CPU mode changes from STOP to RUN.
Interval You must make sure that the interval you specify is longer than the time required for execution. The operating system calls OB35 at the specified time. If OB35 is still active at this time, the operating system calls OB80 (cyclic interrupt error OB).
Note Cyclic interrupts cannot be controlled by system functions at run time.
S7-400 There are up to nine different cyclic interrupt OBs (OB30 to 38) for the S7-400 PLC.
Date: 05.12.2005File: PRO1_13E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Cyclic Interrupt (OB35)
RUN OB35 OB35 OB35Interval
OOB1 B1OB1 OB1 OB1 OB1 OB1 O B1
Interval Interval
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 7
Hardware Interrupt The program in a hardware interrupt OB (OB40) is executed as soon as a certain event occurs. Hardware interrupts can be triggered by various module-specific signals:• For parameter-assignable signal modules (DI, DO, AI, AO) you use the
"HW Config" tool to specify the signal that is to trigger a hardware interrupt.• In the case of CPs and FMs, you specify the interrupt characteristics using the configuration software for the module concerned.
Example In the example above, suitable limit values have been configured for an analog input module. If the measured value exceeds the limit, OB40 is called.This has the same effect as including a comparison operation in OB1 which causes an FB or FC to be called when the upper limit is reached. However, if you use OB40 you don't need to write a program in another block. You can use the program in OB40 for interrupt generation or for process control.
S7-400 There are up to eight different hardware interrupt OBs (OB40 to 47) for theS7-400 PLC.
Date: 05.12.2005File: PRO1_13E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Analog input module
Upper limitvalueLower limitvalue
+27648
0
Hardware Interrupt (OB40)HW Config:
Properties of theanalog input module
Properties of the CPU
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 8
Time-Delay The program in a time-delay OB (OB20) is executed with a specified delayInterrupt after a certain event has occurred.
OB20 can only be activated by calling system function SFC32 (SRT_DINT). SFC32 is also used for setting the delay time.
SFC 32 • OB_NR = Number of the OB to be executed with a time delay.• DTIME = Delay time (1 to 60000ms)• SIGN = User-specified signal for starting the time-delay interrupt OB• RET_VAL = Error code, if an error occurs during execution of the time-
delay interrupt OB (See on-line help for meanings of error numbers).
Note Apart from SFC32, the following SFCs are also available for dealing with time-delay interrupts:• SFC33 (CAN_DINT) = Cancel time-delay interrupt• SFC34 (QRY_DINT) = Query time-delay interrupt.
S7-400 There are up to four different time-delay interrupt OBs (OB20 to 23) for theS7-400 PLC.
Date: 05.12.2005File: PRO1_13E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
( P ) ( )I 0.0 M0.1 SFC 32
(SRT_DINT)EN ENO
OB_NR
DTIME
SIGN
RET_VAL20
T#500ms
W#16#01
MW10
M2.0
Time-Delay Interrupt (OB20)
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 9
Asynchronous Asynchronous errors are faults in the functionality of the PLC. They occurErrors asynchronously to the execution of the program and cannot be traced to a particular
point in the program (e.g. a diagnostic interrupt from a module).
Response If a fault is detected in RUN mode and the relevant error OB has been programmed, it is called and the program in it is executed. This program could, for example, contain:• instructions for switching on a siren• instructions for data backup, followed by a STOP instruction• a program for recording the frequency with which the fault occurs, without
causing the CPU to go into STOP mode.
Note If the error OB for a particular fault is not present, the CPU automatically goes into STOP mode.
Example Asynchronous error interrupt OB82 is called in the following situations, for example:• Wire break on a module with diagnostic capability• Failure of the power supply to an analog input module• Measuring range of an analog input module exceeded, etc.
Date: 05.12.2005File: PRO1_13E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Analog input module
Wire break
+27648
0
Diagnostic Interrupt, Asynchronous Error Interrupt (OB81...87)HW Config:
Properties of theanalog input module
Propertiesof the CPU
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 10
Priority The error OBs called in response to asynchronous errors are executed immediately because they have the highest priority of all interrupt and error OBs:• Priority 26 if the error occurs while an OB with lower priority (<26) is being
executed• Priority 28 if the error occurs while a startup OB (priority 27) is being executed.
Date: 05.12.2005File: PRO1_13E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Asynchronous Error OBs
Type of error Example OB
Time error Maximum scan cycle time exceeded OB80
26 / 28
Priority
26
Power supply fault Backup battery failure OB81
Diagnostic interrupt Wire break at input of diagnostics-capablemodule OB82
Insert / remove interrupt
Removal of a signal module during operation of an S7-400 OB83
CPU hardware fault Incorrect signal level at theMPI interface OB84
Program execution error Error in updating the process image(module defective) OB85
Rack fault Failure of an expansion device or a DP slave OB86
Communication error Error in reading message frame OB87
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 11
Synchronous These errors can be traced to a particular point in the program if the error occurredErrors during execution of a particular statement. The error OBs called in response to synchronous
errors are executed as part of the program, with the same priority as the block that was being executed when the error was detected.
Date: 05.12.2005File: PRO1_13E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Synchronous Errors
Type of error Example OB Priority
Same as that of the OBinterrupted as a result of the error
Programming errorA block that is not present in theCPU is called in the program OB121
Access errorA module which is either defectiveor not present is addressed in the program (e.g. direct access to anon-existent I/O module)
OB122
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 12
OB's You will find a complete list and a description of the error OBs in the online help:LAD/STL/FBD Editor -> Help -> Contents -> Help on Blocks -> Help on Organization Blocks.
SFC's The system functions and their uses, how to call them and assign parameters to them are discussed in an advanced programming course.
Date: 05.12.2005File: PRO1_13E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
System Functions for Controlling Interrupt OBs
Organization block
Function NumberPriority
in S7-300SFCs for controlling OBs Remarks
Time-of-day interrupt OB 10 ... 17 2 SFC 28 ... 31 Alternative to HW Config
Time-delay interrupt OB 20 ... 23 3 SFC32 ... 34 Mandatory
Hardware interrupt OB 40 ... 47 16 none
Diagnostic interrupt OB 81 ... 87 26 none
Cyclic interrupt OB 30 ... 38 none12
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 13
Date: 05.12.2005File: PRO1_13E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
4 / 5
6 / 7
8 / 9
10 / 11
Data formats of L-Bytes 8, 9, 10, 11
Additional info 1 (e.g. start address of interrupt module)
Additional info 2 (e.g. interrupt status)
Additional info 3 (e.g. channel number)
L-Byte
0 / 1
2 / 3
Start event
Priority
Consecutive number
OB No.
12 / 13
14 / 15
16 / 17
18 / 19
Year
Day
Minutes
1/10 Second, 1/100 Second
Month
Hours
Seconds
1 /1000 Second, Weekday
Managementinformation
Startinformation
Starttime
Start Information of OBs
Start Information You have a uniform system start information in the local data stack when the OB is called by the operating system. The start information has a length of 20 bytes and is available after the start of OB execution.
Access to The STEP 7 software makes a standard declaration table available for theStart Information symbolic access to start information (example for OB 81).
Note You can change or supplement the standard declaration table.The meanings of the variables are explained to you in the online help or in the Standardand System Functions manual.
In the example, the variable OB8_FLT_ID contains an identifier, if and which backup battery has failed.
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 14
Task: The S7-300 only has the one startup OB 100. If you want to respond accordingly in the program to the type of startup, you have to evaluate the start information in OB 100. The operating system enters the following identifiers in the variable OB100_STRTUP:
• B#16#81 = manual complete restart• B#16#82 = automatic complete restart.
You are to write a program for the OB 100 so that the output Q 8.4 or Q4.4 is set for a manual complete restart and the output Q8.5 or Q 4.5 is set for an automatic complete restart.
Example of an evaluation of a manual complete restart
L OB100_STRTUP //Load startup identifierL B#16#81 //Load hexanumber 81==I //Compare for sameness= Q 8.4 //Display type of startup
What to Do: 1. Open the OB 100 block from the S7 program of the HW-Station "My Station"(Project "My Project")
2. Supplement the program in OB 100.3. Download the block in the CPU and test your program.
Date: 05.12.2005File: PRO1_13E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Step What to Do Result
1You are to insert the OB100 block in the S7 program of the HW-Station "MyStation" and write a program for the OB100 according to the task.
The type of startup is programmedin the startup block
2 Download the OB100 block in the CPU
3 Test your program The LEDs on the simulator light updepending on the type of startup.
Exercise: Determining the Type of Startup in OB100
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 15
Task To set the correct system time of the S7 CPU.
What to Do 1. Select the menu options PLC -> Set Date and Time (SIMATIC Manager orProgram Editor).
2. Enter the correct date and the exact time in the dialog box.
Date: 05.12.2005File: PRO1_13E.15
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Setting the System Time
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 16
Task You would like to use a flashing frequency of 3 Hz. This frequency is unfortunately not available in the flashing frequency bit memory.Set up a flashing frequency in the bit memory M35.0 with the help of a cyclic interrupt.
Note Use the S7 program of the HW-Station "My Station" in the project "My Project".
Date: 05.12.2005File: PRO1_13E.16
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Creating a Flashing Light with Cyclic Interrupt
You are to assign parameters to the call interval for OB 35 according to the task
Step What to Do Result
1
Create and save OB 35 and download it2
3Check the function Bit memory M 35.0 flashes with 3 Hz
Training Centerfor Automation and Drives
ST-7PRO1Organization BlocksPage 17
Task As of today, the horn on the conveyor model is always to switch on at the end of the course (ask your trainer).The acoustic message is to be acknowledged using an empty input on the simulator.
Note Use the S7 program of the HW-Station "My Station" in the project "My Project".
Result You will be woken in time to go home.
Date: 05.12.2005File: PRO1_13E.17
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Writing a Program for a Time-of-Day Interrupt
You are to assign parameters to the CPUso that the time-of-day interrupt is executedat the end of the course
Step What to Do Result
1
Create and save OB 10 according to thetask and then download it2
3Check the function At the end of the course, the horn sounds
Deactivate the time-of-day interrupt anddownload the changed configuration.4
Training Centerfor Automation and Drives
ST-7PRO1Analog Value ProcessingPage 1
Contents Page
Use of Analog Modules ……............................................................................................................ 2Measuring Range Modules .............................................................................................................. 3Analog Module Addresses with S7-300 …....................................................................................... 4Analog Module SM335 (Inputs) …................................................................................................... 5Analog Module SM335 (Outputs) .................................................................................................... 6Analog Input Module SM331 ........................................................................................................... 7Analog Value Representation and Measured Value Resolution ....................................................... 8Analog Value Representation of Different Measuring Ranges ....................................................... 9Scaling Analog Input Values ......................................................................................................... 10Unscaling a Real Number for Analog Output .................................................................................. 11Analog Value Representation for the Analog Outputs ...................................................................... 12Exercise: Assigning Parameters to the Analog Module SM335 ....................................................... 13Exercise: Assigning Parameters to the Analog Module SM331 ....................................................... 14Exercise: Controlling the Level in a Tank …………......................................................................... 15Exercise: Diagnostic Interrupt from an Analog Module ..................................................................... 16
Date: 05.12.2005File: PRO1_14E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Analog Value Processing
Leveltransmitter
High level
Low level
Training Centerfor Automation and Drives
ST-7PRO1Analog Value ProcessingPage 2
Principle In a production process, there are a variety of physical quantities (pressure, temperature, speed, rotational speed, pH value, viscosity, etc.) that need to be processed in the PLC for automation purposes.
Sensor Measuring sensors respond to changes in the quantity to be measured by linear expansion, angular ductability, alteration of electrical conductivity, etc.
Transducer Measuring transducers convert these above-mentioned changes into standard analog signals, such as: ± 500mV, ± 10V, ± 20mA, 4...20mA.These signals are supplied to the analog input modules.
ADC Before these analog values can be processed in the CPU, they must be converted to digital form. This is done by the ADC (Analog-to-Digital Converter) on the analog input module.The analog-to-digital conversion is performed sequentially, that is, the signals are converted for each analog input channel in turn.
Result Memory The result of the conversion is stored in the result memory and remains there until it is overwritten by a new value. The converted analog value can be read with the Load instruction “L PIW...”.
Analog Output The Transfer instruction “T PQW...” is used to write the analog values calculated by the user program to an analog output module, where a DAC (Digital-to-Analog Converter) converts them to standard analog signals.
Analog Actuators with standard analog input signals can be connected to the analog output modules direct.
Date: 05.12.2005File: PRO1_14E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Use of Analog ModulesProcess
Physical quantity
Standardanalog signal
Sensor Transducer
• Pressure• Temperature• Flow• Speed• pH value• Viscosity• etc.
± 500mV± 1V± 5V± 10V± 20mA4...20mAetc.
DAC
PQW ...PQW ...:::PQW ...
Analog output module
MRmodule ADC
Resultmemory
PIW ...PIW ...:::PIW ...
Analog input module CPU
::::::L PIW 352
T PQW 368:
Analogactuator
Physicalquantity
......................................
Training Centerfor Automation and Drives
ST-7PRO1Analog Value ProcessingPage 3
Type of Measurement You set the type of measurement and the measuring range by setting coding keys on the measuring range module. Special modules without coding keys have different terminals for voltage and current measurement. Thus, the type of measurement can be set by wiring the appropriate terminal.
Measuring Range The measuring range modules with their coding keys are located on the left-Module hand side of the module. You must set them correctly before installing the module.
The possible settings are “A”, “B”, “C” and “D”. The settings for the various types of measurement and measuring ranges are printed on the module.
Channel Groups On some modules, several channels are grouped together to form a channel group. In this case, the coding key setting applies to the whole channel group.
Date: 05.12.2005File: PRO1_14E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Measuring Range Module
Training Centerfor Automation and Drives
ST-7PRO1Analog Value ProcessingPage 4
Address Area The S7-300 has a special address area for analog inputs and outputs, which is separate from the process image input and output tables for the digital modules (PII/PIQ).This address area extends from byte 256 to byte 767. Each analog channel occupies 2 bytes.
Access You access the analog modules by means of Load and Transfer instructions.Example: The statement “L PIW256” reads the first channel of the first module in rack 0.
S7-400 On the S7-400, the address area for the analog modules starts at byte 512.
Date: 05.12.2005File: PRO1_14E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Analog Module Addresses with S7-300
IM 256to270
336to350
352to366
368to382
304to318
320to334
272to286
288to302
(Send)
Slot 2 3 4 5 6 7 8 9 10 11
384to398
400to414
432to446
448to462
464to478
480to494
496to510
416to430
Rack 1
R0
PowerSupply
IM(Receive)
PowerSupply CPU
512to526
528to542
544to558
560to574
576to590
592to606
608to622
624to638
Rack 2 IM(Receive)
PowerSupply
Rack 3 640to654
656to670
672to686
688to702
704to718
720to734
736to750
752to766
IM(Receive)
PowerSupply
Training Centerfor Automation and Drives
ST-7PRO1Analog Value ProcessingPage 5
Diagnostic Interrupt When the diagnostic interrupt is activated and a hardware fault occurs, such as a power supply failure, a diagnostic interrupt (OB 81) is triggered. As well, you must specify in the "Diagnostics" field which inputs are to be monitored. A wire break check is only possible with 4 to 20 mA power inputs.
Scan Cycle Time The scan cycle time is the time it takes for the module to process ("convert") all the activated analog inputs once. The setting for the scan cycle time for A/D conversion can be between 0.5ms and 16ms.When it has processed all the analog inputs, the module can trigger a hardware interrupt (= End of Cycle interrupt) (only if a scan cycle time for conversion longer than 1ms has been selected).
Note Unused inputs must be short-circuited on the hardware and "Deactivated" in the software. Deactivated analog inputs reduce the scan cycle time!
Measuring Range When the type of measurement and the measuring range have been selected, Module the necessary coding key setting on the measuring range module is displayed.
Example: For the measuring ranges selected in the slide above, the measuring range module must be inserted in position “C”.
Resolution The analog inputs of the SM 335 have a resolution of 13 bits + sign, the analog outputs11 bits + sign.
Date: 05.12.2005File: PRO1_14E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Analog Module SM335 (Inputs)
Training Centerfor Automation and Drives
ST-7PRO1Analog Value ProcessingPage 6
Note Unused output channels must remain open on the hardware (not be short-circuited like the analog inputs) and be “deactivated” in the software.
Date: 05.12.2005File: PRO1_14E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Analog Module SM335 (Outputs)
Training Centerfor Automation and Drives
ST-7PRO1Analog Value ProcessingPage 7
Parameters You can set two groups of parameters for analog input modules with the “HW Config”tool:
Module as a Whole • Diagnostic Interrupt:If the “Group Diagnosis” checkbox has been activated and a diagnostic event occurs, the relevant information is entered in the diagnostics data area of the module and the diagnostic interrupt (OB82) is triggered.The analog module can detect the following diagnostic events:- Configuration/ parameter assignment errors- Wire break (if "With Wire Break Check" is activated)- Above measuring range- Below measuring range- No load voltage L+
• Hardware Interrupt when Limit Value ExceededIf the input value exceeds the range set by the entries for "Upper Limit Value" and "Lower Limit Value", the module triggers a hardware interrupt.Note: Only the first channel in a group can monitor the input value for violation of the selected limit values!
Individual Inputs • Type of Measurement: When you click this box, the possible types of measurement (voltage, current...) are displayed. For unused channels orchannel groups you select the "deactivated" option. You must connect these channels to chassis ground on the module
• Measuring Range: When you click this box, the possible measuring ranges for the type of measurement selected are displayed.• Coding Key Setting: A very specific setting of the measuring range module
becomes necessary when you select the type of measurement and the measuring range. This is displayed here.
• The integration time and interference frequency suppression are interdependent (see next page).
Date: 05.12.2005File: PRO1_14E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Analog Input Module SM331
Training Centerfor Automation and Drives
ST-7PRO1Analog Value ProcessingPage 8
Representation Analog values are represented as the two's complement. The value is positive if bit No. 15=0 and negative if bit No.15=1.
Resolution If the resolution of an analog module is less than 15 bits, the analog value is written into the accumulator left-justified. The unused less significant bit positions are filled with “0”s.
Integration Time The resolution is specified indirectly by selecting an integration time with the “HW Config” tool.The following table for the SM331 illustrates the relationship between integration time, resolution and interference frequency suppression:Integration time Resolution Interference frequency suppression
(ms) (in bits) (Hz)2.5 9 + sign bit 40016.6 12 + sign bit 6020 12 + sign bit 50100 14 + sign bit. 10
Accuracy Resolutions of between 8 and 15 bits are possible, depending on the type of module.
Conversion Time The conversion time depends on the conversion procedure used in the module (integrating procedure, successive approximation).The conversion times of the different modules are given in the S7-300 manual. Example: The SM344 has a conversion time of only 5 ms for all 4 input channels.
Date: 05.12.2005File: PRO1_14E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Analog Value Representation and Measured Value Resolution
20212223242526272829210211212213214VZHex.Bit value Dec.
0123456789101112131415Bit no. Units
Reso-lution in bits+ sign
1 11 ******** * * * * * * *15
* = 0 or 1
80 00000001128 ********8
40
20
10
8
4
000000
00000
0000
000
00
02
164
132
116
18
14
12
******** *
******** * *
******** * * *
******** * * * *
******** * * * * *
******** * * * * * *
9
10
11
12
13
14
Training Centerfor Automation and Drives
ST-7PRO1Analog Value ProcessingPage 9
Voltage, Current Encoding the symmetrical voltage or current ranges(Symmetrical) • ± 80mV • ± 2.5 V • ± 3.2 mA
• ± 250 mV • ± 5V • ± 10 mA• ± 500 mV • ± 10V • ± 20 mA• ± 1 Vresults in a rated range of -27648 to +27648.
Voltage, Current Encoding the asymmetrical voltage or current ranges(Asymmetrical) • 0 to 2 V • 0 to 20 mA
• 1 to 5 V • 4 to 20 mAresults in a rated range of 0 to +27648.
Resistance Encoding the resistance ranges• 0 to 150 Ohm• 0 to 300 Ohm• 0 to 600 Ohmresults in a rated range of 0 to +27648.
Temperature Temperatures are measured with resistance thermometers or thermocouples. Encoding results in a rated range of ten times the temperature range:Sensor: Temperature range: Rated range when encoded:• Pt 100 -200 to + 850 ºC -2000 to + 8500• Ni 100 -60 to + 250 ºC -600 to + 2500• Thermocouple type K -270 to + 1372 ºC -2700 to + 13720• Thermocouple type N -270 to + 1300 ºC -2700 to + 13000• Thermocouple type J -210 to + 1200 ºC -2100 to + 12000• Thermocouple type E -270 to + 1000 ºC -2700 to + 10000.
Date: 05.12.2005File: PRO1_14E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Analog Value Representation of Different Measuring Ranges
Range
Overflow
Overrange
Rated range
Underrange
Underflow
Meas.range± 10V
Voltagee.g.:
>= 11.759
11.7589:
10.0004
10.007.50:
-7.5-10.00
- 10.0004:
- 11.759
<= - 11.76
Units
32767
32511:
27649
2764820736:
-20736-27648
- 27649:
- 32512
- 32768
Meas.range4 .. 20mA
Currente.g.:
>= 22.815
22.810:
20.0005
20.00016.000::
4.000
3.9995:
1.1852
<= 1.1845
Units
32767
32511:
27649
2764820736::
0
- 1:
- 4864
- 32768
Meas.range-200...+850ºC
Temperaturee.g. Pt100
Units
32767
10000:
8501
8500:::
-2000
- 2001:
- 2430
- 32768
>= 1000.1
1000.0:
850.1
850.0:::
-200.0
- 200.1:
- 243.0
<= - 243.1
Meas.range0...300Ohm
Resistancee.g.:
>=352.778
352.767:
300.011
300.000225.000::
0.000
Negative valuesnot possible
Units
32767
32511:
27649
2764820736::
0
- 32768
- 1:
- 4864
Training Centerfor Automation and Drives
ST-7PRO1Analog Value ProcessingPage 10
Example The level in a tank is to be measured in liters. The measuring transformer was chosen in such a way that 500 liters have an analog value of 10 V.
Scaling The analog module encodes the analog value 10 V as the integer value 27 648. This value now has to be converted to the physical quantity “liters”. This is known as “scaling” the analog value.
Program Standard block FC 105 is used for scaling analog values. FC 105 is supplied with the STEP 7 software in the library "Standard Library" in the S7 Program"TI-S7 Converting Blocks".
IN The analog value at input IN can be read in from the module direct or read from a data interface in INTEGER format.
LO_LIM, HI_LIM Inputs LO_LIM (low limit) and HI_LIM (high limit) are used for specifying the limits for conversion to physical quantity. In the example the reading is scaled to the range 0 to 500 liters.
OUT The scaled value (physical quantity) is stored as a real number at output OUT.
BIPOLAR The input BIPOLAR determines whether negative values are also to be converted. In the above example, memory bit M0.0 has a signal "0" and thus indicates that the input value is unipolar.
RET_VAL The output RET_VAL has the value 0 if execution is free of errors.
Date: 05.12.2005File: PRO1_14E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Scaling Analog Input Values
500,0
0,00 27648
Training Centerfor Automation and Drives
ST-7PRO1Analog Value ProcessingPage 11
Example The user program calculates an anaolg value in the range 0 to 100.0%. This value is to be output via an analog output module.
Unscaling Standard block FC106 is used for unscaling (conversion of a real number from 0 to 100.0% to a 16-bit integer between 0 and 27648).
OUT The unscaled analog value at output OUT can be transferred in the form of a 16-bit integer to a data interface or to the module direct.
Program FC 106 is supplied with the STEP 7 software in the library "Standard Library" in the S7 Program "TI-S7 Converting Blocks".
Date: 05.12.2005File: PRO1_14E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Unscaling a Real Number for Analog Output
27648
0 0,0 100,0
Training Centerfor Automation and Drives
ST-7PRO1Analog Value ProcessingPage 12
Voltage, Current For symmetrical voltage or current ranges a rated range ofSymmetrical -27648 to +27648 is converted to:
• ± 10V• ± 20mA.
Voltage, Current For asymmetrical voltage or current ranges a rated range ofAsymmetrical 0 to +27648 is converted to:
• 0 to 10V• 1 to 5V• 0 to 20mA• 4 to 20mA.
Overflow If the value to be converted reaches the overflow range, the analog output module is disabled (0V, 0mA).
Date: 05.12.2005File: PRO1_14E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Analog Value Representation for the Analog Outputs
Range
Overflow
Overrange
Rated range
Underrange
Underflow
Units
>=32767
32511:
27649
27648:
0:
- 6912
- 6913:::
- 27648
- 27649:
- 32512
<=- 32513
Output ranges:
Voltage
0
11.7589:
10.0004
10.0000:0
0 to 10V 1 to 5V
0
5.8794:
5.0002
5.0000:
1.0000
0
11.7589:
10.0004
10.0000:0:::::::
-10.0000
- 10.0004:
- 11.7589
0
± 10V
0 0.9999
0
0
Output ranges:
Current
0
23.515:
20.0007
20.000:0
0 to 20mA 4 to 20mA
0
22.81:
20.005
20.000:
4.000
0
23.515:
20.0007
20.000:0:::::::
-20.000
- 20.007:
- 23.515
0
± 20mA
0 3.9995
0
0
Training Centerfor Automation and Drives
ST-7PRO1Analog Value ProcessingPage 13
Note Depending on which analog module is in your training unit, you are to do either this exercise or the one on the following page.
Goal To get to know how to change the settings and parameters of analog modules.
What to Do Change the settings of your analog module to correspond to those in the slide.
Date: 05.12.2005File: PRO1_14E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Assigning Parameters to the Analog Module SM335
Training Centerfor Automation and Drives
ST-7PRO1Analog Value ProcessingPage 14
Note Depending on which analog module is in your training unit, you are to do either this exercise or the one on the previous page.
Goal To get to know how to change the settings and parameters of analog modules.
What to Do Change the settings of your analog module to correspond to those in the slide.
Date: 05.12.2005File: PRO1_14E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Assigning Parameters to the Analog Module SM331
Training Centerfor Automation and Drives
ST-7PRO1Analog Value ProcessingPage 15
Task The tank has a maximum capacity of 600 liters. The level is measured using a measuring transducer. It has an analog value of 10 V when the maximum level is reached. This analog value is to be converted to a physical quantity (number of liters)using the FC 105 block. If the level goes below the minimum 50 liters, the output Q 9.2 (Q 5.2) is to flash until the level is once more 50 liters or more.
The first potentiometer on the simulator specifies the level.
What to Do 1. Create an FC 20 block in the S7 program "FILL" according to the task.2. Call FC 20 in OB 1 as well.3. Download the FC 20, FC 105 blocks and the OB1.3. Test your program.
Date: 05.12.2005File: PRO1_14E.15
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Controlling the Level in a Tank
Leveltransmitter
Min. level 50 l.When the level falls belowthis, a message is to beoutput at output Q9.2(Q 5.2).
Max. level of 600 l,equals 10 V at analog channel 0
Training Centerfor Automation and Drives
ST-7PRO1Analog Value ProcessingPage 16
Task Solve the problem shown above using the diagnostic interrupt OB82 and the diagnostics capability of the analog input module.
Note If you want to specifically evaluate which channel is in the overflow range, you have to use a system function here.
What to Do 1. Write a program for OB82 in the S7 program "FILL" according to the task.
2. Supplement the program in OB 1 to control the output Q 9.1 or Q 5.1.
3. Test your program.
Date: 05.12.2005File: PRO1_14E.16
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Diagnostic Interrupt from an Analog Module
Analog input module
When the value measured at an analog channel of the module exceeds the overflow range, OB82 is called, as wellas when it re-enters the range.
Rated range
OverrangeOverflow
Task:Output Q 9.1 (Q 5.1) is to flash as longas one of the encoded values is in the overflow range. .
Training Centerfor Automation and Drives
ST-7PRO1Documenting, Saving, ArchivingPage 1
Contents Page
Overview of Documentation Facilities ………................................................................................... 2Block Documentation ....................................................................................................................... 3Print Preview ..................................................................................................................................... 4Page Setup ....................................................................................................................................... 5Other Documentation Facilities ….................................................................................................. 6Saving Programs ............................................................................................................................. 7Ascertaining the Size of a Project ..................................................................................................... 8Archiving on Diskette …................................................................................................................... 9Copying a Program onto a Memory Card ........................................................................................ 10Storing Data on the Hard Disk ........................................................................................................... 11Uploading a Program from the CPU to the PG ................................................................................. 12Exercise: Achiving a Project ............................................................................................................. 13
Date: 05.12.2005File: PRO1_15E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Documenting, Saving, Archiving
Training Centerfor Automation and Drives
ST-7PRO1Documenting, Saving, ArchivingPage 2
Overview The slide shows the different documentation facilities available. All the documentation tools have a print function.
Printer The printer used for documentation is the one installed under Windows. If you want to use a different printer, you must set it up with the Windows Control Panel.
DOCPRO The DOCPRO optional software is also available for superior documentation and for writing wiring manuals.
Date: 05.12.2005File: PRO1_15E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Overview of Documentation Facilities
Network title
Network comment
Statement comment
Program overview
Cross references
Assignment of I/Q/M/T/C
Checklists
Symbol table
Configuration
Network configuration
Training Centerfor Automation and Drives
ST-7PRO1Documenting, Saving, ArchivingPage 3
Block Comments The slide above shows the different comment facilities available for a program block (OB, FC, FB).
Printing To start the Print function:• Click the printer icon or • Select the menu options File --> Print.
Print Setup You can change the printer settings by selecting the menu options File --> Print Setup.
Date: 05.12.2005File: PRO1_15E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Block Documentation
Training Centerfor Automation and Drives
ST-7PRO1Documenting, Saving, ArchivingPage 4
Print Preview For a preview of what your printout will look like, select the menu options File -> Print Preview.
Note The appearance of LAD program printouts depends on the settings made with the menu options Options -> Customize. Example: The setting for the length of the address field affects the number of contacts that can appear side by side in the printout and the number of characters of the symbol name that fit on a line above the contacts.
Date: 05.12.2005File: PRO1_15E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Print Preview
Training Centerfor Automation and Drives
ST-7PRO1Documenting, Saving, ArchivingPage 5
Page Setup When you select the menu options File --> Page Setup a dialog box in which you can select the print format (e.g. A4 Margin) appears.
Headers/Footers In the SIMATIC Manager, you can set, for an entire project, the headers and footers for the documentation with all the tools.Select the menu options File -> Headers and Footers to display a dialog box for entering texts for the headers and footers. Fields for printing out the current date of the printout, the page number or the name of the object are provided in the headers and footers (e.g. {Date} {Time}, Page {Page},{Object}).
Date: 05.12.2005File: PRO1_15E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Page Setup
Training Centerfor Automation and Drives
ST-7PRO1Documenting, Saving, ArchivingPage 6
Reference Data If you print out the reference data it makes troubleshooting, in particular, easier. You will find more information in the chapter "Troubleshooting".
Symbol Table The symbol table contains the association between absolute address, symbol nameand symbol comment. See the chapter "Symbols" for more information.
Configuration Configuration data generated with the HW Config tool. The printout is in text form. If you want a graphic printout, you can copy the graphics into the clipboard and then insert it in another program e.g. Winword and print it out.
Network Displays in graphic form, the stations of a networked system with the relevantConfiguration configuration data such as the MPI address.
Date: 05.12.2005File: PRO1_15E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Other Documentation Facilities
Reference data
Networkconfiguration
Configuration
Symbol table
Program structure
Cross references
Assignment ofI/Q/M/T/C
Checklists
Unused addresses
Addresses without symbols
Training Centerfor Automation and Drives
ST-7PRO1Documenting, Saving, ArchivingPage 7
Note With certain CPUs (e.g. CPU 416), you can also describe the memory card in the CPU. To do so, use the menu options PLC -> Download to EPROM Memory Card on CPU.
Date: 05.12.2005File: PRO1_15E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Copying Programs 1. Open two windows in the SIMATIC Manager:onto Memory Cards: One window containing the program to be saved and one
window with S7 Memory Card -> "Memory Card" icon2. Using the mouse, copy the program you want to save into the
"S7 Memory Card" window
Saving Programs
Archiving on 1. Select the menu options File -> Archive in the SIMATIC Diskette Manager
2. Choose the project you want to archive3. Enter the name of the archive file
Uploading Programs 1. Create a new program in the SIMATIC Managerfrom CPU to PG: 2. Click the "Online" icon
3. Open the S7 program and select Blocks4. Select the menu options PLC -> Upload in the SIMATIC
Manager OR1. Select the project in the SIMATIC Manager2. Select the menu options PLC -> Upload Station
Training Centerfor Automation and Drives
ST-7PRO1Documenting, Saving, ArchivingPage 8
Introduction If a project needs more than 1.44 MB of memory, you can still save it on diskette by archiving (compressing) it first.
Explorer You can find out the size of a project in the Explorer:• Click the project folder with the right mouse button or• Select the project folder and then choose the menu options
File -> Properties.In both cases the "Properties" window opens.
Date: 05.12.2005File: PRO1_15E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Ascertaining the Size of a Project
Training Centerfor Automation and Drives
ST-7PRO1Documenting, Saving, ArchivingPage 9
Introduction Since the data in a project can take up a lot of memory space and would not fit onto a diskette, an archive function is provided.This compresses the data so that it only takes up approx. 1/8 of the original amount of memory. It uses the normal file compression utilities, such as PKZIP, ARJ, LHARC, RARor WINZIP. One of these programs must be installed on the PG. If you want to use long file names for the projects, you will require PKZIP, WinZip or RAR.The file compression utilities ARJ and PKZIP are supplied with STEP 7. You set the path for the archive program by selecting the menu options Options -> Customize -> Archive in the SIMATIC Manager.
Archiving • The project to be archived must be closed in the SIMATIC Manager.• Select the menu options File --> Archive.• Select the project to be archived in the dialog window.• Select the name for the archive in the next dialog box.• In the last dialog box, you can choose between the following options:
- Disk-crossing archive = Split the archive file onto severaldiskettes or not
- Incremental archiving = Only the files with the ACR attribute(STEP7 files) are archived.
- Reset archive bit = Only archive the files that have been changed since the project was last
archived.- Consistency check = Compare the files to be archived
(only for ARJ)
Retrieving • Select the menu options File -> Retrieve.• Select the archive file.• In the next dialog box, select the target directory for the extracted project.• Use the last dialog box to select options for overwriting and restoring the
storage path.
Date: 05.12.2005File: PRO1_15E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Archiving on Diskette
Training Centerfor Automation and Drives
ST-7PRO1Documenting, Saving, ArchivingPage 10
Requirements The memory card driver must be installed in the STEP 7 software. If not, click the "Start" button and select Simatic -> STEP 7 -> Memory Card Parameter Assignmentand install the driver. There will then be a Memory Card icon in the toolbar of the SIMATIC Manager.The memory card must be erased before you can copy your program onto it.Open two windows in the SIMATIC Manager:• One containing the user program you want to save• The other with the memory card
Copying Select the blocks you want or the "Blocks" object from the hard disk and drag them into the Memory Card window with the mouse.
Note With certain CPUs (e.g. CPU 416), you can also describe the memory card in the CPU. To do so, use the menu options PLC -> Download to EPROM Memory Card on CPU.
Date: 05.12.2005File: PRO1_15E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Copying a Program onto a Memory Card
Training Centerfor Automation and Drives
ST-7PRO1Documenting, Saving, ArchivingPage 11
SIMATIC Manager You can obtain an overview of the data of one or more projects with the SIMATIC Manager. The slide shows the project "Syh_32" with all its folders and objects.
Project A project contains all the data created for the project:• One or more user programs• The symbol table• The configuration and parameter assignments of the modules• The network configuration.
Date: 05.12.2005File: PRO1_15E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Storing Data on the Hard Disk
Training Centerfor Automation and Drives
ST-7PRO1Documenting, Saving, ArchivingPage 12
Uploading a When you have completed the startup phase, you should have a copy of theProgram from final version of the program on the hard disk of the PG. CPU to PG The best way of doing this is to save the program with all its comments and symbols on
the hard disk before starting it up on the PLC. When you make changes to the program, you should always save the modified blocks on the hard disk immediately so that you don't lose the comments and symbols.If the program is not on your PG, you can upload the blocks from the CPU. In this case, the comments and symbols will be missing. Don't forget to upload the system data blocks because they contain configuration and communication data.
What to Do To upload an entire program from the CPU to the PG, carry out the following steps:• Create a new S7 program in the SIMATIC Manager• Click the "ON" online icon in the toolbar• Open the S7 program and select the "Blocks" object (user program)• Select the menu options PLC --> Upload.
Note: The blocks are stored in the "Blocks" folder (user program) on the hard disk of the PG.
Uploading a Station You can also upload an entire station to the PG, i.e. a hardware station is also created in the project. The advantage of this is that you can change the parameters of the hardware immediately.What to do:• Create a new project in the SIMATIC Manager.• Select the menu options PLC -> Upload Station.
Date: 05.12.2005File: PRO1_15E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Uploading a Program from the CPU to the PG
System data blocksSystem data blocks
Training Centerfor Automation and Drives
ST-7PRO1Documenting, Saving, ArchivingPage 13
Task To archive your project because you have made additions to the program and want to take the project with you on diskette.
What to Do 1. Change to the SIMATIC Manager.2. Close all opened projects.3. Select the menu options File -> Archive -> Project4. Select the project "My Project" in the next dialog box.5. Enter the file name "My_project.zip" in the "Archive - Select Archive" dialog box and click the "Save" button.6. Confirm with "OK" in the "Archive - Options" window.
Date: 05.12.2005File: PRO1_15E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Achiving a Project
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 1
Contents Page
Networking via MPI ……………….................................................................................................... 2Connection Options to MPI ............................................................................................................. 3Global Data: Overview ........................................................................................................................ 4GD Circles ………........................................................................................................................... 5Global Data: Configuration Procedure ............................................................................................. 6Global Data: Configuring the Hardware …………............................................................................. 7Editing the GD Table ........................................................................................................................ 8Compiling the GD Table .................................................................................................................. 9Downloading GD Configuration Data ................................................................................................ 10Status of GD Communication ............................................................................................................ 11Exercise: Preparing for Communication .......................................................................................... 12Exercise: Configuring Global Data Communication ........................................................................ 13Exercise: Monitoring Variables in Several Stations .......................................................................... 14Transferring Global Data with SFC 60, 61 ........................................................................................ 15Configuring with NETPRO .................................................................................................................. 16Subnets in SIMATIC …...................................................................................................................... 17S7 Communication Methods ............................................................................................................ 18
Date: 05.12.2005File: PRO1_16E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Communication via MPI
PG 720
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 2
Introduction Every programming device has an MPI interface. The MPI interface of the CPU enables all intelligent modules in a PLC to be accessed, e.g. the function modules of a station.Each MPI node needs its own MPI address (between 0 and 126, the default settings are PG=0, OP/TD=1, and CPUs=2).In the S7-300, the MPI bus is looped through on the K bus on a one-to-one basis. This means that every node on the K bus (FMs and CPs) in the S7-300 rack is also an MPI node and needs to have its own MPI address.In the S7-400, communication frames are converted for the internal K bus (10.5 Mbps) via the MPI (187.5 Kbps). In an S7-400 rack, only the CPU has its own MPI address. The other intelligent modules, e.g. FMs and CPs, do not have a separate MPI number.
Connection The main advantage is that several devices can establish a communication linkFacilities with the CPU at the same time.
This means, for example, that a programming device, an HMI device and a link with another PLC can be in operation at the same time. The MPI interface also makes it possible to create a network in which a network administrator has central access with a PG to all the intelligent modules in the stations connected. The number of channels for connection to other communication partners that can be used at the same time depends on the type of CPU. For example, the CPU 314 has four connection resources and the CPU 416 has sixty-four.
Features Main features of the MPI interface:• RS 485 physics• Transmission rate 19.2 Kbps or 187.5 Kbps or 1.5 Mbps• Distances up to 50 m (between 2 neighboring nodes) and with 2 repeaters,
1100 m and 23.8 km with optical fiber and star coupler.• Profibus components (cables, connectors)
Date: 05.12.2005File: PRO1_16E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Networking via MPI
PLC link via MPI
S7-300 or S7- 400
PG connection via MPI
OP connection via MPI
CPU 1 CPU 2
PG 720
S7-300 or S7- 400
01
2
n Default MPI address
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 3
Connectors Two types of connector are available for installing an MPI bus system.The connector with PG socket shown on the left is the standard connector used for linking MPI nodes with one another, while also enabling a PG to be connected at the same time.The connector without PG socket shown on the right is used where facilities for connecting a PG are not necessary.On the last bus node, the outgoing bus cable must be replaced by a terminating resistor.
Requirements To connect a programming device/PC to the MPI interface of the PLC, you need:• an MPI module in the PG/PC and a connecting cable• a PC adapter (a connecting cable with integral MPI converter, if there is no
free slot in the PG/PC ). The PC adapter has the following specifications:- Length 5 m- Transmission rate up to adapter 187.5 Kbps
Adapter to PG 19.2 or 38.4 Kbps (adjustable)
Date: 05.12.2005File: PRO1_16E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Connection Options to MPI
Bus connectorBus connector
Connection forPG/HMI
Connection forPG/HMI
To MPIinterfaceofCPU
To MPIinterfaceofCPU
To MPIinterfaceofCPU
To MPIinterfaceofCPU
Switch for terminatingresistor
Switch for terminatingresistor
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 4
Global Network In SIMATIC S7, global data communication allows you to establishData communication between distributed PLCs without having to write a single extra line in
your user program.Communication using global data is not programmed but configured. The configuration for data exchange is stored in a table.Global data communication can take place between up to 15 CPUs within a project. It is designed for small quantities of data which are normally transmitted cyclically. The S7-400 CPUs also allow program-controlled and therefore also event-driven data transfer.
Configuring You configure data communication with the "Defining Global Data" tool.First of all, you open the Global Data Table and assign the columns of the table to the CPUs that are going to exchange data. In the lines of the table you then define the variables to be exchanged. Almost all CPU address areas (apart from external inputs and outputs and temporary data) can be used as variables, e.g. bit memories, inputs, outputs, timers, counters and areas in data blocks.
GD Packet Global data, i.e. variables with the same sender/receiver, can be collected in a GD packet and sent together. Each GD packet is identified by a GD packet number and the variables within a packet are identified by variable numbers.
GD Circle The CPUs participating in the exchange of GD packets make up a GD circle. Each GD circle is identified by a GD circle number.
Date: 05.12.2005File: PRO1_16E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Global Data: Overview
Global Data
CPU 1MW 10
CPU 2MW 20
CPU 3MW 30
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 5
What is a GD Circle? A GD circle is a fixed distribution list for GD packets. Each CPU in a global data circle can send data to the other CPUs or receive data from another CPU.Types of GD circle:
Global data circle with more than 2 CPUs. One CPU is then the sender of a data packet and all the other CPUs in the GD circle are receivers.
Global data circle with 2 CPUs. Each CPU can both send a data packet to the other CPU and receive a data packet from the other CPU.
Number of Each CPU of an S7-300 can be in up to 4 different GD circles.GD Circles Up to 15 CPUs can exchange data via GD communication in one MPI network.
Example of The diagram above shows an example to illustrate the principle ofa GD Circle communication in GD circles.
Below is an example of the numbering of a GD circle.
Date: 05.12.2005File: PRO1_16E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
2
GD CirclesCPU1 CPU2 CPU3 CPU4 CPU5
GD circle
1
3
4
5
6
S=Sender; R=Receiver; GD x.y=GD Packet y in global data circle x
S GD 1.1R GD 1.2
R GD 1.1S GD 1.2
R GD 2.1 S GD 2.1 R GD 2.1 R GD 2.1 R GD 2.1
S GD 3.1R GD 3.2
R GD 3.1S GD 3.2
R GD 4.1 S GD 4.1 R GD 4.1
S GD 5.1 R GD 5.1 R GD 5.1
R GD 6.1 S GD 6.1 R GD 6.1
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 6
Creating Hardware First of all you must create the stations that you want to network in a projectStations using the SIMATIC Manager. When you have done this, open the HW Config tool and
open the stations one after the other.
Setting the MPI When configuring the hardware, you must explicitly define the CPUs to beAddress networked via MPI as "Networked" and assign each of them their own MPI node
address. Save your CPU parameters on the hard disk and then download the configuration data to each CPU separately (point-to-point) ("PLC -> Download").
Networking You then link up the MPI nodes with Profibus cables. When you have done this, it should be possible to establish an online connection to all the CPUs. You can test this with the SIMATIC Manager "Accessible Nodes" function.
Creating the You use the "Defining Global Data" tool to create a global data table in whichGD Table you define the data to be exchanged. You then compile the table twice and download
the relevant configuration data to the CPUs.
Volume of Data S7-300 : One CPU can be in up to 4 GD circles.A CPU can send 1 packet and receive 1 packet maximum per GD
circle.A maximum of 22 data bytes can be transferred with one packet.
S7-400 : One CPU can be in up to 16 GD circles.A CPU can send 1 packet and receive 2 packets maximum per GD
circle.A maximum of 54 data bytes can be transferred with one packet.
Date: 05.12.2005File: PRO1_16E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Global Data: Configuration Procedure
Create hardware stations in a projectwith the "SIMATIC Manager"
Create and download configuration data (MPI address) for the individual CPUs
with the "HW Config" tool
Configure Global Data table with the "Defining Global Data" tool
Create hardware stations in a projectwith the "SIMATIC Manager"
Create and download configuration data (MPI address) for the individual CPUs
with the "HW Config" tool
Configure Global Data table with the "Defining Global Data" tool
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 7
What to Do To configure the hardware for global data communication you must carry out the following steps:1. A STEP 7 project must already have been created with the SIMATIC
Manager.2. An MPI network object must be created in this project and assigned
parameters. An MPI network object is automatically created when you create a new S7 project.
3. Configure at least two GD-capable modules in the project (e.g. S7 CPUs).When configuring the CPUs with the "HW Config" tool, explicitly define each CPU as "Networked" (see above) and assign it its own MPI address.
4. Download the configuration data you have entered to each CPU separately. 5. Physically link up the CPU modules with network cables.6. Use the SIMATIC Manager "Accessible Nodes" function to check that you
have networked the stations correctly
MPI Address from PG If several PGs are to be connected to the MPI network, then each PG must be given its own MPI address. Use the "Simatic -> STEP 7 -> Setting the PG/PC Interface" program to set the address.
Date: 05.12.2005File: PRO1_16E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Global Data: Configuring the Hardware
Set MPI address
Network CPUs "Accessible Nodes"
Create stations
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 8
Overview The GD table is where you enter the CPUs that are going to exchange data and the address areas of the data to be exchanged.You can also specify the scan rate and a doubleword for the status information.
Opening the Open the GD table as follows:GD Table 1. Open your project and select the MPI network object.
2. Select the menu options Options -> Define Global Data. A new GD table is then generated or an existing GD table is opened.
Filling in the You must enter the address areas to be used in a separate column forGD Table each CPU taking part in GD communication. You do this as follows:
1. First assign each column of the table to a CPU by clicking the column header with the mouse to select it and choosing the menu optionsEdit -> Assign CPU.
2. Select the CPU you want in the dialog box that appears and confirm with "OK".
3. Enter the global data to be transferred in the lines beneath. You can select Edit mode for the individual cells of the table with the F2 key.You can enter a replication factor for the variables to specify transfer of a whole section of data. In the example above: 20 bytes starting from DBB0 of DB100 (Station_3).
4. Define a sender in each line of the GD table by selecting the relevant cell and clicking the icon for "Select as Sender" in the toolbar.
.
Date: 05.12.2005File: PRO1_16E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Editing the GD Table
Define Global Data
Open GD Table
Select CPUs
Replication factorReplication factor
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 9
Compiling the You can now compile configuration data from the information you have enteredGD Table in the GD table. The configuration data is generated in two phases:
• Start the first compilation by selecting the menu options GD Table ->Compile. The first time you compile the GD table the individual variables areput into packets and the relevant GD circles are created.The relevant GD circle number, packet number and variable number are displayed in the first column:GD 1.1.1 1st variable in the 1st packet of the 1st GD circleGD 1.2.1 1st variable in the 2nd packet of the 1st GD circle:GD m.3.n nth variable in the 3rd packet of the mth GD circle
• After the first compilation, i.e. when the GD circles and packets have been created, you can define different scan rates or variables for storing status information for the individual packets.
• You must then start the compiler again to include the information about the scan rates and storage of the status information in the configuration data.
Scan Rates You can use the menu options View -> Scan Rates to select a different value (from 1 to 255 for the sender and 1 to 255 for the receiver, 0 for purely event-driven send and receive communication on the S7-400).
Status If you want to be notified whether the data has been transferred with or without errors, you can specify a doubleword for the status information for each data packet by selecting the menu options View -> GD Status. The operating system of the CPU will then enter checkback information in this doubleword.
Date: 05.12.2005File: PRO1_16E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Compiling the GD Table
Compile GD Table
Define scan rates andstatus information
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 10
Downloading When you have compiled the configuration data for the second time, you canthe GD Table download it to the CPUs as follows :
1. Switch all the CPUs involved to STOP mode.2. Select the menu options PLC -> Download to transfer the data.3. When you have successfully downloaded the configuration data, switch the
CPUs involved back to RUN mode. Cyclic exchange of global data starts automatically.
GD Exchange Global data is exchanged as follows:• The sending CPU sends the global data at the end of a cycle.• The receiving CPU transfers the data from the communication part of a CPU
to the S7 address area at the beginning of a cycle.You can specify a scan rate to set the number of scan cycles to elapse before the data is sent or received.
Scan cycle checkpoint
Receive GD
PII
OB1 Cyclic program execution
PIQ
Send GD
Date: 05.12.2005File: PRO1_16E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Downloading GD Configuration Data
Download GD configuration data
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 11
Status Indication You can specify a status doubleword for each GD packet for each CPU "involved". Status doublewords have the identifier "GDS" in the table.
Status Doubleword If you assign the status doubleword (GDS) to a CPU address (e.g. MD 120), youEvaluation can evaluate the status in the user program or on the PG.
Structure of the The GD status doubleword is bit-oriented. The diagram shows the meanings ofStatus Doubleword the bits if they are set. A bit remains set until it is reset by the user program or by a PG
input.Bits which are not labeled are not used and have no meaning at present.The GD status information requires a doubleword in memory. To make this easier to understand, MD 120 is used in the illustration.
Group Status STEP 7 provides group status information (GST) for all GD packets.This group status information, which is also stored in a doubleword with the same structure as the status doubleword (GDS), is the result obtained by OR-ing all the status words.
Date: 05.12.2005File: PRO1_16E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Range length errorin sender
Status of GD Communication
MB 120
7 6 5 4 5 4 3 2 1 0
MB 121
MD 120
7 6 5 4 3 2 1 0
MB 122
6 5 4 3 2 1
MB 123
7 0
DB does not existin sender
GD packet lostSyntax error in GD packet
GD object missing in GD packet
GD objects in sender and receiverare not the same length
Range length error in receiver
DB does not exist in receiver
Sender has performed a restartReceiver has received new data
0
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 12
Date: 05.12.2005File: PRO1_16E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Preparing for Communication
Training Area 2
PG 740
SIEMENS Node No.:.......Station 2
CPU-MPI address: .............
PG 740
SIEMENS Node No.:.......Station 1
CPU-MPI address: .............
Training Area 1
Step 1 Together with your counter-part group define an MPI communication setup.Each group creates a new project "GD Communication" with two hardware stations each (e.g. PLC1 and PLC2) for this purpose.
Step 2 In the above configuration diagram, enter the necessary information and assign in each case the relevant addresses to the PGs (program PG-interface parameter assignment)and the PLCs (CPU parameter, MPI address). Assign parameters to the CPUs of both stations.
Download the configuration to both CPUs using the menu options PLC -> Download.The modules may not yet be physically networked at this time!
Step 3 Connect your system with the Profibus cable.Step 4 Test if both PGs on both PLCs can go online.Step 5 Now configure on one of the two PGs the communication using global data exchange
(see next page).
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 13
Task The number, that is set on the pushwheel button of station "PLC1", is to be displayed on the digital display of station "PLC 2" and vice versa.
What to Do • Create a new project "GD Communiation".• Insert two S7-300 stations "PLC1" and "PLC2".• Assign parameters to the stations for networking via MPI.• Create the GD table according to the task and download it.• Test the communication.
Date: 05.12.2005File: PRO1_16E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Configuring Global Data Communication
Station PLC1Station PLC1 Station PLC2Station PLC2
0 8 1 50 8 1 5
4 7 1 1 4 7 1 1
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 14
Date: 05.12.2005File: PRO1_16E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Monitoring Variables in Several Stations
Task You are to monitor addresses from both CPUs at the same time using Monitor Variable.
What to Do • Create two variable tables as shown in the slide above.Note: Different addesses result for the training units with 32 channel modules.
• For VAT1, establish an online connection to station "PLC1" and for VAT2 an online connection to station "PLC2".
• Select the menu options Window -> Arrange -> Horizontal.• Switch on the test function and monitor the variables.• Change the value on the pushwheel button of station 2 and check if the value is transferred to station 1.
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 15
Introduction You can send and receive global data packets in a program-controlled and therefore event-driven way with SFC60 GD_SND and SFC61 GD_RCV.The scan rate 0 must be specified in the GD table for the purely program-controlled data exchange. You can also use the cyclic-driven and program-controlled modes either separately or combined.
SFC60 "GD_SND" SFC60 collects the data of a GD packet and sends it on its configured way. SFC60 canbe called anywhere in the user program.SFC60 has the CIRCLE_ID (circle no. in which the send packet is found) andBLOCK_ID (packet no. of the packet to be sent) parameters.
SFC61 "GD_RCV" SFC61 fetches the data for exactly one sent GD packet and enters it in the configured area. SFC61 can be called anywhere in the user program.Analog to SFC60, SFC61 has the CIRCLE_ID dnd BLOCK_ID parameters. To guarantee data consistency, all interrupts must be disabled in the user program prior to the SFC60/ 61 calls.For example:
:CALL SFC 39 // "Disable interrupt"CALL SFC 41 // "Delay interrupt"CALL SFC 60/61 // "Send/receive GD"CALL SFC 42 // "Enable delay" CALL SFC 40 // "Enable interrupts" .:
Date: 05.12.2005File: PRO1_16E.15
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Transferring Global Data with SFC 60, 61
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 16
Introduction Instead of the configuration method you have been using up to now, you can use the "NETPRO" tool to configure a network (MPI, Profibus or Industrial Ethernet) graphically. This tool makes things clearer, provides you with documentation, and its tools, e.g. hardware configuration, are easy to invoke.
Opening the Tool You open the tool by double-clicking a network icon, e.g. MPI, in the SIMATIC Manager.
Inserting Hardware The catalog contains the components you need, such as subnets and stations,Stations and you can insert them by drag and drop.
Configuring When you have inserted the stations, you double-click to open the "HardwareHardware Configuration" tool. You use this to set the MPI addresses and establish a connection to
the subnet.
Global Data Click the subnet, e.g. MPI, with the right mouse button and select the menu option "Define Global Data". You create the global data table as before.
Date: 05.12.2005File: PRO1_16E.16
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Configuring with NETPRO
Insert hardware stations
Define global data
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 17
Overview To meet the different communication requirements at cell level (non-time-critical) and field level (time-critical) SIEMENS offers the following subnets.
MPI The MPI subnet is designed for use at cell level. MPI is the multipoint interface in SIMATIC S7, M7 and C7. The MPI is basically a PG interface, i.e. it is designed for the connection of PGs (for startup and testing) and OPs (human-machine interface). The MPI subnet can, however, also be used for networking a small number of CPUs.
Industrial Ethernet Industrial Ethernet is the network for the plant management and cell levels in the SIMATIC open, manufacturer-independent communication system.Industrial Ethernet is designed for non-time-critical transmission of large quantities of data and provides via Gateways facilities for connection to remote networks.
PROFIBUS PROFIBUS is the network for the cell and field levels in the SIMATIC open, manufacturer-independent communication system. There are two versions:• PROFIBUS is for non-time-critical communication between equal, intelligent
nodes at cell level. • PROFIBUS DP is the fieldbus for time-critical, cyclic data exchange
between intelligent masters and field devices.Point-to-Point Point-to-point connections are primarily used for non-time-critical dataConnection exchange between two stations or for connecting devices such as OPs, printers, bar
code scanners, magnetic stripe ID card readers, etc. to a station.
AS Interface The Actuator-Sensor-Interface is a subnet for the lowest process level in an automation system. It enables binary sensors and actuators to be networked.
Date: 05.12.2005File: PRO1_16E.17
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Subnets in SIMATIC
-SINUMERIK, RCM-TI 505-Other PLCS7-300S7-400 M7-400
OPs
SIMATIC S5
PROFIBUS-DP
ET 200B/LET 200C
DP/AS-I link
ASI (Actuator Sensor Interface)
AS-Isubmodules
Sensors and ActuatorsField device with AS-I ASIC
AS-I power supply
Industrial Ethernet
PROFIBUS
MPI network
Point-to-Point
PCs, OS PGsPG 720
Cell level
Field level
AS-Ilevel
Training Centerfor Automation and Drives
ST-7PRO1Communication via MPIPage 18
Global Data This communication method enables data to be exchanged between CPUs cyclically via the MPI interface without programming. Data is exchanged at the scan cycle checkpoint when the process image is updated. On the S7-400 data exchange can also be initiated using SFCs.Global data can be inputs, outputs, bit memories, timers, counters and data block areas.Data communication is not programmed, but configured by means of a global data table. None of the connections on the CPU need to be used for global data communication.
Basic This communication method can be used with all S7-300/400 CPUs forCommunication transmitting data via the MPI subnet or within a station on its K bus.
System functions (SFCs), e.g. X_SEND at the Send end and X_RCV at the Receive end, are called in the user program. The maximum amount of user data is 76 bytes.When the system function is called, a connection to the communication partner is established and cleared dynamically. One free connection is required on the CPU.
Extended You can use this communication method with all S7-400 CPUs. Up toCommunication 64KBytes of data can be transmitted via any subnet (MPI, Profibus, Industrial
Ethernet). This is done with system functions (SFBs), which also allow communication with acknowledgement. Data can also be read from or written to an S7-300 (PUT/GET blocks).You can not only transfer data, but also perform control functions, like Stop or Start, on the communication partner. Configured connections (connection table) are required for communication by this method. These connections are established on a complete restart of the station and usually remain in force. Free connections on the CPU are necessary for this.
Date: 05.12.2005File: PRO1_16E.18
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Event-drivenvia
MPI, Profibus or Industrial Ethernet
Event-drivenvia
MPI or K-Bus
S7 Communication Methods
Global DataGlobal Data
Basic communication( non-configured connection )
Basic communication( non-configured connection ) Extended communication
(configured connection )Extended communication(configured connection )
SFCSFC SFCSFC SFBSFB SFBSFB
Op. Sys.of CPU
Op. Sys.of CPU Op. Sys.
of CPUOp. Sys.of CPU
cyclic or event-driven
via MPI
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 1
Contents Page
Exercises for the Chapter "The SIMATIC Manager" ........................................................................ 2-5Exercises for the Chapter "Editing Blocks" ...................................................................................... 6-13Exercises for the Chapter "Binary Operations" ............................................................................... 14-15Exercises for the Chapter "Digital Operations" ................................................................................. 16-19Exercises for the Chapter "Symbols" ............................................................................................... 20Exercises for the Chapter "Test Functions“ ..................................................................................... 21-25Exercises for the Chapter "Data Storage in Data Blocks" ............................................................... 26-27Exercises for the Chapter "Functions and Function Blocks" ........................................................... 28-33Exercises for the Chapter "Troubleshooting" ................................................................................... 34-40Exercises for the Chapter "HW-Configuration and Memory Concept" ............................................ 41-42Exercises for the Chapter “Organization Blocks" ............................................................................ 43-46Exercises for the Chapter "Analog Value Processing" ..................................................................... 47-50Exercises for the Chapter "Dokumenting, Saving, Archiving" ......................................................... 51Exercises for the Chapter “Communication via MPI" ....................................................................... 52-54
Date: 05.12.2005File: PRO1_17E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Solutions (Version A)
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 2
Date: 05.12.2005File: PRO1_17E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Creating a Project
Note The result of the exercise is displayed in the picture above.
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 3
Date: 05.12.2005File: PRO1_17E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Inserting an S7-Program
Note The result of the exercise is displayed in the picture above.
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 4
Date: 05.12.2005File: PRO1_17E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Inserting an S7-Block
Note The result of the exercise is displayed in the picture above.
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 5
Date: 05.12.2005File: PRO1_17E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: CPU Memory Reset
Note The result of the exercise is displayed in the picture above.
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 6
Note The result of the exercise is displayed in the picture above.
Date: 05.12.2005File: PRO1_17E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Selecting the Mnemonics
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 7
Note The result of the exercise is displayed in the picture above (for the 16-channel training unit).
Date: 05.12.2005File: PRO1_17E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Opening and Editing FC 1
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 8
Note The result of the exercise is displayed in the picture above (for the 16-channel training unit).
Date: 05.12.2005File: PRO1_17E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Changing the Programming Language
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 9
Date: 05.12.2005File: PRO1_17E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Saving FC 1
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 10
Date: 05.12.2005File: PRO1_17E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Downloading a Block into the PLC
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 11
Date: 05.12.2005File: PRO1_17E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Calling FC 1 in OB 1
Note The result of the exercise is displayed in the picture above.
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 12
Date: 05.12.2005File: PRO1_17E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Testing FC 1 (in LAD)
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 13
Date: 05.12.2005File: PRO1_17E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Expanding the Program in the FC 1 Block
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 14
Exercise Complete the programs above to obtain the following functionality: When switch S1 is activated and switch S2 is not activated, the light should be ON in all three cases.
Note ! The terms "NO contact" and "NC contact" have different meanings depending on whether they are used in the process hardware context or as symbols in the software.
Date: 05.12.2005File: PRO1_17E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Normally Open and Normally Closed ContactsTask: In all three examples the light should be on when S1 is activated and S2 is not activated!
I 1.0 I 1.1 Q 4.0 I 1.0 I 1.1 Q 4.0
A I 1.0AN I 1.1= Q 4.0
Q 4.0
I 1.0
I 1.1
&
Q 4.0
I 1.0
I 1.1
&
Q 4.0
I 1.0
I 1.1
&
A I1.0A I1.1= Q 4.0
AN I 1.0A I 1.1= Q 4.0
Software
I1.0
S1
I1.1
S2
I1.0
S1
I1.1
S2
I1.0
S1
I1.1
S2
Q 4.0Programmable controller
LightLight Light
Q 4.0Programmable controller
Q 4.0Programmable controller
FDB
STL
LAD
Hardware
I 1.0 I 1.1 Q 4.0
I 1.0 I 1.1 I 1.0 I 1.1 I 1.0 I 1.1
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 15
FC15: Exercise: Program for a Bottling Plant (Mode Section)Network 1: Plant On/Off
Network 2: Manual Mode
SRS
R Q
Q 8.1
I 0.0
I 0.1
SRS
R Q
& Q 8.2
>=1&
Q 8.1
I 0.4
I 0.5
Q 8.1I 0.4
I 0.5
Network 3: Automatic Mode
SRS
R Q
& Q 8.3
>=1&
Q 8.1
I 0.4
I 0.5
Q 8.1I 0.4
I 0.5
Network 4: Conveyor forward (Jog mode)
&Q 8.2
I 0.2
I 0.3=
Q 20.5
Network 5: Conveyor backward (Jog mode)
&Q 8.2
I 0.3
I 0.2=
Q 20.6
Exercise: Program for a Bottling Plant (Mode Section)
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 16
Date: 05.12.2005File: PRO1_17E.16
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Timers
T4S_PEXT
STVR
BIBCD
Q
I 0.7S5T#5s
I 0.5 Q 8.0
I 0.7
I 0.5
Q8.0
T4S_PULSE
STVR
BIBCD
Q
I 0.7S5T#5s
I 0.5 Q 8.0
I 0.7
I 0.5
Q8.05s
T4S_ODT
STVR
BIBCD
Q
I 0.7S5T#5s
I 0.5 Q 8.0
I 0.7
I 0.5
Q8.0
T4S_ODTS
STVR
BIBCD
Q
I 0.7S5T#5s
I 0.5 Q 8.0
I 0.7
I 0.5
Q8.0
I 0.7
I 0.5
Q8.0
T4S_OFFDT
STVR
BIBCD
Q
I 0.7S5T#5s
I 0.5 Q 8.0
Note The result of the exercise is displayed in the picture above.
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 17
Exercise: Program for a Bottling Plant(Filling Cycle and Bottle Count)
FC16: Exercise: Program for a Bottling Plant (Filling Cycle)Network 1: Filling time for filling bottles
Network 2: Auxiliary memory marker for conveyor operation in automatic mode
Network 3: Count empty bottles
T1
S_PEXT
TV
Q
BI
R
I 16.6
S5T#3s BCD
=
Q 9.0
S
S_CU
PV
Q
BI
R
CV_BCD
S
C 1
C#0
I 16.5 CU
Q 8.1
Network 4: Count full bottles
S_CU
PV
Q
BI
R
CV_BCD
S
C 2
C#0
I 16.7 CU
Q 8.1
QW12
Modified Network 4 for Block FC 15: Conveyor operation forward
&Q 8.2
I 0.2
I 0.3=
Q 20.5>=1
M 50.1
T 1
&Q 8.3=
M 50.1
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 18
Exercise: Program for a Bottling Plant (Production Data)
FC18: Exercise: Program for a Bottling Plant (Production Data)Network 1: Delete memory words if Plant On
Network 2: Count empty bottles
Q8.1MOVE
IN
OUT
ENO
ENP
M 4.1
MD100
I16.5ADD_I
IN2 ENO
OUT
ENP
M 8.5
MW100IN1MW100
1
Network 3: Count full bottles
I16.7ADD_I
IN2 ENO
OUT
ENP
M 8.7
MW102IN1MW102
1
Network 4: Calculate number of broken bottles
SUB_I
IN2 ENO
OUT
EN
MW104IN1MW100
MW102
Network 5: Display number of full bottles
I_BCD
IN
OUT
ENO
EN QW12
MW102
0
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 19
Date: 05.12.2005File: PRO1_17E.19
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise : Program for a Bottling Plant(Number of Packaging Units)
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 20
Date: 05.12.2005File: PRO1_17E.20
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Creating a Symbol Table for FC 15
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 21
Date: 05.12.2005File: PRO1_17E.21
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Monitoring and Modifying Variables
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 22
Date: 05.12.2005File: PRO1_17E.22
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Modifying Variables in the Stop Mode
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 23
Date: 05.12.2005File: PRO1_17E.23
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Using Trigger Points for the Modify Variables Function
(Q 4.6)
Additional network in OB 1 of the S7 program "My Program"
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 24
Date: 05.12.2005File: PRO1_17E.24
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Forcing
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 25
Date: 05.12.2005File: PRO1_17E.25
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Combining Program Status and Monitor Variable
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 26
Date: 05.12.2005File: PRO1_17E.26
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Program for a Bottling Plant - Data Storage (1)
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 27
Date: 05.12.2005File: PRO1_17E.27
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Program for a Bottling Plant - Data Storage (2)
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 28
Date: 05.12.2005File: PRO1_17E.28
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Using Local Variables
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 29
Date: 05.12.2005File: PRO1_17E.29
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Editing a Parameter-assignable FC
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 30
Date: 05.12.2005File: PRO1_17E.30
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Calling a Parameter-assignable FC
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 31
Date: 05.12.2005File: PRO1_17E.31
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Editing a Function Block
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 32
Date: 05.12.2005File: PRO1_17E.32
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Calling a Function Block and Testing It
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 33
Date: 05.12.2005File: PRO1_17E.33
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Recognizing Types of Variables
Absolute SymbolicXXXXX
XX
Temporary Static ParameterXX
XX
X
L #Number_1
T #Max_value
T MW 40
Statement
L #Number_2
L #Intermediate_resultL “Number_1"
T #Number_2
Global
XX
LocalXXXX
X
Question What is not correct in the statement T#Number_2 ?
Number_2 is defined as an input parameter and thus read-only accesses are possible
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 34
Date: 05.12.2005File: PRO1_17E.34
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Finding Stop Errors and Eliminating Them
Incorrect -> Correct InstructionLocationError
CALL FC 30 -> CALL FC 23OB 1, Network 51
T DB4.DBW 2 -> T DB5.DBW 2FC 23, Network 22
T DB5.DBW 40 -> T DB5.DBW 4FC 23, Network 33
L PIW 362 -> L PIW 352 ( L PIW 304 )FC 20, Network 14
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 35
Date: 05.12.2005File: PRO1_17E.35
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Troubleshooting with I Stack, B Stack
Error 1Questions Error 2 Error 3
FC 100, NW 2BTI
In which block and at whichinstruction did the erroroccur?
FC 101, NW 2OPN DB[MW 30] FC 102, NW 2
BCD conversion errorWhat is the cause of the error? Incorrect block numberat OPN DB
I/O accesserror, writing
OB 1, FC 100Which blocks were executedup to the error? OB 1, FC 101 OB 1, FC 102
Accu 1: 8A
Accu 2: 5
Which values were in the accumulators at the errorlocation?
Accu 1: 80
Accu 2: 5
Accu 1: 4868
Accu 2: CAFE
No valid BCD numberin Accu 1Why did the error occur? Incorrect DB number
in MW 30Incorrect I/Oaddress
DB 104Which data blocks wereopen? --- ---
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 36
Date: 05.12.2005File: PRO1_17E.36
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Eliminating Logical Program Errors
Incorrect -> Correct InstructionLocationError
A Q 8.1 -> A Q 8.0FC 15, Network 21
= Q 20.5 -> = Q 20.6FC 15, Network 52
A I 16.1 -> A I 16.6FC 16, Network 13
„>R“ -> „<R“FC 20, Network 24
L 0 -> L 6FC 19, Network 15
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 37
Date: 05.12.2005File: PRO1_17E.37
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Enabling Diagnostic Messages
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 38
Date: 05.12.2005File: PRO1_17E.38
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Outputting User Messages
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 39
Date: 05.12.2005File: PRO1_17E.39
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Enabling Diagnostic Interrupts and Simulating HardwareFaults
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 40
Date: 05.12.2005File: PRO1_17E.40
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Reading Out System Information
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 41
Note The result of the exercise is displayed in the picture above (for the S7-300 16-channel training unit).
Date: 05.12.2005File: PRO1_17E.41
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Reading Out and Adapting the Actual Configuration
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 42
Note The result of the exercise is displayed in the picture above.
Date: 05.12.2005File: PRO1_17E.42
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Assign Parameters to Clock Memory and Test It
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 43
Date: 05.12.2005File: PRO1_17E.43
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Determing type of Startup in OB 100
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 44
Date: 05.12.2005File: PRO1_17E.44
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Setting the System Time
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 45
Date: 05.12.2005File: PRO1_17E.45
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Creating a Flashing Light with Cyclic Interrupt
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 46
Date: 05.12.2005File: PRO1_17E.46
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Writing a Program for a Time-of-Day Interrupt
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 47
Date: 05.12.2005File: PRO1_17E.47
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Assigning Parameters to the Analog Module SM335
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 48
Date: 05.12.2005File: PRO1_17E.48
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Assigning Parameters to the Analog Module SM331
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 49
Date: 05.12.2005File: PRO1_17E.49
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Controlling the Level in a Tank
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 50
Date: 05.12.2005File: PRO1_17E.50
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Diagnostic Interrupt from an Analog Module
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 51
Date: 05.12.2005File: PRO1_17E.51
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Achiving a Project
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 52
Date: 05.12.2005File: PRO1_17E.52
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Preparing for Communication
Training Area 2
PG 740
SIEMENS Node No.:.......Station 2
CPU-MPI address: 3
PG 740
SIEMENS Node No.:.......Station 1
CPU-MPI address: 2
Training Area 1
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 53
Date: 05.12.2005File: PRO1_17E.53
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Configuring Global Data Communication
Training Centerfor Automation and Drives
ST-7PRO1Solutions (Version A)Page 54
Date: 05.12.2005File: PRO1_17E.54
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Exercise: Monitoring Variables in Several Stations
Training Centerfor Automation and Drives
ST-7PRO1Appendix: Special Features of S7-400Page 1
Contents Page
Main Differences to the S7-300 ................................................................................................. 2Technical Specifications of the S7-300 CPUs (1) ............................................................................ 3Technical Specifications of the S7-300 CPUs (2) ............................................................................ 4
Technical Specifications of the S7-400 CPUs (1) ............................................................................ 5Technical Specifications of the S7-400 CPUs (2) ............................................................................ 6
Components of the S7- 400 .............................................................................................................. 7Racks of the S7-400 ………………................................................................................................... 8Module Parameters: Logical Addresses .......................................................................................... 9CPU Parameters: Startup ................................................................................................................. 10CPU Parameters: Interrupts ............................................................................................................. 11CPU Parameters: Local Data ........................................................................................................... 12Configuring Multicomputing Operation ............................................................................................. 13SFC 35 for Synchronization in Multicomputing Operation ............................................................... 14Remove and Insert Interrupt ............................................................................................................. 15
Date: 05.12.2005File: PRO1_18E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Appendix: Technical Specifications andSpecial Features of the S7-400
Training Centerfor Automation and Drives
ST-7PRO1Appendix: Special Features of S7-400Page 2
Introduction In order to be able to rate the technical specifications of the S7-400, you can first of all see the specifications of the S7-300. They are current as of 5.99. For the most current technical specifications, please refer to the ST 70 catalog.
Date: 05.12.2005File: PRO1_18E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Technical Specifications of the S7-300 CPUs (1)CPU
Execution time perBinary instructionLoad/Transfer (Word)16 bit integer (+/-)IEEE flaoting pnt (+/-)
User memoryWork memoryLoad memory integr. Load memory extern
AddressesBit memoriesClock memoriesTimersCounters
Block Types/NumberFBsFCsDB's
Size of process image(inputs/outputs)
max. I/O address area
Integral interfaces
314 IFM
300 ns800 ns1500 ns<50 µs
32 KB48 KB-
2048812864
128128127
124 Byte each
752 Byte each
MPI
315-2 DP
300 ns900 ns1500 ns<35 µs
64 KB96 KB4 MB
2048812864
192192254
128 Byte each
1024 Byte each
MPI, DP
315
300 ns900 ns1500 ns<35 µs
48 KB80 KB4 MB
2048812864
192192254
128 Byte each
768 Byte each
MPI
312 IFM
700 ns2400 ns2400 ns<60 µs
6 KB20 KB-
102486432
3232127
32 Byte each
32 Byte each
MPI
314
300 ns800 nsc1500 ns<50 µs
24 KB40 KB4 MB
2048812864
128128127
128 Byte each
768 Byte each
MPI
313
700 ns2400 ns2400 ns<60 µs
12 KB20 KB4 MB
2048812864
128128127
128 Byte each
32 Byte each
MPI
316-2 DP
300 ns900 ns1500 ns<35 µs
128 KB192 KB4 MB
2048812864
256512511
128 Byte each
1024 Byte each
MPI, DP
318-2 DP
100 ns100 ns100 ns0,6 µs
512 KB64 KB4 MB
81928512512
102410242047
256 Byte each
8192 Byte each
MPI/DP, DP
Training Centerfor Automation and Drives
ST-7PRO1Appendix: Special Features of S7-400Page 3
Date: 05.12.2005File: PRO1_18E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
313
OB-No.110203540-10080-82, 85, 87121,122
1536 Byte
8 KB8
4
4
1
1
22 bytes
CPU
Organization blocksFree cycleTime-of-day interruptsTime-delay interruptsCyclic interruptsHardware interruptsBackground executionStartupErrors, asynchronous
Errors, synchronous
Local data
max. Block lengthBlock nesting depth
per execution level
Program-controlledcommunication: max. Number of connections
Global Data communication via MPI:GD circles per CPU
Send GD packets perGD circle
Receive GD packets perGD circle
max. user data size of a packet
Technical Specifications of the S7-300 CPUs (2)314 IFM
OB-No.110203540-10080-82, 85, 87121,122
1536 Byte
8 KB8
4
4
1
1
22 bytes
315-2 DP
OB-No.110203540-10080-87
121,122
1536 Byte
16 KB8
4
4
1
1
22 bytes
315
OB-No.110203540-10080-82, 85,87121,122
1536 Byte
16 KB8
4
4
1
1
22 bytes
312 IFM
OB-No.1---40-100-
-
512 Byte
8 KB8
4
4
1
1
22 bytes
316-2 DP
OB-No.110203540-10080-87
121,122
1536 Byte
16 KB8
4
4
1
1
22 bytes
318-2 DP
OB-No.110,1120,2132,3540,4190100,10280-87
121,122
4096 Byte
64 KB16
32
8
1
2
54 bytes
314
OB-No.110203540-10080-82, 85, 87121,122
1536 Byte
8 KB8
4
4
1
1
22 bytes
Training Centerfor Automation and Drives
ST-7PRO1Appendix: Special Features of S7-400Page 4
CPU Types CPUs are available with the appropriate execution times, sufficient work memory capacity and a suitable number of blocks for every performance range.
Process I/O The logical addresses of the I/O modules are all in a linear address area of appropriate size. The addresses of the slave stations connected to the integral DP interface are also mapped in this linear address area. This enables distributed I/Os to be accessed in the same way as central I/Os in the user program.The address parameters for both central and distributed I/Os are assigned with STEP 7.
Date: 05.12.2005File: PRO1_18E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Technical Specifications of the S7-400 CPUs (1)
*) 1 byte = 8 digital inputs/outputs
2 bytes = 1 analog input/output
CPU
Execution time perBinary instructionLoad/Transfer (word)16-bit integer (+/-)IEEE floating pnt (+/-)
User memory Work memoryLoad memory integr. Load memory extern
Addresses Bit memoriesClock memoriesTimersCounters
Block Types /NumberFBsFCsDB's
Size of Process Image (inputs/outputs)
Max. I/O address area
Integral interfaces
414-1
100 ns100 ns100 ns0.6 µs
128 KB8 KB15 MB
81928256256
51210241023
256 byteseach
2 Kbyte each*)
MPI
416-1
80 ns80 ns80 ns0.48 µs
512 KB16 KB15 MB
163848512512
204820484095
512 byteseach
4 KByteeach *)
MPI
414-2 DP
100 ns100 ns100 ns0.6 µs
128/384 KB8 KB15 MB
81928256256
51210241023
256 byteseach
4 Kbyte each*)
MPI, DP
412-1
200 ns200 ns200 ns1.2 µs
48 KB8 KB15 MB
40968256256
256256511
128 bytes each
0.5 Kbyte each*)
MPI
413-2 DP
200 ns200 nsc200 ns1.2 µs
72 KB8 KB15 MB
40968256256
256256511
128 byteseach
1 Kbyte each*)
MPI, DP
413-1
200 ns200 ns200 ns1.2 µs
72 KB8 KB15 MB
40968256256
256256511
128 bytes each
1 Kbyte each*)
MPI
416-2 DP
80 ns80 ns80 ns0.48 µs
0.8/1.6 MB16 KB15 MB
163848512512
204820484095
512 byteseach
8 KByteeach *)
MPI, DP
417-4
100 ns100 ns100 ns0.48 µs
4...20 MB256 KB64 MB
163848512512
614461448191
1024 bytes each
16 KByteeach*)
MPI,4 x DP
Training Centerfor Automation and Drives
ST-7PRO1Appendix: Special Features of S7-400Page 5
Communication The S7-400 offers a variety of facilities for communication:1. Integral Multi-Point-Interface (MPI), for connection of PGs/PCs, HMI
systems, M7-300/400 systems and other S7-300/400 systems as active nodes.
2. Integral PROFIBUS-DP interfaces on CPUs 413-2/414-2/416-2/417-4 forconnection of distributed I/O stations (e.g. ET200) to the CPU.
3. Communication processors such as CP443, for connection to the PROFIBUS and Industrial Ethernet bus systems.
4. Communication processors such as CP441, for powerful point-to-point (PtP) communication to other S7 or S5 PLCs or PLCs from other manufacturers.
S7 Functions There are two types of S7 communication functions:S7 basic communication: These services can be used for exchanging small quantities of data (up to 76 bytes) between communication partners (S7-300/400) via MPI orwithin a station (or to intelligent slaves via PROFIBUS-DP). The necessary communication SFCs are integrated in the operating system. You don't need to configure the connections. You assign the communication resources and specify the address of the communication partner direct in the SFC call. S7 extended communication: These services enable larger quantities of data (up to 64KBytes) to be exchanged on any network (MPI, Profibus or Industrial Ethernet). The necessary SFBs are integrated in the operating system of the S7-400 (not S7-300, S7-300 as server only). They need configured connections when called. Configured connections are established in accordance with the connection table on power up and the relevant resources are assigned statically.
Date: 05.12.2005File: PRO1_18E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
CPU
Organization blocksFree cycleTime-of-day interruptsTime-delay interruptsCyclic interruptsHardware interruptsMulticomp. interruptBackground executionStartupErrors, asynchronousErrors, synchronous
Local data
Max. block lengthBlock nesting depth
per execution level
Program-controlled communication: max. number of connections
Global data communication via MPI:GD circles per CPU
Send GD packets per GD circle
Receive GD packets perGD circle
Max. user data size of apacket
Technical Specifications of the S7-400 CPUs (2)414-1
OB No.110-1320-2332-3540-436090100-10280-87121,122
8 KB
64 KB16
32
8
1
2
54 bytes
416-1
OB No.110-1720-2330-3840-476090100-10280-87121,122
16 KB
64 KB16
64
16
1
2
54 bytes
414-2 DP
OB No.110-1320-2332-3540-436090100-10180-87121,122
8 KB
64 KB16
32
8
1
2
54 bytes
412-1
OB No.110,1120,2132,3540,416090100-10280-87121,122
4 KB
64 KB16
8
8
1
2
54 bytes
413-2 DP
OB No.110,1120,2132,3540,416090100-10280-87121,122
4 KB
64 KB16
16
8
1
2
54 bytes
413-1
OB No.110,1120,2132,3540,416090100-10180-87121,122
4 KB
64 KB16
16
8
1
2
54 bytes
416-2 DP
OB No.110-1720-2330-3840-476090100-10280-87121,122
16 KB
64 KB16
64
16
1
2
54 bytes
417-4
OB No.110-1720-2330-3840-476090100-10280-87121,122
24 KB
64 KB24
64
16
1
2
54 bytes
Training Centerfor Automation and Drives
ST-7PRO1Appendix: Special Features of S7-400Page 6
Differences The main differences between the S7-400 and the S7-300, with which you have been working in this course, are listed above.
Date: 05.12.2005File: PRO1_18E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Main Differences to the S7-300
Larger memory and more I/Q/M/T/C
Addresses of input/output modules selectable
Can connect EUs from S5 and use S5 CP/IP modules
More system functions, e.g. programmed block communication
Block size up to 64KB and twice as many DBs
Complete restart and restart
Preset/actual comparison of configuration on startup
Modules can be removed without disconnecting the power supply
Several part process images
Priorities of OBs are parameter-assignable
Several OBs for cyclic, hardware and time-of-day interrupts
Block nesting up to 16 levels
Size of L Stack selectable for each execution level
4 accumulators
Multicomputimg
Training Centerfor Automation and Drives
ST-7PRO1Appendix: Special Features of S7-400Page 7
Racks The following racks are available for S7-400 PLCs.• UR1/UR2 are universal racks and can be used as either central racks or
extension racks. They have 18/9 single-width slots with P and K bus.• ER1/ER2 are extension racks without a K bus.• CR2 is a segmented central rack for asymmetrical multicomputing.
S7-CPUs The S7-400 CPUs are upward compatible for all STEP 7 user programs. There are two versions: single-width and double-width with integrated DP master interface. The integrated DP interface enables up to 64 DP slave stations to be addressed. The maximum transmission rate is 12 Mbps.
FMs The FMs for positioning, closed-loop control and counting replace the S5-IP range.
IMs Interface modules can be used for connecting SIMATIC S7 and SIMATIC S5 extension racks to an S7-400 central rack.
CPs CP modules enable a CPU to be hooked up to the following networks:• Industrial Ethernet (CP 443-1)• PROFIBUS (CP 443-5)• Point-to-Point network (CP441-1 and CP441-2).Each CPU also has an MPI interface for connection to an MPI network. Up to 32 nodes can be connected to an MPI network.
Date: 05.12.2005File: PRO1_18E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Components of the S7- 400
CPUsCPUs
CPU 412-1CPU 413-1, 413-2 CPU 414-1, 414-2,CPU 416-1, 416-2CPU 417-4
RacksRacks
- Universal rack (UR 1/2) for use as CR and ER
- Extension rack (ER 1/2)- Segmented central rack (CR2)
Signal modules (SM)Signal modules (SM)
- DI/DO 32,16,8 channels- DO wit h relay output- AI/AO 16,8 channels- diagnostics-capable
modules
Communicationprocessors (CP)
Communicationprocessors (CP)
- Point-to-PointCP441-1, 1- channelCP441-2, 2- channel
- NetworksProfibus Ethernet
Power supplies (PS)Power supplies (PS)
- AC 120V/230V, 4A/10A/20A- DC 24V, 4A/10A/20A
Functionmodules (FM)Function
modules (FM)
- Counting- Positioning- Closed-loop control
Training Centerfor Automation and Drives
ST-7PRO1Appendix: Special Features of S7-400Page 8
UR 1 / UR 2 UR1/UR2 can be used both as central and as extension rack. They have a parallelPeripheral Bus (P bus) for the high-speed exchange of I/O signals (1.5 microsec./ Byte) and the time critical access of the signal module process data.In addition, UR1 (18 slots) / UR2 (9 slots) have a serial, powerful Communication bus(K bus) for high-speed data exchange (10.5 Mbps) between K bus stations (S7/M7 CPUs, FMs, CPs, ).By separating the P BUS and K BUS, each task is assigned its own bus system. Control and communication have their own separate "data highways". That way, the communication tasks do not slow down the control tasks.
CR2 The segmented rack CR 2 features an I/O bus divided into two segments with 10 and 8 slots. One CPU can be used for each segment. Both CPUs are respectively master for their P bus segment and can only access their own SMs. Operating mode transitions are not synchronized, that is, the CPUs can be in different operating modes. Both CPUs can communicate via the continuous K bus.
Why CR2? All CPUs (max. 4) have the same operating mode in symmetrical multicomputing, e.g.STOP, that is, the operating mode transitions are synchronized.
ER 1 / ER 2 ER1 (18 slots) / ER2 (9 slots) have no K bus, no interrupt lines, no 24 V power supply for the modules and no battery power supply.
No Slot Rules Exception: PS on the far left and Receive IM in the ER on the far right!
Date: 05.12.2005File: PRO1_18E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Racks of the S7 - 400
UR1 / UR2(Universal Rack)
Type of Rack Centralrack
Extensionrack
Usable in
Yes Yes
P busER1 / ER2(Extension Rack)
No Yes
P bus
K bus
CR2(Central Rack)
NoYesP bus, Segment 1
K bus
P bus, Segment 2
Training Centerfor Automation and Drives
ST-7PRO1Appendix: Special Features of S7-400Page 9
General The S7-400 has default addresses for the I/O modules. These defaults remain active until a configuration is downloaded to the CPU.The system generates these default addresses from the geographic addresses.
Addresses The default settings correspond to the slot-dependent addressing of theS7-300.The address depends on the slot in which the module is inserted in the rack. It is calculated as follows: • digital starting address = [(rack number) x 18 + slot no. -1] x 4• analog starting address = [(rack number) x 18 + slot no. -1] x 64 + 512The rack number is set on the receive-IM (No. 1 to 21). The central rack always has the number 0.Variable (slot-dependent) addresses of the I/O modules are established using the HW Config tool.
Part Process Image In additon to the (full) process image (PII and PIQ), you can assign parameters for up to 8 part process images for an S7-400 CPU (No. 1 to No. 8). You can update each part process image in the user program using SFCs. This means that you can deactivate cyclic updating of the process image and implement event-driven updating of the process image in the user program.
Date: 05.12.2005File: PRO1_18E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Module Parameters: Logical Addresses
Training Centerfor Automation and Drives
ST-7PRO1Appendix: Special Features of S7-400Page 10
Date: 05.12.2005File: PRO1_18E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
CPU Parameters: Startup
Preset/Actual For specifying whether the CPU should stall start up if the actual I/ODifference configuration differs from the preset configuration.
Delete PIQ!!! The process image output table is deleted in the first residual cycle on hot restart. Always select this if possible.
Restarts On Complete Restart (warm restart), the M/C/Ts are reset and the user program starts from the beginning.On Restart (hot restart), the retentive M/C/Ts are not reset and execution of the user program resumes at the point of interruption.
Actions The operating system performs the following actions on startup:
• deletes stacks (CR)• resets non-retentive bit memories, timers, counter (CR)• resets process image output table PIQ (CR), takes action as instructed by
parameter assignment (R)• resets external output area (CR), takes action as instructed by parameter
assignment (R)• resets interrupts (CR/R) by means of OD• updates system status list (CR/R)• transfers configuration to modules (CR/R)
(CR= complete restart, R= restart).
Training Centerfor Automation and Drives
ST-7PRO1Appendix: Special Features of S7-400Page 11
Hardware Interrupts This parameter block is for setting the priorities of the hardware interrupt organization blocks. Permissible entries are 0 and the values from 2 to 24(0 = deselect).Priorities range from 1 to 24 and if two interrupts occur at the same time, the one with the higher priority is processed first.There are 8 independent of one another hardware interrupts, each with its own organization block. You assign the interrupt OBs to the interrupt modules when assigning the I/O module parameters.
Time-Delay Interrupts A time-delay interrupt is a delayed one-time call of an organization blockactivated, for example, when a process signal is received.In this parameter block of the Interrupts tab page you can set the priorities of the time-delay interrupts. Permissible entries are 0 and values from 2 to 24 (0 = Deselect). Time-delay interrupts are handled by SFCs 32 to 34.
• SFC32 "SRT_DINT" = Start time-delay interrupt.• SFC33 "CAN_DINT" = Cancel time-delay interrupt• SFC34 "QRY_DINT" = Query status of time-delay interrupt
Communication The arrival of communication data can be indicated by communication interruptsInterrupts to enable the data received to be evaluated as quickly as possible.(coming soon)
• Global Data interrupt (OB50)• SFB communication interrupt (OB51)
Date: 05.12.2005File: PRO1_18E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
CPU Parameters: Interrupts
Training Centerfor Automation and Drives
ST-7PRO1Appendix: Special Features of S7-400Page 12
Date: 05.12.2005File: PRO1_18E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
CPU Parameters: Local Data
Local Data The system reserves 256 bytes in the local data stack (default setting) for every execution level.If the user program requires little or no local data in several levels, you can specify the local data requirements you want (scratchpad memory) per level (OB).
The maximum amount of local data depends on the type of CPU:CPU 412 -> 4 Kbyte of local dataCPU 413 -> 4 Kbyte of local dataCPU 414 -> 8 Kbyte of local dataCPU 416 -> 16 Kbyte of local dataCPU 417 -> 24 Kbyte of local data
Training Centerfor Automation and Drives
ST-7PRO1Appendix: Special Features of S7-400Page 13
Date: 05.12.2005File: PRO1_18E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Configuring Multicomputing Operation
Overview Multicomputing operation is the synchronous operation of several CPUs (2 to 4) in an S7-400 central rack. The CPUs startup together, if they have the same startup mode (complete restart or restart) and they also go into the STOP mode together.
Setting Up You can set up a multicomputing operation by inserting several multicomputing-Multicomputing capable CPUs in a suitable rack. The infotext in the "Hardware Catalog" indicates
whether a CPU is multicomputing-capable.The CPUs participating in multicomputing, "divide" a common address area, that is, the adress area of a module is always assigned to a specific CPU.
What to Do You can configure the multicomputing operation as follows:1. Line up all the CPUs necessary for the multicomputing operation.2. Double-click on the CPUs and adjust the CPU number in the
"Multicomputing" tab.3. To assign a module to a specific CPU, proceed as follows:
- Arrange the modules in the rack.- Double-click the modules and select the "Addresses" tab.- In the "CPU Nu.." field select the number of the CPU you want.
For interrupt capable modules, the CPU assignment is displayed as the target CPU in the "Inputs" or "Outputs" tab.
You can make the modules that are assigned to a specific CPU stand out optically in the table by selecting the menu options View -> Filter -> CPU No.x Modules.The parameter assignment data for a station are always downloaded into all participating CPUs; downloading into only one CPU is not possible. That way, inconsistent configurations are avoided.
Training Centerfor Automation and Drives
ST-7PRO1Appendix: Special Features of S7-400Page 14
Date: 05.12.2005File: PRO1_18E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
SFC 35 for Synchronization in Multicomputing Operation
Parameter Declaration Data type Memory Description
JOB INPUT BYTE I, Q, M, D, L, Const. Task identifier (possible values: 1 to 15)
RET_VAL OUTPUT INT I, Q, M, D, L Return value (error code).
Description The call of SFC 35 "MP_ALM" triggers the multicomputing interrupt. This leads to the synchronized start of OB60 on all relevant CPUs. With single-processor operation and with operation in a segmented rack, OB 60 is only started on the CPU in which you called the SFC 35.You can use the input parameter JOB to identify the cause for the multicomputing interrupt that you wanted. This task identifier is transferred to all relevant CPUs and you can evaluate it in OB 60.You can call SFC 35 (MP_ALM) anywhere in your program. Since this call only makes sense in RUN mode, the multicomputing interrupt is suppressed when it is called in the STARTUP mode. A function value informs you of this.
Error Code If an error occurs while the function is being executed, the return value receives an error code:
W#16#0000: No error has occurred.
W#16#8090: The input parameter JOB contains an invalid value.
W#16#80A0:The OB 60 execution of the preceeding multicomputing interrupt is not yet completed in its own or in another CPU.
W#16#80A1: Incorrect operating mode (STARTUP instead of RUN).
Training Centerfor Automation and Drives
ST-7PRO1Appendix: Special Features of S7-400Page 15
Date: 05.12.2005File: PRO1_18E.15
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Remove and Insert Interrupt
Module exists
Module available
Remove/Insert interrupt
Parameter assignment of module through the operating system
Removing amodule
Inserting amodule
max.
1smax.
1s
Remove and Insert In the S7-400, it is possible to remove and to insert modules while powered upInterrupt OB83 in RUN or in STOP mode. The exceptions to this are CPUs, PSs, S5 modules in
adapter modules and IMs.After removing a module in the RUN mode, you can - depending on the situation - call the following organization blocks from the CPU‘s operating system:• OB 85-Process image update• OB 122-I/O access error• OB 83- Remove&Insert event. You must take into consideration that OB 83 is only called after approximately 1sec., while the other OBs, as a rule, become active much sooner.After you insert the module, it is checked by the CPU and - if no type error exists - it is assigned parameters. After a correct parameter assignment, the module is available for use.If an error is recognized during parameter assignment, the diagnostic interrupt OB82 is automatically started.
Start Information The following information exists in the local data of OB83:in OB83 • module removed or inserted
• logical address of the module• type of module
Replacement Value You can specify replacement values for the missing process signals of an input module by using a system function.
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 1
Contents Page
Automating with SIMATIC S7 ........................................................................................................... 2The SIMATIC S7/C7/M7 and WinAC Controllers .............................................................................. 3STEP 7- Software for S7/C7/M7 .......................................................................................................... 4Programming Sequence Control Systems with S7- GRAPH ........................................................... 5Programming using the State Diagram Method with S7- HiGraph .............................................. 6Programming in the High Level Language S7- SCL ......................................................................... 7CFC for SIMATIC S7 and SIMATIC M7 .............................................................................................. 8Configuring Sequence Control Systems with S7- SFC ..................................................................... 9Process Diagnosis with S7- PDIAG .................................................................................................... 10Testing User Programs with S7- PLCSIM ……….......................................................................... 11Remote Maintenance and Remote Diagnosis with TeleService ...................................................... 12Creating Plant Documentation with DOCPRO ........................................................................... 13Runtime Software for Closed-loop Control Engineering Tasks ......................................................... 14Borland C/C++, M7- ProC/C++ and M7- SYS RT for M7 Automation Computers .......................... 15Communicating with SIMATIC NET ................................................................................................. 16Operator Control and Process Monitoring with SIMATIC HMI .......................................................... 17Consistent Configuration with SIMATIC ProTool ............................................................................. 18Process Visualization and Operator Control with WinCC .................................................................. 19Process Automation with SIMATIC PCS 7 ....................................................................................... 20Summary ……................................................................................................................................ 21
Date: 05.12.2005File: PRO1_19E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Totally Integrated Automation
SIMATICWinCC
SIMATIC PC
SIMATIC DP
SIMATIC Controller
SIMATIC HMI
SIMATIC NET
SIMATICPCS 7
SIMATIC Software
SIMATIC
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 2
Introduction In the past, the SIMATIC product name was frequently used as a synonym forprogrammable logic controllers.
Today SIMATIC has come to mean much more: SIMATIC is the basic automation system for solving automation tasks in all industries. It consists of standard components in hardware and software, that offer a multitude of possibilities for customer-specific expansions.
Two factors have lead to this solution:• the new, comprehensive SIMATIC software, that has the optimal tool for every phase of an automation project and• the members of the SIMATIC automation family, that are more than just
programmable logic controllers.
TIA Totally Integrated Automation is the new way of uniting production and process control technology. All hardware and software components are thus united in a single system with the name SIMATIC. This total integration is made possible by a threefold integraton:• common data management (data are only entered once),• common configuring and programming (modular software),• common communication (simple and uniform configuration).
In the slide you can see the individual components of TIA.
Date: 05.12.2005File: PRO1_19E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Automating with SIMATIC S7
ASI
PROFIBUS-DP
S7-200 S7/M7-300 S7/M7-400
OP...OS
7 8 9
4 5 6
1 2 3
0
.D E F
A B C INSDELSHIFT HELP
ESC
ENTER
ACK
SIMATIC OP17
SHIFT
HELPK1 K5 K6 K7 K8K2 K3 K4
K9 K10 K11 K12 K13 K14 K15 K16
F1 F5 F6 F7 F8F2 F3 F4
S I M A T I C O P 1 74 x 2 0 Z e i c h e n
6 / 1 1 m m S c h r i f t h ö h e8 x 4 0 Z e i c h e n
Z e i c h e n g r ö ß e n b e l i e b i g m i s c h b a r
Standard Tools
Engineering Tools
Runtime Software
SIMATIC SOFTWARE
WIN CC PCS 7
SIMATIC NET
ET200
FM
SV
Industrial Ethernet PROFIBUS
MPI Network
SIMATIC PGSIMATIC PC
PG 740
SIEMENS
SIMATIC Controller
SIMATIC HMI
SIMATIC DP
WinAC
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 3
SIMATIC S7 The programmable logic controller family consists of the Micro PLC (S7-200) performance range, the lower performance range (S7-300) and the middle/upper performance range (S7-400).
SIMATIC M7 The M7 PLC system brings AT compatible computer performance to the PLC and, vice versa, PLC functionality to the computer user in the computer world while keeping the familiar programming environment.The M7-300 and M7-400 automation computers expand the PLC family by an open hardware and software platform. They consist of an AT compatible computer with the proven real-time multitasking operating system RMOS.M7 is always installed in situations where high computer performance and the demanding tasks of process data management and visualization are required.
SIMATIC C7 This complete system is the combination of a PLC (S7-300) and an operator panel of the HMI operator control and process monitoring system. The integration of programmable logic controller and operator panel in one device makes complete machine controls in the smallest space and at an economical price possible.
WinAC WinAC is a PC-based solution. It is used when various automation tasks (control, visualization, data processing) are to be solved with a PC.
There are 3 different products:
• WinAC Basic as pure software solution (PLC as Windows NT-Task),• WinAC Pro as hardware solution (PLC as PC card),• WinAC FI Station Pro as complete solution (SIMATIC PC FI25)
Date: 05.12.2005File: PRO1_19E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
The SIMATIC S7/C7/M7 and WinAC Controllers
modular
SIMATIC S7 - 400
modular
SIMATIC S7 - 300
modular
SIMATIC M7 - 300
complete
SIMATIC C7 - 620
SIMATIC S7 - 200
compact
modular
SIMATIC M7 - 400
Upper andmiddle performancerange
Lower performancerange
Micro PLC
SIMATIC WinAC Pro
SIMATIC WinAC Basic
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 4
STEP 7 Micro for configuration, service and commissioning of S7-200 logic controllers
STEP 7 Mini for programming, service and commissioning of simple stand-alone applications of S7-300 and C7-620.Unlike STEP 7, there are the following restrictions:• cannot (additionally) load option packages, for example, Engineering Tools.• no communication configuration (CPU - CPU communication) possible.
STEP 7 Basic package for project planning and programming S7-300/400 logic controllers, with interfaces to the option packages.
Options Options are software packages for S7/ M7 for program generation, debugging and commissioning:• S7-SCL = PASCAL-similar high level language.• S7-GRAPH = Graphic programming of sequence control systems. • S7-HiGraph = Graphic programming of machining sequences. • CFC = Graphic configuring and interconnection of blocks.• S7-PLCSIM = Testing the program logic offline on the PG/PC.• S7-Pdiag = Process diagnostics for logic controllers and sequence control systems.• TeleService = Extension of the MPI interface via the telephone network.• HARDPRO = Configuration software for hardware.• DOCPRO = Documentation software.
Closed-loop Control Runtime Software (standard function blocks and parameter assigning tools) for (Engineering) solving closed-loop control engineering tasks:
M7 • Borland C/C++ = Programming environment for M7• M7-ProC/C++ = Integration of Borland C/C++ in STEP 7 (Debugger)• M7-SYS = Operating system for M7
Date: 05.12.2005File: PRO1_19E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
STEP 7 Software for S7/C7/M7
STEP 7 Mini
Standard ToolsEngineering Tools
S7-300 S7-300C7
S7-400C7
M7-300M7-400
M7-SYS
STEP 7
Runtime Software ToolsCFC
DOCPRO
TeleService
S7-PDIAG
S7-PLCSIM
S7-HiGraph
S7-Graph
S7-SCL
PID Control
Fuzzy Control
Neuro Systems
M7-ProC/C++
Borland C/C++
S7-200
STEP 7 MicroLAD / STL
S7-200Support
LAD / STL
Manager
S7-300Support
S7-300Support
S7-400Support
Manager
STL LAD FBD
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 5
S7-GRAPH With the S7-GRAPH programming language, you can clearly and quickly configure and program sequential sequences that you wish to control with an S7 PLC system.The process is thus split into single steps with their own function scope. The sequence is graphically displayed and can be documented with picture and text.The actions to be performed and the transitions, which control the conditions for switching to the next step, are determined in the individual steps. Their definitions, interlocking or monitoring are determined by a subset of the STEP 7 programming language LAD (ladder diagram).S7-GRAPH for S7-300/400 is compatible with the sequence language established in the IEC 1131-3 standard.
Functionality The following functions are offered:• Several sequencers in the same S7-GRAPH function block• Free number assignment of the steps and transitions • Simultaneous branches and alternative branches• Jumps (also to other sequence cascades)• Starting/Stopping of sequence cascades as well as activating/holding of
steps.
Test Functions • Display of active steps or faulty steps• Status display and Modify Variable• Switching between the operating modes: manual, automatic and jogging mode
User Interface • Overview, Single Page and Single-step display• Graphic separation of locking controls and monitoring conditions.
Date: 05.12.2005File: PRO1_19E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
S1
Programming Sequence Control Systems with S7- GRAPH
S7-GRAPH: The tool for programming sequence cascades
Compatible with IEC 1131-3Designed for the requirements ofproduction engineeringGraphic division of the processinto steps and transitionsSteps contain actionsTransitions check the conditions for switching to the next step
The following phases of automation can be optimized with S7-GRAPH:
Planning, ConfiguringProgrammingDebuggingCommissioningMaintenance, Diagnostics
S2
T1
T2
S4
T3
S6
T4
T5
S5
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 6
Overview S7-Higraph allows the asychonous processes to be described using state diagrams. The machine or system to be automated is looked upon as a combination of independent elements, the function units.
Function Units The function units are the smallest mechanical units of a machine or system. As a rule, a function unit is made up of mechanical and electrical basic elements. In programming, a state diagram is assigned to every function unit. In it, the functional, that is, the mechanical and electrical properties of the function unit are mapped.
State Diagram The state diagram describes the dynamic behaviour of a function unit. It describes the states that a function unit can have, as well as the state transitions. State diagrams can be used more than once. State diagrams that were created once for a specific function unit, can be reused in other progam locations.
Diagram Groups By combining parallel running state diagrams, you can describe the completeand Instances functionality of a machine or system.
Advantages This "object-oriented" method of S7-HiGraph is well suited for:• the machine and system manufacturer (mechanical engineering)• the automation specialist (electrical engineering) as common means of
description• the commissioning engineer and the maintenance specialistThe state diagram method helps to optimize the entire process for the creation of a machine or system in the sense of shorter development and turnaround time as well as less commissioning time.
Date: 05.12.2005File: PRO1_19E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Programming using the State Diagram Method with S7- HiGraph
1 2 4
PositionCam-operated switch
Index in
Index out
Counterbearinglock/release
pieceTurn left
Turn right
Motor
IndexCounterbearingMotor
Coordinator
S7-HiGraph: The tool for programming using State Diagrams
Division of the machine intofunctional unitsCreating state diagramsfor every function unitStates contain actionsState diagrams communicateusing messages
The following phases of automation can be optimized with S7-HiGraph:
Planning, ConfiguringProgramming and DebuggingCommissioningMaintenance, DiagnosticsSupports reuseability
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 7
Overview S7-SCL (Structured Control Language) is a PASCAL-similar high level text language for S7 - 300/400 and C7 and simplifies the programming in control technology for mathematical algorithms, data management and organization tasks.S7-SCL has the PLCopen Base Level certificate and is in accordance with the IEC 1131-3 (Structured Text) standard.With S7-SCL, you can formulate time-saving and economical solutions for automation tasks.
Functionality SCL offers the functional scope of a high level language such as:• loops• alternatives• branch distributors, etc.combined with control-specific functions such as:• bit accesses to the I/O, bit memories, timers, counters etc.• access to the symbol table• STEP7 block accesses
Advantages of SCL • simple to learn programming language especially for beginners• easy to read (understandable) programs are generated.• simpler programming of complex algorithms and processing of complex data
structures• integral debugger for symbolic debugging of the source code (single-step,
breakpoints, etc.)• system integration in S7 languages such as STL and LAD.
Date: 05.12.2005File: PRO1_19E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Programming in the High Level Language S7- SCLFUNCTION_BLOCK IntegratorVAR_INPUT
Init : BOOL; // Reset output valuex : REAL; // Input value Ta : TIME; // Sampling interval in msTi : TIME; // Integration time in msolim : REAL; // Output value upper limit ulim : REAL; // Output value lower limit
END_VAR
VAR_OUTPUTy : REAL:= 0.0; // Initialize output value with 0
END_VAR
BEGIN IF TIME_TO_DINT(Ti) = 0 THEN // Division by ?
OK := FALSE;y := 0.0; RETURN;
END_IF;IF Init THEN
y:= 0.0;ELSE
y := y+TIME_TO_DINT(Ta)*x/TIME_TO_DINT(Ti); IF y > olim THEN y := olim; END_IF; IF y < ulim THEN y := ulim; END_IF;
END_IF; END_FUNCTION_BLOCK
S7-SCL: High level language for creating PLC programs
Compatible with IEC 1131-3Text(ST=Structered Text))Certified according to PLCopenBase LevelContains all the typicalelements of a high level language, such asoperands, terms, control statementsPLC specifics are integrated, such as I/O access, timers, counters...)
Advantages:Well structured, easy tounderstand programFor those knowlegeable in highlevel langugagesFor complex algorithms
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 8
Overview With the engineering tool CFC (Continuous Function Chart), you can create SIMATIC S7 or SIMATIC M7 automation tasks by drawing a technology plan - similar to a Function Block Diagram in PLC programming.In this graphic programming method, blocks are positioned in a type of drawing sheet and are graphically interconnected with one another. You can quickly and easily convert technological aspects into complete executable automation programs with CFC.
Scope The following is supplied with CFC:• CFC Editor• Code Generator• Debugger• Standard block libraries
Customer Benefits • The CFC product, as an option package, is smoothly integrated in the STEP 7 architecture with a unified Look&Feel and with common data management. CFC is easy to use, easy to learn and provides consistent data
management.• You can use CFC for simple tasks as well as for very complex tasks.• Simple interconnection technology makes communication between blocks user-friendly to configure.• Manual handling and management of machine resources is no longer
necessary.• User-friendly testing and debugging are supported
Date: 05.12.2005File: PRO1_19E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
CFC for SIMATIC S7 and SIMATIC M7
CFC (Continuous Function Chart):Tool for graphic creation of PLC programs
Blocks are placed on function charts and interconnectedInterconnection is possible:- between I/O fields- also to blocks in
other chartsSources and destinations are managed in themargins
AdvantagesProgram creation fortechnologistsquick creation, testing and commissioning times
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 9
SFC (Sequential SFC is a sequence control system with step by step execution, that was Function Chart) designed especially for the demands of process control systems (process engineering,
process control engineering, etc.).The typical fields of application for sequence control systems of this type are in the areas of discrete production processes. Sequence control systems can, however, also be installed in continuous systems, for example, for startup or shutdown, working point changes as well as state changes due to disturbances etc.With SFC, for example, product manufacturing specifications can be written as event-driven processes.
Principle In the SFC Editor, you generate the flow chart by graphic means. The structureMethod of Operation elements of the plan are thereby placed according to fixed rules. You do not have to
worry about details such as algorithms or the allocation of machine resources, but instead can concentrate on the technological aspects of the configuration.After generating the plan topology, you switch into the detail display (zoom-in configuration) and there assign parameters to the individual elements, that is, you configure the actions (steps) and the conditions (transitions).In the programming of actions, functions of the basis automation, typically generated with CFC, are controlled or selectively processed per operating change and state change.After configuration, you generate the executable machine code through the SFC, download it into the PLC and test it with the SFC test functions.
Date: 05.12.2005File: PRO1_19E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Configuring Sequence Control Systems with S7- SFC
S7-SFC: The tool for programming sequence cascades
Designed for the require-ments of process automationCompatible with IEC 1131-3Steps assign values to blocks in the CFCTransitions check theconditions for switching tothe next stepSyntax check during creation
Direct connection to CFCAcceptance of values using“Drag&Drop”Cross reference selections
Visualization within WinCC
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 10
Process Diagnosis Diagnosis is important in the operating phase of a plant or machine. Diagnosis is usually initiated when a fault leads to standstill or malfunction of the plant or machine. Programmable logic controllers are widely used in many areas. Field experience has proven that over 98% of faults occur in the peripherals (magnet valves, end switches, etc.). The distribution of fault occurrences makes it meaningful for the diagnosis to focus on process faults, since missing messages or faulty functions lead to down-times and the resulting costs. Process diagnosis diagnoses exactly these external components (sensors, actuators, etc.) or sequences in the process of a plant or machine.
S7-PDIAG The S7-PDIAG software package enables a uniform configuration of the process diagnosis for the SIMATIC S7-300/400 controllers in the LAD, FBD and STL programming languages. You can already define signal monitoring routines including first-up signal acquisition and criteria analysis and input the associated message texts while or after creating the user program in the LAD, FBD or STL programming languages. PDIAG automatically generates monitoring blocks which you must call in your user program.At every call, the fault conditions are checked and in case of an error, the relevant process values are acquired and sent to the display device for the criteria analysis. For the configuration of the operator panel, S7-PDIAG stores the process diagnosis data in a shared database. This data can then be accessed by the OP configuration software SIMATIC ProTool with the option package ProAgent and be made available for display on the operator panel.
Date: 05.12.2005File: PRO1_19E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Process Diagnosis with S7- PDIAG
I1.0 I1.1 Q1.0
Message
Process diagnosis: Detection of faults occurring outside the PLC
Sensor/actuator defective, movement faulty, ...
S7- PDIAG: Tool for configuringthe fault definition in STL, LAD, FBD
Integrated in the development environmentSimple formulation of fault monitoring andmessage texts (during and after the program session)Fault detection and criteria analysis are conducted automaticallyComprehensive information for the operator on:
type of faultlocation of faultcause of fault
Reduction of down-time
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 11
S7 - PLCSIM The SIMATIC S7-PLCSIM engineering tool (option package) emulates a complete S7-CPU including addresses and I/O on a PG/PC. S7-PLCSIM thus enables you to test a program offline on the PG/PC. All STEP 7 programming languages (STL, LAD, FBD, S7-Graph, S7-HiGraph, S7-SCL and CFC) can be used.S7-PLCSIM allows you to check the functionality of user programs on the PC/PG, regardless of whether the final hardware is available or not.
Functionality S7-PLCSIM offers the following functions for running a program on a simulated PLC:• An icon in the SIMATIC Manager‘s toolbar switches the Simulation on or off. If the simulation is turned on, every new connection is automatically made to
the simulated PLC.If the simulation is turned off, then every new connection is made to the
"real" PLC. • You can create view objects that allow you to access memory areas, accu-
mulators and tabs of the simulated CPU. You can modify and display all the data in these view objects.
• You can change the CPU‘s operating mode (STOP, RUN and RUN-P) just as with a "real" CPU. The simulation also provides a "Pause" function that allows you to halt the program execution without affecting the state of the program.
Advantages With S7-PLCSIM, you can detect faults early in the development phase and eliminate them. The quality of the user programs is greatly improved and the commissioning costs are lowered.
Date: 05.12.2005File: PRO1_19E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Testing User Programs with S7- PLCSIM
S7-PLCSIM: Simulation software for offline testing of PLC programs
Functional program test on a simulated CPUwith display/modify I/O
Testing of user blocks in LAD, FBD, STL, S7-SCL,S7-GRAPH, S7-HiGraph, CFCS7-PDIAG, WinCC
AdvantagesFaults can be detected early and eliminatedMany tests are already possible in the office without the final hardware
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 12
TeleService With Teleservice, SIMATIC S7- /M7- /C7 PLCs can be remotely maintained with the PG/PC using a telephone network or a radio network. All the while, you have the full functionality of STEP 7 and the Engineering Tools at your disposal.
Configuration A PG/PC is connected to the PLC using standard modems available on the market. The following are supported:• Analog modems• External ISDN adapter/modems• GSM technology (e.g. D1 network)On the plant side, a teleservice-capable TS adapter is inserted between the standard market modem and the MPI network. All stations (nodes) are thus accessible on the MPI network with this connection.
Procedure To set up teleservice operation, you must carry out the following steps:• Assigning parameters to the modem on the PG/PC side (TS adapter with
default parameters for the modem on the plant side) using the teleservice package.
• Establishing a remote connection, supported by an electronic phone book, which includes system management in the form of a file system.
• Carrying out remote maintenance with the full function scope of STEP 7 and the Engineering Tools.
Advantages Through the accessibility of PLCs in remote (other rooms, plants, etc.) locations you can carry out technical services such as maintenance, update services or fault analysis from a central service base cost effectively.
Date: 05.12.2005File: PRO1_19E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
CPU I/O ...
TS adapter
Control room withSTEP7 and TeleService
PG/PCmodem
systemmodem
CPU
MPI bus
Remote Maintenance and Remote Diagnosis with TeleService
TeleService: Makes an onlineconnection to SIMATIC S7/C7 or M7 possible"Extends" the MPI via telephone/radio networks
STEP 7 functionality Market standard modems and TS adapterFault detection, fault eliminationand commissioning from a central location
Advantages:Reduction of maintenance costs Faster upgrading of the system
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 13
DOCPRO DOCPRO is a tool for creating and managing plant documentation. DOCPRO allows you to structure project data, prepare wiring manuals and print out all this information in a uniform format.
Functionality DOCPRO provides you with user-friendly functions for creating and managing the documentation as a wiring manual of the plant:• Creation of wiring manuals and job lists (result of print jobs);
a wiring manual is subdivided into job lists.• Central creation, editing and managing of footer data; the individual jobs can also be assigned footers that contain information about the particular job.• Standard layout templates supplied with the program in different formats as the starting point for your own layouts and coversheets.• Automatic and manual assignment of reference numbers; you can assign the job‘s reference numbers according to your own criteria.• Automatic creation of document indexes of the printed documentation.• Printing of job lists and wiring manuals; the jobs of a job list are printed in the
predefined sequence. You can take a look at the print reports and status list after printing is completed.
Advantages The project data of a project/plant can be clearly documented with DOCPRO. A structured (well-organized) documentation makes additional work on a project as well as service work easier and thus saves time and money.
Date: 05.12.2005File: PRO1_19E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Creating Plant Documentation with DOCPRO
DOCPRO: Creating wiring manuals for plants
Standardized layout templates, can be modified to your needsGenerates reference numbers,generates indexesPrints the entire documentation in one run (e. g. at night)
Advantage:Convenient creation of documents
Layout template..............................................................................................................................................Reference numberProject
Layout template..............................................................................................................................................Reference numberProject
CompanyProject
2/5Company
Project1/5
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 14
Date: 05.12.2005File: PRO1_19E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Runtime Software for Closed-loop Control Engineering Tasks
C7S7-400S7-300 M7S7-200
Standard PID Control
Fuzzy Control
Neuro Systems
Modular PID Control
Basic SW PID Control
PID Controller
FM 355 / 455
Confi-gura-tiontool
No
Yes
Yes
Yes
Yes
Yes
Yes
Overview
Basic SWoroptionpackage
Basic SW
Basic SW
Option
Option
Option
Option
Closed-loop In a closed-loop control system process variables are controlled in such a wayControl Engineering that they reach their new preset values as quickly as possible and that they maintain
these in spite of the effect of disturbances.
Basic Software The STEP 7 basic package already contains a series of function blocks forPID Control solving simple control engineering tasks.
Standard This additional package contains blocks and a parameter assignment tool withPID Control integrated control setting for standard tasks such as temperature controllers, flow rate
regulators, pressure regulators etc.
Modular Through the interconnection of supplied standard function blocks, you can PID Control implement just about every closed-loop control engineering structure, even in the upper
performance range of process engineering.The package contains 27 FBs and a commissioning tool.
Fuzzy Control Fuzzy Systems are used when the mathematic description of a process difficult or even impossible, when a process behaviour is not consistent, when non-linearities occur, but, on the other hand, experience with the process exists.
NeuroSystems Neuronal Systems are used with those problems, whose structure and solution are only partly known.NeuroSystems can be used in all automation levels, from the individual closed-loop controller to the optimization of a plant.
Closed-loop Control The closed-loop control modules FM355 (for S7-300) and FM455 (for S7-400)Modules are intelligent 4 and 16 channel modules for universal closed-loop control tasks in
chemical and process engineering, with rubber and plastics machinery, with heating and cooling units, in the glass, ceramic and paper industry, etc.
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 15
Borland C/C++ The control programs executed on an M7 automation computer can either be generated with CFC or with the integrated development environment Borland C/C++ V5.01. With Borland C/C++ , you can easily edit, compile and integrate C/C++ programs and,at the same time, you can access all project-specific configuration data and symbol data using STEP 7. Within Borland, all Borland C++ tools are available to you: AppExpert, ClassExpert, Project Management, Resource Workshop, Command Line Tools, etc.
M7- ProC/C++ The M7 ProC7C++ option software integrates the Borland C/C++ development environment in STEP 7 and also provides a real-time capable multitasking debugger.Moreover, the M7-ProC7C++, provides the configuration of the Borland development environment, so that no settings for path names for compiler and debugger and no settings for options of compiler and linker are necessary.
M7-SYS RT M7-SYS RT is the runtime system, optimized for the M7 automation computer, for implementing real-time tasks. With it, a powerful software base is available for the various tasks.M7-SYS RT includes in particular:• the real-time and multitasking operating system RMOS32 (32-Bit Real Time
Operating System)• a standard ANSI-C library• the M7-API user interface (Application Programming Interface)• interfaces for loadable drivers, as well as drivers for the serial interface
(e.g. 3964R) and TCP/IP drivers for Industrial Ethernet.
Date: 05.12.2005File: PRO1_19E.15
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Borland C/C++, M7- ProC/C++ and M7- SYS RT for M7-Automation Computers
Borland C/C++Creation of C/C++ programsfor M7
M7- ProC/C++Integration of Borland C/C++in STEP 7Powerful debugger foruser-friendly program testing
M7- SYS RTRMOS operating system
real-time capablemultitasking
Advantage:Technological functions can be programmedExtreme time-critical tasks
SIEMENS
PG 740
STEP7BorlandC/C++M7-ProC/C++
Cfor the computer pro M7-SYS RT
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 16
Date: 05.12.2005File: PRO1_19E.16
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Communicating with SIMATIC NET
Manage-ment level
Cell level
Field level
Actuator-sensorlevel
Industrial Ethernet
PROFIBUS
ActuatorSensor-Interface
SIMATIC NET SIMATIC NET is the name of an entire family of networks.• Industrial Ethernet according to IEEE 802.3 - the international standard for the networking of areas and cells• PROFIBUS according to EN 50170 - the international standard for the field area and the cell network with a limited number of nodes• AS-Interface - for communication with sensors and actuators.
Industrial Ethernet The Industrial Ethernet network is a cell level network according the international standard IEEE 802.3 (Ethernet) and is designed for industrial use. Extensive open network solutions are possible. A high transmission rate is guaranteed with various transmission media. Industrial Ethernet is an industry standard, world-wide tested and accepted. The Industrial Ethernet network functions according to the IEEE 802.3 standardized accessing procedure CSMA/CD (Carrier sense multiple access with collision detection).
Profibus PROFIBUS is the bus system for cell networks with a limited number of nodes. It is based on the European standard EN 50170, Volume 2, PROFIBUS. Since the requirements according to EN 50170 are fulfilled, PROFIBUS guarantees openness for the connection of components from other manufacturers that conform to standards. ThePROFIBUS accessing procedure functions according to the "Token Passing with subordinate Master-Slave" procedure. As a result, a distinction is made between active and passive network participants.
AS-Interface The AS-Interface is a networking system for binary sensors and actuators in the field area. With AS-Interface, binary actuators and sensors become capable of communication, for which a direct field bus connection was not technically possible up until now or was not economical.
Unlike the powerful PROFIBUS, the main area of use for the AS-Interface line is the transmission of small amounts of information such as from switching positions.
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 17
Overview For the SIMATIC S7, there is a field-proven HMI system for user-friendly process control and monitoring available, the SIMATIC HMI. It ranges from the simple textdisplay to the process visualization system.SIMATIC S7 and SIMATIC HMI are completely harmonized and integrated. This simplifies the use of the human-machine interface system SIMATIC HMI considerably.• SIMATIC S7 has already integrated HMI services. The HMI system
requests process data from the SIMATIC S7. Data transmission between SIMATIC S7 and SIMATIC HMI is carried out by the two operating systems and
does not have to be taken into account in the user program.SIMATIC HMI systems can be connected directly to PPI (S7-200) and MPI or Profibus (S7-300 and S7-400). Operation using PROFIBUS makes process control and monitoring even over greater distances possible.
• Numerous features from the uniform database and symbols up to the same user-friendly Windows-oriented user interfaces simplify the use of HMI systems.
Date: 05.12.2005File: PRO1_19E.17
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Process visualizationsystem
SIMATIC WinCC
SIMATIC Panels
Configuration andvisualization software
SIMATIC ProTool
Operator Control and Process Monitoring with SIMATIC HMI
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 18
ProTool SIMATIC ProTool and SIMATIC ProTool/Lite are modern configuration toolsProTool/Lite for configuring SIMATIC Text Displays, Operator Panels, Touch Panels as well as the
HMI portion of the SIMATIC C7 complete system.While you can configure all devices with SIMATIC ProTool, SIMATIC ProTool/Lite, as the economical version, is restricted to the configuration of line oriented devices.Functionally, SIMATIC ProTool/Lite is a subset of SIMATIC ProTool. The operator control and configuration philosophy of both tools is the same.
ProTool/Pro SIMATIC ProTool/Pro upwardly expands the existing product family of SIMATIC ProTool with the Operator Panel OP37/Pro and supplements the panels with a runtime software for a standard PC. ProTool/Pro contains the basic functionality of the graphic display units (OP27, OP37) and thus creates a visualization consistency from the existing graphic OPs up to the PC-based systems.ProTool/Pro stands out with the following features:• Runtime software for various platforms
- OP37/Pro (Windows 95) - Standard-PC (Windows 95/98 and NT 4.0)
• Extensive basic functionality of the graphic OP OP27, OP37• Expanded functional scope to OP27, OP37
Date: 05.12.2005File: PRO1_19E.18
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Text Display Panels
Graphic Display Panels
PC-based Systems
Consistent Configuration with SIMATIC ProTool
ProToolProTool//Lite Lite ProToolProTool
ProToolProTool/Pro/Pro
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 19
WinCC SIMATIC WinCC (Windows Control Center) is the open process visualization systemfrom Siemens. It can be integrated problem free in a new or already existing PLC system.
Function Modules The heart of SIMATIC WinCC is an industry and technology independent basic systemwith all the important functions for operator control and monitoring, such as:• pixel graphic display• measured value acquisition (archiving functions, data compression,
minimum and maximum values etc.)• message display, archiving and reporting• process communication to different PLC systems• standard interfaces, for example, Microsoft programs• documentation of machine and process sequences with individual reports.
Basis of WinCC WinCC is based on the 32-bit standard operating systems Windows 95/98 or Windows NT from Mircrosoft. This platform gives WinCC the following functionality:• use of the Windows operating equipment (printer, driver, etc.)• data exchange with other Windows applications via DDE, ODBC,
OLE and SQL.• API programming interface• use of hardware available in the market
Date: 05.12.2005File: PRO1_19E.19
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Process Visualization and Operator Control with WinCC
anzahl ()float zaebeginif wert > 0 begom zae = zae + 1 endend
Programmier-Schnittstellen
SPSKommunikation
Protokolle
Report Designer(Berichtssystem)
Tag Logging(Archivierung)
Ventil geschlossenKlappe zu
Motor ein
Alarm Logging(Meldesystem)
StandardSchnittstellen
Prozeßvisualisierung
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 20
Date: 05.12.2005File: PRO1_19E.20
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Process Automation with SIMATIC PCS 7
Engineering System Process terminal 1 Process terminal 2 Process terminal 3
Terminal bus
System bus
WinCC OS-ServerWinCC OS
S7-400 ascentral unit
Field devices
FM
SV DP
FM
SV DP
ET 200M
Introduction SIMATIC PCS 7 represents the new control system generation in SIEMENS. It is the consistent, further development and summary of the experiences with TELEPERM M, SIMATIC PCS and SIMATIC S5 based systems. As a result, it is tailored to the process control system tasks in all industries.
Engineering The Engineering System can be designed as its own station in the system. It System can however also be loaded as a software package in the OS components at the same
time.The Engineering System has the following components:• STEP 7 with the SIMATIC Manager, the central database, and with HW
Config for configuring hardware and networks. It also contains the servers, that facilitate consistent configuration between PLC and OS.• SCL (Structured Control Language) as PASCAL-similar higher level
programming language for block generation• CFC (Continuous Function Chart) for graphic configuration of the basic
automation functions• SFC (Sequential Function Chart) for graphic configuration of production
sequences• Expansion of the SIMATIC Manager with a technological hierarchical view• WinCC (Windows Control Center) for OS configuration• DOCPRO for documenting configuration data• Import–/Export wizard for bi-directional data exchange with other CAE
systemsThese components are supplemented by libraries that provide pre-defined blocks for PLC and OS.
Training Centerfor Automation and Drives
ST-7PRO1Totally Integrated AutomationPage 21
Totally Integrated The new SIMATIC family unifies all devices and systems, that is, hardware asAutomation well as software, into a uniform, powerful system platform.
In this platform, the system borders that have existed until now, that is, the borders between computer world, PLC world and process control, that is, between operator control and monitoring and control, between central and distributed automation are overcome.
Advantages This totally integrated automation offers you, among other things, the following advantages:• A scalable hardware platform, that is, the optimal (price/performance)
functionality (PLC or computer) can be chosen for the task to be solved.• An open totally integrated automation environment, that is, an existing
system can be easily extended, or existing or future automation solutions can be integrated.
Existing investments retain their value. The transition from an existing SIMATIC, TELEPERM or TI environment can be carried out very easily.
• Powerful software increases the productivity in the implementation of a project and thus reduces the engineering and life cycle costs. In addition, expenses for commissioning, maintenance and service are reduced.
• SIMATIC is based on Windows standards and can thus easily use their applications (standard software) and communication mechanisms.
Date: 05.12.2005File: PRO1_19E.21
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Summary
SIMATIC S7
WinCC PCS 7
Engi
neer
ing
NET
NETInstrum. Drives
M
Training Centerfor Automation and Drives
ST-7PRO1What’s Next?Page 1
We'd just like to say a few words...
Contents:
• What's Next ?
• Our Automation and Drives Training
• SIMATIC Training
• Systematic SIMATIC S5 Training
• Upgrade from SIMATIC S5 to SIMATIC S7
• SIMATIC S7 System Training
• SIMATIC S7-200 Training
• SIMATIC S7/M7 Option Packages
• SIMATIC NET
• SIMATIC WinCC
• PLC Technician
Date: 05.12.2005File: PRO1_20E.1
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
SIMATIC NET
SIMATIC HMI
SIMATIC M7
SIMATIC S5
and other courses on PCS7, IT, NC ....
What's Next ?
SIMATIC S7
Training Centerfor Automation and Drives
ST-7PRO1What’s Next?Page 2
What are the advantages of our SIMATIC Training for you?
• Fast, effective acquisition of knowledge
• Saves downtimes at your plant
• Ensures quality
• Gives you motivated personnel
• Simplifies and shortens decision-making processes
Note The following pages present just a sample of our extensive range of SIMATIC courses.
On the last page you‘ll find a fax form with the addresses of our course offices.We‘ll gladly send you information about our entire course spectrum !
Look us up in the Internet:http://www.ad.siemens.de/trainingor call our Info Line:Tel: 01805 23 56 11Fax: 01805 23 56 12
Date: 05.12.2005File: PRO1_20E.2
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Training from A&D
Our Automation and Drives Training
Training Courses on site or in200 locations in 60 countries
Future-oriented and Topical Trainingfirst handfrom the market leader
Task-oriented Trainingindividually decided with you
Training for everybody, in all areas ofAutomation and Drives
Training Centerfor Automation and Drives
ST-7PRO1What’s Next?Page 3
You have just attended one of our courses and we hope it came up to your expectations.
Above all, we hope you will be able to use the knowledge you obtained at the course to advantage in your work.
We would like to continue to be your partner in training for your career in the future.
For this reason we have outlined some of our current courses for you on the next few pages.
Date: 05.12.2005File: PRO1_20E.3
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
SIMATIC Training
SIMATIC S7
SIMATIC M7
SIMATIC HMI (COROS, ProTool, WinCC)
SIMATIC NET (PROFIBUS, Ethernet)
SIMATIC S5
Training Centerfor Automation and Drives
ST-7PRO1What’s Next?Page 4
Date: 05.12.2005File: PRO1_20E.4
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
SIMATIC S7
Upgrade SIMATIC S5 -> S7
ST-7UPPROG 5 days
Configuring/Programming
Good SIMATIC S5 knowledge andSIMATIC S5 programming
experiencePC and Windows knowledge
Upgrade from SIMATIC S5 to SIMATIC S7
ST-7UPPROG Upgrade SIMATIC S5 -> S7Course Contents - Overview of the SIMATIC S7, components, performance features(Excerpt): - The STEP7 programming language and its components
- Using block types and symbols for program structuring and program creation
- Test tools for system information, troubleshooting and diagnostics- Carrying out a hardware configuration of the modules- Communication via MPI interface- Integration of SIMATIC S5- Conversion of S5 programs
Training Centerfor Automation and Drives
ST-7PRO1What’s Next?Page 5
Date: 05.12.2005File: PRO1_20E.5
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
SIMATIC S7TroubleshootingST-7STOE 5 days
SIMATIC S7Programming 1ST-7PRO1 5 days
SIMATIC S7System HandlingST-7SYH 5 days
SIMATIC S7Programming 2ST-7PRO2 5 days
Installation/Maintenance
Basic knowledge of control engineering
SIMATIC S7 System Training
SIMATIC NETSIMATIC NET
SIMATIC S7 Option packages SIMATIC S7 Option packages
SIMATIC M7SIMATIC M7
SIMATIC HMISIMATIC HMI
Configuring/Programming
Technical training such as engineer, technician PC/Windows knowledge, Programming experience, Knowledge of digital technology
ST-7PRO1 SIMATIC S7 Programming 1Course Contents - System overview and main performance features(Excerpt): - The STEP7 programming language and its components
- Block types and symbols for program structuring and program creation - Test tools for system information, troubleshooting and diagnostics- Carrying out a hardware configuration of the modules- Communication via MPI interface
ST-7PRO2 SIMATIC S7 Programming 2Course Contents - Ability to use status bit dependent operations, accumulator operations and(Excerpt): expanded real number arithmetic
- Ability to use complex structures with parameters- Using indirect addressing in the program- Ability to integrate system functions (SFC) in the program- Ability to utilize communication function blocks (CFB)
ST-7SYH SIMATIC S7 System HandlingCourse Contents - Ability to configure and install a programmable logic controller(Excerpt): - Hardware and software commissioning of the programmable logic controller
- Overview of the S7-300 software configuration and parameter assignment
ST-7STOE SIMATIC S7 TroubleshootingCourse Contents - Using STEP 7 software for troubleshooting(Excerpt): - Detecting and eliminating software errors, that lead to the Stop state
- Diagnosing program errors with I STACK and B STACK- Troubleshooting in networked PLC systems
Training Centerfor Automation and Drives
ST-7PRO1What’s Next?Page 6
Date: 05.12.2005File: PRO1_20E.6
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
SIMATIC S7S7-200 WorkshopST-7MICRO 2 days
Basic knowledge of control engineering PC/Windows knowledge
Configuring/Programming and Installation/Maintenance
SIMATIC S7-200 Training
ST-7MICRO SIMATIC S7, S7-200 WorkshopCourse Contents - Becoming familiar with the performance features of the SIMATIC S7-200 PLCs(Excerpt): and programming devices
- Expansion facilities and addressing of the S7-200- Ability to structure, write, document and start up simple programs for controltasks on SIMATIC S7-200 PLCs
- Ability to use STEP7 Micro/WIN programming tools for program creation,documentation, program test and troubleshooting
Training Centerfor Automation and Drives
ST-7PRO1What’s Next?Page 7
Date: 05.12.2005File: PRO1_20E.7
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
SIMATIC M7Programming with CFCST-7CFC 2 days
SIMATIC S7 knowledge equivalent to ST-7PRO1
SIMATIC M7Programming with CST-7MC32 2 Days
SIMATIC M7ServiceST-7MSERV 3 days
PC/Windows knowledge
Programming engineers, Planning engineers and Commissioning engineers
SIMATIC M7System DesignST-7MSYS 3 days
C knowledge equivalent toIT-CKOMP or IT-CEIN
SIMATIC M7 System Training
ST-7MSYS SIMATIC M7, System DesignCourse Contents - Components of M7-300 and M7-400 (hardware and software)(Excerpt): - Interaction of S7 and M7
- Simple programming examples with C and CFC
ST-7MC32 C Programming Interface for M7Course Contents - RMOS API functions (excerpt)(Excerpt): - Priorities, multitasking, messages, ...
- M7 API functions (excerpt)- Access to process I/O, S7 server objects, interrupts, ...
ST-7MSERV SIMATIC M7, ServiceCourse Contents - Interaction of hardware and configuration (BIOS, STEP7)(Excerpt): - CPUs and FMs (properties, rules, limits)
- Standard Interface Modules- Function test and troubleshooting
ST-7CFC SIMATIC M7/S7, Graphic Programming with CFCCourse Contents - Programming tool for graphic programming of SIMATIC S7/M7(Excerpt): - Program configuration
- Interconnection of blocks- Programming user blocks in STEP7- Test and diagnostic facilities, documentation
Training Centerfor Automation and Drives
ST-7PRO1What’s Next?Page 8
Date: 05.12.2005File: PRO1_20E.8
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Programming the Inter-face Controller S7-300NC-S7APT 3 days
SIMATIC S7Sequential Control with S7-GRAPHST-7GRAPH 2 days
S7-GRAPHS7-GRAPH
SIMATIC S7HiGraph ProgrammingNC-ZSG 3 days
S7-HiGraphS7-HiGraph
SIMATIC S7Graphic Programming with CFCST-7CFC 2 days
CFCCFC
SIMATIC S7Programming with SCLST-7SCL 2 days
S7-SCLS7-SCL
SIMATIC S7 knowledge equivalent to the ST-7PRO1 or ST-7UPPROG courses
Configuring/Programming
SIMATIC S7/M7 Option Packages
ST-7GRAPH SIMATIC S7, Sequential Control with S7-GRAPHCourse Contents - Programming sequencers(Excerpt): - Program creation with S7-GRAPH
- Comparison of GRAPH 5 to S7-GRAPH- Test and diagnostic facilities, program documentation
NC-S7APT Programming Interface Controller S7-300Course Contents - Overview of the controllers FMNC, 810D and 840D(Excerpt): - Structure of the PLC - NC interface
- Fast data exchange between PLC and NC- Communication structures- Practical exercises on the individual topics
NC-ZSG HIGRAPH Programming SIMATIC S7Course Contents - Programming machine controllers with HiGRAPH. (Excerpt): - Programming tools and their use
- Test and diagnostic facilities- Program documentation, exercises
ST-7SCL SIMATIC S7, Programming with SCLCourse Contents - S7-SCL high level language for SIMATIC S7 controllers(Excerpt): - S7-SCL tools
- Program structure, language structure and program commands- Test and diagnostic facilities, exercises
ST-7CFC SIMATIC M7/S7, Graphic Programming with CFCCourse Contents - Programming tool for graphic programming of SIMATIC S7/M7(Excerpt): - Program configuration
- Interconnection of blocks- Programming user blocks in STEP7- Test and diagnostic facilities, documentation
Training Centerfor Automation and Drives
ST-7PRO1What’s Next?Page 9
Date: 05.12.2005File: PRO1_20E.9
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
SIMATIC S7/M7Communication PROFIBUS-FMSKO-7KFMS 2 days
SIMATIC S7Communication with Industrial EthernetKO-7KETHER 3 days
SIMATIC S7Point-to-Point ConnectionST-7PTP 2 days
SIMATIC S7Distributed I/O PROFIBUS-DPKO-7KDP 2 days
SIMATIC S7 knowledge equivalent to the ST-7PRO1 or ST-7UPPROG courses
Configuring/Programming
SIMATIC S7Communicationwith PROFIBUSKO-7KPROFI 4 days
SIMATIC NET
ST-7PTP SIMATIC S7, Point-to-Point ConnectionCourse Contents - Performance features and technical specifications of CP340 and CP441(Excerpt): - Creating configuration and parameter assignments of the communication
processors- Writing user programs for CP340 and CP441- Diagnostic facilities of CP340 and CP441
KO-7KDP SIMATIC S7, PROFIBUS-DPCourse Contents - Structure and functional principle of distributed I/O(Excerpt): - Planning and configuring the DP-Master in SIMATIC S7
- User programming and diagnostic facilities
KO-7KFMS SIMATIC S7, PROFIBUS-FMSCourse Contents - FMS mode of operation(Excerpt): - Configuration software NCM for PROFIBUS
- Programming FMS applications- Diagnostic and test facilities
KO-7KPROFI SIMATIC S7, PROFIBUS-DP/FMSContents of the KO-7KDP and KO-7KFMS courses
KO-7KETHER SIMATIC S7, Industrial EthernetCourse Contents - Mode of operation, properties and components of the Industrial Ethernet bus(Excerpt): system
- ISO and TCP/IP protocols- Configuration using the configuration software NCM-S7 for IndustrialEthernet
- Diagnostic functions
Training Centerfor Automation and Drives
ST-7PRO1What’s Next?Page 10
ST-BWINCCS SIMATIC WinCC, WorkshopCourse Contents - WinCC system overview(Excerpt): - Windows 95 (settings), using the standard Windows interfaces
- Creating a project, PLC connections, variable simulation, graphics- Message display, message archiving- Trend display, measured value archiving, user archives- Report system, background processing (Global Scripts)- API open user interface (use and structure)- Practical exercises
ST-BWINCCE SIMATIC WinCC Open System ECourse Contents - Introduction to the WinCC- system architecture (open interfaces and(Excerpt): integration capability, databases, channel DLL, Global Scripts), introduction to
Visual C++, ODK (development environment for API), WinCC-API structuring,using API functions,
- Practical exercises
ST-BWINCCN SIMATIC WinCC Open System NCourse Contents - Brief introduction to the WinCC- system architecture (open interfaces and(Excerpt): integration capability, databases, channel DLL), general introduction to
Global Scripts, accessing WinCC databases with Excel, OLE functions- Practical exercises
Date: 05.12.2005File: PRO1_20E.10
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
SIMATIC WinCCOpen System NST-BWINCCN 1 day
SIMATIC WinCCOpen System EST-BWINCCE 2 days
C knowledge, basic knowledge of
relational databases
Good knowledge of C,Win95/NT knowledge,
Experience with graphic interfaces,e.g. Windows 95/NT
Configuring/Programming
SIMATIC WinCCHuman-Machine Interface, System Training ST-BWINCCS 5 days
SIMATIC WinCC
Training Centerfor Automation and Drives
ST-7PRO1What’s Next?Page 11
Date: 05.12.2005File: PRO1_20E.11
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
SIMATIC S7PC Based Control with WinACST-7WINAC 2 days
SIMATIC ProTool/ProProTool/Pro WorkshopST-BPROPRS 3 days
SIMATIC ProTool/ProUpgrade ProTool -> ProTool/ProST-BPROPRU 2 days
SIMATIC S7 knowledge equivalent to the ST-7PRO1 or ST-7UPPROG courses
Experience with graphic interfaces,e.g. Windows 95/NT
Configuring/Programming
SIMATIC - New Courses for 1998/99
ST-7WINAC SIMATIC S7, PC Based Control with WinACCourse Contents - Introduction to PC based control with SIMATIC WinAC(Excerpt): - WinAC hardware components, properties, components
- Use of data-OCX and supplied OCXs- Assigning parameters to the MPI card- Overview of OPC / ActiveX / DCOM for WinAC
ST-BPROPRS SIMATIC ProTool/Pro WorkshopCourse Contents - SIMATIC ProTool/Pro system overview(Excerpt): - Basics of graphic screen creation
- User functions (introduction to VBScript)- Message configuration, message display, message archiving- Trend configuration, trend display, measured value archiving
ST-BPROPRU Upgrade SIMATIC ProTool -> ProTool/ProCourse Contents - Expansions of ProTool/Pro when compared with ProTool(Excerpt): - Graphic screen creation
- User functions- Message archiving and measured value archiving
Training Centerfor Automation and Drives
ST-7PRO1What’s Next?Page 12
Date: 05.12.2005File: PRO1_20E.12
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Actuator-Sensor-InterfaceBasic CourseKO-ASIG 1 day
Actuator-Sensor-InterfaceAdvanced CourseKO-ASIA 1 day
SIMATIC S5 and/or SIMATIC S7 knowledge and basic knowledge of data communication
Planning, Programming, and Commissioning engineers, Installation, Maintenance and Service personnel
Actuator-Sensor-Interface - New Courses for 1998/99
KO-ASIG Actuator-Sensor-Interface, Basic CourseCourse Contents - Basics of the Actuator-Sensor-Interface (AS-Interface)(Excerpt): - Structure and configuration
- AS-i Master, supply cables, power supply unit, control and signal modules,motor starter, consumer branch circuits,...
- Diagnostic facilities
KO-ASIA Actuator-Sensor-Interface, Advanced CourseCourse Contents - Function blocks and handling blocks for the extended operation of the Master(Excerpt): modules
- In-depth knowledge of system components- PROFIBUS DP/AS-Interface transitions- Service and diagnosis with SCOPE S1 for AS-Interface
Training Centerfor Automation and Drives
ST-7PRO1What’s Next?Page 13
Date: 05.12.2005File: PRO1_20E.13
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
OLE for Process ControlBasic CourseKO-OPC 2 days
S7/PC Communicationvia LAN with TCP/IPKO-S7TCPL 1 day
Internet Communicationof SIMATIC S7KO-S7INTER 1 day
Basic knowledge of data communication / local networks
Planning engineer, Commissioning engineer and User
SIMATIC NET - New Courses for 1998/99
KO-OPC OLE for Process Control, Basic CourseCourse Contents - OPC goals and background(Excerpt): - OLE basics (architecture of the NET software)
- Installation of the NET hardware and software components- Implementation example based on the SIMATIC NET OPC products- S7-OPC Server- DP-OPC Server
KO-S7TCPL S7/PC Communication via LAN with TCP/IPCourse Contents - Industrial Ethernet mode of operation and networking components(Excerpt): - The Internet protocol family
- Comparison of ISO/OSI and TCP/IP- The transport protocols TCP and UDP- TCP/IP with SIMATIC NET
KO-S7INTER Internet Communication of the SIMATIC S7Course Contents - Internet origins and technology(Excerpt): - Using the Internet in automation technology
- Safety concepts- SIMATIC S7 in the Internet - world-wide access for commissioning,testing and maintenance
Training Centerfor Automation and Drives
ST-7PRO1What’s Next?Page 14
System Courses System trainingService trainingCompact courses for engineersProgramming courses
Supplementary Project planning/configuringCourses Sequential control with GRAPH 5
Fail-safe and fault-tolerant systems
Digital control engineeringSoftware-based closed-loop controlPositioning with IP246/266
Point-to-point connectionsL1 bus communicationSIMATIC S5, PROFIBUSCP 5431 FMS workshop S5-95/PROFIBUS workshop SIMATIC S5, Industrial Ethernet
Course Contents For full details of the contents of these courses please refer to our ITC catalog. You can obtain this catalog through your trainer or order it yourself from the Course Office direct (see last page for address and fax form).Alternatively you can obtain information via:Internet: http://www.ad.siemens.de/trainingInfo Line: Tel: 01805 23 56 11
Fax: 01805 23 56 12
Date: 05.12.2005File: PRO1_20E.14
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
SIMATIC S5 - System and Supplementary Courses
Basic knowledge of control engineering
Planning engineer/Programming engineer, Installation and Maintenance personnel
SIMATIC S5Service TrainingST-S5SERV 5 days
SIMATIC S5Programming 1ST-S5PRG1 5 days
SIMATIC S5System Training Part 2ST-S5SYS2 5 days
SIMATIC S5System Training Part 1ST-S5SYS1 5 days
SIMATIC S5 - Supplementary Courses
Training Centerfor Automation and Drives
ST-7PRO1What’s Next?Page 15
Qualification for Our structured training course for PLC technicians is based on the requirementsPLC Technicians of the VDMA/ZVEI 1).
These requirements define what a skilled PLC technician needs to know and be able to do, regardless of the brand of PLC and from the point of view of the user. Training can take the form of:• distance learning, • evening courses or • daytime courses.
Trainees can take an examination at the end of this training sequence. This normally takes one day and consists of a theory section and a practical section.For further information, please see our ITC catalog or the special information sheet about training for PLC technicians.
1) Association of German Machine and Plant Manufacturers (VDMA)Association of the Electrical and Electronics Industry (ZVEI)
Upgrade PLC technicians who have completed their training with SIMATIC S5 can obtain a further qualification in an upgrade course dealing with the differences between SIMATIC S5 and SIMATIC S7.
Date: 05.12.2005File: PRO1_20E.15
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
PLC Technician SIMATIC S5 and SIMATIC S7
SIMATIC S7PLC Programmer(based on SIMATIC S7)ST-SPSPROF 8 Wochen
SIMATIC S7PLC Technician (based on SIMATIC S7)ST-SPSTEF 6 months
Installation/Maintenance and Service personnel
Evening training course according to VDMA/ZVEI
SIMATIC S5PLC Technician (based on SIMATIC S5)ST-SPSTEA5 14 weeks
SIMATIC S7Upgrade S5 -> S7 ST-7UPSPS 14 weeks
SIMATIC S7PLC Technician (based on SIMATIC S7)ST-SPSTEA7 14 weeks
Distance learning
Training Centerfor Automation and Drives
ST-7PRO1What’s Next?Page 16
Now it‘s your turn ...
Date: 05.12.2005File: PRO1_20E.16
SIMATIC S7Siemens AG 1999. All rights reserved.
Information and Training CenterKnowledge for Automation
Still have questions ?
We‘ll help you!
... with the info-line:Tel 01805 23 56 11Fax 01805 23 56 12
... in the Internet:www.ad.siemens.de/training