SlideShare a Scribd company logo
Automating With Simatic S71500 Configuring
Programming And Testing With Step 7 Professional
1st Edition Hans Berger download
https://ebookbell.com/product/automating-with-
simatic-s71500-configuring-programming-and-testing-with-
step-7-professional-1st-edition-hans-berger-4725148
Explore and download more ebooks at ebookbell.com
Here are some recommended products that we believe you will be
interested in. You can click the link to download.
Automating With Simatic S71200 Configuring Programming And Testing
With Step 7 Basic Second Edition 2nd Edition Hans Berger
https://ebookbell.com/product/automating-with-
simatic-s71200-configuring-programming-and-testing-with-step-7-basic-
second-edition-2nd-edition-hans-berger-5182296
Automating With Simatic S71500 2nd Edition Hans Berger
https://ebookbell.com/product/automating-with-simatic-s71500-2nd-
edition-hans-berger-10411844
Automating With Simatic S7400 Inside Tia Portal 1st Edition Hans
Berger
https://ebookbell.com/product/automating-with-simatic-s7400-inside-
tia-portal-1st-edition-hans-berger-4722742
Automating With Simatic S7300 Inside Tia Portal Configuring
Programming And Testing With Step 7 Professional 2nd Edition Hans
Berger
https://ebookbell.com/product/automating-with-simatic-s7300-inside-
tia-portal-configuring-programming-and-testing-with-
step-7-professional-2nd-edition-hans-berger-4914546
Automating With Simatic Integrated Automation With Simatic S7300400
Controllers Software Programming Data Communication Operator Control
And Process Monitoring 2nd Rev Ed Hans Berger
https://ebookbell.com/product/automating-with-simatic-integrated-
automation-with-simatic-s7300400-controllers-software-programming-
data-communication-operator-control-and-process-monitoring-2nd-rev-ed-
hans-berger-1203994
Automating With Step 7 In Lad And Fbd Simatic S7300400 Programmable
Controllers 5th Edition Hans Berger
https://ebookbell.com/product/automating-with-step-7-in-lad-and-fbd-
simatic-s7300400-programmable-controllers-5th-edition-hans-
berger-5410536
Automating With Step 7 In Stl And Scl Simatic S7300400 Programmable
Controllers 6th Edition Hans Berger
https://ebookbell.com/product/automating-with-step-7-in-stl-and-scl-
simatic-s7300400-programmable-controllers-6th-edition-hans-
berger-10206210
Automating With Step 7 In Stl And Scl Programmable Controllers Simatic
S7300400 5th Revised And Enlarged Edition2009 2009th Edition Hans
Berger
https://ebookbell.com/product/automating-with-step-7-in-stl-and-scl-
programmable-controllers-simatic-s7300400-5th-revised-and-enlarged-
edition2009-2009th-edition-hans-berger-230975020
Automating With Simatic Controllers Software Programming Data
Communication Operator Control And Process Monitoring 5th Hans Berger
https://ebookbell.com/product/automating-with-simatic-controllers-
software-programming-data-communication-operator-control-and-process-
monitoring-5th-hans-berger-4750532
Automating With Simatic S71500 Configuring Programming And Testing With Step 7 Professional 1st Edition Hans Berger
Automating With Simatic S71500 Configuring Programming And Testing With Step 7 Professional 1st Edition Hans Berger
Berger Automating with SIMATIC S7-1500
Automating With Simatic S71500 Configuring Programming And Testing With Step 7 Professional 1st Edition Hans Berger
Automating with
SIMATIC S7-1500
Configuring, Programming and Testing
with STEP 7 Professional
by Hans Berger
Publicis Publishing
Bibliographic information from the Deutsche Nationalbibliothek
The Deutsche Nationalbibliothek lists this publication in the Deutsche Nationalbibliografie;
detailed bibliographic data are available on the Internet at http://dnb.d-nb.de.
The author, translators, and publisher have taken great care with all texts and
illustrations in this book. Nevertheless, errors can never be completely avoided.
The publisher, author, and translators accept no liability, for whatever legal reasons,
for any damage resulting from the use of the programming examples.
www.publicis-books.de
Print ISBN 978-3-89578-404-0
ePDF ISBN 978-3-89578-919-9
Editor: Siemens Aktiengesellschaft, Berlin and Munich
Publisher: Publicis Publishing, Erlangen
© 2014 by Publicis Erlangen, Zweigniederlassung der PWW GmbH
The publication and all parts thereof are protected by copyright.
Any use of it outside the strict provisions of the copyright law without
the consent of the publisher is forbidden and will incur penalties.
This applies particularly to reproduction, translation, microfilming
or other processing, and to storage or processing in electronic systems.
It also applies to the use of extracts from the text.
Printed in Germany
Preface
5
Preface
The SIMATIC automation system unites all of the subsystems of an automation
solution under a uniform system architecture to form a homogenous whole from
the field level right up to process control.
The Totally Integrated Automation (TIA) concept permits uniform handling of all au-
tomation components using a single system platform and tools with uniform oper-
ator interfaces. These requirements are fulfilled by the SIMATIC automation sys-
tem, which provides uniformity for configuration, programming, data manage-
ment, and communication.
This book describes the newly developed SIMATIC S7-1500 automation system.
S7-1500 controllers are compact in design and can be modularly expanded. The
CPUs feature integrated bus interfaces for communicating with other automation
systems via Industrial Ethernet and, depending on the type of module, via
PROFIBUS DP as well.
The STEP 7 Professional engineering software in the TIA Portal makes it possible to
use the complete functionality of the S7-1500 controllers. STEP 7 Professional is the
common tool for hardware configuration, generation of the user program, and for
program testing and diagnostics.
STEP 7 Professional provides five programming languages for generation of the us-
er program: Ladder logic (LAD) with a graphic representation similar to a circuit di-
agram, function block diagram (FBD) with a graphic representation based on elec-
tronic circuitry systems, a high-level Structured Control Language (SCL) similar to
Pascal, statement list (STL) with formulation of the control task as a list of
commands at machine level, and finally GRAPH as a sequencer with sequential pro-
cessing of the user program.
STEP 7 Professional supports testing of the user program by means of watch tables
for monitoring, control and forcing of tag values, by representation of the program
with the current tag values during ongoing operation, and by offline simulation of
the programmable controller.
This book describes the configuration, programming, and testing of the S7-1500
automation system using the engineering software STEP 7 V12 SP 1 in connection
with a CPU 1500 with firmware version V1.1 and the simulation software PLCSIM
version V12 SP 1.
Erlangen, May 2014 Hans Berger
The contents of the book at a glance
6
The contents of the book at a glance
Start
Overview of the SIMATIC S7-1500 automation system.
Introduction to the SIMATIC STEP 7 Professional V12 engineering software.
The basis of the automation solution: Creating and editing a project.
SIMATIC S7-1500 automation system
Overview of the SIMATIC S7-1500 modules: Design of an automation system, CPUs, signal,
technology and communication modules.
Device configuration
Configuration of a station, parameterization of modules, and networking of stations.
Tags, addressing, and data types
The properties of inputs, outputs, I/O, bit memories, data, and temporary local data as oper-
and areas, and how they are addressed: absolute, symbolic, and indirect.
Description of elementary and structured data types, data types for block parameters, point-
ers, user and system data types.
Program execution
How the CPU responds in the STARTUP, RUN, and STOP modes.
How the user program is structured with blocks, what the properties of these blocks are, and
how they are called.
How the user program is executed: startup characteristics, main program, interrupt process-
ing, troubleshooting, and diagnostics.
The program editor
Working with the PLC tag table, creating and editing code and data blocks, compiling blocks,
and evaluating program information.
The ladder logic programming language LAD
The characteristics of LAD programming; series and parallel connection of contacts, the use
of coils, standard boxes, Q boxes, and EN/ENO boxes.
The function block diagram programming language FBD
The characteristics of FBD programming; boxes for binary logic operations, the use of stan-
dard boxes, Q boxes, and EN/ENO boxes.
The structured control language SCL
The characteristics of SCL programming; operators and expressions, working with binary
and digital functions, control of program execution using control statements.
The contents of the book at a glance
7
The statement list programming language STL
The characteristics of STL programming; programming of binary logic operations, applica-
tion of digital functions, and control of program execution.
The sequential control programming language GRAPH
What a sequential control is, and what its elements are: sequencers, steps, transitions, and
branches. How a sequential control is configured using GRAPH.
Description of the control functions
Basic functions: Functions for binary signals: binary logic operations, memory functions,
edge evaluations, SIMATIC timer/counter functions, IEC timer/counter functions.
Digital functions: Functions for digital tags: transfer, comparison, arithmetic, math, con-
version, shift, and logic functions.
Program control: Branching in the program using jump functions, calling and ending func-
tions and function blocks, ARRAY and CPU data blocks.
Online operation and program test
Connecting a programming device to the PLC station, switching on online mode, transfer-
ring the project data, and protecting the user program.
Loading, modifying, deleting, and comparing the user blocks.
Working with the hardware diagnostics and testing the user program.
Distributed I/O
Overview: The ET 200 distributed I/O system.
How a PROFINET IO system is configured, and what properties it has.
How a PROFIBUS DP master system is configured, and what properties it has.
Communication
The communication functions used to implement open user communication.
The properties of S7 communication and with what communication functions it is pro-
grammed.
How PtP communication is implemented.
Appendix
How external source files are created and imported for STL and SCL blocks.
How a project created using STEP 7 V5.x is migrated to the TIA Portal.
How the Web server is configured in the CPU, and what features it offers.
Technology functions: counting, measuring, motion control, PID control
How the user program is tested offline using the S7-PLCSIM simulation software.
Table of contents
8
Table of contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.1 Overview of the S7-1500 automation system . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.1.1 SIMATIC S7-1500 programmable controller . . . . . . . . . . . . . . . . . . . . . . . . 24
1.1.2 Overview of STEP 7 Professional V12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.1.3 Various programming languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.1.4 Execution of the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
1.1.5 Data management in the SIMATIC automation system . . . . . . . . . . . . . . . 31
1.2 Introduction to STEP 7 Professional V12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1.2.1 Installing STEP 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1.2.2 Automation License Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.2.3 Starting STEP 7 Professional . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.2.4 Portal view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.2.5 The windows of the Project view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
1.2.6 Help information system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.2.7 Adapting the user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.3 Editing a SIMATIC project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
1.3.1 Structured representation of project data . . . . . . . . . . . . . . . . . . . . . . . . . 39
1.3.2 Project data and editors for a PLC station . . . . . . . . . . . . . . . . . . . . . . . . . . 39
1.3.3 Creating and editing a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
1.3.4 Working with reference projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
1.3.5 Creating and editing libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2 SIMATIC S7-1500 automation system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2.1 S7-1500 station components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2.2 S7-1500 CPUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.2.1 CPU versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.2.2 Control and display elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.2.3 SIMATIC Memory Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.2.4 Memory areas in an S7-1500 station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.2.5 Bus interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.3 Signal modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.3.1 Digital input modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.3.2 Digital output modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
2.3.3 Analog input modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.3.4 Analog output modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.4 Technology modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
2.5 Communication modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
2.6 Other modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
2.6.1 System power supply modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
2.6.2 Load power supply modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Table of contents
9
3 Device configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.2 Configuring a station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.2.1 Adding a PLC station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.2.2 Adding a module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.3 Parameterization of modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.3.1 Parameterization of CPU properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.3.2 Addressing modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.3.3 Assigning parameters to signal modules . . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.4 Configuring a network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.4.1 Introduction, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.4.2 Networking a station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.4.3 Node addresses in a subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.4.4 Communication services and types of connection . . . . . . . . . . . . . . . . . . 76
3.4.5 Configuring a connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
3.4.6 Configuring a PROFINET subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
3.4.7 Configuring a PROFIBUS subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
4 Tags, addressing, and data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
4.1 Operands and tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
4.1.1 Introduction, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
4.1.2 Operand areas: inputs and outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
4.1.3 Operand area: bit memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
4.1.4 Operand area: data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
4.1.5 Operand area: temporary local data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
4.2 Addressing of operands and tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
4.2.1 Signal path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
4.2.2 Absolute addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
4.2.3 Symbolic addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
4.2.4 Addressing of a tag area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
4.2.5 Addressing a constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
4.3 Indirect addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
4.3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
4.3.2 Indirect addressing of ARRAY components . . . . . . . . . . . . . . . . . . . . . . . . 100
4.3.3 Indirect addressing of a tag in an ARRAY DB . . . . . . . . . . . . . . . . . . . . . . 102
4.3.4 Indirect addressing of a data block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
4.3.5 Indirect addressing with an ANY pointer . . . . . . . . . . . . . . . . . . . . . . . . . 103
4.3.6 Indirect addressing with PEEK and POKE (SCL) . . . . . . . . . . . . . . . . . . . . 105
4.4 Addressing of hardware objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
4.5 General information on data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
4.5.1 Overview of data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
4.5.2 Implicit data type conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
4.5.3 Overlaying tags (data type views) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
4.6 Elementary data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
4.6.1 Bit-serial data types BOOL, BYTE, WORD, DWORD, and LWORD . . . . . . 113
4.6.2 Data type CHAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
4.6.3 BCD numbers BCD16 and BCD32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
4.6.4 Fixed-point data types without sign USINT, UINT, UDINT, ULINT . . . . . 116
4.6.5 Fixed-point data types with sign SINT, INT, DINT, and LINT . . . . . . . . . 117
Table of contents
10
4.6.6 Floating-point data types REAL and LREAL . . . . . . . . . . . . . . . . . . . . . . . 118
4.6.7 Data types for durations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
4.6.8 Data types for points in time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
4.7 Structured data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
4.7.1 Date and time DATE_AND_TIME (DT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
4.7.2 Date and time DATE_AND_LTIME (DTL) . . . . . . . . . . . . . . . . . . . . . . . . . . 125
4.7.3 STRING data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
4.7.4 Data type ARRAY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
4.7.5 Data type STRUCT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
4.8 Parameter types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
4.8.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
4.8.2 TIMER and COUNTER parameter types . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
4.8.3 Parameter types for IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . 132
4.8.4 Parameter types for IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . 132
4.8.5 Parameter types BLOCK_FC and BLOCK_FB (STL) . . . . . . . . . . . . . . . . . 132
4.8.6 Parameter type DB_ANY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
4.8.7 Parameter type VOID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
4.8.8 Parameter types POINTER, ANY, and VARIANT . . . . . . . . . . . . . . . . . . . . . 134
4.9 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
4.9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
4.9.2 Area pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
4.9.3 DB pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
4.9.4 ANY pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
4.10 PLC data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
4.10.1 Programming a PLC data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
4.10.2 Using a PLC data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
4.10.3 Comparing PLC data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
4.11 System data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
4.11.1 System data types for IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . 139
4.11.2 System data types for IEC counter functions . . . . . . . . . . . . . . . . . . . . . 140
4.11.3 Data type ERROR_STRUCT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
4.11.4 Start information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
4.12 Hardware data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
5 Program execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
5.1 Operating states of the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
5.1.1 STOP operating state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
5.1.2 STARTUP operating state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
5.1.3 RUN operating state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
5.1.4 Retentive behavior of operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
5.2 Creating a user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
5.2.1 Program draft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
5.2.2 Program execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
5.3 Programming blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
5.3.1 Block types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
5.3.2 Block properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
5.3.3 Block interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
5.3.4 Programming block parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Table of contents
11
5.4 Calling blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
5.4.1 General information on calling of code blocks . . . . . . . . . . . . . . . . . . . . 163
5.4.2 Supplying the block parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
5.4.3 Calling a function (FC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
5.4.4 Calling a function block (FB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
5.4.5 “Passing on” of block parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
5.5 Startup program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
5.5.1 Startup organization blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
5.5.2 Resetting retentive data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
5.5.3 Determining a module address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
5.5.4 Parameterization of modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
5.6 Main program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
5.6.1 Main program organization blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
5.6.2 Process image updating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
5.6.3 Cycle time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
5.6.4 Response time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
5.6.5 Stopping and delaying the program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
5.6.6 Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
5.6.7 Read system time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
5.6.8 Runtime meter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
5.7 Interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
5.7.1 Introduction to interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
5.7.2 Time-of-day interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
5.7.3 Time-delay interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
5.7.4 Cyclic interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
5.7.5 Hardware interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
5.7.6 Assigning interrupts during runtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
5.7.7 Reading additional interrupt information . . . . . . . . . . . . . . . . . . . . . . . . 210
5.8 Error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
5.8.1 Causes of errors and error responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
5.8.2 Local error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
5.8.3 Global error handling (synchronous error) . . . . . . . . . . . . . . . . . . . . . . . 215
5.8.4 Enabling and disabling synchronous error processing . . . . . . . . . . . . . 218
5.8.5 Asynchronous errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
5.8.6 Disable, delay, and enable interrupts and asynchronous errors . . . . . . 223
5.9 Diagnostics in the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
5.9.1 Diagnostics interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
5.9.2 Read start information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
5.9.3 Diagnostic functions in the user program . . . . . . . . . . . . . . . . . . . . . . . . 228
5.10 Configuring alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
5.10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
5.10.2 Configuring alarms according to the alarm number procedure . . . . . 238
5.10.3 Blocks for programming alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
5.10.4 CPU alarm display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
6 Program editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
6.2 PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
6.2.1 Creating and editing a PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Table of contents
12
6.2.2 Defining and processing PLC tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
6.2.3 Comparing PLC tag tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
6.2.4 Exporting and importing a PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . 252
6.2.5 Constants tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
6.3 Programming a code block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
6.3.1 Creating a new code block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
6.3.2 Working area of the program editor for code blocks . . . . . . . . . . . . . . . . 254
6.3.3 Specifying code block properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
6.3.4 Protecting blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
6.3.5 Programming a block interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
6.3.6 Programming a control function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
6.3.7 Editing tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
6.3.8 Working with program comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
6.4 Programming a data block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
6.4.1 Creating a new data block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
6.4.2 Working area of program editor for data blocks . . . . . . . . . . . . . . . . . . . 271
6.4.3 Defining properties for data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
6.4.4 Declaring data tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
6.4.5 Entering data tags in global data blocks . . . . . . . . . . . . . . . . . . . . . . . . . 275
6.5 Compiling blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
6.5.1 Starting the compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
6.5.2 Compiling SCL blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
6.5.3 Eliminating errors following compilation . . . . . . . . . . . . . . . . . . . . . . . . 278
6.6 Program information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
6.6.1 Cross-reference list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
6.6.2 Assignment list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
6.6.3 Call structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
6.6.4 Dependency structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
6.6.5 Consistency check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
6.6.6 Resources of the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
6.7 Language settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
7 Ladder logic LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
7.1.1 Programming with LAD in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
7.1.2 Program elements of ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
7.2 Programming binary logic operations with LAD . . . . . . . . . . . . . . . . . . . . . . 290
7.2.1 NO and NC contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
7.2.2 Series and parallel connection of contacts . . . . . . . . . . . . . . . . . . . . . . . . 292
7.2.3 T branch, open parallel branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
7.2.4 Negate result of logic operation in the ladder logic . . . . . . . . . . . . . . . . 293
7.2.5 Edge evaluation of a binary tag in the ladder logic . . . . . . . . . . . . . . . . . 294
7.2.6 Validity check of a floating-point tag in the ladder logic . . . . . . . . . . . . 294
7.2.7 Comparison contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
7.3 Programming memory functions with LAD . . . . . . . . . . . . . . . . . . . . . . . . . 295
7.3.1 Simple and negating coils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
7.3.2 Set and reset coils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
7.3.3 Retentive response due to latching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
7.3.4 Edge evaluation with pulse output in the ladder logic . . . . . . . . . . . . . . 299
Table of contents
13
7.3.5 Multiple setting and resetting (filling the bit array) in the ladder logic 299
7.3.6 Coils with time response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
7.3.7 Coils with counter response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
7.4 Programming Q boxes with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
7.4.1 Memory boxes in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
7.4.2 Edge evaluation of current flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
7.4.3 SIMATIC timer functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . 305
7.4.4 SIMATIC counter functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . 306
7.4.5 IEC timer functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
7.4.6 IEC counter functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . 307
7.5 Programming EN/ENO boxes with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
7.5.1 Edge evaluation with an EN/ENO box . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
7.5.2 Transfer functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
7.5.3 Arithmetic functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . 311
7.5.4 Math functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
7.5.5 Conversion functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . 313
7.5.6 Shift functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
7.5.7 Logic functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
7.5.8 Functions for strings in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . 315
7.6 Program control with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
7.6.1 Jump functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
7.6.2 Block call functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
7.6.3 Block end function in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
7.6.4 EN/ENO mechanism in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
8 Function block diagram FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
8.1.1 Programming with FBD in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
8.1.2 Program elements of the function block diagram . . . . . . . . . . . . . . . . . . 325
8.2 Programming binary logic operations with FBD . . . . . . . . . . . . . . . . . . . . . . 325
8.2.1 Scanning for signal states “1” and “0” . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
8.2.2 Programming a binary logic operation in the function block diagram 326
8.2.3 AND function in the function block diagram . . . . . . . . . . . . . . . . . . . . . . 328
8.2.4 OR function in the function block diagram . . . . . . . . . . . . . . . . . . . . . . . 329
8.2.5 Exclusive OR function in the function block diagram . . . . . . . . . . . . . . . 329
8.2.6 Combined binary logic operations, negating result of logic operation 329
8.2.7 T branch in the function block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 330
8.2.8 Edge evaluation of binary tags in the function block diagram . . . . . . . 331
8.2.9 Validity checking of floating-point numbers in the function
block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
8.2.10 Comparison functions in the function block diagram . . . . . . . . . . . . . 332
8.3 Programming standard boxes with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
8.3.1 Assignment and negating assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
8.3.2 Set and reset boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
8.3.3 Edge evaluation with pulse output in the function block diagram . . . . 335
8.3.4 Multiple setting and resetting (filling the bit array) in the function
block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
8.3.5 Standard boxes with time response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
8.3.6 Standard boxes with counter response . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
Table of contents
14
8.4 Programming Q boxes with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
8.4.1 Memory boxes in the function block diagram . . . . . . . . . . . . . . . . . . . . . 340
8.4.2 Edge evaluation of the result of logic operation in the function
block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
8.4.3 SIMATIC timer functions in the function block diagram . . . . . . . . . . . . . 341
8.4.4 SIMATIC counter functions in the function block diagram . . . . . . . . . . . 342
8.4.5 IEC timer functions in the function block diagram . . . . . . . . . . . . . . . . . 343
8.4.6 IEC counter functions in the function block diagram . . . . . . . . . . . . . . . 343
8.5 Programming EN/ENO boxes with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
8.5.1 Edge evaluation with an EN/ENO box . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
8.5.2 Transfer functions in the function block diagram . . . . . . . . . . . . . . . . . . 346
8.5.3 Arithmetic functions in the function block diagram . . . . . . . . . . . . . . . . 347
8.5.4 Math functions in the function block diagram . . . . . . . . . . . . . . . . . . . . . 348
8.5.5 Conversion functions in the function block diagram . . . . . . . . . . . . . . . 349
8.5.6 Shift functions in the function block diagram . . . . . . . . . . . . . . . . . . . . . 349
8.5.7 Logic functions in the function block diagram . . . . . . . . . . . . . . . . . . . . 350
8.5.8 Functions for character strings in the function block diagram . . . . . . . 351
8.6 Program control with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
8.6.1 Jump functions in the function block diagram . . . . . . . . . . . . . . . . . . . . 353
8.6.2 Block call functions in the function block diagram . . . . . . . . . . . . . . . . . 354
8.6.3 Block end function in the function block diagram . . . . . . . . . . . . . . . . . . 355
8.6.4 EN/ENO mechanism in the function block diagram . . . . . . . . . . . . . . . . . 356
9 Structured Control Language SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
9.1.1 Programming with SCL in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
9.1.2 SCL statements and operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
9.2 Programming binary logic operations with SCL . . . . . . . . . . . . . . . . . . . . . 361
9.2.1 Scanning for signal states “1” and “0” . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
9.2.2 AND function in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
9.2.3 OR function in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
9.2.4 Exclusive OR function in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
9.2.5 Combined binary logic operations in SCL . . . . . . . . . . . . . . . . . . . . . . . . 365
9.2.6 Negate result of logic operation in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
9.3 Programming memory functions with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . 367
9.3.1 Value assignment of a binary tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
9.3.2 Setting and resetting in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
9.3.3 Edge evaluation in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
9.4 Programming timer and counter functions with SCL . . . . . . . . . . . . . . . . . . 368
9.4.1 SIMATIC timer functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
9.4.2 SIMATIC counter functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
9.4.3 IEC timer functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
9.4.4 IEC counter functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
9.5 Programming digital functions with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
9.5.1 Transfer function, value assignment of a digital tag . . . . . . . . . . . . . . . . 372
9.5.2 Comparison functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
9.5.3 Arithmetic functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
9.5.4 Math functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
9.5.5 Conversion functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Table of contents
15
9.5.6 Shift functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
9.5.7 Word logic operations, logic expression in SCL . . . . . . . . . . . . . . . . . . . . 378
9.5.8 Functions for strings in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
9.6 Program control with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
9.6.1 Working with the ENO tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
9.6.2 EN/ENO mechanism with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
9.6.3 Control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
9.6.4 Block functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
10 Statement list STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
10.1.1 Programming with STL in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
10.1.2 Structure of an STL statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
10.1.3 Entering an STL statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
10.1.4 Addressing of 64-bit tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
10.1.5 STL networks in LAD and FBD blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
10.2 Programming binary logic operations with STL . . . . . . . . . . . . . . . . . . . . 400
10.2.1 Processing of a binary logic operation, operation step . . . . . . . . . . . . 401
10.2.2 Scanning for signal states “1” and “0” . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
10.2.3 AND function in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
10.2.4 OR function in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
10.2.5 Exclusive OR function in the statement list . . . . . . . . . . . . . . . . . . . . . . 403
10.2.6 Combined binary logic operations in the statement list . . . . . . . . . . . 404
10.2.7 Control of result of logic operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
10.3 Programming memory functions with STL . . . . . . . . . . . . . . . . . . . . . . . . . 408
10.3.1 Assignment in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
10.3.2 Setting and resetting in the statement list . . . . . . . . . . . . . . . . . . . . . . 409
10.3.3 Edge evaluation in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
10.4 Programming timer and counter functions with STL . . . . . . . . . . . . . . . . . 410
10.4.1 SIMATIC timer functions in the statement list . . . . . . . . . . . . . . . . . . . 410
10.4.2 SIMATIC counter functions in the statement list . . . . . . . . . . . . . . . . . 411
10.4.3 IEC timer functions in the statement list . . . . . . . . . . . . . . . . . . . . . . . . 413
10.4.4 IEC counter functions in the statement list . . . . . . . . . . . . . . . . . . . . . . 414
10.5 Programming digital functions with STL . . . . . . . . . . . . . . . . . . . . . . . . . . 415
10.5.1 Transfer functions in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . 415
10.5.2 Comparison functions in the statement list . . . . . . . . . . . . . . . . . . . . . . 418
10.5.3 Arithmetic functions in the statement list . . . . . . . . . . . . . . . . . . . . . . . 422
10.5.4 Math functions in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
10.5.5 Conversion functions in the statement list . . . . . . . . . . . . . . . . . . . . . . 428
10.5.6 Shift functions in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
10.5.7 Word logic operations in the statement list . . . . . . . . . . . . . . . . . . . . . . 432
10.5.8 Functions for strings in the statement list . . . . . . . . . . . . . . . . . . . . . . 435
10.6 Program control with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
10.6.1 Jump functions in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
10.6.2 Block call function in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . 438
10.6.3 Block end functions in the statement list . . . . . . . . . . . . . . . . . . . . . . . . 440
10.7 Further STL functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
10.7.1 Working with status bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
10.7.2 EN/ENO mechanism in the statement list . . . . . . . . . . . . . . . . . . . . . . . . 447
Table of contents
16
10.7.3 Accumulator functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
10.7.4 Working with the data block registers . . . . . . . . . . . . . . . . . . . . . . . . . . 451
10.7.5 Partial addressing of data operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
10.7.6 Absolute addressing of temporary local data . . . . . . . . . . . . . . . . . . . . . 454
10.7.7 Working with the address registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
10.7.8 Memory-indirect addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
10.7.9 Register-indirect addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
10.7.10 Direct access to complex local tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
10.7.11 Data storage of the block parameters of a function (FC) . . . . . . . . . . 465
10.7.12 Data storage of the block parameters of a function block (FB) . . . . . 467
10.7.13 Data storage of a local instance in a multi-instance . . . . . . . . . . . . . . 468
10.7.14 Null instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
11 S7-GRAPH sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
11.1.1 What is a sequential control? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
11.1.2 Properties of a sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
11.1.3 Program for a sequential control, quantity framework . . . . . . . . . . . . 474
11.1.4 Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
11.1.5 Procedure for configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
11.2 Elements of a sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
11.2.1 Steps and transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
11.2.2 Jumps in a sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
11.2.3 Branching of a sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
11.2.4 GRAPH-specific tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
11.2.5 Permanent instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
11.2.6 Step and transition functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
11.2.7 Processing of actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
11.3 Configuring a sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
11.3.1 Programming the GRAPH function block . . . . . . . . . . . . . . . . . . . . . . . . 489
11.3.2 Configuring the sequencer structure . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
11.3.3 Programming steps and transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
11.3.4 Programming permanent instructions . . . . . . . . . . . . . . . . . . . . . . . . . . 493
11.3.5 Configuring block-independent alarms . . . . . . . . . . . . . . . . . . . . . . . . . 494
11.3.6 Attributes of the GRAPH function block . . . . . . . . . . . . . . . . . . . . . . . . . 494
11.3.7 Using the GRAPH function block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
11.4 Testing the sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
11.4.1 Loading the GRAPH function block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
11.4.2 Settings for program testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
11.4.3 Using operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
11.4.4 Synchronization a sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
11.4.5 Testing with program status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
12 Basic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
12.1 Binary logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
12.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
12.1.2 Working with binary signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
12.1.3 AND function, series connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
12.1.4 OR function, parallel connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
Table of contents
17
12.1.5 Exclusive OR function, non-equivalence function . . . . . . . . . . . . . . . . . 508
12.1.6 Negate result of logic operation, NOT contact . . . . . . . . . . . . . . . . . . . . 508
12.2 Memory functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
12.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
12.2.2 Simple and negating coil, assignment . . . . . . . . . . . . . . . . . . . . . . . . . . 511
12.2.3 Single setting and resetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
12.2.4 Multiple setting and resetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
12.2.5 Dominant setting and resetting, memory function . . . . . . . . . . . . . . . 514
12.3 Edge evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
12.3.1 Principle of operation of an edge evaluation . . . . . . . . . . . . . . . . . . . . . 515
12.3.2 Edge evaluation of a binary tag (LAD, FBD) . . . . . . . . . . . . . . . . . . . . . . 517
12.3.3 Edge evaluation with pulse output (LAD, FBD) . . . . . . . . . . . . . . . . . . . 518
12.3.4 Edge evaluation with a Q box (LAD, FBD) . . . . . . . . . . . . . . . . . . . . . . . . 519
12.3.5 Edge evaluation with an EN/ENO box (LAD, FBD) . . . . . . . . . . . . . . . . . 520
12.3.6 Edge evaluation with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
12.3.7 Edge evaluation with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
12.4 SIMATIC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
12.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
12.4.2 Programming a timer function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
12.4.3 Timer response as pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
12.4.4 Timer response as extended pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
12.4.5 Timer response as ON delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
12.4.6 Timer response as retentive ON delay . . . . . . . . . . . . . . . . . . . . . . . . . . 535
12.4.7 Timer response as OFF delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
12.5 IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
12.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
12.5.2 Pulse generation TP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
12.5.3 ON delay TON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
12.5.4 OFF delay TOF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
12.5.5 Accumulating ON delay TONR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
12.5.6 Loading an IEC timer function with a duration . . . . . . . . . . . . . . . . . . . 544
12.5.7 Resetting an IEC timer function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
12.6 SIMATIC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
12.6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
12.6.2 Programming a counter function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
12.6.3 Principle of operation of a counter function . . . . . . . . . . . . . . . . . . . . . 550
12.6.4 Enabling a counter function with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
12.7 IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
12.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
12.7.2 Up counter CTU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
12.7.3 Down counter CTD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
12.7.4 Up/down counter CTUD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
13 Digital functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
13.1 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
13.2 Transfer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
13.2.1 General information on the “simple” transfer function . . . . . . . . . . . . 559
13.2.2 Copy tag, MOVE box for LAD and FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
13.2.3 Copy string, S_MOVE box for LAD and FBD . . . . . . . . . . . . . . . . . . . . . . 560
Table of contents
18
13.2.4 Value assignments with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
13.2.5 Loading and transferring with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
13.2.6 Copy data area (MOVE_BLK_VARIANT) . . . . . . . . . . . . . . . . . . . . . . . . . . 564
13.2.7 Copy data area (MOVE_BLK, UMOVE_BLK) . . . . . . . . . . . . . . . . . . . . . . 566
13.2.8 Fill data area (FILL, FILL_BLK, UFILL_BLK) . . . . . . . . . . . . . . . . . . . . . . 567
13.2.9 Copy and fill data area (BLKMOV, UBLKMOV, FILL) . . . . . . . . . . . . . . . 567
13.2.10 Swap bytes (SWAP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570
13.3 Comparison functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570
13.3.1 Execution of “simple” comparison function . . . . . . . . . . . . . . . . . . . . . . 570
13.3.2 Comparison function T_COMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
13.3.3 Comparison function S_COMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
13.3.4 Range comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
13.4 Arithmetic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
13.4.1 Arithmetic functions for numerical values . . . . . . . . . . . . . . . . . . . . . . 574
13.4.2 Arithmetic functions for date and time . . . . . . . . . . . . . . . . . . . . . . . . . 576
13.4.3 Decrementing and incrementing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
13.5 Math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
13.5.1 General function description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
13.5.2 Trigonometric functions SIN, COS, TAN . . . . . . . . . . . . . . . . . . . . . . . . 579
13.5.3 Arc functions ASIN, ACOS, ATAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
13.5.4 Generate square and extract square root . . . . . . . . . . . . . . . . . . . . . . . . 580
13.5.5 Logarithm and power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
13.5.6 Extract decimal points, generate absolute value and negation . . . . . . 582
13.5.7 Calculating with the CALCULATE box in LAD and FBD . . . . . . . . . . . . . 583
13.6 Conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
13.6.1 Data type conversion with the conversion function CONVERT . . . . . . 586
13.6.2 Data type conversion with ROUND, CEIL, FLOOR, and TRUNC . . . . . . 591
13.6.3 Data type conversion with T_CONV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
13.6.4 Data type conversion with S_CONV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
13.6.5 Conversion functions STRG_TO_CHARS and CHARS_TO_STRG . . . . . . 594
13.6.6 Conversion functions STRG_VAL and VAL_STRG . . . . . . . . . . . . . . . . . . 596
13.6.7 Data type conversion of hexadecimal numbers . . . . . . . . . . . . . . . . . . . 597
13.6.8 Scaling and normalizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
13.7 Shift functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
13.7.1 General function description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
13.7.2 Shift to right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
13.7.3 Shift to left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
13.7.4 Rotate to right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
13.7.5 Rotate to left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
13.8 Logic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
13.8.1 Word logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
13.8.2 Invert, generate one's complement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
13.8.3 Coding functions DECO and ENCO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
13.8.4 Selection functions SEL, MUX, and DEMUX . . . . . . . . . . . . . . . . . . . . . . 611
13.8.5 Minimum selection MIN, maximum selection MAX . . . . . . . . . . . . . . . 612
13.8.6 Limiter LIMIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
13.9 Processing of strings (data type STRING) . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
13.9.1 Output current length of a string LEN . . . . . . . . . . . . . . . . . . . . . . . . . . 615
13.9.2 Output maximum length of a string MAX_LEN . . . . . . . . . . . . . . . . . . . 615
Table of contents
19
13.9.3 Combine strings CONCAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
13.9.4 Output left part of string LEFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
13.9.5 Output right part of string RIGHT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
13.9.6 Output middle part of string MID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
13.9.7 Delete part of a string DELETE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
13.9.8 Insert string INSERT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
13.9.9 Replace part of string REPLACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
13.9.10 Find part of string FIND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
14 Program control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
14.1 Jump functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
14.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
14.1.2 Absolute jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
14.1.3 Conditional jump functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
14.1.4 Jump list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
14.1.5 Jump distributor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
14.1.6 Loop jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
14.2 Calling of code blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
14.2.1 General information on block calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
14.2.2 Calling a function FC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
14.2.3 Calling a function block FB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
14.3 Block end functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
14.3.1 Block end function RET (LAD and FBD) . . . . . . . . . . . . . . . . . . . . . . . . . . 636
14.3.2 RETURN statement (SCL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
14.3.3 Block end functions BEC, BEU, and BE (STL) . . . . . . . . . . . . . . . . . . . . . 637
14.4 Data block functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
14.4.1 Read data block attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
14.4.2 Reading and writing the load memory . . . . . . . . . . . . . . . . . . . . . . . . . . 639
14.4.3 ARRAY data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
14.4.4 System blocks for access to ARRAY data blocks . . . . . . . . . . . . . . . . . . . 642
14.4.5 CPU data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644
15 Online mode and program test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
15.1 Connection of a programming device to the PLC station . . . . . . . . . . . . . . 648
15.1.1 IP addresses of the programming device . . . . . . . . . . . . . . . . . . . . . . . . 648
15.1.2 Connecting the programming device to the PLC station . . . . . . . . . . . 649
15.1.3 Assigning an IP address to the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
15.1.4 Switching on online mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
15.1.5 Resetting the CPU memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
15.1.6 Reset to the factory settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
15.2 Transferring project data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
15.2.1 Loading project data for the first time . . . . . . . . . . . . . . . . . . . . . . . . . . 654
15.2.2 Reloading the project data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
15.2.3 Protecting the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657
15.2.4 Working with online project data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
15.2.5 Working with the memory card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
15.3 Working with blocks in online mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662
15.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662
15.3.2 Changing and loading a block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
Table of contents
20
15.3.3 Download without reinitialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
15.3.4 Uploading a block from the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
15.3.5 Working with setpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
15.3.6 Comparing blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
15.4 Hardware diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672
15.4.1 Status displays on the modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672
15.4.2 Diagnostic information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673
15.4.3 Diagnostics buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674
15.4.4 Diagnostic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
15.4.5 Online tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
15.4.6 Further diagnostic information via the programming device . . . . . . . 676
15.5 Testing the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
15.5.1 Defining the call environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
15.5.2 Testing with program status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679
15.5.3 Monitoring of PLC tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
15.5.4 Monitoring of data tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
15.5.5 Testing with watch tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684
15.5.6 Testing with the force table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
15.6 Measured value recording with the trace function . . . . . . . . . . . . . . . . . . 691
15.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
15.6.2 Creating the trace configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
15.6.3 Loading a trace and recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
15.6.4 Saving and evaluating recorded traces . . . . . . . . . . . . . . . . . . . . . . . . . . 693
16 Distributed I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
16.1 Introduction, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
16.2 ET 200 distributed I/O system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
16.2.1 ET 200MP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
16.2.2 ET 200M . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
16.2.3 ET 200SP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
16.2.4 ET 200S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
16.2.5 ET 200pro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
16.2.6 ET 200eco and ET200eco PN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
16.3 PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
16.3.1 PROFINET IO components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
16.3.2 Addresses with PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
16.3.3 Configuring PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
16.3.4 Coupling modules for PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
16.3.5 Real-time communication in PROFINET . . . . . . . . . . . . . . . . . . . . . . . . . 710
16.3.6 Special PROFINET configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
16.4 PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
16.4.1 PROFIBUS DP components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
16.4.2 Addresses with PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
16.4.3 Configuring PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
16.4.4 Coupling modules for PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
16.4.5 Special PROFIBUS configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
16.5 System blocks for distributed I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
16.5.1 Read and write user data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
16.5.2 Read diagnostic data from a DP standard slave . . . . . . . . . . . . . . . . . . . 733
Table of contents
21
16.5.3 Receive and provide a data record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
16.5.4 Activate/deactivate distributed station . . . . . . . . . . . . . . . . . . . . . . . . . . 736
16.6 DPV1 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
16.7 Isochronous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
16.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
16.7.2 Isochronous mode with PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . 739
16.7.3 Isochronous mode with PROFIBUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
16.7.4 Isochronous mode interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745
16.7.5 Isochronous process image updating . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
17 Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748
17.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748
17.2 Open user communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751
17.2.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751
17.2.2 Data structure of open user communication . . . . . . . . . . . . . . . . . . . . . 752
17.2.3 Establish connection and send data with TSEND_C . . . . . . . . . . . . . . . 753
17.2.4 Establish connection and receive data with TRCV_C . . . . . . . . . . . . . . 754
17.2.5 Configuring open user communication . . . . . . . . . . . . . . . . . . . . . . . . . 755
17.2.6 Further functions of open user communication . . . . . . . . . . . . . . . . . . 758
17.3 S7 communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
17.3.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
17.3.2 One-way data exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
17.3.3 Two-way data exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
17.3.4 Configuring S7 communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
17.4 Point-to-point communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
17.4.1 Introduction to point-to-point communication . . . . . . . . . . . . . . . . . . . 767
17.4.2 Configuring the CM PtP communication module . . . . . . . . . . . . . . . . . 768
17.4.3 Point-to-point communication functions . . . . . . . . . . . . . . . . . . . . . . . . 769
17.5 Further communication functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
17.5.1 USS protocol for drives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
17.5.2 Modbus RTU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775
17.5.3 Modbus TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777
18 Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780
18.1 Working with source files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780
18.1.1 General procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780
18.1.2 Programming a code block in the source file . . . . . . . . . . . . . . . . . . . . . 782
18.1.3 Programming a data block in the source file . . . . . . . . . . . . . . . . . . . . . 788
18.1.4 Programming a PLC data type in the source file . . . . . . . . . . . . . . . . . . 791
18.2 Migrating and upgrading projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
18.2.1 Migrating a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
18.2.2 Upgrading a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
18.3 Web server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
18.3.1 Enable Web server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
18.3.2 Reading out Web information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
18.3.3 Standard Web pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
18.3.4 Read out service data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800
18.3.5 Initialize Web server and synchronize Web pages (WWW) . . . . . . . . . 801
Table of contents
22
18.4 Technology functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
18.4.1 Technology modules TM Count 2×24V and TM PosInput 2 . . . . . . . . . . 801
18.4.2 Technology objects for counting and measuring . . . . . . . . . . . . . . . . . . 804
18.4.3 Technology objects for motion control . . . . . . . . . . . . . . . . . . . . . . . . . . 807
18.4.4 Technology objects for PID control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810
18.5 Data logging and transferring recipes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813
18.5.1 Introduction to data logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813
18.5.2 Using data logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814
18.5.3 Functions for data logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814
18.5.4 Introduction to recipe transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
18.5.5 Functions for the recipe transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818
18.6 Simulation with PLCSIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819
18.6.1 Differences from a real CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819
18.6.2 Installing PLCSIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819
18.6.3 Starting and saving the simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 820
18.6.4 Testing with the SIM table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 822
18.6.5 Testing with the sequence table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823
18.6.6 Applying the test functions of STEP 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . 825
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 827
1.1 Overview of the S7-1500 automation system
23
1 Introduction
1.1 Overview of the S7-1500 automation system
SIMATIC S7-1500 is the modular automation system for the medium and upper per-
formance ranges. Different versions of the controllers allow the performance to be
matched to the respective application. Depending on the requirements, the pro-
grammable controller can be expanded by input/output modules for digital and
analog signals and technology and communication modules. The SIMATIC S7-1500
automation system is seamlessly integrated in the SIMATIC system architecture
(Fig. 1.1).
Fig. 1.1 Components of the SIMATIC S7-1500 automation system
SIMATIC controllers control the machine
Several versions of the
controllers expand the range of use.
or plant.
The distributed I/O expands
the interface to the machine
or plant.
SIMATIC NET
SIMATIC HMI
SIMATIC ET200 STEP 7 Professional
(TIA Portal)
SIMATIC S7-1500
Networking allows data exchange
between devices and online access
at any location.
STEP 7 is the engineering software
for configuring and programming.
S
SIMATIC S7-1500 automation system
S
ESC OK
Operator control and
for controlling
during operation
monitoring
the plant
S
1 Introduction
24
The SIMATIC ET200 distributed I/O allows for additional expansion using input/output
modules which are connected to the central controller via PROFIBUS DP or
PROFINET IO. The distributed stations can be installed in a control cabinet or – if pro-
vided with special designs for increased mechanical requirements – directly on the
machine or system.
SIMATIC HMI (HMI = Human Machine Interface) is used to control and monitor a
machine or plant and its function. Depending on their version, the devices can pro-
vide control functions via process images, display system status and alarm mes-
sages, and manage the automation data in the form of recipes or measured value
archives.
SIMATIC NET handles the exchange of data via various bus systems between the
SIMATIC controllers, the distributed I/O, the HMI devices, and the programming
device. The programming device can be a personal computer, an industrial PC, or a
notebook with a Microsoft Windows operating system.
The SIMATIC components are configured, parameterized, and programmed using
the STEP 7 Engineering Software. The TIA Portal (TIA = Totally Integrated Automa-
tion) is the central tool for managing automation data and the associated editors in
the form of a hierarchically structured project.
1.1.1 SIMATIC S7-1500 programmable controller
The most important components of an S7-1500 programmable controller are
shown in Fig. 1.2.
Fig. 1.2 Components of an S7-1500 controller
Central controller
Signal modules
(SM)
Can be plugged onto the rack:
The rack has 32 slots. An optional power
supply occupies slot 0 and the CPU
occupies slot 1. To the right of the CPU,
there is room for up to 30 modules
(including power supply modules).
Technology modules
(TM)
Communication modules
(CM)
CPU
(central processing unit)
Power supply module
(PS)
Rack
Components of an S7-1500 controller
S
ESC OK
1.1 Overview of the S7-1500 automation system
25
The CPU contains the operating system and the user program. The user program
is saved powerfail-proof on the SIMATIC Memory Card, which is inserted in the
CPU. The user program is executed in the CPU's work memory. The bus interfaces
present on the CPU establish the connection to other programmable controllers.
Signal modules (SM) are responsible for the connection to the controlled machine
or plant. These input and output modules are available for digital and analog sig-
nals with different voltages and currents.
Technology modules (TM) are signal-preprocessing, “intelligent” I/O modules
which prepare and process signals coming from the process independent of the
CPU and either return them directly to the process or make them available at the
CPU's internal interface. Technology modules are responsible for handling func-
tions which the CPU cannot usually execute quickly enough such as counting
pulses.
Communication modules (CM) allow data traffic in excess of the functionality
provided by the standard interfaces on the CPU with regard to protocols and com-
munication functions.
The (system) power supply modules provide the internal voltages required by the
programmable controller. Up to three system power supply modules can be used in
the programmable controller as needed. Load voltages or load currents are pro-
vided via external load current supplies (power modules, PM), which can also pro-
vide 24 V primary voltage for system power supply modules.
1.1.2 Overview of STEP 7 Professional V12
STEP 7 is the central automation tool for SIMATIC. STEP 7 requires authorization
(licensing) and is executed on the current Microsoft Windows operating systems.
Configuration of an S7-1500 controller is carried out in two views: the Portal view
and the Project view.
The Portal view is task-oriented. In the Start portal you can open an existing proj-
ect, create a new project, or migrate a project. A “project” is a data structure con-
taining all the programs and data required for your automation task. The most
important STEP 7 tools and functions can be accessed from here via further portals:
The Devices & networks portal for hardware configuration, the PLC programming
portal for processing the user program, the Motion & technology portal for generat-
ing technology objects, the Visualization portal for configuring HMI systems, and
the Online & Diagnostics portal for the online mode of the programming device (Fig.
1.3).
The Project view is an object-oriented view with several windows whose contents
change depending on the current activity (Fig. 1.4). In the Device configuration, the
focal point is the working area with the device to be configured. The Device view
includes the rack and the modules which have already been positioned. A further
window – the inspector window – displays the properties of the selected module,
and the task card provides support by means of the hardware catalog with the avail-
able modules. The Network view allows networking between PLC and HMI stations.
1 Introduction
26
Fig. 1.3 Tools in the Start portal of STEP 7 Professional V12
Fig. 1.4 Example of a Project view: Working area of the device configuration
1.1 Overview of the S7-1500 automation system
27
When carrying out PLC programming, you edit the selected block in the working
area. You are again shown the properties of the selected object in the inspector win-
dow, where you can adjust them. In this case, the task card contains the program
elements catalog with the available program elements and statements. The same
applies to the processing of PLC tags or to online program testing using watch
tables.
And you always have a view of the project tree. This contains all objects of the STEP 7
project. You can therefore select an object at any time, for example a program block
or watch table, and edit this object using the corresponding editors which start
automatically when the object is opened.
1.1.3 Various programming languages
You can select between five programming languages for the user program: ladder
logic (LAD), function block diagram (FBD), structured control language (SCL),
statement list (STL), and sequential control (GRAPH).
Using the ladder logic, you program the control task based on the circuit diagram.
Operations on binary signal states are represented by serial or parallel arrange-
ment of contacts and coils (Fig. 1.5). Complex functions such as arithmetic func-
tions are represented by boxes which you arrange like contacts or coils in the ladder
logic.
Using the function block diagram, you program the control task based on electronic
circuitry systems. Binary operations are implemented by linking AND and OR func-
tions and are terminated by memory boxes (Fig. 1.6). Complex boxes are used to han-
dle the operations on digital tags, for example with arithmetic functions.
Structured control language is particularly suitable for programming complex
algorithms or for tasks in the area of data management. The program is made up of
SCL statements which, for example, can be value assignments, comparisons, or
control statements (Fig. 1.7).
Using the statement list, you program the control task using a sequence of state-
ments. Every STL statement contains the specification of what has to be done, and
Fig. 1.5 Example of representation in ladder logic
1 Introduction
28
possibly an operand with which the operation is executed. STL is equally suitable
for binary and digital operations and for programming complex open-loop control
tasks (Fig. 1.8).
Fig. 1.6 Example of representation in function block diagram
Fig. 1.7 Example of SCL statements
Fig. 1.8 Example of STL statements
1.1 Overview of the S7-1500 automation system
29
Using GRAPH, you program a control task as a sequential control in which a
sequence of actions prevails. The individual steps and branches are enabled by step
enabling conditions which can be programmed using LAD or FBD (Fig. 1.9).
1.1.4 Execution of the user program
After the power supply has been switched on, the control processor checks the exist-
ing hardware and parameterizes the modules. A startup program is then executed
once, if present. The startup program belongs to the user program which you pro-
duce. Modules can be initialized, for example, by the startup program.
The user program is usually divided into individual sections called “blocks”. Orga-
nization blocks (OB) represent the interface between operating system and user
program. The operating system calls an organization block for specific events and
the user program is then processed in it (Fig. 1.10).
Function blocks (FB) and functions (FC) are available for structuring the program.
Function blocks have a memory in which local tags are saved permanently. Func-
tions do not have this memory.
Program statements are available for calling function blocks and functions (start of
execution). Each block call can be assigned inputs and outputs, referred to as “block
parameters”. During calling, tags can be transferred with which the program in the
block is to work. In this manner, a block can be repeatedly called with a certain func-
tion (e.g. selection of tag values), but with different parameters sets (e.g. for differ-
ent calculations) (Fig. 1.11).
The data of the user program is saved in data blocks (DB). Instance data blocks have
a fixed assignment to a call of a function block and are the tag memory of the func-
tion block. Global data blocks contain data which is not assigned to any block.
Fig. 1.9 Example of a GRAPH sequencer and step configuration
1 Introduction
30
Following a startup, the control processor updates the input and output signals in
the process images and calls the organization block OB 1. The main program is
present here. Once the main program has been processed, the control processor
returns to the operating system, retains (for example) communication with the
programming device, updates the input and output signals, and then recom-
mences with execution of the main program.
Cyclic program execution is a feature of programmable logic controllers. The user
program is even executed if no actions are requested “from outside”, e.g. if the con-
trolled machine is not running. This provides advantages when programming: For
example, you program the ladder logic as if you were drawing a circuit diagram, or
program the function block diagram as if you were connecting electronic compo-
nents. Roughly speaking, a programmable controller has a characteristic like, for
example, a contactor or relay control: the many programmed operations are effec-
tive quasi simultaneously “in parallel”.
In addition to the cyclically executed main program, it is possible to carry out inter-
rupt-controlled program execution. You must enable the corresponding interrupt
event for this. This can be a hardware interrupt, such as a request from the con-
trolled machine for a fast response, or a cyclic interrupt, in other words an event
which takes place at defined intervals.
The control processor interrupts execution of the main program when an event
occurs, and calls the assigned interrupt program. Once the interrupt program has
been executed, the control processor continues execution of the main program
from the point of interruption.
Fig. 1.10 Execution of the user program
Startup
program
Alarm and
error program
Main
program
Execution of the user program
Switching on
Updating of
inputs and outputs
Interruption
(alarm or error)
Operating state
STARTUP
Operating system User program
Operating state
RUN
OB
OB
FB
FC
FB
FC
FB
FC
FB
FC
FB
FC
FB
FC
OB
Interruption
1.1 Overview of the S7-1500 automation system
31
1.1.5 Data management in the SIMATIC automation system
The automation data is present in various memory locations in the automation sys-
tem. First of all, there is the programming device. All automation data of a STEP 7
project is saved on its hard disk. Configuration and programming of the project
data with STEP 7 are carried out in the main memory of the programming device
(Fig. 1.12).
The automation data on the hard disk is also referred to as offline project data. Once
STEP 7 has appropriately compiled the automation data, this can be downloaded to
a connected programmable controller. The data downloaded into the user memory
of the CPU is known as the online project data.
Fig. 1.11 Multiple use of a block with different tags in each case
“Selection” block with the one-time written program
Two-time call of “Selection” with different parameter sets in each case
1 Introduction
32
The user memory on the CPU is divided into two components: The load memory on
the SIMATIC Memory Card – an SD memory card – contains the complete user pro-
gram with the configured initial data, including the configuration data. The work
memory contains the executable user program with the current control data.
The project data can be transferred between the programming device and CPU
using the SIMATIC Memory Card. The normal case is an online connection for trans-
fer, testing, and diagnostics.
1.2 Introduction to STEP 7 Professional V12
1.2.1 Installing STEP 7
STEP 7 Professional V12 is executed on
the operating systems Windows XP Pro-
fessional SP3, Windows 7 (Professional,
Enterprise, Ultimate) SP1 (32-bit and 64-
bit), Windows 2003 Server R2 Standard
Edition SP2, and Windows 2008 Server
Standard Edition SP2. You require
administration rights in order to install
STEP 7, and to work with STEP 7 you must
at least be logged-on as a main user.
Fig. 1.12 Data management in the SIMATIC S7-1500 automation system
Work memory
Retentive memory
Main memory
Hard disk
Load memory
SIMATIC Memory Card
The load memory contains the
project data transferred to the
CPU. Together with the current
values of the tags from the
work memory, they form the
online project data.
The retentive memory
contains the tags
whose values are
retained even when
deenergized.
The offline project data
is saved on the hard
disk.
All project data is
processed in the
programming device's
main memory.
Programming device CPU 1500
Transfer with online
connection or SIMATIC
Memory Card
Transfer
when switching on
Saving the
project data
Data management in the SIMATIC S7-1500 automation system
The work memory
contains the executable part
of the user program (code and
data), which is executed
during runtime.
1.2 Introduction to STEP 7 Professional V12
33
In order to be able to work with STEP 7, you need a programming device with at
least one Core i5, 2.4 GHz processor or a comparable processor. The main memory
should have a minimum size of 3 GB for a 32-bit operating system and 8 GB for a
64-bit operating system. On the hard disk, STEP 7 Professional requires approxi-
mately 2 GB of free space in the system drive.
For the online connection to the programmable controller, an interface module is
required on the programming device for the connection to Industrial Ethernet.
If you want to work on the programming device using an SD memory card, you
need a corresponding card reader.
Installation, repair, and uninstalling are carried out using the setup program
start.exe on the DVD. You can also uninstall STEP 7 Professional normally in
Windows using the Software application (Windows XP) or the Programs and
functions application (Windows 7) in the Windows Control Panel.
1.2.2 Automation License Manager
You require a license (user authorization) in order to use STEP 7. Licenses are man-
aged by the Automation License Manager, which is installed together with STEP 7
Professional. The license for STEP 7 Professional (license key) is provided on a
USB flash drive. You will be requested to provide authorization during installation
if a license key is not yet present on the hard disk. You can also carry out the autho-
rization following installation of STEP 7.
The license key is stored on the hard disk in specially identified blocks. To avoid
unintentional destruction of the license key, you should observe the information
for handling license keys in the help text of the Automation License Manager. If you
lose the license key, e.g. due to a defective hard disk, you can revert to the trial
license delivered with STEP 7, which is valid for a limited duration.
The Automation License Manager also manages license keys of other SIMATIC prod-
ucts such as STEP 7 V5.5 or WinCC.
1.2.3 Starting STEP 7 Professional
You start STEP 7 Professional either using the Start button of
Windows and Programs > Siemens Automation > TIA Portal V12, or by
double-clicking on the icon on the Windows desktop. The Totally
Integrated Automation Portal (TIA Portal) is the software framework
in which STEP 7 is embedded. TIA Portal may also contain other applications that
use the same database, such as WinCC Professional V12.
1.2.4 Portal view
Following initial starting-up, STEP 7 Professional displays the Start portal. A portal
provides all functions and tools required for the respective range of tasks in the
Portal view. The scope of the portals as well as the range of functions and tools
depends on the installed applications. The Start portal of STEP 7 Professional V12
permits selection of the following portals (Fig. 1.13):
1 Introduction
34
b In the Devices & networks portal, you can configure the hardware of the program-
mable controller, i.e. you select the hardware components, position them, and
set their properties. If several devices are networked, you can define the connec-
tions here.
b The PLC programming portal contains all the tools required for generating the
user program for a PLC station.
b In the Motion & technology portal, you create technology objects, such as a PID
temperature regulator or a high-speed counter.
b In the Visualization portal, you generate the operator control and monitoring
interface for HMI stations. Here you can configure, for example, the process
images, the control elements, and alarms.
b Using the Online & Diagnostics portal, you can connect the programming device
to a programmable controller, transfer and test programs, and search for (and
detect) faults in the automation system.
Additional functions included in the Start portal are: Create new project,
Open existing project, and Migrate project. The Welcome Tour and First steps provide
an introduction to STEP 7. Installed software provides an overview of further
SIMATIC applications that are currently available on the programming device.
You can call Help in every portal. The User interface language allows you to set the
language for working with STEP 7.
Fig. 1.13 Portal view: First steps after opening a project
1.2 Introduction to STEP 7 Professional V12
35
1.2.5 The windows of the Project view
The Project view shows all elements of a project in structured form in various pro-
cessing windows. You can move from the Portal view to the Project view using the
Project view link at the bottom left of the screen, or STEP 7 automatically switches
to the Project view depending on the selected tool.
Fig. 1.14 shows the windows of the Project view in an example of block program-
ming. Different window contents are displayed depending on the currently used
editor.
a Main menu and toolbar, shortcut menu
Underneath the title bar is the main menu with all menu commands. The menu
commands available for selection depend on the currently marked object; menu
commands which cannot be selected are displayed in gray. The same functionality
is available – somewhat user-friendlier – with the shortcut menu: If you click on an
object with the right mouse button, a window is opened with the currently select-
able menu commands. Underneath the main menu is the toolbar with the graphi-
cally represented “main functions”. The main menu and the toolbar are always
present in all editors.
Using Options > Settings in the main menu, you can adapt the user interface.
For example, under General you can define the user interface language in which
Fig. 1.14 Components of Project view using example of block programming
1 Introduction
36
STEP 7 is used, and the mnemonics (the representation of the operands: “I” for
international input, or “E” in German).
s Working window
In the center of the screen is the working window. The contents of the working win-
dow depend on the editor currently being used. In the case of device configuration,
the working window is divided in two: the objects (stations and modules) are dis-
played in graphic form in the top part, and in tabular form in the bottom part. When
programming the PLC, the top part of the working window contains the interface
description of the block and the bottom part contains the program. You use the
working window to configure the hardware of the automation system, generate the
user program, or configure the process images for an HMI device.
d Inspector window
The inspector window underneath the working window shows the properties of the
object marked in the latter, records the sequence of actions, and provides an over-
view of the diagnostics status of the connected devices.
During configuration or programming you set the object properties in the inspec-
tor window, for example the addresses and symbol names of inputs and outputs,
the properties of the PROFINET interface, tag data types, or block attributes.
f Project tree
The project tree window is displayed with the same content for all editors. Its hier-
archical structure contains all project data and the required editors. With the proj-
ect open, it shows the folders for the PLC, HMI and PC stations included in the proj-
ect, and further subfolders within these folders, e.g. for program blocks, PLC tags,
and watch tables with a PLC station or, for example, the process images and the HMI
tags in the case of an HMI station.
A double-click on an object with project data automatically starts the associated
editor. The project tree also includes editors such as Add new device, Device
configuration, or Online & diagnostics, which you can start directly by means of a
double-click.
The lower section of the project tree contains a details view of those objects which
are present in the hierarchy underneath the object marked in the project tree.
g Task window
To the right of the working window is the task window with the task cards. This con-
tains further objects for processing in the working window. The contents of the task
window depend on the currently active editor. In the case of the hardware
configuration, for example, the hardware catalog with the available components is
shown here, in the case of PLC programming the program elements catalog
appears, with Online & Diagnostics the online tools, and with the Visualization the
library for the process image control and display elements.
You can also call the libraries in this window: Global libraries supplied with STEP 7,
or the project library in which you can save reusable objects such as program blocks,
templates for process images, or control elements with special configurations.
1.2 Introduction to STEP 7 Professional V12
37
h Reference projects
The Reference projects palette shows the reference projects that are open in addition
to the current project. Using the View > Reference projects command from the main
menu, you can switch the palette display on and off.
j Editor and status bar
At the bottom left of the Project view you can change to the Portal view. In the middle
you can see the tabs of the open windows. Click on a tab to display its contents in the
top level of the working window. This makes it easy to change quickly between dif-
ferent window contents. The status bar on the far right indicates the current status
of project execution.
1.2.6 Help information system
During programming, the help func-
tion of STEP 7 provides you with com-
prehensive support for solving your
automation task.
To call the help function, click on Help in
the Portal view or select the Help > Show
help command in the main menu in the
Project view. A window appears with the
help information system (Fig. 1.15).
The online help is roughly divided
according to the project execution
steps: Configuration, parameterization
and networking of devices, structuring
and programming of the user program,
visualization of processes, and utiliza-
tion of the online and diagnostics func-
tions.
Readme provides general information
on STEP 7 and further information
which could not be included in the
online help. A comprehensive descrip-
tion of all available basic and extended
statements can be found under
Programming a PLC > References.
1.2.7 Adapting the user interface
The language of the user interface can be changed. In the main menu, select the
General section under Options > Settings. In the User interface language drop-down
list, you can select the desired language from the installed languages. The texts of
the user interface are then immediately displayed in the new language. You can also
define here how the TIA Portal is to be displayed following the next restart.
Fig. 1.15 Start page of the information
system
1 Introduction
38
You can show or hide the displayed windows using the menu command View. You
can always change the size of windows by dragging on its edge with the mouse.
Windows can be minimized into symbols which appear in one of the navigation
bars in the left, bottom or right margin of the screen.
You can separate the working window completely from the Project view so that it is
displayed as a separate window (symbol for Float in the title bar of the working win-
dow), and also insert it again (symbol for Embed). Using the symbol for Maximize,
all other windows are closed and the working window is displayed in maximum
size. The working window can be divided vertically or horizontally, permitting you
to view two working areas simultaneously.
You can change the width of table columns by dragging with the cursor in the table
header. In the case of columns that are too narrow, the entire content of the individ-
ual cells will appear as a tooltip when the cursor is briefly hovered over the relevant
field.
1.3 Editing a SIMATIC project
Fig. 1.16 shows all tools and data which can be of importance in an automation task.
Of prime importance is the project, which contains all the automation data required
Fig. 1.16 Project components, libraries, and programming device design
Global libraries
Programming device design
System libraries User libraries
< Global library >
Online access
< User library >
Card Reader/USB memory
Libraries delivered with STEP 7 Libraries configured by users themselves
Global libraries contain elements for use across projects.
Contains the programming device resources relevant to the project
All the data for an automation task is combined in a project.
A project includes at least one station. Contains cross-station data
Contains all the data for a
controller
Contains text lists for system and user messages
Contains all the data for an HMI
device
Contains all the data for a PC
system or PC application
Contains project texts, project languages, and
graphics
Contains the templates and settings for
documentation of project data
PLC station Common data
HMI station
PC station
Documentation settings
Languages and resources
Stations
Project
Common project data
< Project library >
Contains data compiled by the user
Project library
1.3 Editing a SIMATIC project
39
for control and operation of the machine or plant. The project data is roughly
divided into the data for the individual stations and the common project data which
applies to all stations in the project.
A station can be a controller (PLC station), an HMI device (HMI station), or a PC sta-
tion. A project can include several stations, but at least one station must be present.
The data present in a PLC station is described later in this book. Common project
data includes, for example, centrally managed message texts or texts for multilin-
gual projects.
A project library can be created for each project. Objects which are used in several
projects are combined in global libraries. Also relevant to a project is the program-
ming device design with interface modules (e.g. LAN adapters) and memory card
readers.
1.3.1 Structured representation of project data
The project tree in the Project view displays the project data and the programming
device design in a tree structure (Fig. 1.17).
The structure also includes the editors (tools) required for generating and editing
the data. The project tree does not include the project library. This is represented in
a task card together with the global libraries in the task window under Libraries.
You can replace the names shown in angle brackets by names more appropriate to
your automation task.
1.3.2 Project data and editors for a PLC station
If you add a PLC station (an S7-1500 controller) to the project, STEP 7 creates the
corresponding structure in the project data (Fig. 1.18). A station is always required
for editing in a project so that STEP 7 can create the data structures required for
programming or configuration. If you wish to write a user program without previ-
ously selecting a specific CPU, you can select the “unspecified CPU 1500” from the
hardware catalog and replace it later with a “real” CPU 1500.
The user program which controls the machine or process is located in the Program
blocks folder. The program comprises blocks (separate program components)
which are either stored directly in the Program blocks folder or – if there is a large
number – in subfolders which you can create and configure yourself. The Main
block (“main program”, the name is the symbol for the block and can be changed)
is the organization block OB 1 and is created automatically. The processing
sequence of the blocks is defined in the user program by “block calls” and can be
made visible using the Program info editor (further down in the project tree) in a
call and dependency structure.
The Program blocks folder contains a System blocks subfolder with the system and
standard blocks used in the program. This is created automatically when a block of
this type is used.
1 Introduction
40
The Technology objects folder contains the configuration data for the objects of axis
controls, control loops (PID controllers), and high-speed counters. A new technol-
ogy object can be generated using the Add new object editor.
The External sources files folder contains the program sources for STL and
SCL blocks. The Add new external file editor is used to import a program source and
to save it in this folder. The External sources files folder can be configured using self-
created subfolders.
The PLC tags folder contains the assignment of the absolute address to the symbolic
address (name) of inputs, outputs, and bit memories, as well as SIMATIC timer func-
Fig. 1.17 Project structure in the project tree
< Project >
Online access
Card reader/USB memory
Interface x1
< PLC station >
Common data
Documentation settings
Interface x2
< PLC ... >
< PLC station_1 >
Languages & resources
Add new device
...
...
...
Devices & networks
Update accessible
devices
Add user-defined
card reader
Card reader
Adds a new station to the project
Folder with the data of a found station
Alarm classes, text lists for user and system alarms
Templates and settings for documentation
List with project texts in different languages
Selection of languages for display and alarm texts
Collection of language-dependent graphic symbols
Starts the device and network configuration
Searches for stations connected to this interface (module)
Adds a card reader
Card reader in the programming device
Folder for all data of an automation system
Folder for all interfaces of the programming device
Folder for all card readers of the programming device
Interface of programming device
Folder for all data of a PLC station
Folder for common data in the project
Folder for documentation settings
Further interfaces (interface modules) if applicable
Folder for the data of a further PLC station
Folder for language-dependent objects
Project tree with opened project
1.3 Editing a SIMATIC project
41
Fig. 1.18 Structure of the project data for a PLC station
< PLC_xxx >
Program blocks
Watch and force table
PLC data types
Local modules
Technology objects
System blocks
External sources
PLC tags
< Group_1 >
< Group_1 >
< Group_1 >
< Technology object_1 >
Device configuration
Add new block
Add new watch table
Add new data type
< PLC data type_1 >
Add new object
Add new external file...
< External program source >
Show all tags
Add new tag table
Default tag table [n]
< Tag table [n] >
Online & diagnostics
Main [OB1]
< Watch table_2 >
< Block_2 >
<Tag table_1 [n]>
< Block_1 >
< Watch table_1 >
Force table
Text lists
PLC alarms
Program info
Traces
Starts the editor for device configuration
Creates a new block and opens it
Creates a new watch table and opens it
Adds a new PLC data type
Self-created PLC data type
Self-created watch table
Table with the force tags
Station-specific texts for user and system alarms
PLC, user diagnostics and system alarms
Shows program structure, assignment list, CPU resources
Editor for recording and displaying measured value series
Self-created block
Creates a new technology object and opens it
Imports a program source
Imported program source
Shows all PLC tags of all tables
Adds a new tag table
Automatically created tag table with n tags
Self-created tag table with n tags
Starts the editor for the online connection and diagnostics
Self-created groups with further watch tables can be used under
Watch and force tables for structuring.
Folder for all data of a PLC station (name can be freely selected)
Folder for all blocks of the user program
Folder for all watch and force tables
Folder for all PLC data types
Folder for the local modules of the PLC station
Folder for all technology objects
Folder for the system blocks used
Folder for the program source files
Folder for all PLC tags
Under Program blocks, further blocks can be created in addition
to the permanently existing Main [OB1] block (main program).
The block collection can be structured using self-created groups
which contain further blocks.
Self-created groups with further tag (partial) tables can be used
under PLC tags for structuring.
Self-created technology object
Data structure of a PLC station
1 Introduction
42
tions and SIMATIC counter functions. Example: The symbolic address “Switch on
motor” can be assigned to the input with the absolute address %I1.0. A PLC tag is
applicable throughout the CPU, it is a “global” tag. The PLC tags folder can be con-
figured using self-created subfolders. A subset of the PLC tags is listed in a tag table.
The Show all tags editor lists all PLC tags used from all tag tables.
The PLC data types folder contains user-defined data types. A PLC data type com-
bines various data types in the form of a named data structure. A PLC data type can
be assigned to a local tag in a block or serve as a template for the structure of a data
block. The PLC data types folder can be configured using self-created subfolders.
All created watch tables and the force table can be found in the Watch and force
tables folder. A watch table is used during testing of the user program. It contains
tags whose current value can be monitored and also changed during runtime. The
Force table can be used to assign a fixed value to peripheral inputs and outputs. The
Watch and force tables folder can be configured using self-created subfolders.
Using the Traces editor, the recording of measured value series is planned, the cor-
responding tasks are sent to the CPU, and the recordings are displayed and man-
aged in tables and graphs in the form of a curve chart.
Program info provides information about
b the call structure – which block calls which other block
b the dependency structure – which block is called by which other block
b the assignment list – which global operands are already used and which address-
es are still unused
b the resources – how much space is required by the program in the load and work
memory
Under PLC alarms you see an overview of which program alarms and system alarms
are currently present and edit them.
Message texts are stored under Text lists. In the case of the user-defined text list, you
can specify the value ranges which trigger the alarms and the associated texts; with
a system-defined text list, the contents are specified by STEP 7. Text lists created
under a PLC station contain station-specific texts, those created under a project
contain cross-station texts.
The Local modules folder contains all configured modules of the PLC station. Open-
ing a module initiates device configuration. The module properties are displayed in
the inspector window.
You start configuration of a station using the Device configuration editor, which is
located in the first position in the project structure of the station. There is no cor-
responding folder for the data of the device configuration in the project tree. The
configuration data is located “behind” the Device configuration editor. When you
start the editor, the data is displayed in the form of a pictorial representation of the
programmable controller in the working window and in a register-oriented repre-
sentation of the module properties in the inspector window. The bottom section of
1.3 Editing a SIMATIC project
43
the working window additionally displays the configuration table with the modules
as a drop-down list.
Online & diagnostics starts the editor for the online connection and online func-
tions. For example, you can use a (software) control panel in online mode to control
the operating states of the CPU, to set the CPU's IP address and time, or read the
CPU's diagnostics buffer.
1.3.3 Creating and editing a project
Creating a new project
You can create a new project in the Portal view if you click on Create new project in
the Start portal. Assign a name to the project and set a path in which the project is
to be saved. After clicking the Create button, any project which is open is closed, the
new project is created, and the next steps are displayed in the Start portal for selec-
tion:
b Configure a device
STEP 7 changes to the Devices & networks portal in which you can insert a new
CPU 1500 (a PLC station) into the project and open it for editing.
b Write PLC program
STEP 7 changes to the PLC programming portal in which you can edit the Main
block (organization block OB 1) or add a new block and open it for editing.
b Configure an HMI screen (using the supplied WinCC Basic)
STEP 7 changes to the Visualization portal in which you can create a new
HMI station or configure an already existing one. From this portal you start con-
figuration of the process images, editing of HMI tags and alarms, and the
HMI simulator. If WinCC Comfort, Advanced or Professional is installed, it is
started under this portal.
b Open the project view
STEP 7 changes to the Project view in which you can perform the next steps such
as adding another PLC station, modifying the configuration of an existing
PLC station, adding and programming a block, or configuring the process
images for an HMI station.
In the Project view you can create a new project using the Project > New menu
command. Assign a name to the project in the dialog window, set the path in which
the project is to be saved, and click on the Create button.
Editing an existing project
You can open an existing project in either the Portal view or the Project view. In the
Start portal, either activate Open existing project in the Portal view or Project > Open
in the Project view. Select the desired project from the list of projects last used. Any
project which is open is closed and the selected project is opened.
During editing in the Project view, you can save the entered project data using the
Project > Save or Project > Save as menu command. You can close the project using
1 Introduction
44
Project > Close – following confirmation of whether changes are to be saved –
without exiting STEP 7.
You can delete a (closed) project from the hard disk – following confirmation –
using Project > Delete project.
Compiling and downloading project data
Before project data can be downloaded to a station, it must be made readable for the
respective processor: It must be “compiled”. The project data is compiled
station-by-station. The scope of the compilation can be varied depending on the
type of station. For example, the command from the Compile > Software (only
changes) shortcut menu only compiles those software components which have
been changed since the last compilation.
The same applies to downloading of the compiled data to a station. You can select
for a PLC station whether you wish to download only the hardware configuration,
or only the user program, or both.
Printing project data
The project data can be printed in the form of a circuit manual. You can use the doc-
umentation function to set the layout of the printout. The settings in the main
menu under Options > Settings and General > Print settings apply to all projects in
the TIA Portal. The templates for the project circuit manual are saved in the project
tree in the Documentation settings folder. You can add your own templates or
change existing ones.
In the global Documentation templates library under Master copies in the Document
information group, you can find the templates to design a circuit manual, in the
Frames group are the templates for the page frames, and in the Cover Pages group
are the cover page templates. To copy templates to the project, in the Libraries task
card, open the Documentation templates library and drag a template from the
Document information folder, for example DocuInfo_ISO_A4_Portrait, to the
Document information folder under Documentation settings. Copy a cover page from
the Cover Pages folder to the Cover pages folder and a frame from the Frames folder
to the Frames folder.
Double-clicking on a template in the project tree opens the template for editing.
For example, you add a new text field or graphical symbol to the cover page. You are
supported by the Toolbox task card, which contains object templates for a text box,
a date/time field, a field for the page number, a field for free text, and a graphic
placeholder. In the frame template you complete the title block and in the docu-
ment information template you enter the data for the circuit manual.
You select the objects to be printed in the project tree or in a library. To display
the print preview, select Print preview... from the shortcut menu or Project > Print
preview… from the main menu. In the dialog window you can set the document
information to be used, select the printout of the cover page and table of contents,
1.3 Editing a SIMATIC project
45
and specify whether all project data or a compact selection should be displayed in
the print preview.
To print, select the objects to be printed and click on the Print icon in the toolbar or
select Project > Print… in the main menu or Print… in the shortcut menu. In the dialog
window, you then specify the printer, the document layout, and compact or full
printout.
Archiving and retrieving a project
You can reduce the size of the project on the hard disk in two ways:
b You create a minimized project. This reduces the opened project to its essential
components and saves it as a copy. You can open and continue to edit a mini-
mized project as usual.
b You create a project archive. This reduces the opened project to its essential com-
ponents and compresses it. The compressed project archive can only be edited
further after it is retrieved.
To archive a project, open it. If you make changes to the project, save it before you
archive it. Then select the command Project > Archive… from the main menu. In the
dialog window under File type, select either TIA Portal project minimized or TIA Por-
tal project archives from the drop-down menu. If you want to create a minimized
project copy, save the copy under a different name and/or a different directory.
A project archive is saved with the file extension .zap12. The project name and proj-
ect path can be retained.
To retrieve a project, close any open projects and select the command Project >
Retrieve from the main menu. In the dialog window, specify the name of the project
archive with the file extension .zap12 and, in the next dialog window, specify the
directory in which the retrieved project is to be saved. Then the retrieved project is
opened.
1.3.4 Working with reference projects
You have the capability of opening projects in addition to the current project. These
projects are write-protected, i.e. they cannot be modified. You can import individual
objects from these “reference projects” into the current project and you can com-
pare a PLC station of a reference project to a station of the current project or a dif-
ferent reference project.
You open a reference project using the Open reference project icon in the project tree
on the Reference projects palette. Select the desired project from the subsequent
dialog window and open it.
The read-only reference project is opened. You can open individual objects of this
project, but you cannot change them. You can copy individual objects of the refer-
ence project into the current project: Select the object in question, press and hold
the mouse button, and “drag” the object into the current project. You can process
the copied object further here.
1 Introduction
46
To compare two PLC stations, select the station and then select the command
Compare > Offline/offline from the shortcut menu. The station is displayed in the left
pane of the compare editor. Now press and hold the mouse button and “drag” the
PLC station to be compared into the header of the right pane. This can be a station
from a reference project or from a library. The compare editor marks different
objects with symbols (green circle: no differences, semi-circles in various colors:
differences exist, unfilled semi-circle: object does not exist). You can select individ-
ual objects and start a detailed comparison via the shortcut menu if the type of the
object allows it. Actions such as overwriting an object are not possible for a refer-
ence project. You can compare additional stations by “dragging” the corresponding
station into the header of one of the panes.
1.3.5 Creating and editing libraries
Libraries are used to save reusable program components. These could include sta-
tions, blocks, PLC tag tables, process images, or picture elements, for example.
A project library and global libraries are available.
The libraries are displayed in a task card of the task window. The library contents
can be listed with the symbol open or close the element view in the Elements pallet
in the Details mode, List mode, or Overview mode. The Info pallet shows further
information on the selected library element.
A project library which you can fill with objects is automatically created when you
create a project. You can structure the contents of the project library using folders.
A project library is always opened, saved, and closed together with the project.
Components which can be used in multiple projects are saved in global libraries.
There are global system libraries which are supplied with STEP 7, and global user
libraries which you create yourself. A global library is opened, saved, and closed
independent of the project. If you wish to use a global library simultaneously with
other users, the library must be opened in read-only mode.
To create a global library, open the Libraries task card in the task window and click
on the Create new global library icon in the Global libraries palette. In the dialog
window, specify the name and path of the library before you click on the Create but-
ton. Using the other symbols in the Global libraries palette, you can open a global
library, save the changes to the library, and close the library.
2.1 S7-1500 station components
47
2 SIMATIC S7-1500 automation system
2.1 S7-1500 station components
A programmable controller including all I/O modules is referred to as a “station”.
An S7-1500 station can contain the following components:
b Rack
b Power supply (PS)
b Central processing unit (CPU)
b Input/output modules (signal modules, SM)
b Technology modules (TM)
b Communication modules (CM)
A station can also encompass distributed I/O which is connected to the CPU or a
communication module via a PROFINET IO or PROFIBUS DP bus system.
Design variants
An S7-1500 station comprises one rack with a maximum of 32 slots. It can be
divided into as many as three “power segments”. A power segment comprises a cur-
rent source (PS or CPU) and the modules to be supplied as current sinks. The num-
Fig. 2.1 S7-1500 station with CPU 1516-3 PN/DP
2 SIMATIC S7-1500 automation system
48
ber of modules a power segment encompasses depends on the electrical power that
is provided and consumed. An additional load current supply is needed for supply-
ing the sensors and actuators (Fig. 2.2).
Fig. 2.2 Design variants of an S7-1500 station
Maximum configuration
Configuration without system power supply, one power segment
Configuration with system power supply, one power segment
Central configuration of an S7-1500 station
S
ESC OK
S
ESC OK
S
ESC OK
PS
PS
PS
CPU
CPU
CPU PS
... ...
...
...
...
Modules
Modules
Modules Modules Modules
The CPU is supplied with 24 V DC, and the
CPU in turn supplies the other modules via
the backplane bus.
A system power supply (PS) supplies the CPU
and the remaining modules with power via the
backplane bus.
Additionally, two power segments with system
power supply and modules can be arranged to
the right of the CPU.
The rack can hold a total of 32 modules. This means that up to 30 additional modules (including
system power supplies) can be arranged to the right of the CPU.
Power segment Power segment Power segment
Maximum 30 modules
2.2 S7-1500 CPUs
49
If a power supply module is used for the first power segment, it is plugged into the
first slot on the far left (slot 0). The CPU is always plugged into slot 1 next to it. To the
right of the CPU, there is room for another 30 modules, including any additional
system power supply modules. Each module occupies one slot independent of its
width. The modules must be inserted without gaps.
The power supply for the module electronics and the data exchange between the
modules is accomplished via the backplane bus. The backplane bus is made up of
“U-connectors” between the modules. One U-type-connector is needed for each
module.
2.2 S7-1500 CPUs
2.2.1 CPU versions
CPUs for S7-1500 are available in several
versions for different applications. Com-
mon to all CPUs is the scope of control
functions (operands, tag types, data types,
binary logic operations, fixed-point and
floating-point arithmetic, etc.). Within the
versions, the CPUs differ in their memory
size, the range of operands, and the pro-
cessing speed (Table 2.1).
Standard controllers
Three versions of standard-design control-
lers are currently available: CPU 1511-1 PN,
CPU 1513-2 PN, and CPU 1516-3 PN/DP.
It is possible to connect to Industrial Ether-
net using the PN interface. Each CPU can
be both an IO controller and an “intelli-
gent” IO device on PROFINET IO. A CPU
with a DP interface can be the DP master on
PROFIBUS DP.
2.2.2 Control and display elements
The control panel with the display and sta-
tus LEDs above the control panel are located on the front side of the CPU. The mode
switch, slot for the SIMATIC Memory Card, and interface connections are located
behind the control panel.
Fig. 2.3 CPU 1516-3 PN/DP
Another Random Document on
Scribd Without Any Related Topics
The French Government, like the English, obtained success at the
elections by wild promises to make Germany pay all the costs of the
war. As M. Poincaré has observed, "the French people will not
understand how the victors in a great war can be on the verge of
bankruptcy." Consequently they think their rulers are cheating them.
Educated people, in France as in England, have long since ceased to
expect much from German indemnities, but the Governments still
depend on their appeal to mob-psychology; and it was believed that
if M. Briand ventured to make any concessions in the direction of
reason or moderation he would lose his majority in the Chamber.
The proposals made at the Inter-Allied Conference at Brussels and
drawn up by the French expert, M. Seydoux, had been silently
dropped as unsatisfying; the subsequent British proposals made at
Boulogne had been rejected for the same reason. It was necessary,
however, to make some definite proposals to Germany without much
further delay, since the treaty had laid down May 1, 1921, as the
time for a settlement. Germany was by that time to have paid a
thousand million pounds on account, and was to learn the extent,
finite or infinite, of the total bill. Mr. Lloyd George, as might have
been expected, showed much sympathy with M. Briand in his
awkward position, and agreed to a demand for reparations on a
scale which was obviously fantastic. It began, reasonably enough,
with a system of annuities, though the first figure was probably too
high and the last figures can scarcely have been meant seriously.
Germany was to pay £150,000,000 a year for the first five years;
then the annual sum was to increase at intervals for the
extraordinary period of forty-two years, towards the end of which
time Germany was expected to pay annually £300,000,000, or half
as much again every year as the total indemnity exacted from
France after the war of 1870. Even that was not enough for a
population which had been sedulously fed on lies by a class of
politician who at times seem to possess among them no single sane
and honest man. And an additional payment was demanded of a
yearly sum equivalent to a duty of twelve per cent ad valorem on all
German exports.
Opinion in Germany was sharply divided. All they had to pay with
was an enormous deficit on the Budget, with the prospect of
presently losing the Silesian coal-mines and having prohibitive duties
placed by the Allies upon their exports. One party insisted that the
Government should make no promise which it could not expect to
perform; another, that what Germany wanted was peace, and that
they had better sign anything required of them. The first party, on
the whole, carried the day. The German delegation in London made
a counter-proposal based, very sensibly, on the idea of finding the
present value of the forty-two-year annuities and raising that sum by
means of a loan; but as they worked out the idea they favoured
Germany on every detailed calculation to an extent which they must
have known to be unacceptable. Apparently they expected a long
and serious bargaining march. But, to most people's surprise, Mr.
George leapt with alacrity at the prospect of a rupture. The proposal
was rejected with every semblance of virtuous indignation. No time
was allowed for the delegation to consult the German Government.
A hurried second proposal, to pay the terms demanded for five years
and then have the matter reconsidered, was tossed aside without
consideration, and French and British troops proceeded to invade
Germany, occupy more territory, and set up a new and artificial
customs-barrier in the most unsuitable places, at which they
proceeded themselves to collect the German customs.
The plan is very expensive, and utterly unprofitable. It involves a
straining if not a breach of the treaty,[3] and it is likely, if any
untoward event occurs, to provoke a war of the most humiliating
and embittered kind—the war of a desperate and helpless population
trying to rid themselves of foreign oppressors. But it has saved M.
Briand's Government. If he had agreed to accept any German terms
whatever, he would have been upset for not exacting more. But if he
marches French and British troops into the heart of Germany no one
can accuse him of lack of spirit. So for the present all is well; and as
for the future, it is conceivable that the Germans will give way and
make some impossible promise. That will increase M. Briand's
prestige. It is more likely that they will simply sit still and let the
Allied armies do their worst. Then there will be a chance of carrying
out one of the darling aims of the French chauvinists, and annexing,
or at least separating from Germany, all the German provinces which
they occupy.
In face of these lunatic proceedings the German Government has
behaved with considerable dignity and good sense, though naturally
the German newspapers are running a little wild. It has announced
its intention of appealing to the Assembly of the League of Nations,
and although, not being a member, Germany cannot herself raise the
subject, it may be taken as certain that some member will take it up
on her behalf. This produces a most critical situation.
According to the Covenant, Article III, the Assembly may be
summoned to meet "from time to time as occasion may require." But
presumably it is the Council which decides whether occasion does
require it or not, and no one can expect the Council to favour
Germany's appeal. The appeal will only be considered when the
Assembly has its next regular meeting in September. We shall then
see whether the Assembly possesses the force and courage
necessary to discuss freely and, if necessary, to condemn the actions
of the two leading European Powers; or if the two can successfully
silence all criticism. For my own part I think the discussion will take
place; and that, for the first time since the war, the voice of an
impartial third party wilt be heard in discussing the terms imposed
on Germany by her conquerors. That does not mean the realization
of the "enthronement of public right on the common law of nations,"
but it is one of the first steps toward it.
The League of Nations is in a position to say to France: "You are
afraid of another attack by Germany; and to avert that danger you
propose in various ways to follow a policy which will plunge Europe
into continued distress. We hereby guarantee you against attack.
Thirty-nine nations at present, who will shortly be increased to fifty-
one, if not more, have signed a definite and unqualified contract to
preserve your 'existing political independence and territorial integrity'
against any 'external aggression'; and further, if you are attacked in
such a way as not actually to threaten your territory or
independence, all the States of the League will consider that an act
of war has been committed against themselves, will apply the
complete economic boycott to your enemy, and arrange plans for
giving you immediate military support. We offer you here a far more
effective guarantee of safety than you can possibly attain by your
own diplomacy. But we demand in return that your foreign policy
shall be frankly and sincerely a League of Nations policy; that you
shall not make secret treaties, not set up inequitable tariffs, not plot
the ruin of your late enemies or any other people; but work as a
loyal member of the League with a view to the welfare of the
whole."
The League says to Germany: "You complain of the undue severity
of the treaty and the impossibility of carrying out its economic
provisions. Commissions already exist, and you have taken part in
them, for discussing these latter and fixing the terms of the
reparation which you owe. But, beyond that, if there is any clause in
the treaty which appears to any member of the League as
'threatening to disturb international peace or the good
understanding between nations upon which peace depends,' it will,
under Article XI, be brought before the League and considered.
Further, if any clause in the treaty appears to 'have become
inapplicable' or to give rise to 'international conditions which might
endanger the peace of the world,' under Article XXIII the Assembly
of the League may at any time 'advise their reconsideration.' You
complain that the terms of the present treaty were imposed upon
you, without discussion, by implacable enemies who had you at their
mercy; that you have been made a sort of outlaw nation, without
freedom, without colonies, without ships, sitting apart while the
world is administered by your enemies. But at our Assembly table
you will sit as an equal and free member, with the same rights as
those who were lately your conquerors. We submit to you that this
gives you a far better chance of improving your condition than
another war could. Your lot must be for some time a hard one. That
is inevitable, and we cannot think it unjust. You challenged the
Entente to war, you staked all on victory, and you were beaten. Now
you have to make reparation. But the recuperative power of a great
nation is immense; and wherever you have been subjected to a
definitely unjust or dangerous condition, we offer you a remedy.
Wherever you may have a dispute with any other Power, we offer
you a Court of Arbitration as impartially constituted as the wit of
man could devise."
At present neither party quite believes this guarantee. If they did, it
would probably be enough for them. It used to be said of Sir Edward
Grey in the Balkan Conferences that he was not only sincere; he had
the power of making other people see that he was sincere. If Europe
is to be saved from new Great Wars, the Powers of the League must
first of all be sincere in their undertakings, and next, they must
convince the world in general of their sincerity. To that subject we
must return later.
CHAPTER II
THE EAST
But the world is not merely threatened by the prospect of future
wars. It is filled with wars at the present moment. There are
quarrels and bickerings between most of the newly liberated states
in eastern Europe; there is a war, sometimes avowed and sometimes
underground, between Communist Russia and all her neighbours
and rivals, a war whose tentacles reach far throughout Europe and
Asia; and there are wars against the British and French in various
parts of the East. Let us briefly touch upon a few sample cases.
I. Syria, Mesopotamia, Egypt, and India
The simplest case is Syria. In 1915, during the war, a Syrian National
Committee, including representatives from Damascus and Mosul,
negotiated with us through Sherif Husein, and we signed a
document promising to "recognize and uphold Arab independence"
in an area including the whole of Arabia, Palestine, Syria, and
Mesopotamia, except (1) Aden and (2) the Syrian coast. Within the
independent area we merely claimed for ourselves "a measure of
administrative control" in Bagdad and Bosra—not in Mosul—and
reserved any special interests of France. The French were informed
of the negotiations immediately. They expressed themselves content
with the possession of the Syrian coast, and agreed in our promises
to Husein. On the strength of this agreement the Hejaz revolted, and
Feisul's army, consisting mainly of Syrian and Mesopotamian soldiers
who had formerly been in the Turkish service, fought as our allies to
the end of the war. An attempted rising in Syria proper was crushed
with great severity by the Turks.
In 1918 the Syrians welcomed the Entente armies as liberators, and
were again promised their national independence, though this time it
was to be under the guidance of one of the Entente Powers as
mandatory. They asked that the mandatory should be England, but
England had too much on her hands. The Syrians next asked for
America; but America refused all mandates. France, meantime, had
always claimed special rights in Syria, and England by a treaty made
during the war had recognized Syria as a French interest. If they
must be under France, the Syrian representatives specially
demanded pledges that the government should be a civil
government, that a certain degree of independence should be
allowed to the natives, and that the country should not be occupied
by French troops. How far these pledges were given and broken by
the French; how far it was only we ourselves who gave assurances
which we had neither the right nor the power to carry out, and thus
unconsciously deceived Feisul, these are questions still in dispute. It
seems unfortunately certain that the Syrians considered themselves
betrayed. In the end, Syria was occupied by French troops; the
native government was not recognized, but dispersed; there were
raids and pitched battles, and the Emir Feisul, one of our most
popular heroes during the Great War, was expelled from his throne
and country. He is now an exile, and was for a time officially
forbidden to land in England.
France so far has neither accepted nor asked for any mandate from
the League of Nations, and appears not fully to realize the
obligations undertaken by her in signing the Covenant of the
League, or the pledge repeated in the Reply of the Allied Powers to
Germany, "that the Mandatory Powers, in so far as they may be
appointed trustees by the League of Nations, will derive no benefits
from such trusteeship."
In Mesopotamia the British established themselves during the war
after a long and chequered campaign by defeating the Turks and
capturing Bagdad. The Indian soldiers and officials who were in
command showed the most praiseworthy zeal and energy in
proceeding at once to develop the country: to drain and irrigate, to
plant crops, to establish order and good government in regions
which had not known such things since a remote antiquity. The
English were welcomed as liberators and made explicit promises to
set up an independent Arab kingdom under a "measure of British
administrative control." So much propagandist literature was poured
forth on the glories of the independent Arab nation which the
English were to create, that serious discontent was caused in Egypt.
"Is a half-naked Arab to have independence, and am I not good
enough to have even self-government?" wrote a highly educated
Egyptian to a British official. Meantime the actual government of
Mesopotamia became more and more severely effective, and
remained entirely concentrated in the hands of the British. The
expenses were enormous and the rate of taxation per head appears
to have risen to four times what it had been under the Turks. The
productivity of the country, however, was so great as to hold out a
prospect of almost making up the loss, and the important oil-wells at
Mosul were expected to do so completely. The native cultivators
profited by the improved harvests and the increased area of
cultivation, and the expenses of government were in part to be met
out of the future oil profits. And the best British administrators were
certainly beloved by their people.
The educated classes in Bagdad, the sheikhs and the ex-Turkish
officials, became restive at the high taxation and the indefinite delay
of "Arab independence." The turbulent desert tribes and the
disorderly elements in general were disgusted at the good policing.
But there was no general discontent, because personal assurances
were given to leading Arabs that the Covenant of the League of
Nations, which Great Britain had signed, laid down definitely that
Mesopotamia was to be recognized provisionally as an independent
nation and that the mandate was to be given to Great Britain. There
would be, it was promised, a native Government with a British
Resident to advise it, as in an Indian native state. Doubtless the
Government would also ask for other help from England, especially
in the matter of public works, irrigation, and the engineering of the
oil-wells.
But the League issued no mandate. According to rumour, it had
offered a scheme of mandate to the Great Powers concerned, and
one at least of them had refused the terms. The precious oil, it was
discovered, had already been divided by a private treaty between
France and England, which left only a small fraction for the
Mesopotamians and none for the rest of the world. There was no
attempt to set up an Arab Government. Some beginnings were
occasionally made of associating Arab officials with the Englishmen
who did the real work of governing. But they were not whole-
hearted. A letter was accidentally divulged in which an English
soldier said of the high Arab official attached to him, "I will soon
make him lick my boots." There were symptoms of disaffection, non-
payment of taxes, the resurgence of old discredited Turkish and
German agents, open rebellions. And the Government replied by
numerous executions and punitive expeditions. The bombing
aeroplane, which had revealed itself as a very convenient weapon of
war, proved an utterly disastrous instrument of police. The British
liberators, who had come by the special desire of the population to
establish a free Arab nation helped by friendly advice from British
Residents, ended, according to Colonel Lawrence's estimate, in
killing ten thousand Arabs and setting the whole country in a blaze
of war. An army of over one hundred thousand men is now
reconquering it. And at the same time, perhaps at the eleventh hour
and perhaps too late altogether, that section in the British
Government which believed in the League of Nations and wished
scrupulously to carry out in victory the pledges it had given in time
of distress, prevailed to bring about a definite change of policy. Sir
Percy Cox and Mr. Philby were sent to Mesopotamia with
instructions, so it was stated, to reverse the previous policy and try
to set up that independent Arab Government which we had
promised in 1915 and again in 1917, and ought to have set working
before the end of 1919. The "rebellion" will doubtless be crushed,
and the native Government may or not be successfully organized.
There is a strong desire among the Arab leaders to have it based on
a treaty of alliance with Great Britain after the Egyptian model, and
not on Article XXII of the Covenant. In any case the task is infinitely
more difficult than it was before so much blood was shed, and the
original friendship of the Arabs turned to hatred. On simple men
executive action makes a much deeper impression than policy. In
Mesopotamia our policy itself was bad because it was not consistent.
It was a muddle of two contradictory policies, resulting in confusion
and hypocrisy. But the executive action seems to have been such as
to make the chances of even the best policy very precarious. A
government which multiplies the taxes by four and shoots and hangs
its subjects in batches is seldom excused because of its good
drainage or its progressive ideas.
The story in Egypt is shorter and perhaps less unhappy, but
essentially similar. Early in the war, when Turkey joined the enemy,
we declared a British protectorate over Egypt, accompanied by a
promise to give the country independence or free institutions at the
end of the war. This in itself was a perfectly good and defensible
policy, though, to be correct, it should have had the concurrence of
Egypt. But in the course of the war Egypt became full of discontent.
Experienced officials were wanted elsewhere, and inexperienced
substitutes made mistakes. Labour in great quantities was required
for the Army, and was obtained through native contractors or
headmen, who practised the ordinary Oriental methods of extortion
and corruption while professing to act by orders of the English. The
peasant who was dragged off to forced labour, or compelled to buy
his freedom by heavy bribes, blamed the British for both. At one
time Egypt was garrisoned by large numbers of Australian troops,
who had the habit of thinking of all Asiatics as "blackfellows," and
whose ways of dealing with "blackfellows" were not of the gentlest.
The seed was thus sown of a passionate hatred, partly just and
partly unjust; and feeling was already ripe for explosion when it
transpired at the end of the war that the British Government had no
apparent intention of fulfilling their promise to confer on Egypt "free
institutions." Open rebellion was impossible, owing to the presence
of overpowering numbers of British troops; but a time of danger and
infinite trouble, well controlled by Lord Allenby, led at last to the
appointment of a Commission under Lord Milner, which grasped its
almost desperate problem with great courage and skill.
Among other curious misfortunes, it turned out that the word
"protectorate" had been translated into Arabic by a term which
denoted the sort of protection that is extended to an outcast or a
person with no national rights. The Commissioners were met on
their arrival by a universal boycott, and by constant threats of
assassination. They lived in considerable danger, and no Egyptian
would be seen speaking to them. But tact and patience gradually
broke down the boycott; and a much larger measure of agreement
was obtained with Zaghlul and the moderate Nationalists than had at
the outset seemed possible. After inquiry, the Commission has taken
the line of recommending, first, the cancellation of the Capitulations,
or special privileges granted to European states, which have
paralyzed the progress of Egypt for several generations; the
separation from Egypt of the Canal zone, as a special British interest
and of vital importance to the Empire; the retention of British
advisers in two posts, the ministries of Justice and of Finance—a
safeguard without which the European Powers would not consent to
forgo the special protection of the Capitulations; and in other
respects the establishment of Egypt as an independent national
state. As far as is possible to forecast, it looks as if this settlement
would succeed.
The history of recent events in India is too large and complicated a
subject to be dealt with here. But in its main outline it has been
curiously similar to that of the other regions of the East. A wonderful
response from almost the whole continent to the need of Great
Britain during the war; blunders of the War Office and reactions of
discontent; German propaganda; Turkish and Pan-Islamic intrigue;
repressive Press Acts and Conspiracy Acts; passive resistance,
dangerous riots, and widespread conspiracies; the severe and
sometimes lawless coercion of the Punjab; the savage massacre of
Amritsar, and at last, amid great obstructions and hesitations, the
passing of the Montagu-Chelmsford Act and the conferring of a new
and liberal constitution upon India. It is the same story as in Egypt
and Mesopotamia. So much time was wasted in doing the wrong
thing, that when at last resort was had to the right thing the right
time was past. The Indian Government was faced with great
difficulties and very real dangers. Its errors have been so signal and
notorious that public opinion is apt to forget or ignore the admirable
skill and patience with which most officials steered their districts
through periods of extreme strain. But reforms long promised were
delayed until too late. The executive plunged into excesses which
will not be forgotten for centuries. And when the long-hoped-for
reforms at last have come, it may be that they come to a people too
exasperated to give them a fair trial.
II. An Eastern Policy
The policies here described have been so full of errors that it is hard
to derive from them a very clear moral. Government without
principle has many conveniences; if life consisted of isolated
moments it might be entirely successful. But life is continuous, and
human beings have memories and expectations. And almost any
policy that is continuous and consistent and true to itself is more
likely to succeed in the end than a mixture of momentary expedients
and plunges for safety. It is conceivable that a perfectly resolute and
unfaltering military coercion of India, Egypt, and Mesopotamia might
have succeeded. But such a policy, if it was ever possible, is certainly
so no longer; and also it would hardly be a policy for avoiding
international strife. And that is the subject we are considering.
If we look below the mistakes of policy and administration
committed by the British or French Governments, we find
underneath the surface a profound and instinctive resentment of the
Moslem East against the Western Powers. The Western Powers,
which for convenience we term Christian, have been for some
centuries far more efficient than any Moslem state. The West has
increasingly taken charge of the East; beaten it, managed it, "run" it,
governed it, and in some cases exploited it. Western government, or
at least British government, has been just, incorruptible, impartial,
strong, intelligent, far beyond ordinary Eastern standards. It may
have been unsympathetic and grossly expensive; it may, in spite of
the unexampled personal integrity of the whole governing class,
have led to the presence in Eastern countries of undesirable money-
seekers. But it has been, on the whole, essentially and undeniably
good, efficient government, backed by a military power which
committed few excesses, lived on its own pay, and never failed in an
emergency. No one who studies even superficially the history of
average Oriental governments, from Morocco or Bokhara to Oudh,
can be surprised or sorry that they have been superseded by the
better governments of the West. The peoples of the East themselves
have gained by Western penetration; nay, more, they are conscious
of their need of the West. But they have had too much of it; they
resent it, and they are frightened of it. The Moslem nations have lost
their independence one after another. At the beginning of the Great
War only one Moslem Power remained free and powerful—the
Turkish Empire. At the end of the war there was not one.
The Turks were not popular in the East. The Syrians and Arabs hated
them almost as much as their Christian subjects did. The Turkish
peasants of Anatolia suffered cruelly under the exactions of
Constantinople, especially in the matter of military service. But all
through the Moslem East ran the consciousness that the Sultan, with
all his faults, was their own man. He was the acknowledged Head of
the great majority of Moslems in the world. He was, above all, the
last barrier that seemed to protect them from the overwhelming
flood of Western aggression, and the last great Moslem figure which
enabled them to preserve their self-respect.
While the Turkish Empire stood, the Moslem peoples, though fallen
on evil days, could think of Islam as an independent and even an
imperial entity. In places, doubtless, they had to kiss the feet of
dogs; but their Caliph still ruled masses of Christian subject
populations and still was master of the capital city of the world. With
the fall of Turkey, the last free Moslem state was gone. Not here and
there, but everywhere throughout the whole world, the faithful were
set beneath the heel of these rich, drunken, pork-eating idolaters
with their indecent women, their three Gods, and their terrific
material civilization. "Pan-Islamism," as Mr. Toynbee says, "is only an
extreme example of the feeling at the back of almost any modern
Oriental movement we may examine. It may take aggressive forms,
but the essence of it is a defensive impulse. Its appeal is to fear, and
if the fear of the West could be lifted from off the minds of the
Oriental peoples, its mainspring would be gone."
The problem of our Eastern policy is to remove that fear. And that
ought not to be so very difficult. The essential fact to grasp is that
the East needs us far more than we need the East. We need
markets; but that idea is only suggested to us by the fact that
Eastern peoples want our goods. We do almost everything better
than they do. They want our textiles, our knives and tools, our
engines and ploughs, our books, our learning. They cannot make
railways or ships without us. They cannot work their mines or oil-
wells except by Western help. They cannot really govern their
countries satisfactorily without European advisers. The language of
Article XXII of the League of Nations Covenant is quite correct when
it says that "Certain communities formerly belonging to the Turkish
Empire have reached a stage of development where their existence
as independent nations can be provisionally recognized, subject to
the rendering of administrative advice and assistance by a
mandatory until such time as they are able to stand alone." At
present "they are not yet able to stand by themselves under the
strenuous conditions of the modern world."
They ought to want us, and if left alone they would want us. We
have frightened them into fighting and hating us by forcing
ourselves upon them instead of waiting to be asked. We have
conferred incalculable benefits on India: the benefit of protection
from invasion, of comparative protection from plague and famine, of
social order, of administrative justice, to say nothing of roads and
railways, and the enlivening force of Western knowledge. We have
immensely increased the prosperity of Egypt, we have put down all
kinds of Oriental abuses and protected the fellaheen against corvées
and extortions and tortures. We were in process of beginning to
perform the same services for Mesopotamia. But in the latter regions
at any rate—for in India our roots are far deeper and the problem is
more complex—the people did not want us. We only held them and
did them good by force. And the chief reason why they did not want
us was fear. We came to them with machine guns and bombing
planes as conquerors and masters, having destroyed the only free
Moslem Power; and they found it difficult to believe in our good
intentions. We came to them, most unfortunately, also with specious
promises which we made in time of need and broke in the days of
victory.
The right policy is something very easy to state and extremely
difficult to carry out, even for a single-minded and clear-headed
Government. It needs first, perhaps, an effort of imaginative
understanding more far-reaching than has ever yet in history been
demanded of an Imperial Power. Only those who understand the
East can win the respect and confidence of the East. But in the
meantime, if we cannot fully understand, there is a way at least to
make ourselves understood. Justice is the passport to confidence all
the world over. And our first business is to act quite simply and
sincerely up to all our engagements. We undertook certain
obligations when we signed Article XXII of the Covenant. We should
make the "wishes of these communities a principal consideration" in
deciding whether we should go to them at all. We should really treat
them "as independent nations," and should honestly give them
"administrative advice and assistance until they shall be able to
stand alone." And we should not allow our minds to be confused by
thoughts of gain, nor our advice to take the form of horse, foot, and
artillery. Two illustrations may make this point clear. An experienced
and very successful administrator was asked a few weeks ago
whether he would accept the post of adviser to a certain Moslem
Government. He said, "Yes, upon one condition. That there is no
British army anywhere in the country." That is the right and wise
spirit. The second is even simpler. One of the most obvious and
matter-of-course obligations laid upon imperial administrators and
civil servants is that they shall not embark in trade or in any way
make a profit out of the administration of their office. That is the
right rule. The Empire should set an example of the behaviour that it
expects from its best servants.
When we apportioned to ourselves the German colonies, we
specially declined to take over their public debts. And when protest
was raised against this proceeding, we stated definitely in our official
Reply: "It would be unjust to make this responsibility rest on the
Mandatory Powers, which, in so far as they may be appointed
trustees by the League of Nations, will derive no benefit from such
trusteeship." Is it entirely quixotic and idealist to hope that, even in
post-war conditions, a great nation may remain true to her word?
It seems at least as if the only alternative was to hold these Eastern
territories by armed force, and that is no longer possible. It might be
possible to hold by force India alone, or Egypt alone, or
Mesopotamia alone. It is not possible so to hold all three. We must
govern by consent of the governed or not all.
CHAPTER III
RUSSIA AND ITS BORDERS
Another group of wars and threats of war has its centre in Moscow.
All the States on the borders of Russia—Finland, Lithuania, Poland,
the Ukraine, Hungary, Rumania, the new republics of Georgia,
Armenia, and Azerbaijan, and the kingdom of Persia—are either at
war or in fear of war or just recovering from war with Russia, or
from civil war fomented by Russian agents and propagandists. Inside
Russia itself, civil war has never ceased since the first outbreak of
the Revolution in 1917. It is true that the civil war has been largely
helped by foreign munitions and stirred up by foreign intrigues. But
that only shows that—as the world is now organized—there is
something in the present Russian Government which makes
foreigners as well as Russians wish to take up arms against it. It
may have been—I think strongly that it was—exceedingly unwise for
the foreign Governments to intervene in the domestic troubles of
Russia, but no one can pretend that the civil war was entirely
created by foreigners. The rebellions were there before the
foreigners joined in, and it is even thought by good judges that the
opposition to the Bolsheviks might by this time have been successful
if it had not been damned in Russian eyes by its foreign alliances.
For us the question is how the Russian Revolution has become such
a plenteous and intense cause of strife. It is, of course, impossible to
pass judgment on the whole of a vast movement with the very
inadequate information that is now accessible to an average
Englishman about Russia. Even the French Revolution, which has
been studied by thousands of observers and historians, is not yet
judged. The sum of infamies and high achievements is too
complicated to add up. And the Russian Revolution is probably even
harder to value than the French.
I. The Civil War
It would be a mistake to forget the elements of simple early-
Christian brotherhood which seem to characterize the Russian
peasant. It was well known before the war how the members of a
workmen's artel, or trade community, when trade was bad, would
divide their earnings equally and all starve, if need be, together,
without any attempt by the luckier workmen to save themselves at
the expense of the others. The glowing descriptions of Mr. Stephen
Graham cannot be entirely without any basis in fact. And the people
of Tolstoy and Dostoievsky have evidently a most rare capacity for
sainthood and martyrdom, as well as for aberration of mind.
Present-day Russia has been described by an eminent Socialist as "a
nation of artists governed by brutes," and the phrase is probably
true of the old Russia also, and the Russia of centuries back.
Communism comes easily in Russia, and so does submission to
tyranny.
It must also be remembered that the Great War, among its many
aspects, involved the most frightful and bewildering oppression of
the poor and weak. As was said quite truly: "Millions of poor men in
divers regions of the world have been dragged suddenly and without
any previous action of their own into a quarrel which they neither
made nor desired nor understood, and in the course of that quarrel
have been subjected again and again to the very extremity of
possible human suffering." The war naturally and inevitably created
in Europe a passionate wish for some revolutionary transformation of
a world in which rich and clever people in parliaments and
governments had the power of inflicting such pains upon the poor.
The peculiarity of the Bolshevik movement was, as one of its rare
English admirers puts it, not so much that it wanted a particular kind
of Socialism or Communism, but that it wanted it now. The world
has seen many revolutions and many Socialist governments; but
they have never really established that paradise of the poor which
was advertised in their prospectuses and doubtless nursed in their
hopes. Most failed altogether. And those which succeeded went
wrong. They coöperated with "bourgeois Liberals." They extended
the franchise, they improved the condition of the working classes,
they established well-to-do workmen and peasants with a stake in
the country and a conservative bias; but they never really did what
was wanted. They always stopped short. They developed the
middle-class virtues. They left still in existence a capitalist class
which preached the merits of thrift and hard work and was
interested in trade; and of course they left always somewhere an
oppressed class. The under dog was still under.
The Bolshevik remedy was very direct and simple. It was to disarm
everybody who had any share in prosperity, and distribute firearms
to those who had nothing else. Only when he was armed and the
rest of the people unarmed could the real proletarian—the man who
had no savings, no talent, no education, no notable good qualities,
nothing that makes for success in life—hope to beat the men who
always outstripped him. It is strange that even in a moment of
extreme misery such a theory could have established itself in any
country as a principle of government. But the military collapse of
Russia gave it a unique chance. The common soldiers, anxious to
fight no more, already possessed arms. They had merely to murder
their officers and the thing was done. The rest of the population was
unarmed and helpless. And meantime the peasants, though almost
untouched by revolutionary ideas, were amenable to one particular
bribe. The revolutionaries offered all the peasants of Russia their
masters' land without any payment. They could simply take the land,
and kill or not kill the owner as they pleased. There was no
punishment for such killing. According to strict Communist principles,
the land was not to remain in the peasants' possession. It was to be
the property of the State. But this principle had to be dropped in
order to induce the peasants to coöperate with the revolutionary
town workmen. Whatever may be said in favour of this revolution,
there can at least be no surprise at what Lenin calls "the frantic
resistance" of the upper and middle classes of Russia. The policy of
the Government was announced on January 23, 1919: "The present
is the period of destruction and crushing of the capitalist system of
the whole world. . . . In order to establish the dictatorship of the
proletariate it is necessary to disarm the bourgeoisie and its agents
and to arm the proletariate." It is to be dictatorship in the strict
sense: the power of a man with a gun to do what he likes with those
who have no guns. There is to be no democracy or representation of
the dispossessed classes. If they were represented they might
recover power. Only those known to be faithful to the new
Government are to vote. All persons of property must be
dispossessed, from landlords to small shop-keepers. Rich peasants
must go; even "middle peasants" at one time had to go; only the
poorest peasants and the poorest town workmen should rule,
assisted, of course, by those educated people who would accept the
new régime and establish by deeds beyond doubt their hatred of the
bourgeoisie.
The control of a country by a small minority is always difficult. It
needs methods of "terror." But this minority had first to acquire the
control and then to maintain it. Its task was more difficult and its
methods had to be more violent than those of its predecessors. The
"terror" of the old Czarist Government or of the French Revolution
must be superseded by the more drastic method of what was called
"mass terror." The secret police, whose activities had made hideous
the record of the Czarist Government, and who had fled for their
lives at the first outbreak of the Lvof and Kerensky Revolution,
returned from their lurking-places to put themselves at the disposal
of the Bolsheviks. This legion of devils had something to sell which
the new Government badly needed. On the analogy of the Comité de
Salut Public there was established the All-Russian Extraordinary
Commission for stamping out all trace of resistance to the new order.
Spies were placed everywhere (Proclamation, October 17, 1918). No
distinction was to be made between Czarist reactionaries and
unorthodox Socialists, such as the Mensheviks and Social
Revolutionaries (Russkaya Zhizn, May 10, 1919). Enormous numbers
of "hostages" were arrested. At any sign of conspiracy outside, large
numbers of these were shot. The assassination of the Bolshevik
Uritzky was repaid by the execution of five hundred citizens. Yet, just
as in the most furious days of the French Revolution, the terrorists
were always complaining that there was not enough terror. "The
continual discovery of conspiracies in our rear . . . the insignificant
extent of serious repressions and mass shootings of White Guards
and bourgeoisie on the part of the Soviets, show that
notwithstanding frequent pronouncements urging mass terror
against the Social Revolutionaries, White Guards, and bourgeoisie,
no real terror exists" (Official Weekly of the All-Russian Extraordinary
Commission, No. 1, Moscow, September 21, 1918).
Trotzky in comforting language explained that the object of the mass
terror was not really the extermination of all non-communists, or all
Russians who did not attain the full standard of poverty and
orthodoxy. "The proletariate says: 'I shall break your will because my
will is stronger than yours, and I shall force you to serve me.' . . .
Terror as the demonstration of the will and strength of the working
class is historically justified" (Trotzky in Izvestia, January 10, 1919).
Eventually, of course, when all Russia was submissive and all Europe
Communist, there would be a gentler régime, and the proletariate
would show their true beauty of character. And it would be a mistake
to ignore the real reforms which seem to have been carried through
in certain social services, notably in the care of children, the attempt
to develop popular education and the putting down of drink. But in
the meantime terror was reënforced by ingenious petty persecutions
and indignities, reënforced by starvation. Those who joined the Red
Army had three times the ration of food allowed to several
categories of the civil population. No one can wonder that suicide—
that last irrefutable evidence of unbearable oppression—became
extraordinarily common, especially among the educated classes,[4]
and that "frantic resistance" broke out where it had any prospect of
success.
II. Russia's Neighbours
But what of the war outside Russia? Why could not the Russians be
allowed to conduct their revolution and settle their form of
government by themselves? It would be very desirable if they could.
And doubtless it is the aim to be striven for. But the trouble is that
Bolshevism is to its adherents a revelation and a new gospel, and
they have the same zeal for converting the rest of the world as had
the French Revolutionaries or the followers of Mohammed. "The
program of the Communist Party is not merely a program of
liberating the proletariate of one country; it is the program of
liberating the proletariate of the world" (authorized pamphlet by N.
Bukharin, July 24, 1918). This is to be achieved by "a bloody
torturing and heroic fight." The methods are to include every known
form of intrigue, corruption, forgery, and the like, and the plan is to
be the same in all countries. Revolutionary workmen are to be
armed, including common soldiers, tramps, prisoners, and all the
utterly dispossessed of the earth, except, of course, those who have
Conservative, Liberal, or Labour Party views; and then are to work
their proletarian will on the rest of the community. The "national
will" is to be disregarded: "The interests of Socialism stand far above
the interest of the right of nations to self-determination" (Trotzky,
Izvestia, March 8, 1918). "All our hopes for the definitive triumph of
Socialism are based on this conviction and on this scientific
prevision, i.e. that a revolution like the Russian can be produced in
all the nations of Europe" (ib.). In the Treaty of Brest-Litovsk the
Bolsheviks were compelled to sign a clause promising not to conduct
"any agitation against the State and military institutions of
Germany." "But both the Russian Government as a whole and its
accredited representative in Berlin never concealed the fact that they
were not observing this article, and did not intend to do so" (Joffe,
Izvestia, January 1, 1919).
The belief that by some single violent change in social, political, or
economic conditions human life as a whole can be suddenly
transfigured is one that clings to many minds, and by no means the
stupidest minds, of the present age, in spite of much disillusioning
experience. It does seem to them at moments as if only some one
thing was wrong with the world, and as if that one flaw must surely
be definite and remediable: some one bold step is all that is needed
—say, the abolition of the family, or of property, or of competition, or
of wages, or of interest, or of compulsory law, or some other of the
fundamental institutions of society.
To our ancestors it was the abolition of heresy. To the Turks, the
abolition of all Christians in Turkey. To such people at such times the
normal method of trying to correct the worst abuses by persuading
the majority that they ought to be corrected, and of seeking
individually to live a better life and to help one's neighbours, seems
tedious and ineffective, if not hypocritical. But one thing that is clear
is that revolution means "frantic resistance," and the stronger the
faith and energy behind the revolution the more deep-reaching is
the resistance likely to be.
Russia's neighbours see what seems to them the infinite misery and
impoverishment and retardation inflicted by Bolshevism; and they
are naturally indignant and alarmed at the secret propaganda of
Bolshevism within their own borders. In normal times perhaps they
need not have been afraid. But since the war every state is unstable;
every state has a large discontented class. The small republics in the
Caucasus, barely able to support themselves in freedom, are
maddened to find their constitution threatened by Russian bribes,
their malcontents and bad characters armed with Russian rifles and
machine guns, and their public men assassinated. Georgia and
Armenia are probably doomed. Hungary and Finland have gone
Bolshevik and returned, each process being accompanied by hideous
persecutions and murders, the reprisals being naturally the worst.
Germany, in spite of all treaties, has been exposed to constant
propaganda and has had one or two bad outbreaks of violence.
Poland has been and still is—whether through her own bad policy or
otherwise—on the brink of compulsory Bolshevism. Human nature
being what it is, and human politics a little worse than private
human nature, it is inevitable that Russia's neighbours should be
constantly afraid of her and intensely anxious to see her again under
some more normal government; some government which, whatever
its political bias, would leave its neighbours to govern themselves
and accept the ordinary conventions of civilized society.
Nay, one can even understand anti-Russian policies that seem at first
sight intolerably aggressive. The Poles, among other demands, are
anxious for the independence of White Russia, the region north of
the Pripet, of which Minsk is the chief town. They wish it either
annexed to Poland or else made independent, but at any rate cut off
from Russia. The claim seems monstrous. But it has its excuse. The
White Russian peasantry are said to be peculiarly ignorant and
devoid of national feeling; the land-owners and well-to-do classes
are mostly Poles. Is it surprising that the Poles of Poland hate the
idea of handing their countrymen over to a Russia which will, as a
matter of course, set the peasants to burn their houses, destroy
their cattle, and hunt them themselves down like vermin? And when
that is done, they reflect, Bolshevism will only be nearer to Warsaw.
Like the early Moslems, the true Bolsheviks care more for their faith
than for territory. In dealing with Lithuania, which is at present a
comparatively quiet little peasant republic, the Russians offered her
a large slice of territory beyond what she was entitled to or wanted.
Why? Because it was a thoroughly Bolshevized area, and might be
expected to spread the faith—or the poison—into all Lithuania. A
nation, or a government, in that state of mind cannot be surprised if
its neighbours regard it with anxiety.
It is a curious fact that revolutionists so often regard themselves as
pacifists. Many were even conscientious objectors during the war,
and there is no reason to doubt that they were sincere. But they do
seem to be confused thinkers. To hate your neighbours, whom you
know, and love your neighbours' enemies, whom you do not know,
is a consistent and not uncommon frame of mind; though the
element of love in it seems less important and prominent than the
hate. But to expect European peace and good-will by means of a
revolution in all countries argues a lack of understanding not far
removed from madness. Every revolutionary outburst since the war
has been marked by ferocious cruelties and followed by still more
ferocious reprisals. Revolution leads not to peace, but to reciprocal
reigns of terror, first Red and then White, till the exhaustion of
suffering produces some sort of equilibrium.
The war, among its many evil lessons, has inculcated the gospel of
impatience and of force. "When you want a thing, take it from some
one, and if he resists, knock him down." It is the doctrine which
destroys human societies as it destroys the peace in men's own
hearts. If we want peace, we must simply unlearn that creed and go
back to the old Liberal doctrine that is at the root of sound politics
everywhere: "If you think something is right, try to persuade your
fellow citizens of it; try your hardest, but remember that you may be
wrong, and until you succeed, have patience."
CHAPTER IV
PRE-WAR AND POST-WAR CAUSES
OF STRIFE
The war has left behind it a great number of small wars or guerrillas.
Most of them have their explanation in some ordinary excess of
nationalism or revenge or greed. The Serbs, intoxicated with their
new greatness, are still causing war in Albania and Montenegro. The
Rumanians recently invaded Hungary, in spite of all the thunders of
the Peace Conference, because they had been robbed by Austria-
Hungary and wanted revenge and reparation. The Hungarians have
alarmed all their neighbours and forced them into a defensive
alliance, which now calls itself the "Little Entente." The Lithuanians
and Poles have fought, but been reconciled by the mediation of the
League of Nations. The Armenians have been massacred again,
under the eyes of the French army of occupation in Cilicia, where
they had gathered under a repeated guarantee of safety given by
France and England. The Turkish Nationalists are holding out very
unsuccessfully in the centre of Anatolia against a Greek army
carrying out the directions of the Supreme Council. The Turkish
peasants are increasingly reluctant to take arms again. The Koreans
have helplessly declared their right to independence from Japan, and
are apparently being reduced by a terrible persecution.
These are the mere belated effervescence of the passions of the
Great War. The hate and pride which are the basis of nationalism
and which were so violently stimulated by the events of the war
cannot be expected to die out at once. It was calculated a short time
ago that there were twenty-seven "wars" of one sort or another in
progress. But they will presumably simmer down as social conditions
become more normal.
It is interesting to observe that two of the greatest causes of war,
according to the judgment of normal times, are now not actively
operating. Before 1914, if one was asked to name the main causes
of war, the answer would have been, first, competitive armaments,
and, second, protective tariffs and the competition for markets.
These causes will remain fully as dangerous for the future, but it so
happens that none of the existing wars is directly due to either.
I. Armaments
In one sense, indeed, armaments are actually operating now as a
cause of war. There are far too many firearms lying about. America,
England, and France have made very lavish gifts or sales of lethal
weapons to various bodies with whom they sympathized. And the
arms have by no means always stayed in the place for which they
were intended. Guns which we sent to Denikin were sold by corrupt
officials to the Bolsheviks, and passed on by them to the Afghans to
use against us on the Indian frontier. Such things cause some deaths
and some laughter, but are not permanent evils.
No European nation, except those actually compelled, has made
much progress towards disarmament. It is said that Great Britain has
actually made the greatest reduction, but both in numbers of men
and in expenditure our standard is fantastically higher than what
was forced upon us by German competition in 1914. It is impossible
to reduce our forces in a really drastic way as long as our
commitments are so large and—perhaps we must add—our policy so
inconsistent and provocative. Peace with Russia, a settlement with
Mesopotamia and Egypt on the lines laid down by the Covenant and
the Milner Report, the evacuation of Ireland, the execution of the
Montagu-Chelmsford reforms in India, and the extension of similar
reforms to Burmah and the much-suffering Ceylon, will permit us
really to envisage for the first time a satisfactory measure of
disarmament. The air force is already greatly reduced. The vast size
of the navy appears to be utterly unjustified, at any rate by
conditions in Europe. The French army is far beyond the economic
powers of France to support. The same seems to be true of Italy,
and is certainly true of Serbia, which is still calling conscripts to the
colours. Greece is vastly overarmed; but Greek policy, though erring
on the ambitious side, has probably been more sagaciously guided
under M. Venizelos than any in Europe. The fall of that great man,
due mainly to the prolonged economic distresses of Greece, will
probably cause a resurgence of Mustapha Kemal and the Turkish
nationalists. Meantime the Russian conscript army, though
apparently ill-armed and ill-supplied, is overwhelming in numbers
and is led by officers of the old régime, experienced and not
absolutely incompetent. The Russian army is far the greatest and, in
a political sense, the most dangerous, in the world.
But it is not the actual armaments, ruinous as they are, that are the
essential poison to civilized society. It is the competition in
armaments. That has now been abolished throughout Europe.
Slowly, unequally, reluctantly, the armaments which, in Lord Grey's
words, went uphill under the lead of Germany, are now, under the
same lead, groping their way downhill. There is only one great
nation which, if words are to be believed, thinks seriously of starting
a competition in armaments. It has been announced, more than
once, by the American Government that, like Germany in the years
before 1914, they have arranged a naval programme which will
effectually put an end to the British command of the seas and give
the United States "world primacy" (see speech of Mr. Daniels,
Secretary of the Navy, in the Times of September 1, 1920). Since the
British Empire is a scattered series of communities dependent for
their communications upon the sea, and in particular since the
population of Great Britain is absolutely dependent for its food on
the free use of sea transport, it has been generally acknowledged in
Europe that the sea-power of Great Britain was necessary to its
existence. British sea-power has never been challenged except by
definite enemies in pursuit of a definite war policy. If the United
States were seriously to embark on the same policy as the late
German Government, it seems as if all other causes of war must sink
into insignificance beside this gigantic and deliberate one. But, in
spite of some bewildering symptoms, it can hardly be believed that
this conclusion is possible, at any rate until America has definitely
and finally refused to be a member of the League of Nations.
Relations between Great Britain and America have of late been
dangerously strained, partly owing to causes outside our
Government's control, but in part owing to the scandal caused in
America by certain developments of the Peace Treaty, and by the
excesses of the Government forces in Ireland. A wise policy may
help to heal this growing breach, and if America accepts in some
form or other membership of the League of Nations, it ought to be
possible in friendly discussion to arrive at some understanding on
the question of naval armaments.
The problem of armaments is put in the very forefront of the
Covenant of the League, immediately after the constitution of the
League itself. By Article VIII—
The members of the League recognize that the maintenance of peace
requires the reduction of[Pg 105] national armaments to the lowest point
consistent with (a) national safety and (b) the enforcement by common
action of national obligations.
The Council, taking account of the geographical situation and
circumstances of each State, shall formulate plans for such reduction for
the consideration and action of the several Governments.
Such plans shall be subject to reconsideration and revision at least every
ten years.
After these plans shall have been adopted by the several Governments the
limits of armament therein fixed shall not be exceeded without the
concurrence of the Council.
The article goes on to recognize that private munition factories are
objectionable, and must somehow be dealt with, and to lay down
that all members must interchange "full and frank information"
about their armaments and programmes. And the next article
constitutes a permanent Commission to advise the Council on the
execution of the provisions of Article VIII and other similar matters.
The cautious language of the Covenant on this subject is due to the
inherent difficulty of the subject itself. It would be absurd to lay
down that every member of the League must disband its forces
forthwith; the League could hardly undertake to go to war in order
to compel some strong Power to disarm. And it is obvious that
different nations need different degrees of armament. The chief
difficulty is that disarmament ought in justice and prudence to be
simultaneous all round. It is only by the compulsion of a lost war
that Germany has been compelled to disarm while her enemies
stand round her with large armies, and even in Germany the process
is evidently very difficult to enforce. Too many rifles and machine
guns have got loose in private hands. No League could compel
Poland or Rumania to disarm while the Red Army of Russia stood
waiting across the frontier; or compel Great Britain to disarm while
the northwest frontier of India is constantly attacked, while the
Bolsheviks are in Persia and British officials are besieged in
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
More than just a book-buying platform, we strive to be a bridge
connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.
Join us on a journey of knowledge exploration, passion nurturing, and
personal growth every day!
ebookbell.com

More Related Content

PDF
Automating With Simatic S7300 Inside Tia Portal Configuring Programming And T...
PDF
Automating With Simatic S7400 Inside Tia Portal 1st Edition Hans Berger
PDF
Automating with SIMATIC S7 400 inside TIA Portal 1st Edition Hans Berger
PDF
Automating with SIMATIC S7 400 inside TIA Portal 1st Edition Hans Berger
PDF
Automating with SIMATIC S7 1500 Configuring Programming and Testing with STEP...
PDF
Automating with SIMATIC S7 300 inside TIA Portal Configuring Programming and ...
PDF
Automating with SIMATIC S7 1200 Configuring Programming and Testing with STEP...
PDF
Siemens s7 300-400-working with step 7 v5.0
Automating With Simatic S7300 Inside Tia Portal Configuring Programming And T...
Automating With Simatic S7400 Inside Tia Portal 1st Edition Hans Berger
Automating with SIMATIC S7 400 inside TIA Portal 1st Edition Hans Berger
Automating with SIMATIC S7 400 inside TIA Portal 1st Edition Hans Berger
Automating with SIMATIC S7 1500 Configuring Programming and Testing with STEP...
Automating with SIMATIC S7 300 inside TIA Portal Configuring Programming and ...
Automating with SIMATIC S7 1200 Configuring Programming and Testing with STEP...
Siemens s7 300-400-working with step 7 v5.0

Similar to Automating With Simatic S71500 Configuring Programming And Testing With Step 7 Professional 1st Edition Hans Berger (20)

PDF
Siemens s7 300-400-working with step 7 v5.1
PDF
manuales y guías PLC siemens Simatic S7
PDF
Simens plc training. simatic working-with-step-7
PDF
Siemens s7 300-400-standard software for s7-300 and s7-400 standard functions...
PDF
Siemens s7 300-400-standard software for s7-300 400-2
PDF
KOP_e.pdf
PDF
Siemens s7 300-400-s7 graph v5.1 for s7-300 400 programming sequential contro...
PDF
Siemens s7 300 programming instruction
PDF
Siemens s7 300-400-proent-e
PDF
Basics_of_PLCs.pdf
PDF
Basics of PLC-1 For Education in School and for Learn
PDF
Siemens s7 300-400-standard functions part 2
PDF
Siemens s7 300-400-from s5 to s7
PDF
Siemens s7 300-400-ncm s7 for profibus
PDF
Siemens s7 300-400-kop-e
PDF
Comparison list for Siemens S7-300, S7-400, S7-1200, S7-1500 Reference Manual
PPT
Pmo slides jun2010
PDF
Manual del sistema del controlador programable S7-200
PDF
Siemens win cc manual pcs 7 runtime
PPT
S7 bas-16
Siemens s7 300-400-working with step 7 v5.1
manuales y guías PLC siemens Simatic S7
Simens plc training. simatic working-with-step-7
Siemens s7 300-400-standard software for s7-300 and s7-400 standard functions...
Siemens s7 300-400-standard software for s7-300 400-2
KOP_e.pdf
Siemens s7 300-400-s7 graph v5.1 for s7-300 400 programming sequential contro...
Siemens s7 300 programming instruction
Siemens s7 300-400-proent-e
Basics_of_PLCs.pdf
Basics of PLC-1 For Education in School and for Learn
Siemens s7 300-400-standard functions part 2
Siemens s7 300-400-from s5 to s7
Siemens s7 300-400-ncm s7 for profibus
Siemens s7 300-400-kop-e
Comparison list for Siemens S7-300, S7-400, S7-1200, S7-1500 Reference Manual
Pmo slides jun2010
Manual del sistema del controlador programable S7-200
Siemens win cc manual pcs 7 runtime
S7 bas-16
Ad

Recently uploaded (20)

PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Presentation on HIE in infants and its manifestations
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Classroom Observation Tools for Teachers
PPTX
master seminar digital applications in india
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Computing-Curriculum for Schools in Ghana
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
A systematic review of self-coping strategies used by university students to ...
VCE English Exam - Section C Student Revision Booklet
Supply Chain Operations Speaking Notes -ICLT Program
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Presentation on HIE in infants and its manifestations
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Module 4: Burden of Disease Tutorial Slides S2 2025
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Final Presentation General Medicine 03-08-2024.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
Classroom Observation Tools for Teachers
master seminar digital applications in india
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
2.FourierTransform-ShortQuestionswithAnswers.pdf
Computing-Curriculum for Schools in Ghana
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Final Presentation General Medicine 03-08-2024.pptx
A systematic review of self-coping strategies used by university students to ...
Ad

Automating With Simatic S71500 Configuring Programming And Testing With Step 7 Professional 1st Edition Hans Berger

  • 1. Automating With Simatic S71500 Configuring Programming And Testing With Step 7 Professional 1st Edition Hans Berger download https://ebookbell.com/product/automating-with- simatic-s71500-configuring-programming-and-testing-with- step-7-professional-1st-edition-hans-berger-4725148 Explore and download more ebooks at ebookbell.com
  • 2. Here are some recommended products that we believe you will be interested in. You can click the link to download. Automating With Simatic S71200 Configuring Programming And Testing With Step 7 Basic Second Edition 2nd Edition Hans Berger https://ebookbell.com/product/automating-with- simatic-s71200-configuring-programming-and-testing-with-step-7-basic- second-edition-2nd-edition-hans-berger-5182296 Automating With Simatic S71500 2nd Edition Hans Berger https://ebookbell.com/product/automating-with-simatic-s71500-2nd- edition-hans-berger-10411844 Automating With Simatic S7400 Inside Tia Portal 1st Edition Hans Berger https://ebookbell.com/product/automating-with-simatic-s7400-inside- tia-portal-1st-edition-hans-berger-4722742 Automating With Simatic S7300 Inside Tia Portal Configuring Programming And Testing With Step 7 Professional 2nd Edition Hans Berger https://ebookbell.com/product/automating-with-simatic-s7300-inside- tia-portal-configuring-programming-and-testing-with- step-7-professional-2nd-edition-hans-berger-4914546
  • 3. Automating With Simatic Integrated Automation With Simatic S7300400 Controllers Software Programming Data Communication Operator Control And Process Monitoring 2nd Rev Ed Hans Berger https://ebookbell.com/product/automating-with-simatic-integrated- automation-with-simatic-s7300400-controllers-software-programming- data-communication-operator-control-and-process-monitoring-2nd-rev-ed- hans-berger-1203994 Automating With Step 7 In Lad And Fbd Simatic S7300400 Programmable Controllers 5th Edition Hans Berger https://ebookbell.com/product/automating-with-step-7-in-lad-and-fbd- simatic-s7300400-programmable-controllers-5th-edition-hans- berger-5410536 Automating With Step 7 In Stl And Scl Simatic S7300400 Programmable Controllers 6th Edition Hans Berger https://ebookbell.com/product/automating-with-step-7-in-stl-and-scl- simatic-s7300400-programmable-controllers-6th-edition-hans- berger-10206210 Automating With Step 7 In Stl And Scl Programmable Controllers Simatic S7300400 5th Revised And Enlarged Edition2009 2009th Edition Hans Berger https://ebookbell.com/product/automating-with-step-7-in-stl-and-scl- programmable-controllers-simatic-s7300400-5th-revised-and-enlarged- edition2009-2009th-edition-hans-berger-230975020 Automating With Simatic Controllers Software Programming Data Communication Operator Control And Process Monitoring 5th Hans Berger https://ebookbell.com/product/automating-with-simatic-controllers- software-programming-data-communication-operator-control-and-process- monitoring-5th-hans-berger-4750532
  • 6. Berger Automating with SIMATIC S7-1500
  • 8. Automating with SIMATIC S7-1500 Configuring, Programming and Testing with STEP 7 Professional by Hans Berger Publicis Publishing
  • 9. Bibliographic information from the Deutsche Nationalbibliothek The Deutsche Nationalbibliothek lists this publication in the Deutsche Nationalbibliografie; detailed bibliographic data are available on the Internet at http://dnb.d-nb.de. The author, translators, and publisher have taken great care with all texts and illustrations in this book. Nevertheless, errors can never be completely avoided. The publisher, author, and translators accept no liability, for whatever legal reasons, for any damage resulting from the use of the programming examples. www.publicis-books.de Print ISBN 978-3-89578-404-0 ePDF ISBN 978-3-89578-919-9 Editor: Siemens Aktiengesellschaft, Berlin and Munich Publisher: Publicis Publishing, Erlangen © 2014 by Publicis Erlangen, Zweigniederlassung der PWW GmbH The publication and all parts thereof are protected by copyright. Any use of it outside the strict provisions of the copyright law without the consent of the publisher is forbidden and will incur penalties. This applies particularly to reproduction, translation, microfilming or other processing, and to storage or processing in electronic systems. It also applies to the use of extracts from the text. Printed in Germany
  • 10. Preface 5 Preface The SIMATIC automation system unites all of the subsystems of an automation solution under a uniform system architecture to form a homogenous whole from the field level right up to process control. The Totally Integrated Automation (TIA) concept permits uniform handling of all au- tomation components using a single system platform and tools with uniform oper- ator interfaces. These requirements are fulfilled by the SIMATIC automation sys- tem, which provides uniformity for configuration, programming, data manage- ment, and communication. This book describes the newly developed SIMATIC S7-1500 automation system. S7-1500 controllers are compact in design and can be modularly expanded. The CPUs feature integrated bus interfaces for communicating with other automation systems via Industrial Ethernet and, depending on the type of module, via PROFIBUS DP as well. The STEP 7 Professional engineering software in the TIA Portal makes it possible to use the complete functionality of the S7-1500 controllers. STEP 7 Professional is the common tool for hardware configuration, generation of the user program, and for program testing and diagnostics. STEP 7 Professional provides five programming languages for generation of the us- er program: Ladder logic (LAD) with a graphic representation similar to a circuit di- agram, function block diagram (FBD) with a graphic representation based on elec- tronic circuitry systems, a high-level Structured Control Language (SCL) similar to Pascal, statement list (STL) with formulation of the control task as a list of commands at machine level, and finally GRAPH as a sequencer with sequential pro- cessing of the user program. STEP 7 Professional supports testing of the user program by means of watch tables for monitoring, control and forcing of tag values, by representation of the program with the current tag values during ongoing operation, and by offline simulation of the programmable controller. This book describes the configuration, programming, and testing of the S7-1500 automation system using the engineering software STEP 7 V12 SP 1 in connection with a CPU 1500 with firmware version V1.1 and the simulation software PLCSIM version V12 SP 1. Erlangen, May 2014 Hans Berger
  • 11. The contents of the book at a glance 6 The contents of the book at a glance Start Overview of the SIMATIC S7-1500 automation system. Introduction to the SIMATIC STEP 7 Professional V12 engineering software. The basis of the automation solution: Creating and editing a project. SIMATIC S7-1500 automation system Overview of the SIMATIC S7-1500 modules: Design of an automation system, CPUs, signal, technology and communication modules. Device configuration Configuration of a station, parameterization of modules, and networking of stations. Tags, addressing, and data types The properties of inputs, outputs, I/O, bit memories, data, and temporary local data as oper- and areas, and how they are addressed: absolute, symbolic, and indirect. Description of elementary and structured data types, data types for block parameters, point- ers, user and system data types. Program execution How the CPU responds in the STARTUP, RUN, and STOP modes. How the user program is structured with blocks, what the properties of these blocks are, and how they are called. How the user program is executed: startup characteristics, main program, interrupt process- ing, troubleshooting, and diagnostics. The program editor Working with the PLC tag table, creating and editing code and data blocks, compiling blocks, and evaluating program information. The ladder logic programming language LAD The characteristics of LAD programming; series and parallel connection of contacts, the use of coils, standard boxes, Q boxes, and EN/ENO boxes. The function block diagram programming language FBD The characteristics of FBD programming; boxes for binary logic operations, the use of stan- dard boxes, Q boxes, and EN/ENO boxes. The structured control language SCL The characteristics of SCL programming; operators and expressions, working with binary and digital functions, control of program execution using control statements.
  • 12. The contents of the book at a glance 7 The statement list programming language STL The characteristics of STL programming; programming of binary logic operations, applica- tion of digital functions, and control of program execution. The sequential control programming language GRAPH What a sequential control is, and what its elements are: sequencers, steps, transitions, and branches. How a sequential control is configured using GRAPH. Description of the control functions Basic functions: Functions for binary signals: binary logic operations, memory functions, edge evaluations, SIMATIC timer/counter functions, IEC timer/counter functions. Digital functions: Functions for digital tags: transfer, comparison, arithmetic, math, con- version, shift, and logic functions. Program control: Branching in the program using jump functions, calling and ending func- tions and function blocks, ARRAY and CPU data blocks. Online operation and program test Connecting a programming device to the PLC station, switching on online mode, transfer- ring the project data, and protecting the user program. Loading, modifying, deleting, and comparing the user blocks. Working with the hardware diagnostics and testing the user program. Distributed I/O Overview: The ET 200 distributed I/O system. How a PROFINET IO system is configured, and what properties it has. How a PROFIBUS DP master system is configured, and what properties it has. Communication The communication functions used to implement open user communication. The properties of S7 communication and with what communication functions it is pro- grammed. How PtP communication is implemented. Appendix How external source files are created and imported for STL and SCL blocks. How a project created using STEP 7 V5.x is migrated to the TIA Portal. How the Web server is configured in the CPU, and what features it offers. Technology functions: counting, measuring, motion control, PID control How the user program is tested offline using the S7-PLCSIM simulation software.
  • 13. Table of contents 8 Table of contents 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.1 Overview of the S7-1500 automation system . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.1.1 SIMATIC S7-1500 programmable controller . . . . . . . . . . . . . . . . . . . . . . . . 24 1.1.2 Overview of STEP 7 Professional V12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 1.1.3 Various programming languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.1.4 Execution of the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 1.1.5 Data management in the SIMATIC automation system . . . . . . . . . . . . . . . 31 1.2 Introduction to STEP 7 Professional V12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 1.2.1 Installing STEP 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 1.2.2 Automation License Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 1.2.3 Starting STEP 7 Professional . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 1.2.4 Portal view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 1.2.5 The windows of the Project view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 1.2.6 Help information system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 1.2.7 Adapting the user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 1.3 Editing a SIMATIC project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 1.3.1 Structured representation of project data . . . . . . . . . . . . . . . . . . . . . . . . . 39 1.3.2 Project data and editors for a PLC station . . . . . . . . . . . . . . . . . . . . . . . . . . 39 1.3.3 Creating and editing a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 1.3.4 Working with reference projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 1.3.5 Creating and editing libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 2 SIMATIC S7-1500 automation system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 2.1 S7-1500 station components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 2.2 S7-1500 CPUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 2.2.1 CPU versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 2.2.2 Control and display elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 2.2.3 SIMATIC Memory Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 2.2.4 Memory areas in an S7-1500 station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 2.2.5 Bus interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 2.3 Signal modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 2.3.1 Digital input modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 2.3.2 Digital output modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 2.3.3 Analog input modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 2.3.4 Analog output modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 2.4 Technology modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 2.5 Communication modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 2.6 Other modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 2.6.1 System power supply modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 2.6.2 Load power supply modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
  • 14. Table of contents 9 3 Device configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 3.2 Configuring a station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 3.2.1 Adding a PLC station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 3.2.2 Adding a module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 3.3 Parameterization of modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 3.3.1 Parameterization of CPU properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 3.3.2 Addressing modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 3.3.3 Assigning parameters to signal modules . . . . . . . . . . . . . . . . . . . . . . . . . . 70 3.4 Configuring a network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 3.4.1 Introduction, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 3.4.2 Networking a station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 3.4.3 Node addresses in a subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 3.4.4 Communication services and types of connection . . . . . . . . . . . . . . . . . . 76 3.4.5 Configuring a connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 3.4.6 Configuring a PROFINET subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 3.4.7 Configuring a PROFIBUS subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 4 Tags, addressing, and data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4.1 Operands and tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4.1.1 Introduction, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4.1.2 Operand areas: inputs and outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 4.1.3 Operand area: bit memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 4.1.4 Operand area: data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 4.1.5 Operand area: temporary local data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 4.2 Addressing of operands and tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 4.2.1 Signal path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 4.2.2 Absolute addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 4.2.3 Symbolic addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 4.2.4 Addressing of a tag area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 4.2.5 Addressing a constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 4.3 Indirect addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 4.3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 4.3.2 Indirect addressing of ARRAY components . . . . . . . . . . . . . . . . . . . . . . . . 100 4.3.3 Indirect addressing of a tag in an ARRAY DB . . . . . . . . . . . . . . . . . . . . . . 102 4.3.4 Indirect addressing of a data block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 4.3.5 Indirect addressing with an ANY pointer . . . . . . . . . . . . . . . . . . . . . . . . . 103 4.3.6 Indirect addressing with PEEK and POKE (SCL) . . . . . . . . . . . . . . . . . . . . 105 4.4 Addressing of hardware objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 4.5 General information on data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 4.5.1 Overview of data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 4.5.2 Implicit data type conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 4.5.3 Overlaying tags (data type views) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 4.6 Elementary data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 4.6.1 Bit-serial data types BOOL, BYTE, WORD, DWORD, and LWORD . . . . . . 113 4.6.2 Data type CHAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 4.6.3 BCD numbers BCD16 and BCD32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 4.6.4 Fixed-point data types without sign USINT, UINT, UDINT, ULINT . . . . . 116 4.6.5 Fixed-point data types with sign SINT, INT, DINT, and LINT . . . . . . . . . 117
  • 15. Table of contents 10 4.6.6 Floating-point data types REAL and LREAL . . . . . . . . . . . . . . . . . . . . . . . 118 4.6.7 Data types for durations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 4.6.8 Data types for points in time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 4.7 Structured data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 4.7.1 Date and time DATE_AND_TIME (DT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 4.7.2 Date and time DATE_AND_LTIME (DTL) . . . . . . . . . . . . . . . . . . . . . . . . . . 125 4.7.3 STRING data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 4.7.4 Data type ARRAY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 4.7.5 Data type STRUCT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 4.8 Parameter types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 4.8.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 4.8.2 TIMER and COUNTER parameter types . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 4.8.3 Parameter types for IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . 132 4.8.4 Parameter types for IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . 132 4.8.5 Parameter types BLOCK_FC and BLOCK_FB (STL) . . . . . . . . . . . . . . . . . 132 4.8.6 Parameter type DB_ANY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 4.8.7 Parameter type VOID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 4.8.8 Parameter types POINTER, ANY, and VARIANT . . . . . . . . . . . . . . . . . . . . . 134 4.9 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 4.9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 4.9.2 Area pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 4.9.3 DB pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 4.9.4 ANY pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 4.10 PLC data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 4.10.1 Programming a PLC data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 4.10.2 Using a PLC data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 4.10.3 Comparing PLC data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 4.11 System data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 4.11.1 System data types for IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . 139 4.11.2 System data types for IEC counter functions . . . . . . . . . . . . . . . . . . . . . 140 4.11.3 Data type ERROR_STRUCT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 4.11.4 Start information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 4.12 Hardware data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 5 Program execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 5.1 Operating states of the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 5.1.1 STOP operating state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 5.1.2 STARTUP operating state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 5.1.3 RUN operating state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 5.1.4 Retentive behavior of operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 5.2 Creating a user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 5.2.1 Program draft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 5.2.2 Program execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 5.3 Programming blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 5.3.1 Block types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 5.3.2 Block properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 5.3.3 Block interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 5.3.4 Programming block parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
  • 16. Table of contents 11 5.4 Calling blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 5.4.1 General information on calling of code blocks . . . . . . . . . . . . . . . . . . . . 163 5.4.2 Supplying the block parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 5.4.3 Calling a function (FC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 5.4.4 Calling a function block (FB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 5.4.5 “Passing on” of block parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 5.5 Startup program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 5.5.1 Startup organization blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 5.5.2 Resetting retentive data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 5.5.3 Determining a module address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 5.5.4 Parameterization of modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 5.6 Main program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 5.6.1 Main program organization blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 5.6.2 Process image updating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 5.6.3 Cycle time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 5.6.4 Response time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 5.6.5 Stopping and delaying the program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 5.6.6 Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 5.6.7 Read system time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 5.6.8 Runtime meter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 5.7 Interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 5.7.1 Introduction to interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 5.7.2 Time-of-day interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 5.7.3 Time-delay interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 5.7.4 Cyclic interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 5.7.5 Hardware interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 5.7.6 Assigning interrupts during runtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 5.7.7 Reading additional interrupt information . . . . . . . . . . . . . . . . . . . . . . . . 210 5.8 Error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 5.8.1 Causes of errors and error responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 5.8.2 Local error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 5.8.3 Global error handling (synchronous error) . . . . . . . . . . . . . . . . . . . . . . . 215 5.8.4 Enabling and disabling synchronous error processing . . . . . . . . . . . . . 218 5.8.5 Asynchronous errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 5.8.6 Disable, delay, and enable interrupts and asynchronous errors . . . . . . 223 5.9 Diagnostics in the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 5.9.1 Diagnostics interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 5.9.2 Read start information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 5.9.3 Diagnostic functions in the user program . . . . . . . . . . . . . . . . . . . . . . . . 228 5.10 Configuring alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 5.10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 5.10.2 Configuring alarms according to the alarm number procedure . . . . . 238 5.10.3 Blocks for programming alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 5.10.4 CPU alarm display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 6 Program editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 6.2 PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 6.2.1 Creating and editing a PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
  • 17. Table of contents 12 6.2.2 Defining and processing PLC tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 6.2.3 Comparing PLC tag tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 6.2.4 Exporting and importing a PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . 252 6.2.5 Constants tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 6.3 Programming a code block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 6.3.1 Creating a new code block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 6.3.2 Working area of the program editor for code blocks . . . . . . . . . . . . . . . . 254 6.3.3 Specifying code block properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 6.3.4 Protecting blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 6.3.5 Programming a block interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 6.3.6 Programming a control function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 6.3.7 Editing tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 6.3.8 Working with program comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 6.4 Programming a data block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 6.4.1 Creating a new data block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 6.4.2 Working area of program editor for data blocks . . . . . . . . . . . . . . . . . . . 271 6.4.3 Defining properties for data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 6.4.4 Declaring data tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274 6.4.5 Entering data tags in global data blocks . . . . . . . . . . . . . . . . . . . . . . . . . 275 6.5 Compiling blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 6.5.1 Starting the compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 6.5.2 Compiling SCL blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 6.5.3 Eliminating errors following compilation . . . . . . . . . . . . . . . . . . . . . . . . 278 6.6 Program information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 6.6.1 Cross-reference list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 6.6.2 Assignment list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 6.6.3 Call structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 6.6.4 Dependency structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283 6.6.5 Consistency check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283 6.6.6 Resources of the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 6.7 Language settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 7 Ladder logic LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 7.1.1 Programming with LAD in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 7.1.2 Program elements of ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 7.2 Programming binary logic operations with LAD . . . . . . . . . . . . . . . . . . . . . . 290 7.2.1 NO and NC contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 7.2.2 Series and parallel connection of contacts . . . . . . . . . . . . . . . . . . . . . . . . 292 7.2.3 T branch, open parallel branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 7.2.4 Negate result of logic operation in the ladder logic . . . . . . . . . . . . . . . . 293 7.2.5 Edge evaluation of a binary tag in the ladder logic . . . . . . . . . . . . . . . . . 294 7.2.6 Validity check of a floating-point tag in the ladder logic . . . . . . . . . . . . 294 7.2.7 Comparison contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 7.3 Programming memory functions with LAD . . . . . . . . . . . . . . . . . . . . . . . . . 295 7.3.1 Simple and negating coils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 7.3.2 Set and reset coils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 7.3.3 Retentive response due to latching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 7.3.4 Edge evaluation with pulse output in the ladder logic . . . . . . . . . . . . . . 299
  • 18. Table of contents 13 7.3.5 Multiple setting and resetting (filling the bit array) in the ladder logic 299 7.3.6 Coils with time response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 7.3.7 Coils with counter response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 7.4 Programming Q boxes with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 7.4.1 Memory boxes in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 7.4.2 Edge evaluation of current flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 7.4.3 SIMATIC timer functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . 305 7.4.4 SIMATIC counter functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . 306 7.4.5 IEC timer functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 7.4.6 IEC counter functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . 307 7.5 Programming EN/ENO boxes with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 7.5.1 Edge evaluation with an EN/ENO box . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 7.5.2 Transfer functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 7.5.3 Arithmetic functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . 311 7.5.4 Math functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 7.5.5 Conversion functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . 313 7.5.6 Shift functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 7.5.7 Logic functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 7.5.8 Functions for strings in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . 315 7.6 Program control with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 7.6.1 Jump functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 7.6.2 Block call functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 7.6.3 Block end function in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 7.6.4 EN/ENO mechanism in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 8 Function block diagram FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 8.1.1 Programming with FBD in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 8.1.2 Program elements of the function block diagram . . . . . . . . . . . . . . . . . . 325 8.2 Programming binary logic operations with FBD . . . . . . . . . . . . . . . . . . . . . . 325 8.2.1 Scanning for signal states “1” and “0” . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 8.2.2 Programming a binary logic operation in the function block diagram 326 8.2.3 AND function in the function block diagram . . . . . . . . . . . . . . . . . . . . . . 328 8.2.4 OR function in the function block diagram . . . . . . . . . . . . . . . . . . . . . . . 329 8.2.5 Exclusive OR function in the function block diagram . . . . . . . . . . . . . . . 329 8.2.6 Combined binary logic operations, negating result of logic operation 329 8.2.7 T branch in the function block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 330 8.2.8 Edge evaluation of binary tags in the function block diagram . . . . . . . 331 8.2.9 Validity checking of floating-point numbers in the function block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 8.2.10 Comparison functions in the function block diagram . . . . . . . . . . . . . 332 8.3 Programming standard boxes with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 8.3.1 Assignment and negating assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 8.3.2 Set and reset boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 8.3.3 Edge evaluation with pulse output in the function block diagram . . . . 335 8.3.4 Multiple setting and resetting (filling the bit array) in the function block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 8.3.5 Standard boxes with time response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337 8.3.6 Standard boxes with counter response . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
  • 19. Table of contents 14 8.4 Programming Q boxes with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 8.4.1 Memory boxes in the function block diagram . . . . . . . . . . . . . . . . . . . . . 340 8.4.2 Edge evaluation of the result of logic operation in the function block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340 8.4.3 SIMATIC timer functions in the function block diagram . . . . . . . . . . . . . 341 8.4.4 SIMATIC counter functions in the function block diagram . . . . . . . . . . . 342 8.4.5 IEC timer functions in the function block diagram . . . . . . . . . . . . . . . . . 343 8.4.6 IEC counter functions in the function block diagram . . . . . . . . . . . . . . . 343 8.5 Programming EN/ENO boxes with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344 8.5.1 Edge evaluation with an EN/ENO box . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346 8.5.2 Transfer functions in the function block diagram . . . . . . . . . . . . . . . . . . 346 8.5.3 Arithmetic functions in the function block diagram . . . . . . . . . . . . . . . . 347 8.5.4 Math functions in the function block diagram . . . . . . . . . . . . . . . . . . . . . 348 8.5.5 Conversion functions in the function block diagram . . . . . . . . . . . . . . . 349 8.5.6 Shift functions in the function block diagram . . . . . . . . . . . . . . . . . . . . . 349 8.5.7 Logic functions in the function block diagram . . . . . . . . . . . . . . . . . . . . 350 8.5.8 Functions for character strings in the function block diagram . . . . . . . 351 8.6 Program control with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352 8.6.1 Jump functions in the function block diagram . . . . . . . . . . . . . . . . . . . . 353 8.6.2 Block call functions in the function block diagram . . . . . . . . . . . . . . . . . 354 8.6.3 Block end function in the function block diagram . . . . . . . . . . . . . . . . . . 355 8.6.4 EN/ENO mechanism in the function block diagram . . . . . . . . . . . . . . . . . 356 9 Structured Control Language SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 9.1.1 Programming with SCL in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 9.1.2 SCL statements and operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 9.2 Programming binary logic operations with SCL . . . . . . . . . . . . . . . . . . . . . 361 9.2.1 Scanning for signal states “1” and “0” . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 9.2.2 AND function in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364 9.2.3 OR function in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 9.2.4 Exclusive OR function in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 9.2.5 Combined binary logic operations in SCL . . . . . . . . . . . . . . . . . . . . . . . . 365 9.2.6 Negate result of logic operation in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . 366 9.3 Programming memory functions with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . 367 9.3.1 Value assignment of a binary tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 9.3.2 Setting and resetting in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 9.3.3 Edge evaluation in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 9.4 Programming timer and counter functions with SCL . . . . . . . . . . . . . . . . . . 368 9.4.1 SIMATIC timer functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368 9.4.2 SIMATIC counter functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 9.4.3 IEC timer functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370 9.4.4 IEC counter functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371 9.5 Programming digital functions with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . 372 9.5.1 Transfer function, value assignment of a digital tag . . . . . . . . . . . . . . . . 372 9.5.2 Comparison functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372 9.5.3 Arithmetic functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373 9.5.4 Math functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 9.5.5 Conversion functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
  • 20. Table of contents 15 9.5.6 Shift functions in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378 9.5.7 Word logic operations, logic expression in SCL . . . . . . . . . . . . . . . . . . . . 378 9.5.8 Functions for strings in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379 9.6 Program control with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 9.6.1 Working with the ENO tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 9.6.2 EN/ENO mechanism with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381 9.6.3 Control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 9.6.4 Block functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 10 Statement list STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 10.1.1 Programming with STL in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 10.1.2 Structure of an STL statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397 10.1.3 Entering an STL statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398 10.1.4 Addressing of 64-bit tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 10.1.5 STL networks in LAD and FBD blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . 400 10.2 Programming binary logic operations with STL . . . . . . . . . . . . . . . . . . . . 400 10.2.1 Processing of a binary logic operation, operation step . . . . . . . . . . . . 401 10.2.2 Scanning for signal states “1” and “0” . . . . . . . . . . . . . . . . . . . . . . . . . . . 402 10.2.3 AND function in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 10.2.4 OR function in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 10.2.5 Exclusive OR function in the statement list . . . . . . . . . . . . . . . . . . . . . . 403 10.2.6 Combined binary logic operations in the statement list . . . . . . . . . . . 404 10.2.7 Control of result of logic operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407 10.3 Programming memory functions with STL . . . . . . . . . . . . . . . . . . . . . . . . . 408 10.3.1 Assignment in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408 10.3.2 Setting and resetting in the statement list . . . . . . . . . . . . . . . . . . . . . . 409 10.3.3 Edge evaluation in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . . . 409 10.4 Programming timer and counter functions with STL . . . . . . . . . . . . . . . . . 410 10.4.1 SIMATIC timer functions in the statement list . . . . . . . . . . . . . . . . . . . 410 10.4.2 SIMATIC counter functions in the statement list . . . . . . . . . . . . . . . . . 411 10.4.3 IEC timer functions in the statement list . . . . . . . . . . . . . . . . . . . . . . . . 413 10.4.4 IEC counter functions in the statement list . . . . . . . . . . . . . . . . . . . . . . 414 10.5 Programming digital functions with STL . . . . . . . . . . . . . . . . . . . . . . . . . . 415 10.5.1 Transfer functions in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . 415 10.5.2 Comparison functions in the statement list . . . . . . . . . . . . . . . . . . . . . . 418 10.5.3 Arithmetic functions in the statement list . . . . . . . . . . . . . . . . . . . . . . . 422 10.5.4 Math functions in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426 10.5.5 Conversion functions in the statement list . . . . . . . . . . . . . . . . . . . . . . 428 10.5.6 Shift functions in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430 10.5.7 Word logic operations in the statement list . . . . . . . . . . . . . . . . . . . . . . 432 10.5.8 Functions for strings in the statement list . . . . . . . . . . . . . . . . . . . . . . 435 10.6 Program control with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 10.6.1 Jump functions in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 10.6.2 Block call function in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . 438 10.6.3 Block end functions in the statement list . . . . . . . . . . . . . . . . . . . . . . . . 440 10.7 Further STL functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441 10.7.1 Working with status bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442 10.7.2 EN/ENO mechanism in the statement list . . . . . . . . . . . . . . . . . . . . . . . . 447
  • 21. Table of contents 16 10.7.3 Accumulator functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448 10.7.4 Working with the data block registers . . . . . . . . . . . . . . . . . . . . . . . . . . 451 10.7.5 Partial addressing of data operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453 10.7.6 Absolute addressing of temporary local data . . . . . . . . . . . . . . . . . . . . . 454 10.7.7 Working with the address registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454 10.7.8 Memory-indirect addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458 10.7.9 Register-indirect addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461 10.7.10 Direct access to complex local tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463 10.7.11 Data storage of the block parameters of a function (FC) . . . . . . . . . . 465 10.7.12 Data storage of the block parameters of a function block (FB) . . . . . 467 10.7.13 Data storage of a local instance in a multi-instance . . . . . . . . . . . . . . 468 10.7.14 Null instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471 11 S7-GRAPH sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472 11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472 11.1.1 What is a sequential control? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472 11.1.2 Properties of a sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473 11.1.3 Program for a sequential control, quantity framework . . . . . . . . . . . . 474 11.1.4 Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474 11.1.5 Procedure for configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475 11.2 Elements of a sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475 11.2.1 Steps and transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475 11.2.2 Jumps in a sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477 11.2.3 Branching of a sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477 11.2.4 GRAPH-specific tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478 11.2.5 Permanent instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479 11.2.6 Step and transition functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480 11.2.7 Processing of actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 11.3 Configuring a sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489 11.3.1 Programming the GRAPH function block . . . . . . . . . . . . . . . . . . . . . . . . 489 11.3.2 Configuring the sequencer structure . . . . . . . . . . . . . . . . . . . . . . . . . . . 490 11.3.3 Programming steps and transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492 11.3.4 Programming permanent instructions . . . . . . . . . . . . . . . . . . . . . . . . . . 493 11.3.5 Configuring block-independent alarms . . . . . . . . . . . . . . . . . . . . . . . . . 494 11.3.6 Attributes of the GRAPH function block . . . . . . . . . . . . . . . . . . . . . . . . . 494 11.3.7 Using the GRAPH function block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495 11.4 Testing the sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497 11.4.1 Loading the GRAPH function block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498 11.4.2 Settings for program testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498 11.4.3 Using operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499 11.4.4 Synchronization a sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500 11.4.5 Testing with program status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501 12 Basic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503 12.1 Binary logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503 12.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503 12.1.2 Working with binary signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504 12.1.3 AND function, series connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507 12.1.4 OR function, parallel connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
  • 22. Table of contents 17 12.1.5 Exclusive OR function, non-equivalence function . . . . . . . . . . . . . . . . . 508 12.1.6 Negate result of logic operation, NOT contact . . . . . . . . . . . . . . . . . . . . 508 12.2 Memory functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510 12.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510 12.2.2 Simple and negating coil, assignment . . . . . . . . . . . . . . . . . . . . . . . . . . 511 12.2.3 Single setting and resetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511 12.2.4 Multiple setting and resetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513 12.2.5 Dominant setting and resetting, memory function . . . . . . . . . . . . . . . 514 12.3 Edge evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515 12.3.1 Principle of operation of an edge evaluation . . . . . . . . . . . . . . . . . . . . . 515 12.3.2 Edge evaluation of a binary tag (LAD, FBD) . . . . . . . . . . . . . . . . . . . . . . 517 12.3.3 Edge evaluation with pulse output (LAD, FBD) . . . . . . . . . . . . . . . . . . . 518 12.3.4 Edge evaluation with a Q box (LAD, FBD) . . . . . . . . . . . . . . . . . . . . . . . . 519 12.3.5 Edge evaluation with an EN/ENO box (LAD, FBD) . . . . . . . . . . . . . . . . . 520 12.3.6 Edge evaluation with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 12.3.7 Edge evaluation with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523 12.4 SIMATIC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524 12.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524 12.4.2 Programming a timer function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527 12.4.3 Timer response as pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529 12.4.4 Timer response as extended pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 12.4.5 Timer response as ON delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533 12.4.6 Timer response as retentive ON delay . . . . . . . . . . . . . . . . . . . . . . . . . . 535 12.4.7 Timer response as OFF delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537 12.5 IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539 12.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539 12.5.2 Pulse generation TP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540 12.5.3 ON delay TON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 12.5.4 OFF delay TOF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542 12.5.5 Accumulating ON delay TONR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543 12.5.6 Loading an IEC timer function with a duration . . . . . . . . . . . . . . . . . . . 544 12.5.7 Resetting an IEC timer function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545 12.6 SIMATIC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545 12.6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545 12.6.2 Programming a counter function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549 12.6.3 Principle of operation of a counter function . . . . . . . . . . . . . . . . . . . . . 550 12.6.4 Enabling a counter function with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . 551 12.7 IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553 12.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553 12.7.2 Up counter CTU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554 12.7.3 Down counter CTD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555 12.7.4 Up/down counter CTUD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556 13 Digital functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558 13.1 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558 13.2 Transfer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559 13.2.1 General information on the “simple” transfer function . . . . . . . . . . . . 559 13.2.2 Copy tag, MOVE box for LAD and FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . 559 13.2.3 Copy string, S_MOVE box for LAD and FBD . . . . . . . . . . . . . . . . . . . . . . 560
  • 23. Table of contents 18 13.2.4 Value assignments with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561 13.2.5 Loading and transferring with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562 13.2.6 Copy data area (MOVE_BLK_VARIANT) . . . . . . . . . . . . . . . . . . . . . . . . . . 564 13.2.7 Copy data area (MOVE_BLK, UMOVE_BLK) . . . . . . . . . . . . . . . . . . . . . . 566 13.2.8 Fill data area (FILL, FILL_BLK, UFILL_BLK) . . . . . . . . . . . . . . . . . . . . . . 567 13.2.9 Copy and fill data area (BLKMOV, UBLKMOV, FILL) . . . . . . . . . . . . . . . 567 13.2.10 Swap bytes (SWAP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570 13.3 Comparison functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570 13.3.1 Execution of “simple” comparison function . . . . . . . . . . . . . . . . . . . . . . 570 13.3.2 Comparison function T_COMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572 13.3.3 Comparison function S_COMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572 13.3.4 Range comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573 13.4 Arithmetic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574 13.4.1 Arithmetic functions for numerical values . . . . . . . . . . . . . . . . . . . . . . 574 13.4.2 Arithmetic functions for date and time . . . . . . . . . . . . . . . . . . . . . . . . . 576 13.4.3 Decrementing and incrementing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576 13.5 Math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578 13.5.1 General function description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578 13.5.2 Trigonometric functions SIN, COS, TAN . . . . . . . . . . . . . . . . . . . . . . . . 579 13.5.3 Arc functions ASIN, ACOS, ATAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580 13.5.4 Generate square and extract square root . . . . . . . . . . . . . . . . . . . . . . . . 580 13.5.5 Logarithm and power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581 13.5.6 Extract decimal points, generate absolute value and negation . . . . . . 582 13.5.7 Calculating with the CALCULATE box in LAD and FBD . . . . . . . . . . . . . 583 13.6 Conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586 13.6.1 Data type conversion with the conversion function CONVERT . . . . . . 586 13.6.2 Data type conversion with ROUND, CEIL, FLOOR, and TRUNC . . . . . . 591 13.6.3 Data type conversion with T_CONV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592 13.6.4 Data type conversion with S_CONV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594 13.6.5 Conversion functions STRG_TO_CHARS and CHARS_TO_STRG . . . . . . 594 13.6.6 Conversion functions STRG_VAL and VAL_STRG . . . . . . . . . . . . . . . . . . 596 13.6.7 Data type conversion of hexadecimal numbers . . . . . . . . . . . . . . . . . . . 597 13.6.8 Scaling and normalizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599 13.7 Shift functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603 13.7.1 General function description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603 13.7.2 Shift to right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603 13.7.3 Shift to left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605 13.7.4 Rotate to right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605 13.7.5 Rotate to left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606 13.8 Logic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607 13.8.1 Word logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607 13.8.2 Invert, generate one's complement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609 13.8.3 Coding functions DECO and ENCO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610 13.8.4 Selection functions SEL, MUX, and DEMUX . . . . . . . . . . . . . . . . . . . . . . 611 13.8.5 Minimum selection MIN, maximum selection MAX . . . . . . . . . . . . . . . 612 13.8.6 Limiter LIMIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612 13.9 Processing of strings (data type STRING) . . . . . . . . . . . . . . . . . . . . . . . . . . . 615 13.9.1 Output current length of a string LEN . . . . . . . . . . . . . . . . . . . . . . . . . . 615 13.9.2 Output maximum length of a string MAX_LEN . . . . . . . . . . . . . . . . . . . 615
  • 24. Table of contents 19 13.9.3 Combine strings CONCAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616 13.9.4 Output left part of string LEFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617 13.9.5 Output right part of string RIGHT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617 13.9.6 Output middle part of string MID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617 13.9.7 Delete part of a string DELETE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618 13.9.8 Insert string INSERT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618 13.9.9 Replace part of string REPLACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620 13.9.10 Find part of string FIND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620 14 Program control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622 14.1 Jump functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623 14.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623 14.1.2 Absolute jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623 14.1.3 Conditional jump functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625 14.1.4 Jump list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627 14.1.5 Jump distributor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628 14.1.6 Loop jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630 14.2 Calling of code blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631 14.2.1 General information on block calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631 14.2.2 Calling a function FC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632 14.2.3 Calling a function block FB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634 14.3 Block end functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636 14.3.1 Block end function RET (LAD and FBD) . . . . . . . . . . . . . . . . . . . . . . . . . . 636 14.3.2 RETURN statement (SCL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636 14.3.3 Block end functions BEC, BEU, and BE (STL) . . . . . . . . . . . . . . . . . . . . . 637 14.4 Data block functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638 14.4.1 Read data block attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638 14.4.2 Reading and writing the load memory . . . . . . . . . . . . . . . . . . . . . . . . . . 639 14.4.3 ARRAY data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641 14.4.4 System blocks for access to ARRAY data blocks . . . . . . . . . . . . . . . . . . . 642 14.4.5 CPU data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644 15 Online mode and program test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647 15.1 Connection of a programming device to the PLC station . . . . . . . . . . . . . . 648 15.1.1 IP addresses of the programming device . . . . . . . . . . . . . . . . . . . . . . . . 648 15.1.2 Connecting the programming device to the PLC station . . . . . . . . . . . 649 15.1.3 Assigning an IP address to the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651 15.1.4 Switching on online mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651 15.1.5 Resetting the CPU memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652 15.1.6 Reset to the factory settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652 15.2 Transferring project data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653 15.2.1 Loading project data for the first time . . . . . . . . . . . . . . . . . . . . . . . . . . 654 15.2.2 Reloading the project data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656 15.2.3 Protecting the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657 15.2.4 Working with online project data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660 15.2.5 Working with the memory card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661 15.3 Working with blocks in online mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662 15.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662 15.3.2 Changing and loading a block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
  • 25. Table of contents 20 15.3.3 Download without reinitialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665 15.3.4 Uploading a block from the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667 15.3.5 Working with setpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668 15.3.6 Comparing blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669 15.4 Hardware diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672 15.4.1 Status displays on the modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672 15.4.2 Diagnostic information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673 15.4.3 Diagnostics buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674 15.4.4 Diagnostic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675 15.4.5 Online tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676 15.4.6 Further diagnostic information via the programming device . . . . . . . 676 15.5 Testing the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677 15.5.1 Defining the call environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678 15.5.2 Testing with program status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679 15.5.3 Monitoring of PLC tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682 15.5.4 Monitoring of data tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683 15.5.5 Testing with watch tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684 15.5.6 Testing with the force table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689 15.6 Measured value recording with the trace function . . . . . . . . . . . . . . . . . . 691 15.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691 15.6.2 Creating the trace configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691 15.6.3 Loading a trace and recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692 15.6.4 Saving and evaluating recorded traces . . . . . . . . . . . . . . . . . . . . . . . . . . 693 16 Distributed I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696 16.1 Introduction, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696 16.2 ET 200 distributed I/O system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697 16.2.1 ET 200MP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697 16.2.2 ET 200M . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698 16.2.3 ET 200SP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698 16.2.4 ET 200S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699 16.2.5 ET 200pro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700 16.2.6 ET 200eco and ET200eco PN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700 16.3 PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701 16.3.1 PROFINET IO components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701 16.3.2 Addresses with PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704 16.3.3 Configuring PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705 16.3.4 Coupling modules for PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708 16.3.5 Real-time communication in PROFINET . . . . . . . . . . . . . . . . . . . . . . . . . 710 16.3.6 Special PROFINET configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715 16.4 PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716 16.4.1 PROFIBUS DP components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716 16.4.2 Addresses with PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720 16.4.3 Configuring PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721 16.4.4 Coupling modules for PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724 16.4.5 Special PROFIBUS configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728 16.5 System blocks for distributed I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730 16.5.1 Read and write user data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730 16.5.2 Read diagnostic data from a DP standard slave . . . . . . . . . . . . . . . . . . . 733
  • 26. Table of contents 21 16.5.3 Receive and provide a data record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734 16.5.4 Activate/deactivate distributed station . . . . . . . . . . . . . . . . . . . . . . . . . . 736 16.6 DPV1 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737 16.7 Isochronous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738 16.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738 16.7.2 Isochronous mode with PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . 739 16.7.3 Isochronous mode with PROFIBUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742 16.7.4 Isochronous mode interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745 16.7.5 Isochronous process image updating . . . . . . . . . . . . . . . . . . . . . . . . . . . 746 17 Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748 17.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748 17.2 Open user communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751 17.2.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751 17.2.2 Data structure of open user communication . . . . . . . . . . . . . . . . . . . . . 752 17.2.3 Establish connection and send data with TSEND_C . . . . . . . . . . . . . . . 753 17.2.4 Establish connection and receive data with TRCV_C . . . . . . . . . . . . . . 754 17.2.5 Configuring open user communication . . . . . . . . . . . . . . . . . . . . . . . . . 755 17.2.6 Further functions of open user communication . . . . . . . . . . . . . . . . . . 758 17.3 S7 communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761 17.3.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761 17.3.2 One-way data exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761 17.3.3 Two-way data exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763 17.3.4 Configuring S7 communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766 17.4 Point-to-point communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767 17.4.1 Introduction to point-to-point communication . . . . . . . . . . . . . . . . . . . 767 17.4.2 Configuring the CM PtP communication module . . . . . . . . . . . . . . . . . 768 17.4.3 Point-to-point communication functions . . . . . . . . . . . . . . . . . . . . . . . . 769 17.5 Further communication functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773 17.5.1 USS protocol for drives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773 17.5.2 Modbus RTU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775 17.5.3 Modbus TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777 18 Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780 18.1 Working with source files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780 18.1.1 General procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780 18.1.2 Programming a code block in the source file . . . . . . . . . . . . . . . . . . . . . 782 18.1.3 Programming a data block in the source file . . . . . . . . . . . . . . . . . . . . . 788 18.1.4 Programming a PLC data type in the source file . . . . . . . . . . . . . . . . . . 791 18.2 Migrating and upgrading projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792 18.2.1 Migrating a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792 18.2.2 Upgrading a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796 18.3 Web server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796 18.3.1 Enable Web server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796 18.3.2 Reading out Web information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797 18.3.3 Standard Web pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797 18.3.4 Read out service data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800 18.3.5 Initialize Web server and synchronize Web pages (WWW) . . . . . . . . . 801
  • 27. Table of contents 22 18.4 Technology functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801 18.4.1 Technology modules TM Count 2×24V and TM PosInput 2 . . . . . . . . . . 801 18.4.2 Technology objects for counting and measuring . . . . . . . . . . . . . . . . . . 804 18.4.3 Technology objects for motion control . . . . . . . . . . . . . . . . . . . . . . . . . . 807 18.4.4 Technology objects for PID control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810 18.5 Data logging and transferring recipes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813 18.5.1 Introduction to data logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813 18.5.2 Using data logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814 18.5.3 Functions for data logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814 18.5.4 Introduction to recipe transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816 18.5.5 Functions for the recipe transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818 18.6 Simulation with PLCSIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819 18.6.1 Differences from a real CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819 18.6.2 Installing PLCSIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819 18.6.3 Starting and saving the simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 820 18.6.4 Testing with the SIM table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 822 18.6.5 Testing with the sequence table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823 18.6.6 Applying the test functions of STEP 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . 825 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 827
  • 28. 1.1 Overview of the S7-1500 automation system 23 1 Introduction 1.1 Overview of the S7-1500 automation system SIMATIC S7-1500 is the modular automation system for the medium and upper per- formance ranges. Different versions of the controllers allow the performance to be matched to the respective application. Depending on the requirements, the pro- grammable controller can be expanded by input/output modules for digital and analog signals and technology and communication modules. The SIMATIC S7-1500 automation system is seamlessly integrated in the SIMATIC system architecture (Fig. 1.1). Fig. 1.1 Components of the SIMATIC S7-1500 automation system SIMATIC controllers control the machine Several versions of the controllers expand the range of use. or plant. The distributed I/O expands the interface to the machine or plant. SIMATIC NET SIMATIC HMI SIMATIC ET200 STEP 7 Professional (TIA Portal) SIMATIC S7-1500 Networking allows data exchange between devices and online access at any location. STEP 7 is the engineering software for configuring and programming. S SIMATIC S7-1500 automation system S ESC OK Operator control and for controlling during operation monitoring the plant S
  • 29. 1 Introduction 24 The SIMATIC ET200 distributed I/O allows for additional expansion using input/output modules which are connected to the central controller via PROFIBUS DP or PROFINET IO. The distributed stations can be installed in a control cabinet or – if pro- vided with special designs for increased mechanical requirements – directly on the machine or system. SIMATIC HMI (HMI = Human Machine Interface) is used to control and monitor a machine or plant and its function. Depending on their version, the devices can pro- vide control functions via process images, display system status and alarm mes- sages, and manage the automation data in the form of recipes or measured value archives. SIMATIC NET handles the exchange of data via various bus systems between the SIMATIC controllers, the distributed I/O, the HMI devices, and the programming device. The programming device can be a personal computer, an industrial PC, or a notebook with a Microsoft Windows operating system. The SIMATIC components are configured, parameterized, and programmed using the STEP 7 Engineering Software. The TIA Portal (TIA = Totally Integrated Automa- tion) is the central tool for managing automation data and the associated editors in the form of a hierarchically structured project. 1.1.1 SIMATIC S7-1500 programmable controller The most important components of an S7-1500 programmable controller are shown in Fig. 1.2. Fig. 1.2 Components of an S7-1500 controller Central controller Signal modules (SM) Can be plugged onto the rack: The rack has 32 slots. An optional power supply occupies slot 0 and the CPU occupies slot 1. To the right of the CPU, there is room for up to 30 modules (including power supply modules). Technology modules (TM) Communication modules (CM) CPU (central processing unit) Power supply module (PS) Rack Components of an S7-1500 controller S ESC OK
  • 30. 1.1 Overview of the S7-1500 automation system 25 The CPU contains the operating system and the user program. The user program is saved powerfail-proof on the SIMATIC Memory Card, which is inserted in the CPU. The user program is executed in the CPU's work memory. The bus interfaces present on the CPU establish the connection to other programmable controllers. Signal modules (SM) are responsible for the connection to the controlled machine or plant. These input and output modules are available for digital and analog sig- nals with different voltages and currents. Technology modules (TM) are signal-preprocessing, “intelligent” I/O modules which prepare and process signals coming from the process independent of the CPU and either return them directly to the process or make them available at the CPU's internal interface. Technology modules are responsible for handling func- tions which the CPU cannot usually execute quickly enough such as counting pulses. Communication modules (CM) allow data traffic in excess of the functionality provided by the standard interfaces on the CPU with regard to protocols and com- munication functions. The (system) power supply modules provide the internal voltages required by the programmable controller. Up to three system power supply modules can be used in the programmable controller as needed. Load voltages or load currents are pro- vided via external load current supplies (power modules, PM), which can also pro- vide 24 V primary voltage for system power supply modules. 1.1.2 Overview of STEP 7 Professional V12 STEP 7 is the central automation tool for SIMATIC. STEP 7 requires authorization (licensing) and is executed on the current Microsoft Windows operating systems. Configuration of an S7-1500 controller is carried out in two views: the Portal view and the Project view. The Portal view is task-oriented. In the Start portal you can open an existing proj- ect, create a new project, or migrate a project. A “project” is a data structure con- taining all the programs and data required for your automation task. The most important STEP 7 tools and functions can be accessed from here via further portals: The Devices & networks portal for hardware configuration, the PLC programming portal for processing the user program, the Motion & technology portal for generat- ing technology objects, the Visualization portal for configuring HMI systems, and the Online & Diagnostics portal for the online mode of the programming device (Fig. 1.3). The Project view is an object-oriented view with several windows whose contents change depending on the current activity (Fig. 1.4). In the Device configuration, the focal point is the working area with the device to be configured. The Device view includes the rack and the modules which have already been positioned. A further window – the inspector window – displays the properties of the selected module, and the task card provides support by means of the hardware catalog with the avail- able modules. The Network view allows networking between PLC and HMI stations.
  • 31. 1 Introduction 26 Fig. 1.3 Tools in the Start portal of STEP 7 Professional V12 Fig. 1.4 Example of a Project view: Working area of the device configuration
  • 32. 1.1 Overview of the S7-1500 automation system 27 When carrying out PLC programming, you edit the selected block in the working area. You are again shown the properties of the selected object in the inspector win- dow, where you can adjust them. In this case, the task card contains the program elements catalog with the available program elements and statements. The same applies to the processing of PLC tags or to online program testing using watch tables. And you always have a view of the project tree. This contains all objects of the STEP 7 project. You can therefore select an object at any time, for example a program block or watch table, and edit this object using the corresponding editors which start automatically when the object is opened. 1.1.3 Various programming languages You can select between five programming languages for the user program: ladder logic (LAD), function block diagram (FBD), structured control language (SCL), statement list (STL), and sequential control (GRAPH). Using the ladder logic, you program the control task based on the circuit diagram. Operations on binary signal states are represented by serial or parallel arrange- ment of contacts and coils (Fig. 1.5). Complex functions such as arithmetic func- tions are represented by boxes which you arrange like contacts or coils in the ladder logic. Using the function block diagram, you program the control task based on electronic circuitry systems. Binary operations are implemented by linking AND and OR func- tions and are terminated by memory boxes (Fig. 1.6). Complex boxes are used to han- dle the operations on digital tags, for example with arithmetic functions. Structured control language is particularly suitable for programming complex algorithms or for tasks in the area of data management. The program is made up of SCL statements which, for example, can be value assignments, comparisons, or control statements (Fig. 1.7). Using the statement list, you program the control task using a sequence of state- ments. Every STL statement contains the specification of what has to be done, and Fig. 1.5 Example of representation in ladder logic
  • 33. 1 Introduction 28 possibly an operand with which the operation is executed. STL is equally suitable for binary and digital operations and for programming complex open-loop control tasks (Fig. 1.8). Fig. 1.6 Example of representation in function block diagram Fig. 1.7 Example of SCL statements Fig. 1.8 Example of STL statements
  • 34. 1.1 Overview of the S7-1500 automation system 29 Using GRAPH, you program a control task as a sequential control in which a sequence of actions prevails. The individual steps and branches are enabled by step enabling conditions which can be programmed using LAD or FBD (Fig. 1.9). 1.1.4 Execution of the user program After the power supply has been switched on, the control processor checks the exist- ing hardware and parameterizes the modules. A startup program is then executed once, if present. The startup program belongs to the user program which you pro- duce. Modules can be initialized, for example, by the startup program. The user program is usually divided into individual sections called “blocks”. Orga- nization blocks (OB) represent the interface between operating system and user program. The operating system calls an organization block for specific events and the user program is then processed in it (Fig. 1.10). Function blocks (FB) and functions (FC) are available for structuring the program. Function blocks have a memory in which local tags are saved permanently. Func- tions do not have this memory. Program statements are available for calling function blocks and functions (start of execution). Each block call can be assigned inputs and outputs, referred to as “block parameters”. During calling, tags can be transferred with which the program in the block is to work. In this manner, a block can be repeatedly called with a certain func- tion (e.g. selection of tag values), but with different parameters sets (e.g. for differ- ent calculations) (Fig. 1.11). The data of the user program is saved in data blocks (DB). Instance data blocks have a fixed assignment to a call of a function block and are the tag memory of the func- tion block. Global data blocks contain data which is not assigned to any block. Fig. 1.9 Example of a GRAPH sequencer and step configuration
  • 35. 1 Introduction 30 Following a startup, the control processor updates the input and output signals in the process images and calls the organization block OB 1. The main program is present here. Once the main program has been processed, the control processor returns to the operating system, retains (for example) communication with the programming device, updates the input and output signals, and then recom- mences with execution of the main program. Cyclic program execution is a feature of programmable logic controllers. The user program is even executed if no actions are requested “from outside”, e.g. if the con- trolled machine is not running. This provides advantages when programming: For example, you program the ladder logic as if you were drawing a circuit diagram, or program the function block diagram as if you were connecting electronic compo- nents. Roughly speaking, a programmable controller has a characteristic like, for example, a contactor or relay control: the many programmed operations are effec- tive quasi simultaneously “in parallel”. In addition to the cyclically executed main program, it is possible to carry out inter- rupt-controlled program execution. You must enable the corresponding interrupt event for this. This can be a hardware interrupt, such as a request from the con- trolled machine for a fast response, or a cyclic interrupt, in other words an event which takes place at defined intervals. The control processor interrupts execution of the main program when an event occurs, and calls the assigned interrupt program. Once the interrupt program has been executed, the control processor continues execution of the main program from the point of interruption. Fig. 1.10 Execution of the user program Startup program Alarm and error program Main program Execution of the user program Switching on Updating of inputs and outputs Interruption (alarm or error) Operating state STARTUP Operating system User program Operating state RUN OB OB FB FC FB FC FB FC FB FC FB FC FB FC OB Interruption
  • 36. 1.1 Overview of the S7-1500 automation system 31 1.1.5 Data management in the SIMATIC automation system The automation data is present in various memory locations in the automation sys- tem. First of all, there is the programming device. All automation data of a STEP 7 project is saved on its hard disk. Configuration and programming of the project data with STEP 7 are carried out in the main memory of the programming device (Fig. 1.12). The automation data on the hard disk is also referred to as offline project data. Once STEP 7 has appropriately compiled the automation data, this can be downloaded to a connected programmable controller. The data downloaded into the user memory of the CPU is known as the online project data. Fig. 1.11 Multiple use of a block with different tags in each case “Selection” block with the one-time written program Two-time call of “Selection” with different parameter sets in each case
  • 37. 1 Introduction 32 The user memory on the CPU is divided into two components: The load memory on the SIMATIC Memory Card – an SD memory card – contains the complete user pro- gram with the configured initial data, including the configuration data. The work memory contains the executable user program with the current control data. The project data can be transferred between the programming device and CPU using the SIMATIC Memory Card. The normal case is an online connection for trans- fer, testing, and diagnostics. 1.2 Introduction to STEP 7 Professional V12 1.2.1 Installing STEP 7 STEP 7 Professional V12 is executed on the operating systems Windows XP Pro- fessional SP3, Windows 7 (Professional, Enterprise, Ultimate) SP1 (32-bit and 64- bit), Windows 2003 Server R2 Standard Edition SP2, and Windows 2008 Server Standard Edition SP2. You require administration rights in order to install STEP 7, and to work with STEP 7 you must at least be logged-on as a main user. Fig. 1.12 Data management in the SIMATIC S7-1500 automation system Work memory Retentive memory Main memory Hard disk Load memory SIMATIC Memory Card The load memory contains the project data transferred to the CPU. Together with the current values of the tags from the work memory, they form the online project data. The retentive memory contains the tags whose values are retained even when deenergized. The offline project data is saved on the hard disk. All project data is processed in the programming device's main memory. Programming device CPU 1500 Transfer with online connection or SIMATIC Memory Card Transfer when switching on Saving the project data Data management in the SIMATIC S7-1500 automation system The work memory contains the executable part of the user program (code and data), which is executed during runtime.
  • 38. 1.2 Introduction to STEP 7 Professional V12 33 In order to be able to work with STEP 7, you need a programming device with at least one Core i5, 2.4 GHz processor or a comparable processor. The main memory should have a minimum size of 3 GB for a 32-bit operating system and 8 GB for a 64-bit operating system. On the hard disk, STEP 7 Professional requires approxi- mately 2 GB of free space in the system drive. For the online connection to the programmable controller, an interface module is required on the programming device for the connection to Industrial Ethernet. If you want to work on the programming device using an SD memory card, you need a corresponding card reader. Installation, repair, and uninstalling are carried out using the setup program start.exe on the DVD. You can also uninstall STEP 7 Professional normally in Windows using the Software application (Windows XP) or the Programs and functions application (Windows 7) in the Windows Control Panel. 1.2.2 Automation License Manager You require a license (user authorization) in order to use STEP 7. Licenses are man- aged by the Automation License Manager, which is installed together with STEP 7 Professional. The license for STEP 7 Professional (license key) is provided on a USB flash drive. You will be requested to provide authorization during installation if a license key is not yet present on the hard disk. You can also carry out the autho- rization following installation of STEP 7. The license key is stored on the hard disk in specially identified blocks. To avoid unintentional destruction of the license key, you should observe the information for handling license keys in the help text of the Automation License Manager. If you lose the license key, e.g. due to a defective hard disk, you can revert to the trial license delivered with STEP 7, which is valid for a limited duration. The Automation License Manager also manages license keys of other SIMATIC prod- ucts such as STEP 7 V5.5 or WinCC. 1.2.3 Starting STEP 7 Professional You start STEP 7 Professional either using the Start button of Windows and Programs > Siemens Automation > TIA Portal V12, or by double-clicking on the icon on the Windows desktop. The Totally Integrated Automation Portal (TIA Portal) is the software framework in which STEP 7 is embedded. TIA Portal may also contain other applications that use the same database, such as WinCC Professional V12. 1.2.4 Portal view Following initial starting-up, STEP 7 Professional displays the Start portal. A portal provides all functions and tools required for the respective range of tasks in the Portal view. The scope of the portals as well as the range of functions and tools depends on the installed applications. The Start portal of STEP 7 Professional V12 permits selection of the following portals (Fig. 1.13):
  • 39. 1 Introduction 34 b In the Devices & networks portal, you can configure the hardware of the program- mable controller, i.e. you select the hardware components, position them, and set their properties. If several devices are networked, you can define the connec- tions here. b The PLC programming portal contains all the tools required for generating the user program for a PLC station. b In the Motion & technology portal, you create technology objects, such as a PID temperature regulator or a high-speed counter. b In the Visualization portal, you generate the operator control and monitoring interface for HMI stations. Here you can configure, for example, the process images, the control elements, and alarms. b Using the Online & Diagnostics portal, you can connect the programming device to a programmable controller, transfer and test programs, and search for (and detect) faults in the automation system. Additional functions included in the Start portal are: Create new project, Open existing project, and Migrate project. The Welcome Tour and First steps provide an introduction to STEP 7. Installed software provides an overview of further SIMATIC applications that are currently available on the programming device. You can call Help in every portal. The User interface language allows you to set the language for working with STEP 7. Fig. 1.13 Portal view: First steps after opening a project
  • 40. 1.2 Introduction to STEP 7 Professional V12 35 1.2.5 The windows of the Project view The Project view shows all elements of a project in structured form in various pro- cessing windows. You can move from the Portal view to the Project view using the Project view link at the bottom left of the screen, or STEP 7 automatically switches to the Project view depending on the selected tool. Fig. 1.14 shows the windows of the Project view in an example of block program- ming. Different window contents are displayed depending on the currently used editor. a Main menu and toolbar, shortcut menu Underneath the title bar is the main menu with all menu commands. The menu commands available for selection depend on the currently marked object; menu commands which cannot be selected are displayed in gray. The same functionality is available – somewhat user-friendlier – with the shortcut menu: If you click on an object with the right mouse button, a window is opened with the currently select- able menu commands. Underneath the main menu is the toolbar with the graphi- cally represented “main functions”. The main menu and the toolbar are always present in all editors. Using Options > Settings in the main menu, you can adapt the user interface. For example, under General you can define the user interface language in which Fig. 1.14 Components of Project view using example of block programming
  • 41. 1 Introduction 36 STEP 7 is used, and the mnemonics (the representation of the operands: “I” for international input, or “E” in German). s Working window In the center of the screen is the working window. The contents of the working win- dow depend on the editor currently being used. In the case of device configuration, the working window is divided in two: the objects (stations and modules) are dis- played in graphic form in the top part, and in tabular form in the bottom part. When programming the PLC, the top part of the working window contains the interface description of the block and the bottom part contains the program. You use the working window to configure the hardware of the automation system, generate the user program, or configure the process images for an HMI device. d Inspector window The inspector window underneath the working window shows the properties of the object marked in the latter, records the sequence of actions, and provides an over- view of the diagnostics status of the connected devices. During configuration or programming you set the object properties in the inspec- tor window, for example the addresses and symbol names of inputs and outputs, the properties of the PROFINET interface, tag data types, or block attributes. f Project tree The project tree window is displayed with the same content for all editors. Its hier- archical structure contains all project data and the required editors. With the proj- ect open, it shows the folders for the PLC, HMI and PC stations included in the proj- ect, and further subfolders within these folders, e.g. for program blocks, PLC tags, and watch tables with a PLC station or, for example, the process images and the HMI tags in the case of an HMI station. A double-click on an object with project data automatically starts the associated editor. The project tree also includes editors such as Add new device, Device configuration, or Online & diagnostics, which you can start directly by means of a double-click. The lower section of the project tree contains a details view of those objects which are present in the hierarchy underneath the object marked in the project tree. g Task window To the right of the working window is the task window with the task cards. This con- tains further objects for processing in the working window. The contents of the task window depend on the currently active editor. In the case of the hardware configuration, for example, the hardware catalog with the available components is shown here, in the case of PLC programming the program elements catalog appears, with Online & Diagnostics the online tools, and with the Visualization the library for the process image control and display elements. You can also call the libraries in this window: Global libraries supplied with STEP 7, or the project library in which you can save reusable objects such as program blocks, templates for process images, or control elements with special configurations.
  • 42. 1.2 Introduction to STEP 7 Professional V12 37 h Reference projects The Reference projects palette shows the reference projects that are open in addition to the current project. Using the View > Reference projects command from the main menu, you can switch the palette display on and off. j Editor and status bar At the bottom left of the Project view you can change to the Portal view. In the middle you can see the tabs of the open windows. Click on a tab to display its contents in the top level of the working window. This makes it easy to change quickly between dif- ferent window contents. The status bar on the far right indicates the current status of project execution. 1.2.6 Help information system During programming, the help func- tion of STEP 7 provides you with com- prehensive support for solving your automation task. To call the help function, click on Help in the Portal view or select the Help > Show help command in the main menu in the Project view. A window appears with the help information system (Fig. 1.15). The online help is roughly divided according to the project execution steps: Configuration, parameterization and networking of devices, structuring and programming of the user program, visualization of processes, and utiliza- tion of the online and diagnostics func- tions. Readme provides general information on STEP 7 and further information which could not be included in the online help. A comprehensive descrip- tion of all available basic and extended statements can be found under Programming a PLC > References. 1.2.7 Adapting the user interface The language of the user interface can be changed. In the main menu, select the General section under Options > Settings. In the User interface language drop-down list, you can select the desired language from the installed languages. The texts of the user interface are then immediately displayed in the new language. You can also define here how the TIA Portal is to be displayed following the next restart. Fig. 1.15 Start page of the information system
  • 43. 1 Introduction 38 You can show or hide the displayed windows using the menu command View. You can always change the size of windows by dragging on its edge with the mouse. Windows can be minimized into symbols which appear in one of the navigation bars in the left, bottom or right margin of the screen. You can separate the working window completely from the Project view so that it is displayed as a separate window (symbol for Float in the title bar of the working win- dow), and also insert it again (symbol for Embed). Using the symbol for Maximize, all other windows are closed and the working window is displayed in maximum size. The working window can be divided vertically or horizontally, permitting you to view two working areas simultaneously. You can change the width of table columns by dragging with the cursor in the table header. In the case of columns that are too narrow, the entire content of the individ- ual cells will appear as a tooltip when the cursor is briefly hovered over the relevant field. 1.3 Editing a SIMATIC project Fig. 1.16 shows all tools and data which can be of importance in an automation task. Of prime importance is the project, which contains all the automation data required Fig. 1.16 Project components, libraries, and programming device design Global libraries Programming device design System libraries User libraries < Global library > Online access < User library > Card Reader/USB memory Libraries delivered with STEP 7 Libraries configured by users themselves Global libraries contain elements for use across projects. Contains the programming device resources relevant to the project All the data for an automation task is combined in a project. A project includes at least one station. Contains cross-station data Contains all the data for a controller Contains text lists for system and user messages Contains all the data for an HMI device Contains all the data for a PC system or PC application Contains project texts, project languages, and graphics Contains the templates and settings for documentation of project data PLC station Common data HMI station PC station Documentation settings Languages and resources Stations Project Common project data < Project library > Contains data compiled by the user Project library
  • 44. 1.3 Editing a SIMATIC project 39 for control and operation of the machine or plant. The project data is roughly divided into the data for the individual stations and the common project data which applies to all stations in the project. A station can be a controller (PLC station), an HMI device (HMI station), or a PC sta- tion. A project can include several stations, but at least one station must be present. The data present in a PLC station is described later in this book. Common project data includes, for example, centrally managed message texts or texts for multilin- gual projects. A project library can be created for each project. Objects which are used in several projects are combined in global libraries. Also relevant to a project is the program- ming device design with interface modules (e.g. LAN adapters) and memory card readers. 1.3.1 Structured representation of project data The project tree in the Project view displays the project data and the programming device design in a tree structure (Fig. 1.17). The structure also includes the editors (tools) required for generating and editing the data. The project tree does not include the project library. This is represented in a task card together with the global libraries in the task window under Libraries. You can replace the names shown in angle brackets by names more appropriate to your automation task. 1.3.2 Project data and editors for a PLC station If you add a PLC station (an S7-1500 controller) to the project, STEP 7 creates the corresponding structure in the project data (Fig. 1.18). A station is always required for editing in a project so that STEP 7 can create the data structures required for programming or configuration. If you wish to write a user program without previ- ously selecting a specific CPU, you can select the “unspecified CPU 1500” from the hardware catalog and replace it later with a “real” CPU 1500. The user program which controls the machine or process is located in the Program blocks folder. The program comprises blocks (separate program components) which are either stored directly in the Program blocks folder or – if there is a large number – in subfolders which you can create and configure yourself. The Main block (“main program”, the name is the symbol for the block and can be changed) is the organization block OB 1 and is created automatically. The processing sequence of the blocks is defined in the user program by “block calls” and can be made visible using the Program info editor (further down in the project tree) in a call and dependency structure. The Program blocks folder contains a System blocks subfolder with the system and standard blocks used in the program. This is created automatically when a block of this type is used.
  • 45. 1 Introduction 40 The Technology objects folder contains the configuration data for the objects of axis controls, control loops (PID controllers), and high-speed counters. A new technol- ogy object can be generated using the Add new object editor. The External sources files folder contains the program sources for STL and SCL blocks. The Add new external file editor is used to import a program source and to save it in this folder. The External sources files folder can be configured using self- created subfolders. The PLC tags folder contains the assignment of the absolute address to the symbolic address (name) of inputs, outputs, and bit memories, as well as SIMATIC timer func- Fig. 1.17 Project structure in the project tree < Project > Online access Card reader/USB memory Interface x1 < PLC station > Common data Documentation settings Interface x2 < PLC ... > < PLC station_1 > Languages & resources Add new device ... ... ... Devices & networks Update accessible devices Add user-defined card reader Card reader Adds a new station to the project Folder with the data of a found station Alarm classes, text lists for user and system alarms Templates and settings for documentation List with project texts in different languages Selection of languages for display and alarm texts Collection of language-dependent graphic symbols Starts the device and network configuration Searches for stations connected to this interface (module) Adds a card reader Card reader in the programming device Folder for all data of an automation system Folder for all interfaces of the programming device Folder for all card readers of the programming device Interface of programming device Folder for all data of a PLC station Folder for common data in the project Folder for documentation settings Further interfaces (interface modules) if applicable Folder for the data of a further PLC station Folder for language-dependent objects Project tree with opened project
  • 46. 1.3 Editing a SIMATIC project 41 Fig. 1.18 Structure of the project data for a PLC station < PLC_xxx > Program blocks Watch and force table PLC data types Local modules Technology objects System blocks External sources PLC tags < Group_1 > < Group_1 > < Group_1 > < Technology object_1 > Device configuration Add new block Add new watch table Add new data type < PLC data type_1 > Add new object Add new external file... < External program source > Show all tags Add new tag table Default tag table [n] < Tag table [n] > Online & diagnostics Main [OB1] < Watch table_2 > < Block_2 > <Tag table_1 [n]> < Block_1 > < Watch table_1 > Force table Text lists PLC alarms Program info Traces Starts the editor for device configuration Creates a new block and opens it Creates a new watch table and opens it Adds a new PLC data type Self-created PLC data type Self-created watch table Table with the force tags Station-specific texts for user and system alarms PLC, user diagnostics and system alarms Shows program structure, assignment list, CPU resources Editor for recording and displaying measured value series Self-created block Creates a new technology object and opens it Imports a program source Imported program source Shows all PLC tags of all tables Adds a new tag table Automatically created tag table with n tags Self-created tag table with n tags Starts the editor for the online connection and diagnostics Self-created groups with further watch tables can be used under Watch and force tables for structuring. Folder for all data of a PLC station (name can be freely selected) Folder for all blocks of the user program Folder for all watch and force tables Folder for all PLC data types Folder for the local modules of the PLC station Folder for all technology objects Folder for the system blocks used Folder for the program source files Folder for all PLC tags Under Program blocks, further blocks can be created in addition to the permanently existing Main [OB1] block (main program). The block collection can be structured using self-created groups which contain further blocks. Self-created groups with further tag (partial) tables can be used under PLC tags for structuring. Self-created technology object Data structure of a PLC station
  • 47. 1 Introduction 42 tions and SIMATIC counter functions. Example: The symbolic address “Switch on motor” can be assigned to the input with the absolute address %I1.0. A PLC tag is applicable throughout the CPU, it is a “global” tag. The PLC tags folder can be con- figured using self-created subfolders. A subset of the PLC tags is listed in a tag table. The Show all tags editor lists all PLC tags used from all tag tables. The PLC data types folder contains user-defined data types. A PLC data type com- bines various data types in the form of a named data structure. A PLC data type can be assigned to a local tag in a block or serve as a template for the structure of a data block. The PLC data types folder can be configured using self-created subfolders. All created watch tables and the force table can be found in the Watch and force tables folder. A watch table is used during testing of the user program. It contains tags whose current value can be monitored and also changed during runtime. The Force table can be used to assign a fixed value to peripheral inputs and outputs. The Watch and force tables folder can be configured using self-created subfolders. Using the Traces editor, the recording of measured value series is planned, the cor- responding tasks are sent to the CPU, and the recordings are displayed and man- aged in tables and graphs in the form of a curve chart. Program info provides information about b the call structure – which block calls which other block b the dependency structure – which block is called by which other block b the assignment list – which global operands are already used and which address- es are still unused b the resources – how much space is required by the program in the load and work memory Under PLC alarms you see an overview of which program alarms and system alarms are currently present and edit them. Message texts are stored under Text lists. In the case of the user-defined text list, you can specify the value ranges which trigger the alarms and the associated texts; with a system-defined text list, the contents are specified by STEP 7. Text lists created under a PLC station contain station-specific texts, those created under a project contain cross-station texts. The Local modules folder contains all configured modules of the PLC station. Open- ing a module initiates device configuration. The module properties are displayed in the inspector window. You start configuration of a station using the Device configuration editor, which is located in the first position in the project structure of the station. There is no cor- responding folder for the data of the device configuration in the project tree. The configuration data is located “behind” the Device configuration editor. When you start the editor, the data is displayed in the form of a pictorial representation of the programmable controller in the working window and in a register-oriented repre- sentation of the module properties in the inspector window. The bottom section of
  • 48. 1.3 Editing a SIMATIC project 43 the working window additionally displays the configuration table with the modules as a drop-down list. Online & diagnostics starts the editor for the online connection and online func- tions. For example, you can use a (software) control panel in online mode to control the operating states of the CPU, to set the CPU's IP address and time, or read the CPU's diagnostics buffer. 1.3.3 Creating and editing a project Creating a new project You can create a new project in the Portal view if you click on Create new project in the Start portal. Assign a name to the project and set a path in which the project is to be saved. After clicking the Create button, any project which is open is closed, the new project is created, and the next steps are displayed in the Start portal for selec- tion: b Configure a device STEP 7 changes to the Devices & networks portal in which you can insert a new CPU 1500 (a PLC station) into the project and open it for editing. b Write PLC program STEP 7 changes to the PLC programming portal in which you can edit the Main block (organization block OB 1) or add a new block and open it for editing. b Configure an HMI screen (using the supplied WinCC Basic) STEP 7 changes to the Visualization portal in which you can create a new HMI station or configure an already existing one. From this portal you start con- figuration of the process images, editing of HMI tags and alarms, and the HMI simulator. If WinCC Comfort, Advanced or Professional is installed, it is started under this portal. b Open the project view STEP 7 changes to the Project view in which you can perform the next steps such as adding another PLC station, modifying the configuration of an existing PLC station, adding and programming a block, or configuring the process images for an HMI station. In the Project view you can create a new project using the Project > New menu command. Assign a name to the project in the dialog window, set the path in which the project is to be saved, and click on the Create button. Editing an existing project You can open an existing project in either the Portal view or the Project view. In the Start portal, either activate Open existing project in the Portal view or Project > Open in the Project view. Select the desired project from the list of projects last used. Any project which is open is closed and the selected project is opened. During editing in the Project view, you can save the entered project data using the Project > Save or Project > Save as menu command. You can close the project using
  • 49. 1 Introduction 44 Project > Close – following confirmation of whether changes are to be saved – without exiting STEP 7. You can delete a (closed) project from the hard disk – following confirmation – using Project > Delete project. Compiling and downloading project data Before project data can be downloaded to a station, it must be made readable for the respective processor: It must be “compiled”. The project data is compiled station-by-station. The scope of the compilation can be varied depending on the type of station. For example, the command from the Compile > Software (only changes) shortcut menu only compiles those software components which have been changed since the last compilation. The same applies to downloading of the compiled data to a station. You can select for a PLC station whether you wish to download only the hardware configuration, or only the user program, or both. Printing project data The project data can be printed in the form of a circuit manual. You can use the doc- umentation function to set the layout of the printout. The settings in the main menu under Options > Settings and General > Print settings apply to all projects in the TIA Portal. The templates for the project circuit manual are saved in the project tree in the Documentation settings folder. You can add your own templates or change existing ones. In the global Documentation templates library under Master copies in the Document information group, you can find the templates to design a circuit manual, in the Frames group are the templates for the page frames, and in the Cover Pages group are the cover page templates. To copy templates to the project, in the Libraries task card, open the Documentation templates library and drag a template from the Document information folder, for example DocuInfo_ISO_A4_Portrait, to the Document information folder under Documentation settings. Copy a cover page from the Cover Pages folder to the Cover pages folder and a frame from the Frames folder to the Frames folder. Double-clicking on a template in the project tree opens the template for editing. For example, you add a new text field or graphical symbol to the cover page. You are supported by the Toolbox task card, which contains object templates for a text box, a date/time field, a field for the page number, a field for free text, and a graphic placeholder. In the frame template you complete the title block and in the docu- ment information template you enter the data for the circuit manual. You select the objects to be printed in the project tree or in a library. To display the print preview, select Print preview... from the shortcut menu or Project > Print preview… from the main menu. In the dialog window you can set the document information to be used, select the printout of the cover page and table of contents,
  • 50. 1.3 Editing a SIMATIC project 45 and specify whether all project data or a compact selection should be displayed in the print preview. To print, select the objects to be printed and click on the Print icon in the toolbar or select Project > Print… in the main menu or Print… in the shortcut menu. In the dialog window, you then specify the printer, the document layout, and compact or full printout. Archiving and retrieving a project You can reduce the size of the project on the hard disk in two ways: b You create a minimized project. This reduces the opened project to its essential components and saves it as a copy. You can open and continue to edit a mini- mized project as usual. b You create a project archive. This reduces the opened project to its essential com- ponents and compresses it. The compressed project archive can only be edited further after it is retrieved. To archive a project, open it. If you make changes to the project, save it before you archive it. Then select the command Project > Archive… from the main menu. In the dialog window under File type, select either TIA Portal project minimized or TIA Por- tal project archives from the drop-down menu. If you want to create a minimized project copy, save the copy under a different name and/or a different directory. A project archive is saved with the file extension .zap12. The project name and proj- ect path can be retained. To retrieve a project, close any open projects and select the command Project > Retrieve from the main menu. In the dialog window, specify the name of the project archive with the file extension .zap12 and, in the next dialog window, specify the directory in which the retrieved project is to be saved. Then the retrieved project is opened. 1.3.4 Working with reference projects You have the capability of opening projects in addition to the current project. These projects are write-protected, i.e. they cannot be modified. You can import individual objects from these “reference projects” into the current project and you can com- pare a PLC station of a reference project to a station of the current project or a dif- ferent reference project. You open a reference project using the Open reference project icon in the project tree on the Reference projects palette. Select the desired project from the subsequent dialog window and open it. The read-only reference project is opened. You can open individual objects of this project, but you cannot change them. You can copy individual objects of the refer- ence project into the current project: Select the object in question, press and hold the mouse button, and “drag” the object into the current project. You can process the copied object further here.
  • 51. 1 Introduction 46 To compare two PLC stations, select the station and then select the command Compare > Offline/offline from the shortcut menu. The station is displayed in the left pane of the compare editor. Now press and hold the mouse button and “drag” the PLC station to be compared into the header of the right pane. This can be a station from a reference project or from a library. The compare editor marks different objects with symbols (green circle: no differences, semi-circles in various colors: differences exist, unfilled semi-circle: object does not exist). You can select individ- ual objects and start a detailed comparison via the shortcut menu if the type of the object allows it. Actions such as overwriting an object are not possible for a refer- ence project. You can compare additional stations by “dragging” the corresponding station into the header of one of the panes. 1.3.5 Creating and editing libraries Libraries are used to save reusable program components. These could include sta- tions, blocks, PLC tag tables, process images, or picture elements, for example. A project library and global libraries are available. The libraries are displayed in a task card of the task window. The library contents can be listed with the symbol open or close the element view in the Elements pallet in the Details mode, List mode, or Overview mode. The Info pallet shows further information on the selected library element. A project library which you can fill with objects is automatically created when you create a project. You can structure the contents of the project library using folders. A project library is always opened, saved, and closed together with the project. Components which can be used in multiple projects are saved in global libraries. There are global system libraries which are supplied with STEP 7, and global user libraries which you create yourself. A global library is opened, saved, and closed independent of the project. If you wish to use a global library simultaneously with other users, the library must be opened in read-only mode. To create a global library, open the Libraries task card in the task window and click on the Create new global library icon in the Global libraries palette. In the dialog window, specify the name and path of the library before you click on the Create but- ton. Using the other symbols in the Global libraries palette, you can open a global library, save the changes to the library, and close the library.
  • 52. 2.1 S7-1500 station components 47 2 SIMATIC S7-1500 automation system 2.1 S7-1500 station components A programmable controller including all I/O modules is referred to as a “station”. An S7-1500 station can contain the following components: b Rack b Power supply (PS) b Central processing unit (CPU) b Input/output modules (signal modules, SM) b Technology modules (TM) b Communication modules (CM) A station can also encompass distributed I/O which is connected to the CPU or a communication module via a PROFINET IO or PROFIBUS DP bus system. Design variants An S7-1500 station comprises one rack with a maximum of 32 slots. It can be divided into as many as three “power segments”. A power segment comprises a cur- rent source (PS or CPU) and the modules to be supplied as current sinks. The num- Fig. 2.1 S7-1500 station with CPU 1516-3 PN/DP
  • 53. 2 SIMATIC S7-1500 automation system 48 ber of modules a power segment encompasses depends on the electrical power that is provided and consumed. An additional load current supply is needed for supply- ing the sensors and actuators (Fig. 2.2). Fig. 2.2 Design variants of an S7-1500 station Maximum configuration Configuration without system power supply, one power segment Configuration with system power supply, one power segment Central configuration of an S7-1500 station S ESC OK S ESC OK S ESC OK PS PS PS CPU CPU CPU PS ... ... ... ... ... Modules Modules Modules Modules Modules The CPU is supplied with 24 V DC, and the CPU in turn supplies the other modules via the backplane bus. A system power supply (PS) supplies the CPU and the remaining modules with power via the backplane bus. Additionally, two power segments with system power supply and modules can be arranged to the right of the CPU. The rack can hold a total of 32 modules. This means that up to 30 additional modules (including system power supplies) can be arranged to the right of the CPU. Power segment Power segment Power segment Maximum 30 modules
  • 54. 2.2 S7-1500 CPUs 49 If a power supply module is used for the first power segment, it is plugged into the first slot on the far left (slot 0). The CPU is always plugged into slot 1 next to it. To the right of the CPU, there is room for another 30 modules, including any additional system power supply modules. Each module occupies one slot independent of its width. The modules must be inserted without gaps. The power supply for the module electronics and the data exchange between the modules is accomplished via the backplane bus. The backplane bus is made up of “U-connectors” between the modules. One U-type-connector is needed for each module. 2.2 S7-1500 CPUs 2.2.1 CPU versions CPUs for S7-1500 are available in several versions for different applications. Com- mon to all CPUs is the scope of control functions (operands, tag types, data types, binary logic operations, fixed-point and floating-point arithmetic, etc.). Within the versions, the CPUs differ in their memory size, the range of operands, and the pro- cessing speed (Table 2.1). Standard controllers Three versions of standard-design control- lers are currently available: CPU 1511-1 PN, CPU 1513-2 PN, and CPU 1516-3 PN/DP. It is possible to connect to Industrial Ether- net using the PN interface. Each CPU can be both an IO controller and an “intelli- gent” IO device on PROFINET IO. A CPU with a DP interface can be the DP master on PROFIBUS DP. 2.2.2 Control and display elements The control panel with the display and sta- tus LEDs above the control panel are located on the front side of the CPU. The mode switch, slot for the SIMATIC Memory Card, and interface connections are located behind the control panel. Fig. 2.3 CPU 1516-3 PN/DP
  • 55. Another Random Document on Scribd Without Any Related Topics
  • 56. The French Government, like the English, obtained success at the elections by wild promises to make Germany pay all the costs of the war. As M. Poincaré has observed, "the French people will not understand how the victors in a great war can be on the verge of bankruptcy." Consequently they think their rulers are cheating them. Educated people, in France as in England, have long since ceased to expect much from German indemnities, but the Governments still depend on their appeal to mob-psychology; and it was believed that if M. Briand ventured to make any concessions in the direction of reason or moderation he would lose his majority in the Chamber. The proposals made at the Inter-Allied Conference at Brussels and drawn up by the French expert, M. Seydoux, had been silently dropped as unsatisfying; the subsequent British proposals made at Boulogne had been rejected for the same reason. It was necessary, however, to make some definite proposals to Germany without much further delay, since the treaty had laid down May 1, 1921, as the time for a settlement. Germany was by that time to have paid a thousand million pounds on account, and was to learn the extent, finite or infinite, of the total bill. Mr. Lloyd George, as might have been expected, showed much sympathy with M. Briand in his awkward position, and agreed to a demand for reparations on a scale which was obviously fantastic. It began, reasonably enough, with a system of annuities, though the first figure was probably too high and the last figures can scarcely have been meant seriously. Germany was to pay £150,000,000 a year for the first five years; then the annual sum was to increase at intervals for the extraordinary period of forty-two years, towards the end of which time Germany was expected to pay annually £300,000,000, or half as much again every year as the total indemnity exacted from France after the war of 1870. Even that was not enough for a population which had been sedulously fed on lies by a class of politician who at times seem to possess among them no single sane and honest man. And an additional payment was demanded of a yearly sum equivalent to a duty of twelve per cent ad valorem on all German exports.
  • 57. Opinion in Germany was sharply divided. All they had to pay with was an enormous deficit on the Budget, with the prospect of presently losing the Silesian coal-mines and having prohibitive duties placed by the Allies upon their exports. One party insisted that the Government should make no promise which it could not expect to perform; another, that what Germany wanted was peace, and that they had better sign anything required of them. The first party, on the whole, carried the day. The German delegation in London made a counter-proposal based, very sensibly, on the idea of finding the present value of the forty-two-year annuities and raising that sum by means of a loan; but as they worked out the idea they favoured Germany on every detailed calculation to an extent which they must have known to be unacceptable. Apparently they expected a long and serious bargaining march. But, to most people's surprise, Mr. George leapt with alacrity at the prospect of a rupture. The proposal was rejected with every semblance of virtuous indignation. No time was allowed for the delegation to consult the German Government. A hurried second proposal, to pay the terms demanded for five years and then have the matter reconsidered, was tossed aside without consideration, and French and British troops proceeded to invade Germany, occupy more territory, and set up a new and artificial customs-barrier in the most unsuitable places, at which they proceeded themselves to collect the German customs. The plan is very expensive, and utterly unprofitable. It involves a straining if not a breach of the treaty,[3] and it is likely, if any untoward event occurs, to provoke a war of the most humiliating and embittered kind—the war of a desperate and helpless population trying to rid themselves of foreign oppressors. But it has saved M. Briand's Government. If he had agreed to accept any German terms whatever, he would have been upset for not exacting more. But if he marches French and British troops into the heart of Germany no one can accuse him of lack of spirit. So for the present all is well; and as for the future, it is conceivable that the Germans will give way and make some impossible promise. That will increase M. Briand's prestige. It is more likely that they will simply sit still and let the
  • 58. Allied armies do their worst. Then there will be a chance of carrying out one of the darling aims of the French chauvinists, and annexing, or at least separating from Germany, all the German provinces which they occupy. In face of these lunatic proceedings the German Government has behaved with considerable dignity and good sense, though naturally the German newspapers are running a little wild. It has announced its intention of appealing to the Assembly of the League of Nations, and although, not being a member, Germany cannot herself raise the subject, it may be taken as certain that some member will take it up on her behalf. This produces a most critical situation. According to the Covenant, Article III, the Assembly may be summoned to meet "from time to time as occasion may require." But presumably it is the Council which decides whether occasion does require it or not, and no one can expect the Council to favour Germany's appeal. The appeal will only be considered when the Assembly has its next regular meeting in September. We shall then see whether the Assembly possesses the force and courage necessary to discuss freely and, if necessary, to condemn the actions of the two leading European Powers; or if the two can successfully silence all criticism. For my own part I think the discussion will take place; and that, for the first time since the war, the voice of an impartial third party wilt be heard in discussing the terms imposed on Germany by her conquerors. That does not mean the realization of the "enthronement of public right on the common law of nations," but it is one of the first steps toward it. The League of Nations is in a position to say to France: "You are afraid of another attack by Germany; and to avert that danger you propose in various ways to follow a policy which will plunge Europe into continued distress. We hereby guarantee you against attack.
  • 59. Thirty-nine nations at present, who will shortly be increased to fifty- one, if not more, have signed a definite and unqualified contract to preserve your 'existing political independence and territorial integrity' against any 'external aggression'; and further, if you are attacked in such a way as not actually to threaten your territory or independence, all the States of the League will consider that an act of war has been committed against themselves, will apply the complete economic boycott to your enemy, and arrange plans for giving you immediate military support. We offer you here a far more effective guarantee of safety than you can possibly attain by your own diplomacy. But we demand in return that your foreign policy shall be frankly and sincerely a League of Nations policy; that you shall not make secret treaties, not set up inequitable tariffs, not plot the ruin of your late enemies or any other people; but work as a loyal member of the League with a view to the welfare of the whole." The League says to Germany: "You complain of the undue severity of the treaty and the impossibility of carrying out its economic provisions. Commissions already exist, and you have taken part in them, for discussing these latter and fixing the terms of the reparation which you owe. But, beyond that, if there is any clause in the treaty which appears to any member of the League as 'threatening to disturb international peace or the good understanding between nations upon which peace depends,' it will, under Article XI, be brought before the League and considered. Further, if any clause in the treaty appears to 'have become inapplicable' or to give rise to 'international conditions which might endanger the peace of the world,' under Article XXIII the Assembly of the League may at any time 'advise their reconsideration.' You complain that the terms of the present treaty were imposed upon you, without discussion, by implacable enemies who had you at their mercy; that you have been made a sort of outlaw nation, without freedom, without colonies, without ships, sitting apart while the world is administered by your enemies. But at our Assembly table you will sit as an equal and free member, with the same rights as
  • 60. those who were lately your conquerors. We submit to you that this gives you a far better chance of improving your condition than another war could. Your lot must be for some time a hard one. That is inevitable, and we cannot think it unjust. You challenged the Entente to war, you staked all on victory, and you were beaten. Now you have to make reparation. But the recuperative power of a great nation is immense; and wherever you have been subjected to a definitely unjust or dangerous condition, we offer you a remedy. Wherever you may have a dispute with any other Power, we offer you a Court of Arbitration as impartially constituted as the wit of man could devise." At present neither party quite believes this guarantee. If they did, it would probably be enough for them. It used to be said of Sir Edward Grey in the Balkan Conferences that he was not only sincere; he had the power of making other people see that he was sincere. If Europe is to be saved from new Great Wars, the Powers of the League must first of all be sincere in their undertakings, and next, they must convince the world in general of their sincerity. To that subject we must return later. CHAPTER II THE EAST But the world is not merely threatened by the prospect of future wars. It is filled with wars at the present moment. There are
  • 61. quarrels and bickerings between most of the newly liberated states in eastern Europe; there is a war, sometimes avowed and sometimes underground, between Communist Russia and all her neighbours and rivals, a war whose tentacles reach far throughout Europe and Asia; and there are wars against the British and French in various parts of the East. Let us briefly touch upon a few sample cases. I. Syria, Mesopotamia, Egypt, and India The simplest case is Syria. In 1915, during the war, a Syrian National Committee, including representatives from Damascus and Mosul, negotiated with us through Sherif Husein, and we signed a document promising to "recognize and uphold Arab independence" in an area including the whole of Arabia, Palestine, Syria, and Mesopotamia, except (1) Aden and (2) the Syrian coast. Within the independent area we merely claimed for ourselves "a measure of administrative control" in Bagdad and Bosra—not in Mosul—and reserved any special interests of France. The French were informed of the negotiations immediately. They expressed themselves content with the possession of the Syrian coast, and agreed in our promises to Husein. On the strength of this agreement the Hejaz revolted, and Feisul's army, consisting mainly of Syrian and Mesopotamian soldiers who had formerly been in the Turkish service, fought as our allies to the end of the war. An attempted rising in Syria proper was crushed with great severity by the Turks. In 1918 the Syrians welcomed the Entente armies as liberators, and were again promised their national independence, though this time it was to be under the guidance of one of the Entente Powers as mandatory. They asked that the mandatory should be England, but England had too much on her hands. The Syrians next asked for America; but America refused all mandates. France, meantime, had always claimed special rights in Syria, and England by a treaty made during the war had recognized Syria as a French interest. If they must be under France, the Syrian representatives specially
  • 62. demanded pledges that the government should be a civil government, that a certain degree of independence should be allowed to the natives, and that the country should not be occupied by French troops. How far these pledges were given and broken by the French; how far it was only we ourselves who gave assurances which we had neither the right nor the power to carry out, and thus unconsciously deceived Feisul, these are questions still in dispute. It seems unfortunately certain that the Syrians considered themselves betrayed. In the end, Syria was occupied by French troops; the native government was not recognized, but dispersed; there were raids and pitched battles, and the Emir Feisul, one of our most popular heroes during the Great War, was expelled from his throne and country. He is now an exile, and was for a time officially forbidden to land in England. France so far has neither accepted nor asked for any mandate from the League of Nations, and appears not fully to realize the obligations undertaken by her in signing the Covenant of the League, or the pledge repeated in the Reply of the Allied Powers to Germany, "that the Mandatory Powers, in so far as they may be appointed trustees by the League of Nations, will derive no benefits from such trusteeship." In Mesopotamia the British established themselves during the war after a long and chequered campaign by defeating the Turks and capturing Bagdad. The Indian soldiers and officials who were in command showed the most praiseworthy zeal and energy in proceeding at once to develop the country: to drain and irrigate, to plant crops, to establish order and good government in regions which had not known such things since a remote antiquity. The English were welcomed as liberators and made explicit promises to set up an independent Arab kingdom under a "measure of British administrative control." So much propagandist literature was poured forth on the glories of the independent Arab nation which the English were to create, that serious discontent was caused in Egypt. "Is a half-naked Arab to have independence, and am I not good
  • 63. enough to have even self-government?" wrote a highly educated Egyptian to a British official. Meantime the actual government of Mesopotamia became more and more severely effective, and remained entirely concentrated in the hands of the British. The expenses were enormous and the rate of taxation per head appears to have risen to four times what it had been under the Turks. The productivity of the country, however, was so great as to hold out a prospect of almost making up the loss, and the important oil-wells at Mosul were expected to do so completely. The native cultivators profited by the improved harvests and the increased area of cultivation, and the expenses of government were in part to be met out of the future oil profits. And the best British administrators were certainly beloved by their people. The educated classes in Bagdad, the sheikhs and the ex-Turkish officials, became restive at the high taxation and the indefinite delay of "Arab independence." The turbulent desert tribes and the disorderly elements in general were disgusted at the good policing. But there was no general discontent, because personal assurances were given to leading Arabs that the Covenant of the League of Nations, which Great Britain had signed, laid down definitely that Mesopotamia was to be recognized provisionally as an independent nation and that the mandate was to be given to Great Britain. There would be, it was promised, a native Government with a British Resident to advise it, as in an Indian native state. Doubtless the Government would also ask for other help from England, especially in the matter of public works, irrigation, and the engineering of the oil-wells. But the League issued no mandate. According to rumour, it had offered a scheme of mandate to the Great Powers concerned, and one at least of them had refused the terms. The precious oil, it was discovered, had already been divided by a private treaty between France and England, which left only a small fraction for the Mesopotamians and none for the rest of the world. There was no attempt to set up an Arab Government. Some beginnings were
  • 64. occasionally made of associating Arab officials with the Englishmen who did the real work of governing. But they were not whole- hearted. A letter was accidentally divulged in which an English soldier said of the high Arab official attached to him, "I will soon make him lick my boots." There were symptoms of disaffection, non- payment of taxes, the resurgence of old discredited Turkish and German agents, open rebellions. And the Government replied by numerous executions and punitive expeditions. The bombing aeroplane, which had revealed itself as a very convenient weapon of war, proved an utterly disastrous instrument of police. The British liberators, who had come by the special desire of the population to establish a free Arab nation helped by friendly advice from British Residents, ended, according to Colonel Lawrence's estimate, in killing ten thousand Arabs and setting the whole country in a blaze of war. An army of over one hundred thousand men is now reconquering it. And at the same time, perhaps at the eleventh hour and perhaps too late altogether, that section in the British Government which believed in the League of Nations and wished scrupulously to carry out in victory the pledges it had given in time of distress, prevailed to bring about a definite change of policy. Sir Percy Cox and Mr. Philby were sent to Mesopotamia with instructions, so it was stated, to reverse the previous policy and try to set up that independent Arab Government which we had promised in 1915 and again in 1917, and ought to have set working before the end of 1919. The "rebellion" will doubtless be crushed, and the native Government may or not be successfully organized. There is a strong desire among the Arab leaders to have it based on a treaty of alliance with Great Britain after the Egyptian model, and not on Article XXII of the Covenant. In any case the task is infinitely more difficult than it was before so much blood was shed, and the original friendship of the Arabs turned to hatred. On simple men executive action makes a much deeper impression than policy. In Mesopotamia our policy itself was bad because it was not consistent. It was a muddle of two contradictory policies, resulting in confusion and hypocrisy. But the executive action seems to have been such as to make the chances of even the best policy very precarious. A
  • 65. government which multiplies the taxes by four and shoots and hangs its subjects in batches is seldom excused because of its good drainage or its progressive ideas. The story in Egypt is shorter and perhaps less unhappy, but essentially similar. Early in the war, when Turkey joined the enemy, we declared a British protectorate over Egypt, accompanied by a promise to give the country independence or free institutions at the end of the war. This in itself was a perfectly good and defensible policy, though, to be correct, it should have had the concurrence of Egypt. But in the course of the war Egypt became full of discontent. Experienced officials were wanted elsewhere, and inexperienced substitutes made mistakes. Labour in great quantities was required for the Army, and was obtained through native contractors or headmen, who practised the ordinary Oriental methods of extortion and corruption while professing to act by orders of the English. The peasant who was dragged off to forced labour, or compelled to buy his freedom by heavy bribes, blamed the British for both. At one time Egypt was garrisoned by large numbers of Australian troops, who had the habit of thinking of all Asiatics as "blackfellows," and whose ways of dealing with "blackfellows" were not of the gentlest. The seed was thus sown of a passionate hatred, partly just and partly unjust; and feeling was already ripe for explosion when it transpired at the end of the war that the British Government had no apparent intention of fulfilling their promise to confer on Egypt "free institutions." Open rebellion was impossible, owing to the presence of overpowering numbers of British troops; but a time of danger and infinite trouble, well controlled by Lord Allenby, led at last to the appointment of a Commission under Lord Milner, which grasped its almost desperate problem with great courage and skill. Among other curious misfortunes, it turned out that the word "protectorate" had been translated into Arabic by a term which denoted the sort of protection that is extended to an outcast or a person with no national rights. The Commissioners were met on their arrival by a universal boycott, and by constant threats of
  • 66. assassination. They lived in considerable danger, and no Egyptian would be seen speaking to them. But tact and patience gradually broke down the boycott; and a much larger measure of agreement was obtained with Zaghlul and the moderate Nationalists than had at the outset seemed possible. After inquiry, the Commission has taken the line of recommending, first, the cancellation of the Capitulations, or special privileges granted to European states, which have paralyzed the progress of Egypt for several generations; the separation from Egypt of the Canal zone, as a special British interest and of vital importance to the Empire; the retention of British advisers in two posts, the ministries of Justice and of Finance—a safeguard without which the European Powers would not consent to forgo the special protection of the Capitulations; and in other respects the establishment of Egypt as an independent national state. As far as is possible to forecast, it looks as if this settlement would succeed. The history of recent events in India is too large and complicated a subject to be dealt with here. But in its main outline it has been curiously similar to that of the other regions of the East. A wonderful response from almost the whole continent to the need of Great Britain during the war; blunders of the War Office and reactions of discontent; German propaganda; Turkish and Pan-Islamic intrigue; repressive Press Acts and Conspiracy Acts; passive resistance, dangerous riots, and widespread conspiracies; the severe and sometimes lawless coercion of the Punjab; the savage massacre of Amritsar, and at last, amid great obstructions and hesitations, the passing of the Montagu-Chelmsford Act and the conferring of a new and liberal constitution upon India. It is the same story as in Egypt and Mesopotamia. So much time was wasted in doing the wrong thing, that when at last resort was had to the right thing the right time was past. The Indian Government was faced with great difficulties and very real dangers. Its errors have been so signal and notorious that public opinion is apt to forget or ignore the admirable skill and patience with which most officials steered their districts through periods of extreme strain. But reforms long promised were
  • 67. delayed until too late. The executive plunged into excesses which will not be forgotten for centuries. And when the long-hoped-for reforms at last have come, it may be that they come to a people too exasperated to give them a fair trial. II. An Eastern Policy The policies here described have been so full of errors that it is hard to derive from them a very clear moral. Government without principle has many conveniences; if life consisted of isolated moments it might be entirely successful. But life is continuous, and human beings have memories and expectations. And almost any policy that is continuous and consistent and true to itself is more likely to succeed in the end than a mixture of momentary expedients and plunges for safety. It is conceivable that a perfectly resolute and unfaltering military coercion of India, Egypt, and Mesopotamia might have succeeded. But such a policy, if it was ever possible, is certainly so no longer; and also it would hardly be a policy for avoiding international strife. And that is the subject we are considering. If we look below the mistakes of policy and administration committed by the British or French Governments, we find underneath the surface a profound and instinctive resentment of the Moslem East against the Western Powers. The Western Powers, which for convenience we term Christian, have been for some centuries far more efficient than any Moslem state. The West has increasingly taken charge of the East; beaten it, managed it, "run" it, governed it, and in some cases exploited it. Western government, or at least British government, has been just, incorruptible, impartial, strong, intelligent, far beyond ordinary Eastern standards. It may have been unsympathetic and grossly expensive; it may, in spite of the unexampled personal integrity of the whole governing class, have led to the presence in Eastern countries of undesirable money- seekers. But it has been, on the whole, essentially and undeniably good, efficient government, backed by a military power which
  • 68. committed few excesses, lived on its own pay, and never failed in an emergency. No one who studies even superficially the history of average Oriental governments, from Morocco or Bokhara to Oudh, can be surprised or sorry that they have been superseded by the better governments of the West. The peoples of the East themselves have gained by Western penetration; nay, more, they are conscious of their need of the West. But they have had too much of it; they resent it, and they are frightened of it. The Moslem nations have lost their independence one after another. At the beginning of the Great War only one Moslem Power remained free and powerful—the Turkish Empire. At the end of the war there was not one. The Turks were not popular in the East. The Syrians and Arabs hated them almost as much as their Christian subjects did. The Turkish peasants of Anatolia suffered cruelly under the exactions of Constantinople, especially in the matter of military service. But all through the Moslem East ran the consciousness that the Sultan, with all his faults, was their own man. He was the acknowledged Head of the great majority of Moslems in the world. He was, above all, the last barrier that seemed to protect them from the overwhelming flood of Western aggression, and the last great Moslem figure which enabled them to preserve their self-respect. While the Turkish Empire stood, the Moslem peoples, though fallen on evil days, could think of Islam as an independent and even an imperial entity. In places, doubtless, they had to kiss the feet of dogs; but their Caliph still ruled masses of Christian subject populations and still was master of the capital city of the world. With the fall of Turkey, the last free Moslem state was gone. Not here and there, but everywhere throughout the whole world, the faithful were set beneath the heel of these rich, drunken, pork-eating idolaters with their indecent women, their three Gods, and their terrific material civilization. "Pan-Islamism," as Mr. Toynbee says, "is only an extreme example of the feeling at the back of almost any modern Oriental movement we may examine. It may take aggressive forms, but the essence of it is a defensive impulse. Its appeal is to fear, and
  • 69. if the fear of the West could be lifted from off the minds of the Oriental peoples, its mainspring would be gone." The problem of our Eastern policy is to remove that fear. And that ought not to be so very difficult. The essential fact to grasp is that the East needs us far more than we need the East. We need markets; but that idea is only suggested to us by the fact that Eastern peoples want our goods. We do almost everything better than they do. They want our textiles, our knives and tools, our engines and ploughs, our books, our learning. They cannot make railways or ships without us. They cannot work their mines or oil- wells except by Western help. They cannot really govern their countries satisfactorily without European advisers. The language of Article XXII of the League of Nations Covenant is quite correct when it says that "Certain communities formerly belonging to the Turkish Empire have reached a stage of development where their existence as independent nations can be provisionally recognized, subject to the rendering of administrative advice and assistance by a mandatory until such time as they are able to stand alone." At present "they are not yet able to stand by themselves under the strenuous conditions of the modern world." They ought to want us, and if left alone they would want us. We have frightened them into fighting and hating us by forcing ourselves upon them instead of waiting to be asked. We have conferred incalculable benefits on India: the benefit of protection from invasion, of comparative protection from plague and famine, of social order, of administrative justice, to say nothing of roads and railways, and the enlivening force of Western knowledge. We have immensely increased the prosperity of Egypt, we have put down all kinds of Oriental abuses and protected the fellaheen against corvées and extortions and tortures. We were in process of beginning to perform the same services for Mesopotamia. But in the latter regions at any rate—for in India our roots are far deeper and the problem is more complex—the people did not want us. We only held them and did them good by force. And the chief reason why they did not want
  • 70. us was fear. We came to them with machine guns and bombing planes as conquerors and masters, having destroyed the only free Moslem Power; and they found it difficult to believe in our good intentions. We came to them, most unfortunately, also with specious promises which we made in time of need and broke in the days of victory. The right policy is something very easy to state and extremely difficult to carry out, even for a single-minded and clear-headed Government. It needs first, perhaps, an effort of imaginative understanding more far-reaching than has ever yet in history been demanded of an Imperial Power. Only those who understand the East can win the respect and confidence of the East. But in the meantime, if we cannot fully understand, there is a way at least to make ourselves understood. Justice is the passport to confidence all the world over. And our first business is to act quite simply and sincerely up to all our engagements. We undertook certain obligations when we signed Article XXII of the Covenant. We should make the "wishes of these communities a principal consideration" in deciding whether we should go to them at all. We should really treat them "as independent nations," and should honestly give them "administrative advice and assistance until they shall be able to stand alone." And we should not allow our minds to be confused by thoughts of gain, nor our advice to take the form of horse, foot, and artillery. Two illustrations may make this point clear. An experienced and very successful administrator was asked a few weeks ago whether he would accept the post of adviser to a certain Moslem Government. He said, "Yes, upon one condition. That there is no British army anywhere in the country." That is the right and wise spirit. The second is even simpler. One of the most obvious and matter-of-course obligations laid upon imperial administrators and civil servants is that they shall not embark in trade or in any way make a profit out of the administration of their office. That is the right rule. The Empire should set an example of the behaviour that it expects from its best servants.
  • 71. When we apportioned to ourselves the German colonies, we specially declined to take over their public debts. And when protest was raised against this proceeding, we stated definitely in our official Reply: "It would be unjust to make this responsibility rest on the Mandatory Powers, which, in so far as they may be appointed trustees by the League of Nations, will derive no benefit from such trusteeship." Is it entirely quixotic and idealist to hope that, even in post-war conditions, a great nation may remain true to her word? It seems at least as if the only alternative was to hold these Eastern territories by armed force, and that is no longer possible. It might be possible to hold by force India alone, or Egypt alone, or Mesopotamia alone. It is not possible so to hold all three. We must govern by consent of the governed or not all. CHAPTER III RUSSIA AND ITS BORDERS Another group of wars and threats of war has its centre in Moscow. All the States on the borders of Russia—Finland, Lithuania, Poland, the Ukraine, Hungary, Rumania, the new republics of Georgia, Armenia, and Azerbaijan, and the kingdom of Persia—are either at war or in fear of war or just recovering from war with Russia, or from civil war fomented by Russian agents and propagandists. Inside Russia itself, civil war has never ceased since the first outbreak of the Revolution in 1917. It is true that the civil war has been largely helped by foreign munitions and stirred up by foreign intrigues. But that only shows that—as the world is now organized—there is something in the present Russian Government which makes foreigners as well as Russians wish to take up arms against it. It
  • 72. may have been—I think strongly that it was—exceedingly unwise for the foreign Governments to intervene in the domestic troubles of Russia, but no one can pretend that the civil war was entirely created by foreigners. The rebellions were there before the foreigners joined in, and it is even thought by good judges that the opposition to the Bolsheviks might by this time have been successful if it had not been damned in Russian eyes by its foreign alliances. For us the question is how the Russian Revolution has become such a plenteous and intense cause of strife. It is, of course, impossible to pass judgment on the whole of a vast movement with the very inadequate information that is now accessible to an average Englishman about Russia. Even the French Revolution, which has been studied by thousands of observers and historians, is not yet judged. The sum of infamies and high achievements is too complicated to add up. And the Russian Revolution is probably even harder to value than the French. I. The Civil War It would be a mistake to forget the elements of simple early- Christian brotherhood which seem to characterize the Russian peasant. It was well known before the war how the members of a workmen's artel, or trade community, when trade was bad, would divide their earnings equally and all starve, if need be, together, without any attempt by the luckier workmen to save themselves at the expense of the others. The glowing descriptions of Mr. Stephen Graham cannot be entirely without any basis in fact. And the people of Tolstoy and Dostoievsky have evidently a most rare capacity for sainthood and martyrdom, as well as for aberration of mind. Present-day Russia has been described by an eminent Socialist as "a nation of artists governed by brutes," and the phrase is probably true of the old Russia also, and the Russia of centuries back. Communism comes easily in Russia, and so does submission to tyranny.
  • 73. It must also be remembered that the Great War, among its many aspects, involved the most frightful and bewildering oppression of the poor and weak. As was said quite truly: "Millions of poor men in divers regions of the world have been dragged suddenly and without any previous action of their own into a quarrel which they neither made nor desired nor understood, and in the course of that quarrel have been subjected again and again to the very extremity of possible human suffering." The war naturally and inevitably created in Europe a passionate wish for some revolutionary transformation of a world in which rich and clever people in parliaments and governments had the power of inflicting such pains upon the poor. The peculiarity of the Bolshevik movement was, as one of its rare English admirers puts it, not so much that it wanted a particular kind of Socialism or Communism, but that it wanted it now. The world has seen many revolutions and many Socialist governments; but they have never really established that paradise of the poor which was advertised in their prospectuses and doubtless nursed in their hopes. Most failed altogether. And those which succeeded went wrong. They coöperated with "bourgeois Liberals." They extended the franchise, they improved the condition of the working classes, they established well-to-do workmen and peasants with a stake in the country and a conservative bias; but they never really did what was wanted. They always stopped short. They developed the middle-class virtues. They left still in existence a capitalist class which preached the merits of thrift and hard work and was interested in trade; and of course they left always somewhere an oppressed class. The under dog was still under. The Bolshevik remedy was very direct and simple. It was to disarm everybody who had any share in prosperity, and distribute firearms to those who had nothing else. Only when he was armed and the rest of the people unarmed could the real proletarian—the man who had no savings, no talent, no education, no notable good qualities, nothing that makes for success in life—hope to beat the men who always outstripped him. It is strange that even in a moment of extreme misery such a theory could have established itself in any
  • 74. country as a principle of government. But the military collapse of Russia gave it a unique chance. The common soldiers, anxious to fight no more, already possessed arms. They had merely to murder their officers and the thing was done. The rest of the population was unarmed and helpless. And meantime the peasants, though almost untouched by revolutionary ideas, were amenable to one particular bribe. The revolutionaries offered all the peasants of Russia their masters' land without any payment. They could simply take the land, and kill or not kill the owner as they pleased. There was no punishment for such killing. According to strict Communist principles, the land was not to remain in the peasants' possession. It was to be the property of the State. But this principle had to be dropped in order to induce the peasants to coöperate with the revolutionary town workmen. Whatever may be said in favour of this revolution, there can at least be no surprise at what Lenin calls "the frantic resistance" of the upper and middle classes of Russia. The policy of the Government was announced on January 23, 1919: "The present is the period of destruction and crushing of the capitalist system of the whole world. . . . In order to establish the dictatorship of the proletariate it is necessary to disarm the bourgeoisie and its agents and to arm the proletariate." It is to be dictatorship in the strict sense: the power of a man with a gun to do what he likes with those who have no guns. There is to be no democracy or representation of the dispossessed classes. If they were represented they might recover power. Only those known to be faithful to the new Government are to vote. All persons of property must be dispossessed, from landlords to small shop-keepers. Rich peasants must go; even "middle peasants" at one time had to go; only the poorest peasants and the poorest town workmen should rule, assisted, of course, by those educated people who would accept the new régime and establish by deeds beyond doubt their hatred of the bourgeoisie. The control of a country by a small minority is always difficult. It needs methods of "terror." But this minority had first to acquire the control and then to maintain it. Its task was more difficult and its
  • 75. methods had to be more violent than those of its predecessors. The "terror" of the old Czarist Government or of the French Revolution must be superseded by the more drastic method of what was called "mass terror." The secret police, whose activities had made hideous the record of the Czarist Government, and who had fled for their lives at the first outbreak of the Lvof and Kerensky Revolution, returned from their lurking-places to put themselves at the disposal of the Bolsheviks. This legion of devils had something to sell which the new Government badly needed. On the analogy of the Comité de Salut Public there was established the All-Russian Extraordinary Commission for stamping out all trace of resistance to the new order. Spies were placed everywhere (Proclamation, October 17, 1918). No distinction was to be made between Czarist reactionaries and unorthodox Socialists, such as the Mensheviks and Social Revolutionaries (Russkaya Zhizn, May 10, 1919). Enormous numbers of "hostages" were arrested. At any sign of conspiracy outside, large numbers of these were shot. The assassination of the Bolshevik Uritzky was repaid by the execution of five hundred citizens. Yet, just as in the most furious days of the French Revolution, the terrorists were always complaining that there was not enough terror. "The continual discovery of conspiracies in our rear . . . the insignificant extent of serious repressions and mass shootings of White Guards and bourgeoisie on the part of the Soviets, show that notwithstanding frequent pronouncements urging mass terror against the Social Revolutionaries, White Guards, and bourgeoisie, no real terror exists" (Official Weekly of the All-Russian Extraordinary Commission, No. 1, Moscow, September 21, 1918). Trotzky in comforting language explained that the object of the mass terror was not really the extermination of all non-communists, or all Russians who did not attain the full standard of poverty and orthodoxy. "The proletariate says: 'I shall break your will because my will is stronger than yours, and I shall force you to serve me.' . . . Terror as the demonstration of the will and strength of the working class is historically justified" (Trotzky in Izvestia, January 10, 1919). Eventually, of course, when all Russia was submissive and all Europe
  • 76. Communist, there would be a gentler régime, and the proletariate would show their true beauty of character. And it would be a mistake to ignore the real reforms which seem to have been carried through in certain social services, notably in the care of children, the attempt to develop popular education and the putting down of drink. But in the meantime terror was reënforced by ingenious petty persecutions and indignities, reënforced by starvation. Those who joined the Red Army had three times the ration of food allowed to several categories of the civil population. No one can wonder that suicide— that last irrefutable evidence of unbearable oppression—became extraordinarily common, especially among the educated classes,[4] and that "frantic resistance" broke out where it had any prospect of success. II. Russia's Neighbours But what of the war outside Russia? Why could not the Russians be allowed to conduct their revolution and settle their form of government by themselves? It would be very desirable if they could. And doubtless it is the aim to be striven for. But the trouble is that Bolshevism is to its adherents a revelation and a new gospel, and they have the same zeal for converting the rest of the world as had the French Revolutionaries or the followers of Mohammed. "The program of the Communist Party is not merely a program of liberating the proletariate of one country; it is the program of liberating the proletariate of the world" (authorized pamphlet by N. Bukharin, July 24, 1918). This is to be achieved by "a bloody torturing and heroic fight." The methods are to include every known form of intrigue, corruption, forgery, and the like, and the plan is to be the same in all countries. Revolutionary workmen are to be armed, including common soldiers, tramps, prisoners, and all the utterly dispossessed of the earth, except, of course, those who have Conservative, Liberal, or Labour Party views; and then are to work their proletarian will on the rest of the community. The "national will" is to be disregarded: "The interests of Socialism stand far above
  • 77. the interest of the right of nations to self-determination" (Trotzky, Izvestia, March 8, 1918). "All our hopes for the definitive triumph of Socialism are based on this conviction and on this scientific prevision, i.e. that a revolution like the Russian can be produced in all the nations of Europe" (ib.). In the Treaty of Brest-Litovsk the Bolsheviks were compelled to sign a clause promising not to conduct "any agitation against the State and military institutions of Germany." "But both the Russian Government as a whole and its accredited representative in Berlin never concealed the fact that they were not observing this article, and did not intend to do so" (Joffe, Izvestia, January 1, 1919). The belief that by some single violent change in social, political, or economic conditions human life as a whole can be suddenly transfigured is one that clings to many minds, and by no means the stupidest minds, of the present age, in spite of much disillusioning experience. It does seem to them at moments as if only some one thing was wrong with the world, and as if that one flaw must surely be definite and remediable: some one bold step is all that is needed —say, the abolition of the family, or of property, or of competition, or of wages, or of interest, or of compulsory law, or some other of the fundamental institutions of society. To our ancestors it was the abolition of heresy. To the Turks, the abolition of all Christians in Turkey. To such people at such times the normal method of trying to correct the worst abuses by persuading the majority that they ought to be corrected, and of seeking individually to live a better life and to help one's neighbours, seems tedious and ineffective, if not hypocritical. But one thing that is clear is that revolution means "frantic resistance," and the stronger the faith and energy behind the revolution the more deep-reaching is the resistance likely to be. Russia's neighbours see what seems to them the infinite misery and impoverishment and retardation inflicted by Bolshevism; and they are naturally indignant and alarmed at the secret propaganda of Bolshevism within their own borders. In normal times perhaps they
  • 78. need not have been afraid. But since the war every state is unstable; every state has a large discontented class. The small republics in the Caucasus, barely able to support themselves in freedom, are maddened to find their constitution threatened by Russian bribes, their malcontents and bad characters armed with Russian rifles and machine guns, and their public men assassinated. Georgia and Armenia are probably doomed. Hungary and Finland have gone Bolshevik and returned, each process being accompanied by hideous persecutions and murders, the reprisals being naturally the worst. Germany, in spite of all treaties, has been exposed to constant propaganda and has had one or two bad outbreaks of violence. Poland has been and still is—whether through her own bad policy or otherwise—on the brink of compulsory Bolshevism. Human nature being what it is, and human politics a little worse than private human nature, it is inevitable that Russia's neighbours should be constantly afraid of her and intensely anxious to see her again under some more normal government; some government which, whatever its political bias, would leave its neighbours to govern themselves and accept the ordinary conventions of civilized society. Nay, one can even understand anti-Russian policies that seem at first sight intolerably aggressive. The Poles, among other demands, are anxious for the independence of White Russia, the region north of the Pripet, of which Minsk is the chief town. They wish it either annexed to Poland or else made independent, but at any rate cut off from Russia. The claim seems monstrous. But it has its excuse. The White Russian peasantry are said to be peculiarly ignorant and devoid of national feeling; the land-owners and well-to-do classes are mostly Poles. Is it surprising that the Poles of Poland hate the idea of handing their countrymen over to a Russia which will, as a matter of course, set the peasants to burn their houses, destroy their cattle, and hunt them themselves down like vermin? And when that is done, they reflect, Bolshevism will only be nearer to Warsaw. Like the early Moslems, the true Bolsheviks care more for their faith than for territory. In dealing with Lithuania, which is at present a
  • 79. comparatively quiet little peasant republic, the Russians offered her a large slice of territory beyond what she was entitled to or wanted. Why? Because it was a thoroughly Bolshevized area, and might be expected to spread the faith—or the poison—into all Lithuania. A nation, or a government, in that state of mind cannot be surprised if its neighbours regard it with anxiety. It is a curious fact that revolutionists so often regard themselves as pacifists. Many were even conscientious objectors during the war, and there is no reason to doubt that they were sincere. But they do seem to be confused thinkers. To hate your neighbours, whom you know, and love your neighbours' enemies, whom you do not know, is a consistent and not uncommon frame of mind; though the element of love in it seems less important and prominent than the hate. But to expect European peace and good-will by means of a revolution in all countries argues a lack of understanding not far removed from madness. Every revolutionary outburst since the war has been marked by ferocious cruelties and followed by still more ferocious reprisals. Revolution leads not to peace, but to reciprocal reigns of terror, first Red and then White, till the exhaustion of suffering produces some sort of equilibrium. The war, among its many evil lessons, has inculcated the gospel of impatience and of force. "When you want a thing, take it from some one, and if he resists, knock him down." It is the doctrine which destroys human societies as it destroys the peace in men's own hearts. If we want peace, we must simply unlearn that creed and go back to the old Liberal doctrine that is at the root of sound politics everywhere: "If you think something is right, try to persuade your fellow citizens of it; try your hardest, but remember that you may be wrong, and until you succeed, have patience."
  • 80. CHAPTER IV PRE-WAR AND POST-WAR CAUSES OF STRIFE The war has left behind it a great number of small wars or guerrillas. Most of them have their explanation in some ordinary excess of nationalism or revenge or greed. The Serbs, intoxicated with their new greatness, are still causing war in Albania and Montenegro. The Rumanians recently invaded Hungary, in spite of all the thunders of the Peace Conference, because they had been robbed by Austria- Hungary and wanted revenge and reparation. The Hungarians have alarmed all their neighbours and forced them into a defensive alliance, which now calls itself the "Little Entente." The Lithuanians and Poles have fought, but been reconciled by the mediation of the League of Nations. The Armenians have been massacred again, under the eyes of the French army of occupation in Cilicia, where they had gathered under a repeated guarantee of safety given by France and England. The Turkish Nationalists are holding out very unsuccessfully in the centre of Anatolia against a Greek army carrying out the directions of the Supreme Council. The Turkish peasants are increasingly reluctant to take arms again. The Koreans have helplessly declared their right to independence from Japan, and are apparently being reduced by a terrible persecution. These are the mere belated effervescence of the passions of the Great War. The hate and pride which are the basis of nationalism and which were so violently stimulated by the events of the war cannot be expected to die out at once. It was calculated a short time ago that there were twenty-seven "wars" of one sort or another in
  • 81. progress. But they will presumably simmer down as social conditions become more normal. It is interesting to observe that two of the greatest causes of war, according to the judgment of normal times, are now not actively operating. Before 1914, if one was asked to name the main causes of war, the answer would have been, first, competitive armaments, and, second, protective tariffs and the competition for markets. These causes will remain fully as dangerous for the future, but it so happens that none of the existing wars is directly due to either. I. Armaments In one sense, indeed, armaments are actually operating now as a cause of war. There are far too many firearms lying about. America, England, and France have made very lavish gifts or sales of lethal weapons to various bodies with whom they sympathized. And the arms have by no means always stayed in the place for which they were intended. Guns which we sent to Denikin were sold by corrupt officials to the Bolsheviks, and passed on by them to the Afghans to use against us on the Indian frontier. Such things cause some deaths and some laughter, but are not permanent evils. No European nation, except those actually compelled, has made much progress towards disarmament. It is said that Great Britain has actually made the greatest reduction, but both in numbers of men and in expenditure our standard is fantastically higher than what was forced upon us by German competition in 1914. It is impossible to reduce our forces in a really drastic way as long as our commitments are so large and—perhaps we must add—our policy so inconsistent and provocative. Peace with Russia, a settlement with Mesopotamia and Egypt on the lines laid down by the Covenant and the Milner Report, the evacuation of Ireland, the execution of the Montagu-Chelmsford reforms in India, and the extension of similar reforms to Burmah and the much-suffering Ceylon, will permit us
  • 82. really to envisage for the first time a satisfactory measure of disarmament. The air force is already greatly reduced. The vast size of the navy appears to be utterly unjustified, at any rate by conditions in Europe. The French army is far beyond the economic powers of France to support. The same seems to be true of Italy, and is certainly true of Serbia, which is still calling conscripts to the colours. Greece is vastly overarmed; but Greek policy, though erring on the ambitious side, has probably been more sagaciously guided under M. Venizelos than any in Europe. The fall of that great man, due mainly to the prolonged economic distresses of Greece, will probably cause a resurgence of Mustapha Kemal and the Turkish nationalists. Meantime the Russian conscript army, though apparently ill-armed and ill-supplied, is overwhelming in numbers and is led by officers of the old régime, experienced and not absolutely incompetent. The Russian army is far the greatest and, in a political sense, the most dangerous, in the world. But it is not the actual armaments, ruinous as they are, that are the essential poison to civilized society. It is the competition in armaments. That has now been abolished throughout Europe. Slowly, unequally, reluctantly, the armaments which, in Lord Grey's words, went uphill under the lead of Germany, are now, under the same lead, groping their way downhill. There is only one great nation which, if words are to be believed, thinks seriously of starting a competition in armaments. It has been announced, more than once, by the American Government that, like Germany in the years before 1914, they have arranged a naval programme which will effectually put an end to the British command of the seas and give the United States "world primacy" (see speech of Mr. Daniels, Secretary of the Navy, in the Times of September 1, 1920). Since the British Empire is a scattered series of communities dependent for their communications upon the sea, and in particular since the population of Great Britain is absolutely dependent for its food on the free use of sea transport, it has been generally acknowledged in Europe that the sea-power of Great Britain was necessary to its existence. British sea-power has never been challenged except by
  • 83. definite enemies in pursuit of a definite war policy. If the United States were seriously to embark on the same policy as the late German Government, it seems as if all other causes of war must sink into insignificance beside this gigantic and deliberate one. But, in spite of some bewildering symptoms, it can hardly be believed that this conclusion is possible, at any rate until America has definitely and finally refused to be a member of the League of Nations. Relations between Great Britain and America have of late been dangerously strained, partly owing to causes outside our Government's control, but in part owing to the scandal caused in America by certain developments of the Peace Treaty, and by the excesses of the Government forces in Ireland. A wise policy may help to heal this growing breach, and if America accepts in some form or other membership of the League of Nations, it ought to be possible in friendly discussion to arrive at some understanding on the question of naval armaments. The problem of armaments is put in the very forefront of the Covenant of the League, immediately after the constitution of the League itself. By Article VIII—
  • 84. The members of the League recognize that the maintenance of peace requires the reduction of[Pg 105] national armaments to the lowest point consistent with (a) national safety and (b) the enforcement by common action of national obligations. The Council, taking account of the geographical situation and circumstances of each State, shall formulate plans for such reduction for the consideration and action of the several Governments. Such plans shall be subject to reconsideration and revision at least every ten years. After these plans shall have been adopted by the several Governments the limits of armament therein fixed shall not be exceeded without the concurrence of the Council. The article goes on to recognize that private munition factories are objectionable, and must somehow be dealt with, and to lay down that all members must interchange "full and frank information" about their armaments and programmes. And the next article constitutes a permanent Commission to advise the Council on the execution of the provisions of Article VIII and other similar matters. The cautious language of the Covenant on this subject is due to the inherent difficulty of the subject itself. It would be absurd to lay down that every member of the League must disband its forces forthwith; the League could hardly undertake to go to war in order to compel some strong Power to disarm. And it is obvious that different nations need different degrees of armament. The chief difficulty is that disarmament ought in justice and prudence to be simultaneous all round. It is only by the compulsion of a lost war that Germany has been compelled to disarm while her enemies stand round her with large armies, and even in Germany the process is evidently very difficult to enforce. Too many rifles and machine guns have got loose in private hands. No League could compel Poland or Rumania to disarm while the Red Army of Russia stood waiting across the frontier; or compel Great Britain to disarm while the northwest frontier of India is constantly attacked, while the Bolsheviks are in Persia and British officials are besieged in
  • 85. Welcome to our website – the perfect destination for book lovers and knowledge seekers. We believe that every book holds a new world, offering opportunities for learning, discovery, and personal growth. That’s why we are dedicated to bringing you a diverse collection of books, ranging from classic literature and specialized publications to self-development guides and children's books. More than just a book-buying platform, we strive to be a bridge connecting you with timeless cultural and intellectual values. With an elegant, user-friendly interface and a smart search system, you can quickly find the books that best suit your interests. Additionally, our special promotions and home delivery services help you save time and fully enjoy the joy of reading. Join us on a journey of knowledge exploration, passion nurturing, and personal growth every day! ebookbell.com