Automating with SIMATIC S7 400 inside TIA Portal
1st Edition Hans Berger pdf download
https://ebookname.com/product/automating-with-
simatic-s7-400-inside-tia-portal-1st-edition-hans-berger/
Get Instant Ebook Downloads – Browse at https://ebookname.com
Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...
Automating with STEP 7 in STL and SCL SIMATIC S7 300
400 Programmable Controllers 6th Edition Hans Berger
https://ebookname.com/product/automating-with-step-7-in-stl-and-
scl-simatic-s7-300-400-programmable-controllers-6th-edition-hans-
berger/
Automating with SIMATIC S7 1500 Configuring Programming
and Testing with STEP 7 Professional 1st Edition Hans
Berger
https://ebookname.com/product/automating-with-
simatic-s7-1500-configuring-programming-and-testing-with-
step-7-professional-1st-edition-hans-berger/
STEP 7 in 7 Steps A Practical Guide to Implementing S7
300 S7 400 Programmable Logic Controllers 1ST Edition
Clarence T. Jones
https://ebookname.com/product/step-7-in-7-steps-a-practical-
guide-to-implementing-s7-300-s7-400-programmable-logic-
controllers-1st-edition-clarence-t-jones/
Upgrading Fixing PCs For Dummies 7th ed Edition Andy
Rathbone
https://ebookname.com/product/upgrading-fixing-pcs-for-
dummies-7th-ed-edition-andy-rathbone/
The transcripts 3rd ed. digitized & modernized in 2008
Edition Xexoxial Editions
https://ebookname.com/product/the-transcripts-3rd-ed-digitized-
modernized-in-2008-edition-xexoxial-editions/
The parallel brain the cognitive neuroscience of the
corpus callosum 1st Edition Eran Zaidel
https://ebookname.com/product/the-parallel-brain-the-cognitive-
neuroscience-of-the-corpus-callosum-1st-edition-eran-zaidel/
India and the Anglosphere Race Identity and Hierarchy
in International Relations Alexander E Davis
https://ebookname.com/product/india-and-the-anglosphere-race-
identity-and-hierarchy-in-international-relations-alexander-e-
davis/
Applied Calculus Fifth Edition Geoffrey C. Berresford
https://ebookname.com/product/applied-calculus-fifth-edition-
geoffrey-c-berresford/
Unstitching Rex Trueform The Story of an African
Factory 1st Edition Ilze Wolff
https://ebookname.com/product/unstitching-rex-trueform-the-story-
of-an-african-factory-1st-edition-ilze-wolff/
JUNOS High Availability Best Practices for High Network
Uptime 1st Edition James Sonderegger
https://ebookname.com/product/junos-high-availability-best-
practices-for-high-network-uptime-1st-edition-james-sonderegger/
Berger
Automating with SIMATIC S7-400 inside TIA Portal
Automating with
SIMATIC S7-400
inside TIA Portal
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
ISBN 978-3-89578-383-8
Editor: Siemens Aktiengesellschaft, Berlin and Munich
Publisher: Publicis Publishing, Erlangen
© 2013 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 the subsystems of an automation solu-
tion 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
automation components using a single system platform and tools with uniform
operator interfaces. These requirements are fulfilled by the SIMATIC automation
system, which provides uniformity for configuration, programming, data manage-
ment, and communication.
This book describes the hardware components of the SIMATIC S7-400 automation
system with standard controllers, and the features provided for designing a distrib-
uted control concept with PROFIBUS and PROFINET. To permit communication with
other automation systems, the controllers offer integrated bus interfaces for multi-
point interface (MPI), PROFIBUS, and Industrial Ethernet.
The STEP 7 Professional engineering software makes it possible to use the complete
functionality of the S7-400 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 languages for generation of the user program:
Ladder logic (LAD) with a graphic representation similar to a circuit diagram, func-
tion block diagram (FBD) with a graphic representation based on electronic circuit-
ry systems, statement list (STL) with formulation of the control task as a list of com-
mands at machine level, a high-level Structured Control Language (SCL) similar to
Pascal, and finally GRAPH as a sequencer with sequential processing 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-400
automation system with the STEP 7 Professional engineering software Version 11
with Service Pack 4.
Erlangen, June 2013 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-400 automation system.
Introduction to the SIMATIC STEP 7 Professional V11 engineering software.
The basis of the automation solution: Creating and editing a project.
SIMATIC S7-400 automation system
Overview of SIMATIC S7-400 modules: Design of an automation system, CPUs, signal, func-
tion 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 compound data types, data types for block parameters, point-
ers, and user data types.
Program execution
How the CPU module 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 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 contents of the book at a glance
7
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 S7-GRAPH sequential controller
What a sequential control is, and what its elements are: sequencers, steps, transitions, and
branches. How a sequential control is configured using S7-GRAPH.
Description of the control functions
Basic functions: Functions for binary signals: binary logic operations, memory functions,
edge evaluations, SIMATIC and IEC timer and counter functions.
Digital functions: Functions for digital tags: transfer, comparison, arithmetic, math, conver-
sion, shift, and logic functions.
Program flow control: Working with status bits, programming jump functions, calling and
closing blocks, using the master control relay.
Online operation and program testing
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 properties of S7 basic communication and of S7 communication, and with what commu-
nication functions they are programmed.
The communication functions used to implement open user communication.
How PtP communication is implemented.
Annex
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 user program is tested offline using the S7-PLCSIM simulation software.
How the Web server is configured in the CPU, and what features it offers.
How block parameters and local tags are saved in the memory.
Table of contents
8
Table of contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.1 Overview of the S7-400 automation system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.1.1 SIMATIC S7-400 programmable controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.1.2 Overview of STEP 7 Professional V11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.1.3 Five programming languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.1.4 Execution of the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.1.5 Data management in the SIMATIC automation system . . . . . . . . . . . . . . . . . . . 30
1.2 Introduction to STEP 7 Professional V11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.2.1 Installing STEP 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.2.2 Automation License Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.2.3 Starting STEP 7 Professional . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.2.4 Portal view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.2.5 Help information system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.2.6 The windows of the Project view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.2.7 Adapting the user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
1.3 Editing a SIMATIC project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
1.3.1 Structured representation of project data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.3.2 Project data and editors for a PLC station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.3.3 Creating and editing a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
1.3.4 Creating and editing libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2 SIMATIC S7-400 automation system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.1 Components of an S7-400 station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.2 S7-400 CPUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.2.1 CPU versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.2.2 Control and display elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.2.3 SIMATIC memory card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.2.4 Memory areas in an S7-400 station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.2.5 Bus interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
2.2.6 IF 964-DP interface module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.3 Signal modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.3.1 Digital input modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.3.2 Digital output modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.3.3 Analog input modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
2.3.4 Analog output module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.4 Function modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.5 Communication modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
2.6 Other modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
2.6.1 Interface modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
2.6.2 Power supply modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
2.7 SIPLUS S7-400 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Table of contents
9
3 Device configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.2 Configuring a station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.2.1 Adding a PLC station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.2.2 Adding a module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.2.3 Adding an expansion unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.3 Parameterization of modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.3.1 Parameterization of CPU properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.3.2 Addressing modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.3.3 Assigning parameters to signal modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.4 Configuring the network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.4.1 Introduction, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.4.2 Networking stations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
3.4.3 Node addresses in a subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.4.4 Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
3.4.5 Configuring an MPI subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
3.4.6 Configuring a PROFIBUS subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
3.4.7 Configuring a PROFINET subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
3.4.8 Configuring a PtP subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
4 Tags, addressing, and data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
4.1 Operands and tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
4.1.1 Introduction, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
4.1.2 Operand areas: inputs and outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
4.1.3 Operand area: bit memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
4.1.4 Operand area: data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
4.1.5 Operand area temporary local data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
4.2 Addressing of operands and tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
4.2.1 Signal path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
4.2.2 Absolute addressing of tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
4.2.3 Symbolic addressing of tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
4.2.4 Addressing constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
4.3 Indirect addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
4.3.1 Memory-indirect addressing with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
4.3.2 Register-indirect addressing with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
4.3.3 Working with the address registers with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
4.3.4 Direct access to complex local tags with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
4.3.5 Indirect addressing with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
4.4 Elementary data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
4.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
4.4.2 Bit-serial data types BOOL, BYTE, WORD, and DWORD . . . . . . . . . . . . . . . . . . . 122
4.4.3 BCD numbers BCD16 and BCD32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
4.4.4 Fixed-point data types with sign INT and DINT . . . . . . . . . . . . . . . . . . . . . . . . . 122
4.4.5 Floating-point data type REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
4.4.6 Data type CHAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
4.4.7 Data types for durations and points in time . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
4.5 Complex data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
4.5.1 STRING data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
4.5.2 Data type ARRAY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
4.5.3 Data type STRUCT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Table of contents
10
4.6 Parameter types and pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
4.6.1 Parameter types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
4.6.2 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
4.6.3 “Variable” ANY pointer with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
4.6.4 “Variable” ANY pointer with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
4.7 PLC data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
4.8 Start information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
5 Program execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
5.1 Operating states of the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
5.1.1 STOP operating state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
5.1.2 STARTUP operating state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
5.1.3 RUN operating state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
5.1.4 HOLD operating state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
5.1.5 Reset CPU memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
5.1.6 Restoring the factory settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
5.1.7 Retentive behavior of operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
5.2 Creating a user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
5.2.1 Program draft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
5.2.2 Program execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
5.2.3 Block types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
5.2.4 Editing block properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
5.2.5 Block interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
5.2.6 Example of use of block parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
5.3 Calling blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
5.3.1 General information on calling of code blocks . . . . . . . . . . . . . . . . . . . . . . . . . 165
5.3.2 Calling functions (FC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
5.3.3 Calling function blocks (FB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
5.3.4 “Passing on” of block parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
5.4 Startup program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
5.4.1 Startup organization blocks OB 100, OB 101, and OB 102 . . . . . . . . . . . . . . . 171
5.4.2 Determining a module address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
5.4.3 Parameterization of modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
5.5 Main program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
5.5.1 Organization block OB 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
5.5.2 Process image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
5.5.3 Cycle time and response time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
5.5.4 Minimum cycle time and background processing . . . . . . . . . . . . . . . . . . . . . . 184
5.5.5 Compress, hold, stop, and protect program . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
5.5.6 Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
5.5.7 Determine system time and OB runtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
5.5.8 Runtime meter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
5.6 Interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
5.6.1 Introduction to interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
5.6.2 Priority classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
5.6.3 Time-of-day interrupts, organization blocks OB 10 to OB 17 . . . . . . . . . . . . . 199
5.6.4 Time-delay interrupts, organization blocks OB 20 to OB 23 . . . . . . . . . . . . . . 202
5.6.5 Cyclic interrupts, organization blocks OB 30 to OB 38 . . . . . . . . . . . . . . . . . . 205
5.6.6 Hardware interrupts, organization blocks OB 40 to OB 47 . . . . . . . . . . . . . . . 207
5.6.7 Interrupts for DPV1 organization blocks OB 55 to OB 57 . . . . . . . . . . . . . . . . 208
5.6.8 Synchronous cycle interrupts, organization blocks OB 61 to OB 64 . . . . . . . 209
Table of contents
11
5.6.9 Reading additional interrupt information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
5.7 Error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
5.7.1 Causes of errors and error responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
5.7.2 Synchronous error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
5.7.3 Enabling and disabling synchronous error processing . . . . . . . . . . . . . . . . . . 215
5.7.4 Enter substitute value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
5.7.5 Asynchronous errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
5.7.6 Disable, delay, and enable interrupts and asynchronous errors . . . . . . . . . . . 224
5.8 Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
5.8.1 Diagnostics interrupt, organization block OB 82 . . . . . . . . . . . . . . . . . . . . . . . 226
5.8.2 Read system state list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
5.8.3 Read start information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
5.8.4 Determine connection status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
5.8.5 System diagnostics with Report System Errors . . . . . . . . . . . . . . . . . . . . . . . . . 231
5.9 Configure alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
5.9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
5.9.2 Configuring alarms according to the message numbering . . . . . . . . . . . . . . . 236
5.9.3 Message blocks for PLC alarms with instance data . . . . . . . . . . . . . . . . . . . . . . 241
5.9.4 Message blocks for PLC alarms without instance data . . . . . . . . . . . . . . . . . . . 244
5.9.5 Blocks for working with alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
5.9.6 Configuring a user diagnostic alarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
5.9.7 CPU alarm display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
6 Program editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
6.2 PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
6.2.1 Editing PLC tag tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
6.2.2 Defining PLC tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
6.2.3 Exporting and importing a PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
6.2.4 Constants tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
6.3 Programming a code block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
6.3.1 Creating a new code block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
6.3.2 Working area of program editor for code blocks . . . . . . . . . . . . . . . . . . . . . . . . 258
6.3.3 Specifying code block properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
6.3.4 Programming a block interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
6.3.5 Programming a control function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
6.3.6 Editing tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
6.3.7 Working with program comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
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 . . . . . . . . . . . . . . . . . . . . . . . . 270
6.4.3 Defining properties for data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
6.4.4 Declaring data tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
6.4.5 Entering data tags in global data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
6.5 Compiling blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
6.5.1 Starting the compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
6.5.2 Compiling SCL blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
6.5.3 Eliminating errors following compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
6.6 Program information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
6.6.1 Cross-reference list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
6.6.2 Assignment list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Table of contents
12
6.6.3 Call structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
6.6.4 Dependency structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
6.6.5 Consistency check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
6.6.6 Memory utilization of the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
7 Ladder logic LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
7.1.1 Programming with LAD in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
7.1.2 Program elements of ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
7.2 Programming binary logic operations with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . 286
7.2.1 NO and NC contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
7.2.2 Series and parallel connection of contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
7.2.3 T branch, open parallel branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
7.2.4 Negating result of logic operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
7.2.5 Edge evaluation of a binary tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
7.2.6 Comparison contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
7.3 Programming memory functions with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
7.3.1 Simple coil, assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
7.3.2 Set and reset coils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
7.3.3 Retentive response due to latching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
7.3.4 Coils with time response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
7.3.5 Coils with counter response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
7.4 Programming Q boxes with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
7.4.1 Memory boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
7.4.2 Edge evaluation of current flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
7.4.3 SIMATIC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
7.4.4 SIMATIC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
7.4.5 IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
7.4.6 IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
7.5 Programming EN/ENO boxes with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
7.5.1 Transfer function, MOVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
7.5.2 Arithmetic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
7.5.3 Math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
7.5.4 Conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
7.5.5 Shift functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
7.5.6 Word logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
7.6 Controlling the program flow with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
7.6.1 Working with status bits in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
7.6.2 EN/ENO mechanism with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
7.6.3 Jump functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
7.6.4 Block functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
7.6.5 Master Control Relay (MCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
8 Function block diagram FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
8.1.1 Programming with FBD in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
8.1.2 Program elements of the function block diagram . . . . . . . . . . . . . . . . . . . . . . 317
8.2 Programming binary logic operations with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . 318
8.2.1 Scanning for signal states “1” and “0” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
8.2.2 Programming a binary logic operation in the function block diagram . . . . . 319
Table of contents
13
8.2.3 AND function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
8.2.4 OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
8.2.5 Exclusive OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
8.2.6 Combined binary logic operations, negating result of logic operation . . . . . 321
8.2.7 T branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
8.2.8 Edge evaluation of binary tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
8.2.9 Comparison functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
8.3 Programming standard boxes with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
8.3.1 Assign box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
8.3.2 Set and reset boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
8.3.3 Standard boxes with time response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
8.3.4 Standard boxes with counter response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
8.4 Programming Q boxes with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
8.4.1 Memory boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
8.4.2 Edge evaluation of result of logic operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
8.4.3 SIMATIC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
8.4.4 SIMATIC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
8.4.5 IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
8.4.6 IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
8.5 Programming EN/ENO boxes with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
8.5.1 Transfer function MOVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
8.5.2 Arithmetic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
8.5.3 Math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
8.5.4 Conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
8.5.5 Shift functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
8.5.6 Word logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
8.6 Controlling the program flow with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
8.6.1 Working with status bits in the function block diagram . . . . . . . . . . . . . . . . . . 340
8.6.2 EN/ENO mechanism with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
8.6.3 Jump functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
8.6.4 Block functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
8.6.5 Master Control Relay (MCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
9 Statement list STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
9.1.1 Programming with STL in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
9.1.2 Structure of an STL statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
9.2 Programming binary logic operations with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
9.2.1 Processing of a binary logic operation, operation step . . . . . . . . . . . . . . . . . . . 350
9.2.2 Scanning for signal states “1” and “0” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
9.2.3 Programming a binary logic operation in the statement list . . . . . . . . . . . . . . 353
9.2.4 AND function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
9.2.5 OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
9.2.6 Exclusive OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
9.2.7 Combined binary logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
9.2.8 Control of result of logic operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
9.3 Programming memory functions with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
9.3.1 Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
9.3.2 Setting and resetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
9.3.3 Edge evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
Table of contents
14
9.4 Programming timer and counter functions with STL . . . . . . . . . . . . . . . . . . . . . . 361
9.4.1 SIMATIC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
9.4.2 SIMATIC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
9.4.3 IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
9.4.4 IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
9.5 Programming digital functions with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
9.5.1 Transfer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
9.5.2 Comparison functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
9.5.3 Arithmetic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
9.5.4 Math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
9.5.5 Conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
9.5.6 Shift functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
9.5.7 Word logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
9.6 Controlling the program flow with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
9.6.1 Working with status bits in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . . 380
9.6.2 EN/ENO mechanism with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
9.6.3 Jump functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
9.6.4 Jump list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
9.6.5 Loop jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
9.6.6 Block functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
9.6.7 Master Control Relay (MCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
9.7 Further STL functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
9.7.1 Accumulator functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
9.7.2 Adding of constants to accumulator 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
9.7.3 Decrementing, incrementing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
9.7.4 Null instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
10 Structured Control Language SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
10.1 Introduction to programming with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
10.1.1 Programming with SCL in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
10.1.2 SCL statements and operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
10.2 Programming binary logic operations with SCL . . . . . . . . . . . . . . . . . . . . . . . . . 401
10.2.1 Scanning for signal states “1” and “0” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
10.2.2 AND function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
10.2.3 OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
10.2.4 Exclusive OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
10.2.5 Combined binary logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
10.2.6 Negating result of logic operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
10.3 Programming memory functions with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
10.3.1 Value assignment of a binary tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
10.3.2 Setting and resetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
10.3.3 Edge evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
10.4 Programming timer and counter functions with SCL . . . . . . . . . . . . . . . . . . . . . 406
10.4.1 SIMATIC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
10.4.2 SIMATIC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
10.4.3 IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
10.4.4 IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
10.5 Programming digital functions with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
10.5.1 Transfer function, value assignment of a digital tag . . . . . . . . . . . . . . . . . . . 410
10.5.2 Comparison functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
10.5.3 Arithmetic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
10.5.4 Math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Table of contents
15
10.5.5 Conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
10.5.6 Shift functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
10.5.7 Word logic operations, logic expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
10.6 Controlling the program flow with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
10.6.1 Working with the ENO tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
10.6.2 EN/ENO mechanism with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
10.6.3 Control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
10.6.4 Block functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
11 S7-GRAPH sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
11.1.1 What is a sequential control? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
11.1.2 Properties of a sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
11.1.3 Program for a sequential control, quantity framework . . . . . . . . . . . . . . . . . 433
11.1.4 Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
11.1.5 Procedure for configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
11.2 Elements of a sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
11.2.1 Steps and transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
11.2.2 Jumps in a sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
11.2.3 Branching of a sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
11.2.4 GRAPH-specific tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
11.2.5 Permanent instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
11.2.6 Step and transition functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
11.2.7 Processing of actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
11.3 Configuring a sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
11.3.1 Programming the GRAPH function block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
11.3.2 Configuring the sequencer structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
11.3.3 Programming steps and transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
11.3.4 Programming permanent instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
11.3.5 Configuring block-independent alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
11.3.6 Attributes of the GRAPH function block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
11.3.7 Using the GRAPH function block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
11.4 Testing the sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
11.4.1 Loading the GRAPH function block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
11.4.2 Settings for program testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
11.4.3 Using operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
11.4.4 Synchronization a sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
11.4.5 Testing with program status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
12 Basic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
12.1 Binary logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
12.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
12.1.2 Working with binary signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
12.1.3 AND function, series connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
12.1.4 OR function, parallel connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
12.1.5 Exclusive OR function, non-equivalence function . . . . . . . . . . . . . . . . . . . . . . 465
12.1.6 Negate result of logic operation, NOT contact . . . . . . . . . . . . . . . . . . . . . . . . . 466
12.2 Memory functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
12.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
12.2.2 Standard coil, assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
Table of contents
16
12.2.3 Single setting and resetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
12.2.4 Dominant setting and resetting, memory function . . . . . . . . . . . . . . . . . . . . 471
12.2.5 Edge evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
12.3 SIMATIC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
12.3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
12.3.2 Programming a timer function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
12.3.3 Timer response as pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
12.3.4 Timer response as extended pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
12.3.5 Timer response as ON delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
12.3.6 Timer response as retentive ON delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
12.3.7 Timer response as OFF delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
12.4 IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
12.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
12.4.2 Pulse generation TP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
12.4.3 ON delay TON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
12.4.4 OFF delay TOF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
12.5 SIMATIC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
12.5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
12.5.2 Programming a counter function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
12.5.3 Principle of operation of a counter function . . . . . . . . . . . . . . . . . . . . . . . . . . 499
12.5.4 Enabling a counter function with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
12.6 IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
12.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
12.6.2 Up counter CTU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
12.6.3 Down counter CTD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
12.6.4 Up/down counter CTUD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
13 Digital functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
13.1 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
13.2 Transfer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
13.2.1 General information on the “simple” transfer function . . . . . . . . . . . . . . . . 508
13.2.2 MOVE box with LAD and FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
13.2.3 Loading and transferring with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
13.2.4 Value assignments with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
13.2.5 Copying and filling a data area in the work memory . . . . . . . . . . . . . . . . . . . 513
13.2.6 Control memory area with MCR dependency . . . . . . . . . . . . . . . . . . . . . . . . . 515
13.3 Comparison functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
13.3.1 Execution of “simple” comparison function . . . . . . . . . . . . . . . . . . . . . . . . . . 518
13.3.2 Comparison function T_COMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
13.3.3 Comparison function S_COMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
13.4 Arithmetic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
13.4.1 General function description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
13.4.2 Data types and status bits for an arithmetic function . . . . . . . . . . . . . . . . . . 523
13.4.3 Execution of the arithmetic function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
13.4.4 Arithmetic functions for date and time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
13.5 Math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
13.5.1 General function description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
13.5.2 General execution of a math function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
13.5.3 Trigonometric functions SIN, COS, TAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
13.5.4 Arc functions ASIN, ACOS, ATAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
13.5.5 Additional math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
Table of contents
17
13.6 Conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
13.6.1 Implicit data type conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
13.6.2 Data type conversion of fixed-point numbers . . . . . . . . . . . . . . . . . . . . . . . . . 532
13.6.3 Data type conversion of floating-point numbers . . . . . . . . . . . . . . . . . . . . . . . 535
13.6.4 Data type conversion for date/time with T_CONV . . . . . . . . . . . . . . . . . . . . . . 537
13.6.5 Data type conversion for data type STRING with S_CONV . . . . . . . . . . . . . . . 539
13.6.6 Data type conversion of hexadecimal numbers . . . . . . . . . . . . . . . . . . . . . . . . 540
13.6.7 Scaling and unscaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
13.6.8 Further conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
13.7 Shift functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
13.7.1 General function description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
13.7.2 General execution of a shift function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
13.7.3 Shift to right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
13.7.4 Shift to left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
13.7.5 Rotate to right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
13.7.6 Rotate to left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
13.7.7 Rotating by the condition code bit CC1 (STL) . . . . . . . . . . . . . . . . . . . . . . . . . . 549
13.8 Logic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
13.8.1 Word logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
13.8.2 Invert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
13.8.3 Code bit and set bit number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
13.8.4 Selection and limiting functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
13.9 Functions for strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
14 Program flow control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
14.1 Status bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
14.1.1 Description of the status bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
14.1.2 Controlling the status bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
14.1.3 Setting and resetting the result of logic operation . . . . . . . . . . . . . . . . . . . . . 563
14.1.4 Controlling the binary result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
14.1.5 Evaluating the status bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566
14.2 Jump functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
14.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
14.2.2 Absolute jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
14.2.3 Conditional jump functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570
14.2.4 Jump functions depending on status bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
14.3 Block end functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
14.3.1 Block end function RET (LAD and FBD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
14.3.2 Block end functions BEC, BEU, and BE (STL) . . . . . . . . . . . . . . . . . . . . . . . . . . 576
14.3.3 RETURN statement (SCL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
14.4 Calling of code blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
14.4.1 General information on block calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
14.4.2 Calling a function (FC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
14.4.3 Calling a function block (FB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
14.4.4 Change to a block without block parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
14.5 Data block functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
14.5.1 Opening a data block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
14.5.2 Additional data block functions with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
14.5.3 Creating, deleting, and testing data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
14.6 Master control relay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
14.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
14.6.2 MCR dependency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
Table of contents
18
14.6.3 MCR area and MCR zone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
14.6.4 MCR area and MCR zone with a block change . . . . . . . . . . . . . . . . . . . . . . . . . 589
14.6.5 Statements for the master control relay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
15 Online operation and program test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
15.1 Connection of a programming device to the PLC station . . . . . . . . . . . . . . . . . . 593
15.1.1 Settings on the programming device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
15.1.2 Connecting the programming device to the PLC station . . . . . . . . . . . . . . . . 594
15.1.3 Switching on online mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
15.2 Transferring project data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
15.2.1 Loading project data for the first time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
15.2.2 Reloading the project data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
15.2.3 Protection of the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
15.2.4 Editing of online project without offline project . . . . . . . . . . . . . . . . . . . . . . 600
15.2.5 Working with the memory card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
15.3 Block handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
15.3.1 Downloading a block to the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
15.3.2 Editing the online version of a block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
15.3.3 Deleting a block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
15.3.4 Packing the work memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
15.3.5 Offline/online data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
15.3.6 Comparing blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
15.4 Hardware diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
15.4.1 Status displays on the modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
15.4.2 Diagnostic information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
15.4.3 Diagnostic buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
15.4.4 Diagnostic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
15.4.5 Online tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
15.4.6 Further diagnostic information via the programming device . . . . . . . . . . . 612
15.5 Testing the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
15.5.1 Process and test modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
15.5.2 Defining the call environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
15.5.3 Testing with program status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
15.5.4 Testing in single step mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
15.5.5 Monitoring of PLC tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
15.5.6 Monitoring of data tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
15.5.7 Testing with watch tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
15.5.8 Enable peripheral outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
15.5.9 Testing with the force table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
16 Distributed I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
16.1 Introduction, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
16.2 ET 200 distributed I/O system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
16.2.1 ET 200L . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
16.2.2 ET 200M . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
16.2.3 ET 200S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
16.2.4 ET 200iSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
16.2.5 ET 200R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
16.2.6 ET 200eco . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
16.2.7 ET 200pro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
Table of contents
19
16.3 PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
16.3.1 PROFINET IO components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
16.3.2 Addresses with PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
16.3.3 Special PROFINET configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
16.3.4 Configuring PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
16.3.5 Coupling modules for PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646
16.3.6 Real-time communication with PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . 647
16.4 PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
16.4.1 PROFIBUS DP components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
16.4.2 Addresses with PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
16.4.3 Configuring PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
16.4.4 Coupling modules for PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
16.4.5 Special functions for PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
16.5 System blocks for distributed I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
16.5.1 System blocks for PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
16.5.2 System blocks for PROFIBUS DP and PROFINET IO . . . . . . . . . . . . . . . . . . . . . 668
16.5.3 System block for PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672
17 Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674
17.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674
17.2 S7 basic communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
17.2.1 Basics of station-internal S7 basic communication . . . . . . . . . . . . . . . . . . . . . 675
17.2.2 Configuring of station-internal S7 basic communication . . . . . . . . . . . . . . . 676
17.2.3 System blocks for station-internal S7 basic communication . . . . . . . . . . . . . 676
17.2.4 Basics of station-external S7 basic communication . . . . . . . . . . . . . . . . . . . . . 678
17.2.5 Configuring of station-external S7 basic communication . . . . . . . . . . . . . . . 679
17.2.6 System blocks for station-external S7 basic communication . . . . . . . . . . . . . 679
17.3 S7 Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
17.3.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
17.3.2 Configuring S7 communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684
17.3.3 One-way data exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
17.3.4 Two-way data exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
17.3.5 Control functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
17.3.6 Monitoring functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
17.3.7 Send print data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
17.4 Open user communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
17.4.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
17.4.2 Establishing and terminating connections . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
17.4.3 Data transfer with TCP native or ISO-on-TCP . . . . . . . . . . . . . . . . . . . . . . . . . . 696
17.4.4 Data transfer with UDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
17.5 Point-to-point communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
17.5.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
17.5.2 Data transmission with the 3964 (R) procedure . . . . . . . . . . . . . . . . . . . . . . . 702
17.5.3 Data transmission with the RK 512 protocol . . . . . . . . . . . . . . . . . . . . . . . . . . 702
17.5.4 Data transmission with the ASCII driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
18 Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
18.1 Working with source files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
18.1.1 General procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
18.1.2 Programming a logic block in the source file . . . . . . . . . . . . . . . . . . . . . . . . . 708
Table of contents
20
18.1.3 Programming a data block in the source file . . . . . . . . . . . . . . . . . . . . . . . . . 714
18.1.4 Programming a PLC data type in the source file . . . . . . . . . . . . . . . . . . . . . . 715
18.2 Migrating projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
18.3 Simulation with the TIA Portal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
18.3.1 Differences from a real CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
18.3.2 Starting and saving the simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
18.3.3 Using the simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
18.3.4 Testing the program with the simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
18.3.5 Additional functions of PLCSIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
18.4 Web server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
18.4.1 Enable web server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
18.4.2 Reading out web information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
18.4.3 Standard web pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
18.5 Storage of local tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
18.5.1 Storage in global data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
18.5.2 Storage in instance data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732
18.5.3 Storage in the temporary local data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
18.5.4 Data storage of the block parameters of a function (FC) . . . . . . . . . . . . . . . . 734
18.5.5 Data storage of the block parameters of a function block (FB) . . . . . . . . . . . 736
18.5.6 Data storage of a local instance in a multi-instance . . . . . . . . . . . . . . . . . . . . 739
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
1.1 Overview of the S7-400 automation system
21
1 Introduction
1.1 Overview of the S7-400 automation system
SIMATIC S7-400 is the modular control system for the medium and upper perfor-
mance range (Fig. 1.1). Different versions of the controllers allow the performance
to be matched to the respective application. Depending on the requirements, the
programmable controller can be modularly expanded by input/output modules for
digital and analog signals in up to 21 racks with up to 18 modules.
Further expansion with input/output modules is made possible by the distributed
I/O over PROFIBUS or PROFINET. Special designs of these modules for increased
mechanical demands allow their installation directly on site on the machine or
plant. STEP 7 is used to configure and program the SIMATIC S7-400controllers. Data
Fig. 1.1 Components of the SIMATIC S7-400 automation system
SIMATIC NET
SIMATIC DP STEP 7
Professional
S
S
SIMATIC S7-400 automation system
SIMATIC S7-400
1 Introduction
22
exchange between the controllers, the distributed I/O, and the programming device
is carried out over SIMATIC NET.
1.1.1 SIMATIC S7-400 programmable controller
The most important components of an S7-400 programmable controller are shown
in Fig. 1.2.
The CPU contains the operating system and the user program. The user program is
in the load memory of the CPU, which can be expanded with a SIMATIC Memory
Card (MC). The user program is executed in the CPU's work memory. The bus inter-
faces present on the CPU establish the connection to other programmable control-
lers.
Fig. 1.2 Components of an S7-400 controller
Expansion rack
Central rack
IM module
Components of an S7-400 controller
The racka are available
in various widths:
18, 9, and 4 slots.
CPU module
PS module
SM modules
FM modules
CP modules
Rack
On the racks are
pluggable:
1.1 Overview of the S7-400 automation system
23
Signal modules (SM) are responsible for the connection to the controlled plant.
These input and output modules are available for digital and analog signals.
The function modules (FM) are signal-preprocessing, “intelligent” I/O modules
which prepare 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. Function modules are responsible for handling functions which the CPU
cannot usually execute quickly enough, such as counting pulses, positioning, or
controlling drives.
The CP modules allow data transfer in excess of the possibilities provided by the
standard interfaces on the CPU with regard to protocols and communication func-
tions.
In the case of an expansion, the interface modules (IM) connect the central rack
to a maximum of 21 expansion racks.
Finally, a power supply module provides the internal voltages required by the pro-
grammable controller. Load voltages or load currents must be provided via external
load current supply units.
1.1.2 Overview of STEP 7 Professional V11
STEP 7 is the central automation tool for SIMATIC. STEP 7 requires authorization (li-
censing) and is executed on the current Microsoft Windows operating systems.
Configuration of an S7-400 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 project, create a new project, or migrate
a project. A “project” is a data structure containing 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 (Fig. 1.3):
b In the Devices & networks portal you configure the programmable controllers,
i.e. you position the modules in a rack and set their parameters.
b In the PLC programming portal you create the user program in the form of indi-
vidual sections referred to as “blocks”.
b The Visualization portal provides the most important tools for configuration and
simulation of HMI systems using SIMATIC WinCC.
b The Online & Diagnostics portal allows you to connect the programming device
online to a CPU. You can control the CPU's operating modes and transfer and test
the user program.
The Project view is an object-oriented view with several windows whose contents
change depending on the current activity. 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 (Fig. 1.4). A further
window – the inspector window – displays the properties of the selected module,
1 Introduction
24
Fig. 1.3 Tools in the Start portal of STEP 7 Professional V11
Fig. 1.4 Example of a Project view: working area of the device configuration
Another Random Document on
Scribd Without Any Related Topics
“It was too bad, Oliver, not to come for me!” she cried.
“I meant to be home in time; I did indeed, Jane,” he answered; “but
somehow the evening slipped on.”
“Were you at Mr. Paul’s?”
“No; I was with MacEveril.”
“At billiards, I suppose!—and it’s very foolish of you, Oliver, for you
know you can’t afford billiards.”
“I can’t afford anything, Janey, as it seems to me,” returned Oliver,
kicking up the dust in the road as they walked along. “Billiards don’t
cost much; it’s only the tables: anyway, MacEveril paid for all.”
“Has MacEveril talked any more about going away?”
“He talks of nothing else; is full of it,” answered Oliver. “His uncle
says he is not to go; and old Paul stopped him at the first half-word,
saying he could not be spared from the office. Dick says he shall
start all the same, leave or no leave.”
“Dick will be very silly to go just now, when we are about to be so
gay,” remarked Jane, “There’s the picnic coming off; and the dance
at Mrs. Jacob Chandler’s; and no end of tea-parties.”
For just now the neighbourhood was putting on a spurt of gaiety,
induced to it perhaps by the lovely summer sunshine. Oliver’s face
wore a look of gloom, and he made no answer to Jane’s remark.
Several matters, cross and contrary, were trying Oliver Preen; not
the least of them that he seemed to make no way whatever with
Miss Emma.
When we left school for the midsummer holidays that year, Mr. and
Mrs. Todhetley were staying at Crabb Cot. We got there on Friday,
the eleventh of June.
On the following Monday morning the Squire went to his own small
sitting-room after breakfast to busy himself with his accounts and
papers. Presently I heard him call me.
“Have you a mind for a walk, Johnny?”
“Yes, sir; I should be glad of one.” Tod had gone to the Whitneys for
a couple of days, and without him I felt like a fish out of water.
“Well, I want you to go as far as Massock’s. He is a regular cheat;
that man, Johnny, needs looking after—— What is it, Thomas?”
For old Thomas had come in, a card between his fingers. “It’s Mr.
Gervais Preen, sir,” he said, in answer, putting the card on the
Squire’s table. “Can you see him?”
“Oh, yes, I can see him; show him in. Wait a bit, though, Thomas,”
broke off the Squire. “Johnny, I expect Preen has come about that
pony. I suppose we may as well keep him?”
“Tod said on Saturday, sir, that we should not do better,” I answered.
“He tried him well, and thinks he is worth the price.”
“Ay; ten pounds, wasn’t it? We’ll keep him, then. Mr. Preen can come
in, Thomas.”
Some few days before this the Squire had happened to say in
Preen’s hearing that he wanted a pony for the two children to ride,
Hugh and Lena. Preen caught up the words, saying he had one for
sale—a very nice pony, sound and quiet. So the pony had been sent
to Crabb Cot upon trial, and we all liked him. His name was Taffy.
Mr. Preen came into the room, his small face cool and dark as usual;
he had driven from Duck Brook. “A fine morning,” he remarked, as
he sat down; but it would be fiery hot by-and-by, too hot for the
middle of June, and we should probably pay for it later. The Squire
asked if he would take anything, but he declined.
“What of the pony—Taffy—Squire?” went on Mr. Preen. “Do you like
him?”
“Yes, we like him very well,” said the Squire, heartily, “and we mean
to keep him, Preen.”
“All right,” said Mr. Preen. “You will not repent it.”
Then they fell to talking of horses in general, and of other topics. I
stayed on, sitting by the window, not having received the message
for Massock. Mr. Preen stayed also, making no move to go away;
when it suddenly occurred to the Squire—he mentioned it later—that
perhaps Preen might be waiting for the money.
“Ten pounds, I think, was the price agreed upon,” observed the
Squire with ready carelessness. “Would you like to be paid now?”
“If it does not inconvenience you.”
The Squire unlocked his shabby old bureau, which stood against the
wall, fingered his stock of money, and brought forth a ten-pound
bank-note. This he handed to Preen, together with a sheet of paper,
that he might give a receipt.
When the receipt was written, Mr. Preen took up the note, looked at
it for a moment or two, and then passed it back again.
“Would you mind writing your name on this note, Squire?”
The Squire laughed gently. “Not at all,” he answered; “but why
should I? Do you think it is a bad one? No fear, Preen; I had it from
the Old Bank at Worcester.”
“No, I do not fear that,” said Preen, speaking quietly. “But since a
disagreeable trouble which happened to me some years ago, I have
always liked, when receiving a bank-note, to get, if possible, the
donor’s name upon it in his own handwriting.”
“What was the trouble?”
“I was playing cards at the house of a man of fashion, who was
brother to an earl, and lived in a fashionable square at the West End
of London, and I had a ten-pound note paid me, for I won, by a man
who, I understood, had recently retired with honours from the army,
a Major D——. I will not give you his name. The next day, or next
but one, I paid this note away to a tradesman, and it was found to
be forged; cleverly forged,” repeated Preen, with emphasis.
“What did you do?” asked the Squire.
“I got Major D.’s address from the house where we had played,
carried the note to him, and inquired what it meant and whence he
got it. Will you believe, Mr. Todhetley,” added the speaker, with slight
agitation, “that the man utterly repudiated the note, saying——”
“But how could he repudiate it?” interrupted the Squire, interested in
the tale.
“He said it was not the note he had paid me; he stood it out in the
most impudent manner. I told him, and it was the pure truth, that it
was impossible there could be any mistake. I was a poor man, down
on my luck just then, and it was the only note I had had about me
for some time past. All in vain. He held to it that it was not the note,
and there the matter ended. I could not prove that it was the note
except by my bare word. It was my word against his, you see, and
naturally I went to the wall.”
The Squire nodded. “Who was at the loss of the money?”
“I was. Besides that, I had the cold shoulder turned upon me. Major
D. was believed; I was doubted; some people went so far as to say I
must have trumped up the tale. For some time after that I would not
take a bank-note from any man unless he put his signature to it, and
it has grown into a habit with me. So, if you don’t mind, Squire——”
The Squire smiled goodnaturedly, drew the bank-note to him, and
wrote upon the back in a corner, “J. Todhetley.”
“There, Preen,” said he, returning it, “I won’t repudiate that.
Couldn’t if I would.”
Mr. Preen put the note into his pocket-book, and rose to leave. We
strolled with him across the front garden to the gate, where his gig
was waiting.
“I have to go as far as Norton; and possibly after that on to
Stoulton,” he remarked, as he took the reins in his hand and got in.
“You will have a hot drive of it,” said the Squire.
“Yes; but if one undertakes business it must be attended to,” said
Preen, as he drove off.
A TRAGEDY
II.—IN THE BUTTERY
I
The windows of the room, called the Buttery, which Mr. Preen used
as an office in his house at Duck Brook, were thrown open to the
warm, pure air. It was about the hottest part of the afternoon. Oliver
Preen sat back in his chair before the large table covered with
papers, waiting in idleness and inward rebellion—rebellion against
the untoward fate which had latterly condemned him to this dreary
and monotonous life. Taking out his pocket-handkerchief with a fling,
he passed it over his fair, mild face, which was very hot just now.
To-day, of all days, Oliver had wanted to be at liberty, whereas he
was being kept a prisoner longer than usual, and for nothing. When
Mr. Preen rode out after breakfast in the morning he had left Oliver a
couple of letters to copy as a beginning, remarking that there was a
great deal to do that day, double work, and he should be back in
half-an-hour. The double work arose from the fact that none had
been done the day before, as Mr. Preen was out. For that day,
Monday—this was Tuesday—was the day Mr. Preen had paid us a
visit at Crabb Cott, to be paid for Taffy, the pony, and had then gone
to Norton, and afterwards to Stoulton, and it had taken him the best
part of the day. So the double work was waiting. But the half hours
and the hours had passed on, and Mr. Preen had not yet returned. It
was now three o’clock in the afternoon, and they had dined without
him.
Oliver, who did not dare to absent himself without permission, and
perhaps was too conscientious to do so, left his chair for the
window. The old garden was quite a wilderness of blossom and
colour, with all kinds of homely flowers crowded into it. The young
man stretched forth his hand and plucked a spray or two of
jessamine, which grew against the wall. Idly smelling it, he lost
himself in a vision of the days gone by; his careless, happy life at
Tours, in his aunt’s luxurious home, when he had no fear of a dark
future, had only to dress well and ride or drive out, and idly enjoy
himself.
Suddenly he was brought back to reality. The sound of hoofs
clattering into the fold-yard behind the house struck upon his ear,
and he knew his father had come home.
Ten minutes yet, or more, and then Mr. Preen came into the room,
his little dark face looking darker and more cross than usual. He had
been snatching some light refreshment, and sat down at once in his
place at the table, facing the windows; Oliver sat opposite to him.
“What have you done?” asked he.
“I have only copied those two letters; there was nothing else to do,”
replied Oliver.
“Could you not have looked over the pile of letters which came this
morning, to see whether there were any you could answer?”
growled Mr. Preen.
“Why, no, father,” replied Oliver in slight surprise; “I did not know I
might look at them. And if I had looked I should not have known
what to reply.”
Mr. Preen began reading the letters over at railroad speed, dictating
answers for Oliver to write, writing some himself. This took time. He
had been unexpectedly detained at the other end of Captain
Falkner’s land by some business which had vexed him. Most of these
letters were from farmers and others, about the new patent
agricultural implements for which Mr. Preen had taken the agency.
G. Preen.”
He wished to push the sale of them, as it gave him a good
percentage.
The answers, addressed and stamped for the post, at length lay
ready on the table. Mr. Preen then took out his pocket-book and
extracted from it that ten-pound bank-note given him the previous
morning by Mr. Todhetley for the children’s pony, the note he had
got the Squire to indorse, as I have already told. Letting the bank-
note lie open before him, Mr. Preen penned a few lines, as follows,
Oliver looking on:—
“Dear Sir,—I enclose you the ten pounds. Have not been able to
send it before. Truly yours,
Mr. Preen folded the sheet on which he had written this, put the
bank-note within it, and enclosed all in a good-sized business
envelope, which he fastened securely down. He then addressed it to
John Paul, Esquire, Islip, and put on a postage stamp.
“I shall seal this, Oliver,” he remarked; “it’s safer. Get the candle and
the wax. Here, you can seal it,” he added, taking the signet ring
from his finger, on which was engraved the crest of the Preen family.
Oliver lighted a candle kept on a stand at the back for such
purposes, brought it to the table, and sealed the letter with a large,
imposing red seal. As he passed the ring and letter back to his
father, he spoke.
“If you are particularly anxious that the letter should reach Mr. Paul
safely, father, and of course you are so, as it contains money, why
did you not send it by hand? I would have taken it to him.”
“There’s nothing safer than the post,” returned Mr. Preen, “and I
want him to have it to-morrow morning.”
Oliver laughed. “I could have taken it this evening, father. I can do
so still, if you like.”
“No, it shall go by post. You want to be off to MacEveril, I suppose.”
“No, I do not,” replied Oliver. “Had I been able to finish here this
morning I might have gone over this afternoon; it is too late now.”
“You had nothing to do all day yesterday,” growled his father.
“Oh, yes, I know. I am not grumbling.”
Mr. Preen put the letter into his pocket, gathered up the pile of other
letters, handed half of them to his son, for it was a pretty good
heap, and they started for the post, about three minutes’ walk.
The small shop containing the post-office at Duck Brook was kept by
Mrs. Sym, who sold sweetstuff, also tapes and cottons. Young Sym,
her son, a growing youth, delivered the letters, which were brought
in by a mail-cart. She was a clean, tidy woman of middle age, never
seen out of a muslin cap with a wide border and a black bow, a
handkerchief crossed over her shoulders, and a checked apron.
Oliver, of lighter step than his father, reached the post-office first and
tumbled his portion of the letters into the box placed in the window
to receive them. The next moment Mr. Preen put his in also,
together with the letter addressed to Mr. Paul.
“We are too late,” observed Oliver. “I thought we should be.”
“Eh?” exclaimed Mr. Preen, in surprise, as he turned round. “Too
late! Why how can the afternoon have gone on?” he continued, his
eyes falling on the clock of the little grey church which stood beyond
the triangle of houses, the hands of which were pointing to a quarter
past five.
“If you knew it was so late why did you not say so?” he asked
sharply of his son.
“I was not sure until I saw the clock; I only thought it must be late
by the time we had been at work,” replied Oliver.
“I might have sent you over with that letter as you suggested, had I
known it would not go to-night. I wonder whether Dame Sym would
give it back to me.”
He dived down the two steps into the shop as he spoke, Oliver
following. Dame Sym—so Duck Brook called her—stood knitting
behind the little counter, an employment she took up at spare
moments.
“Mrs. Sym, I’ve just put some letters into the box, not perceiving
that it was past five o’clock,” began Mr. Preen, civilly. “I suppose
they’ll not go to-night?”
“Can’t, sir,” replied the humble post-mistress. “The bag’s made up.”
“There’s one letter that will hardly bear delay. It is for Mr. Paul of
Islip. If you can return it me out of the box I will send it over by
hand at once; my son will take it.”
“But it is not possible, sir. Once a letter is put into the box I dare not
give it back again,” remonstrated Mrs. Sym, gazing amiably at Mr.
Preen through her spectacles, whose round glasses had a trick of
glistening when at right angles with the light.
“You might stretch a point for once, to oblige me,” returned Mr.
Preen, fretfully.
“And I’m sure I’d not need to be pressed to do it, sir, if I could,” she
cried in her hearty way. “But I dare not break the rules, sir; I might
lose my place. Our orders are not to open the receiving box until the
time for making-up, or give a letter back on any pretence whatever.”
Mr. Preen saw that further argument would be useless. She was a
kindly, obliging old body, but upright to the last degree in all that
related to her place. Anything that she believed (right or wrong)
might not be done she stuck to.
“Obstinate as the grave,” muttered he.
Dame Sym did not hear; she had turned away to serve a child who
came in for some toffee. Mr. Preen waited.
“When will the letter go?” he asked, as the child went out.
“By to-morrow’s day mail, sir. It will be delivered at Islip—I think you
said Islip, Mr. Preen—about half-past four, or so, in the afternoon.”
“Is the delay of much consequence, sir?” inquired Oliver, as he and
his father turned out of the shop.
“No,” said Mr. Preen. “Only I hate letters to be delayed uselessly in
the post.”
Tea was waiting when they got in. A mutton chop was served with it
for Mr. Preen, as he had lost his dinner. Jane ran downstairs, drank a
cup of tea in haste, and ran back again. She had been busy in her
bedroom all day, smartening-up a dress. A picnic was to be held on
Thursday, the next day but one; Jane and Oliver were invited to it,
and Jane wanted to look as well as other girls.
After tea Oliver sat for ever so long at the open window, reading the
Worcester Journal. He then strolled out to the Inlets, sauntered
beside the brook, and presently threw himself listlessly upon one of
the benches facing it. The sun shone right upon his face there, so he
tilted his straw hat over his eyes. That did not do, and he moved to
another bench which the trees shaded. He often felt lonely and
weary now; this evening especially so; even Jane was not with him.
His thoughts turned to Emma Paul; and a glow, bright as the
declining sun rays, shot up in his heart. As long as she filled it, he
could not be all gloom.
“If I had means to justify it I should speak to her,” mused he—as he
had told himself forty times over, and forty more. “But when a fellow
has no fortune, and no prospect of fortune; when it may be seen by
no end of odd signs and tokens that he has not so much as a silver
coin in his pocket, how can he ask a girl the one great question of
life? Old Paul would send me to the right-about.”
He leaned his head sideways for a few minutes against the trunk of
a tree, gazing at the reddening sky through the green tracery of the
waving boughs; and fell to musing again.
“If she loved me as I love her, she would be glad to wait on as
things are, hoping for better times. Lovers, who are truly attached to
each other, do wait for years and years, and are all the happier for it.
Sometimes I feel inclined to enlist in a crack regiment. The worst of
it is that a fellow rarely rises from the ranks in England to position
and honour, as he does in France; they manage things better over
there. If old Uncle Edward would only open his purse-strings and
buy me a commission, I might—— Halloa!”
A burst of girlish laughter, and a pair of girlish arms, flung round his
neck from behind, disturbed Oliver’s castles-in-the-air. Jane came
round and sat down beside him. “I thought I should find you here,
Oliver,” she said.
“Frock finished, Janey?”
“Finished! why no,” she exclaimed. “It will hardly be finished by this
time to-morrow.”
“Why, how idle you must have been!”
“Idle? You don’t understand things, or the time it takes to make an
old frock into a new one. A dressmaker might have done it in a day,
but I’m not a dressmaker, you know, Oliver.”
“Is it a silk gown?”
“It is a mousseline-de-laine, if you chance to be acquainted with that
material,” answered Janey. “It was very pretty when it was new: pale
pink and lilac blossoms upon a cream ground. But it has been
washed, and that has made it shrink, and it has to be let out
everywhere and lengthened, and the faded silk trimming has to be
turned, and—oh, ever so much work. And now, I daresay you are as
wise as you were before, Oliver.”
“I’ve heard of washed-out dresses,” remarked Oliver. “They look like
rags, don’t they?”
“Some may. Mine won’t. It has washed like a pocket-handkerchief,
and it looks as good as new.”
“Wish my coats would wash,” said Oliver. “They are getting shabby,
and I want some new ones.”
Not having any consolation to administer in regard to the coats, Jane
did not take up the subject. “What have you been doing all day,
Oliver?” she asked.
“Airing my patience in that blessed Buttery,” replied he. “Never
stirred out of it at all, except for dinner.”
“I thought you wanted to get over to Islip this afternoon.”
“I might want to get over to the North Pole, and be none the nearer
to it. MacEveril was bound for some place a mile or two across fields
this afternoon, on business for the office, and I promised to go over
to walk with him. Promises, though, are like pie-crust, Janey: made
to be broken.”
Jane nodded assent. “And a promise which you are obliged to break
is sure to be one you particularly want to keep. I wish I had a pair of
new gloves, Oliver. Pale grey.”
“I wish I had half-a-dozen new pairs, for the matter of that. Just
look at those little minnows, leaping in the water. How pretty they
are!”
He went to the edge of the brook and stood looking down at the
small fry. Jane followed. Then they walked about in the Inlets, then
sat down again and watched the sunset; and so the evening wore
away until they went home.
Jane was shut up again the following day, busy with her dress;
Oliver, as usual, was in the Buttery with his father. At twelve o’clock
Mr. Preen prepared to go out to keep an appointment at Evesham,
leaving Oliver a lot of work to do, very much to his aggravation.
“It’s a shame. It will take me all the afternoon to get through it,” ran
his thoughts—and he would have liked to say so aloud.
“You don’t look pleased, young man,” remarked his father. “Recollect
you will be off duty to-morrow.”
Oliver’s countenance cleared; his disposition was a pleasant one,
never retaining anger long, and he set to his task with a good will.
The morrow being the day of the picnic, he would have whole
holiday.
At five o’clock the young servant carried the tea-tray into the parlour.
Presently Mrs. Preen came in, made the tea, and sat down to wait
for her son and daughter. Tired and hot, she was glad of the rest.
Jane ran downstairs, all happiness. “Mamma, it is finished,” she
cried; “quite finished. It looks so well.”
“It had need look well,” fretfully retorted Mrs. Preen, who had been
unable to get at Jane for any useful purpose these two days, and
resented it accordingly.
“When all trades fail I can turn dressmaker,” said the girl, gaily.
“Where’s Oliver?”
“In the Buttery, I expect; he said he had a great deal to do there this
afternoon, and I have not seen him about,” replied Mrs. Preen, as
she poured out the tea. “Not that I should have been likely to see
him—shut into that hot kitchen with the ironing.”
Jane knew this was a shaft meant for herself. At ordinary times she
did her share of the ironing. “I will tell Oliver that tea is ready,
mamma,” she said, rising to go to the other room. “Why, there he is,
sitting in the shade under the walnut tree,” she exclaimed,
happening to look from the window.
“Sitting out in the cool,” remarked Mrs. Preen. “I don’t blame him,
poring all day long over those accounts and things. Call him in,
Jane.”
“Coming,” said Oliver, in response to Jane’s call from the open
window.
He crossed the grass slowly, fanning himself with his straw hat. His
fair face—an unusual thing with him—was scarlet.
“You look red-hot, Oliver,” laughed his sister.
“If it is as hot to-morrow as it is to-day we shall get a baking,”
returned Oliver.
“In this intense weather nothing makes one feel the heat like work,
and I suppose you’ve been hard at it this afternoon,” said his mother
in a tone of compassion, for she disliked work naturally very much
herself.
“Of course; I had to be,” answered Oliver.
He and Jane sat together under the shade of the walnut tree after
tea. When it grew a little cooler they went to the Inlets, that
favourite resort of theirs; a spot destined to bear a strange
significance for one of them in the days to come; a haunting
remembrance.
II
The white mist, giving promise of a hot and glorious day, had hardly
cleared itself from the earth, when, at ten o’clock on the Thursday
morning, Jane and Oliver Preen set off in the gig for North Villa, both
of them as spruce as you please; Jane in that pretty summer dress
she had spent so much work over, a straw hat with its wreath of pink
may shading her fair face, Oliver with a white rose in his button-
hole. The party was first to assemble at Mrs. Jacob Chandler’s, and
to go from thence in waggonettes. There had been some trouble
about the gig, Mr. Preen wanting it himself that day, or telling Jane
and Oliver that he did, and that they could walk. Jane almost cried,
declaring she did not care to arrive at North Villa looking like a
milkmaid, hot and red with walking; and Mr. Preen gave way. Oliver
was to drive himself and Jane, Sam being sent on to Crabb to bring
back the gig.
Mr. Preen did not regard the picnic with favour. Mr. Preen could not
imagine what anybody could want at one, he said, when
ungraciously giving consent to Oliver’s absenting himself from that
delightful Buttery for a whole day.
Picnics in truth are nearly all alike, and are no doubt more agreeable
to the young than to the old. This one was given conjointly by the
Jacob Chandlers, the Letsoms, the Coneys, and the Ashtons of
Timberdale. A few honorary guests were invited. I call them
honorary because they had nothing to do with finding provisions.
Tod got an invitation, myself also; and uncommonly vexed we were
not to be able to arrive till late in the afternoon. The Beeles from
Pigeon Green were coming to spend the day at Crabb Cot, and the
Squire would not let us off earlier.
The picnic was held upon Mrs. Cramp’s farm, not far from Crabb,
and a charming spot for it. Gentle hills and dales, shady groves and
mossy glens surrounded the house, which was a very good one. So
that it may be said we all were chiefly Mrs. Cramp’s guests. Mrs.
Cramp made a beaming hostess, and was commander-in-chief at her
own tea-table. Tea was taken in her large parlour, to save the bother
of carrying things out. Dinner had been taken in the dell, under
shade of the high and wide-spreading trees.
They were seated at tea when we got there. Such a large company
at the long table; and such tempting things to eat! I found a seat by
Emma Paul, the prettiest girl there; Oliver Preen was next her on the
other side. Mary MacEveril made room for Tod beside her. The
MacEverils were proud, exclusive people, and Miss MacEveril
privately looked down on some of her fellow guests; but Tod was
welcome; he was of her own order.
Two or three minutes later Tom Chandler came in; he also had not
been able to get away earlier. He shook hands with his aunt, Mrs.
Cramp, nodded to the rest of us, and deftly managed to wedge
himself in between Emma Paul and young Preen. Preen did not seem
pleased, Emma did; and made all the room she could, by crushing
me.
“I wouldn’t be in your shoes to-morrow morning, young man,” began
Mr. Chandler, in a serio-comic tone, as he looked at Dick MacEveril
across the table. “To leave the office to its own devices the first
thing this morning, in defiance of orders——”
“Hang the musty old office!” interrupted MacEveril, with a genial
laugh.
Valentine Chandler had done the same by his office; pleasure first
and business later always with both of them; but Valentine was his
own master and MacEveril was not. In point of fact, Mr. Paul, not a
man to be set at defiance by his clerks, was in a great rage with Dick
MacEveril.
I supposed the attractions of the picnic had been too powerful for
Dick, and that he thought the sooner he got to it the better. But this
proved to be a fallacy. Mrs. Cramp was setting her nephew right.
“My dear Tom, you are mistaken. Mr. MacEveril did not come this
morning; he only got here an hour ago—like two or three more of
the young men.”
“Oh, did he not, Aunt Mary Ann?” replied Tom, turning his
handsome, pleasant face upon her.
“Yes, and if you were not at the office I should like to know what
you did with yourself all day, Dick,” severely cried Miss MacEveril,
bending forward to regard her cousin.
“I went to see the pigeon-match,” said Dick, coolly.
“To see the pigeon-match!” she echoed. “How cruel of you! You had
better not let papa know.”
“If anyone lets him know it will be yourself, Miss Mary. And suppose
you hold your tongue now,” cried Dick, not very politely.
This little passage-at-arms over, we went on with tea. Afterwards we
strolled out of doors and disposed of ourselves at will. Some of the
Chandler girls took possession of me, and I went about with them.
When it was getting late, and they had talked me deaf, I began
looking about for Tod, and found him on a bench within the Grove. A
sheltered spot. Sitting there, you could look out, but people could
not look in. Mary MacEveril and Georgiana Chandler were with him;
Oliver Preen stood close by, leaning against the stump of a tree. I
thought how sad his look was, and wondered what made it so.
Within view of us, but not within hearing, in a dark, narrow walk
Tom Chandler and Emma Paul were pacing side by side, absorbed
evidently in one another. The sun had set, the lovely colours in the
sky were giving place to twilight. It was the hour when matter-of-
fact prosaic influences change into romance; when, if there’s any
sentiment within us it is safe to come out.
“It is the hour when from the boughs
The nightingale’s high note is heard;
It is the hour when lovers’ vows
Seem sweet in every whispered word,”
as Lord Byron says. And who could discourse on love—the true ring
of it, mind you—as he did?
“Do sing,” said Tod to Miss MacEveril; and I found they had been
teasing her to do so for the last five minutes. She had a pleasant
voice and sang well.
“I’m sure you don’t care to hear me, Mr. Todhetley.”
“But I’m sure I do,” answered Tod, who would flirt with pretty girls
when the fit took him. Flirt and flatter too.
“We should have everyone coming round us.”
“Not a soul of them. They are all away somewhere, out of hearing.
Do sing me one song.”
She began at once, without more ado, choosing an old song that
Mrs. Todhetley often chose; one that was a favourite of hers, as it
was of mine: “Faithless Emma.” Those songs of the old days bore, all
of them, a history.
“I wandered once at break of day,
While yet upon the sunless sea
In wanton sighs the breeze delayed,
And o’er the wavy surface played.
Then first the fairest face I knew,
First loved the eye of softest blue,
And ventured, fearful, first to sip
The sweets that hung upon the lip
Of faithless Emma.
So mixed the rose and lily white
That nature seemed uncertain, quite,
To deck her cheek which flower she chose,
The lily or the blushing rose.
I wish I ne’er had seen her eye,
Ne’er seen her cheeks of doubtful dye,
Nor ever, ever dared to sip
The sweets that hung upon the lip
Of faithless Emma.
Now though from early dawn of day,
I rove alone and, anxious, stray
Till night with curtain dark descends,
And day no more its glimmering lends;
Yet still, like hers no cheek I find,
No eye like hers, save in my mind,
Where still I fancy that I sip
The sweets that hung upon the lip
Of faithless Emma.”
“I think all Emmas are faithless,” exclaimed Georgiana, speaking at
random, as the last sounds of the sweet song died away.
“A sweeping assertion, Miss Georgie,” laughed Tod.
“Any way, I knew two girls named Emma who were faithless to their
engaged lovers, and one of them’s not married yet to any one else,”
returned Georgie.
“I think I know one Emma who will be true for ever and a day,” cried
Tod, as he pointed significantly to Emma Paul, still walking side by
side with Tom Chandler in the distance.
“I could have told you that before now,” said Mary MacEveril. “I have
seen it for a long time, though Miss Emma will never confess to it.”
“And now, I fancy it will soon be a case,” continued Tod.
“A case!” cried Georgie. “What do you mean?”
“A regular case; dead, and gone, and done for,” nodded Tod.
“Church bells and wedding gloves, and all the rest of the
paraphernalia. Looks like it, anyhow, to-night.”
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebookname.com

Automating with SIMATIC S7 400 inside TIA Portal 1st Edition Hans Berger

  • 1.
    Automating with SIMATICS7 400 inside TIA Portal 1st Edition Hans Berger pdf download https://ebookname.com/product/automating-with- simatic-s7-400-inside-tia-portal-1st-edition-hans-berger/ Get Instant Ebook Downloads – Browse at https://ebookname.com
  • 2.
    Instant digital products(PDF, ePub, MOBI) available Download now and explore formats that suit you... Automating with STEP 7 in STL and SCL SIMATIC S7 300 400 Programmable Controllers 6th Edition Hans Berger https://ebookname.com/product/automating-with-step-7-in-stl-and- scl-simatic-s7-300-400-programmable-controllers-6th-edition-hans- berger/ Automating with SIMATIC S7 1500 Configuring Programming and Testing with STEP 7 Professional 1st Edition Hans Berger https://ebookname.com/product/automating-with- simatic-s7-1500-configuring-programming-and-testing-with- step-7-professional-1st-edition-hans-berger/ STEP 7 in 7 Steps A Practical Guide to Implementing S7 300 S7 400 Programmable Logic Controllers 1ST Edition Clarence T. Jones https://ebookname.com/product/step-7-in-7-steps-a-practical- guide-to-implementing-s7-300-s7-400-programmable-logic- controllers-1st-edition-clarence-t-jones/ Upgrading Fixing PCs For Dummies 7th ed Edition Andy Rathbone https://ebookname.com/product/upgrading-fixing-pcs-for- dummies-7th-ed-edition-andy-rathbone/
  • 3.
    The transcripts 3rded. digitized & modernized in 2008 Edition Xexoxial Editions https://ebookname.com/product/the-transcripts-3rd-ed-digitized- modernized-in-2008-edition-xexoxial-editions/ The parallel brain the cognitive neuroscience of the corpus callosum 1st Edition Eran Zaidel https://ebookname.com/product/the-parallel-brain-the-cognitive- neuroscience-of-the-corpus-callosum-1st-edition-eran-zaidel/ India and the Anglosphere Race Identity and Hierarchy in International Relations Alexander E Davis https://ebookname.com/product/india-and-the-anglosphere-race- identity-and-hierarchy-in-international-relations-alexander-e- davis/ Applied Calculus Fifth Edition Geoffrey C. Berresford https://ebookname.com/product/applied-calculus-fifth-edition- geoffrey-c-berresford/ Unstitching Rex Trueform The Story of an African Factory 1st Edition Ilze Wolff https://ebookname.com/product/unstitching-rex-trueform-the-story- of-an-african-factory-1st-edition-ilze-wolff/
  • 4.
    JUNOS High AvailabilityBest Practices for High Network Uptime 1st Edition James Sonderegger https://ebookname.com/product/junos-high-availability-best- practices-for-high-network-uptime-1st-edition-james-sonderegger/
  • 6.
    Berger Automating with SIMATICS7-400 inside TIA Portal
  • 8.
    Automating with SIMATIC S7-400 insideTIA Portal Configuring, Programming and Testing with STEP 7 Professional by Hans Berger Publicis Publishing
  • 9.
    Bibliographic information fromthe 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 ISBN 978-3-89578-383-8 Editor: Siemens Aktiengesellschaft, Berlin and Munich Publisher: Publicis Publishing, Erlangen © 2013 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 automationsystem unites all the subsystems of an automation solu- tion 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 automation components using a single system platform and tools with uniform operator interfaces. These requirements are fulfilled by the SIMATIC automation system, which provides uniformity for configuration, programming, data manage- ment, and communication. This book describes the hardware components of the SIMATIC S7-400 automation system with standard controllers, and the features provided for designing a distrib- uted control concept with PROFIBUS and PROFINET. To permit communication with other automation systems, the controllers offer integrated bus interfaces for multi- point interface (MPI), PROFIBUS, and Industrial Ethernet. The STEP 7 Professional engineering software makes it possible to use the complete functionality of the S7-400 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 languages for generation of the user program: Ladder logic (LAD) with a graphic representation similar to a circuit diagram, func- tion block diagram (FBD) with a graphic representation based on electronic circuit- ry systems, statement list (STL) with formulation of the control task as a list of com- mands at machine level, a high-level Structured Control Language (SCL) similar to Pascal, and finally GRAPH as a sequencer with sequential processing 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-400 automation system with the STEP 7 Professional engineering software Version 11 with Service Pack 4. Erlangen, June 2013 Hans Berger
  • 11.
    The contents ofthe book at a glance 6 The contents of the book at a glance Start Overview of the SIMATIC S7-400 automation system. Introduction to the SIMATIC STEP 7 Professional V11 engineering software. The basis of the automation solution: Creating and editing a project. SIMATIC S7-400 automation system Overview of SIMATIC S7-400 modules: Design of an automation system, CPUs, signal, func- tion 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 compound data types, data types for block parameters, point- ers, and user data types. Program execution How the CPU module 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 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.
  • 12.
    The contents ofthe book at a glance 7 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 S7-GRAPH sequential controller What a sequential control is, and what its elements are: sequencers, steps, transitions, and branches. How a sequential control is configured using S7-GRAPH. Description of the control functions Basic functions: Functions for binary signals: binary logic operations, memory functions, edge evaluations, SIMATIC and IEC timer and counter functions. Digital functions: Functions for digital tags: transfer, comparison, arithmetic, math, conver- sion, shift, and logic functions. Program flow control: Working with status bits, programming jump functions, calling and closing blocks, using the master control relay. Online operation and program testing 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 properties of S7 basic communication and of S7 communication, and with what commu- nication functions they are programmed. The communication functions used to implement open user communication. How PtP communication is implemented. Annex 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 user program is tested offline using the S7-PLCSIM simulation software. How the Web server is configured in the CPU, and what features it offers. How block parameters and local tags are saved in the memory.
  • 13.
    Table of contents 8 Tableof contents 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.1 Overview of the S7-400 automation system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.1.1 SIMATIC S7-400 programmable controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.1.2 Overview of STEP 7 Professional V11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.1.3 Five programming languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 1.1.4 Execution of the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.1.5 Data management in the SIMATIC automation system . . . . . . . . . . . . . . . . . . . 30 1.2 Introduction to STEP 7 Professional V11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 1.2.1 Installing STEP 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 1.2.2 Automation License Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.2.3 Starting STEP 7 Professional . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.2.4 Portal view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.2.5 Help information system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 1.2.6 The windows of the Project view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 1.2.7 Adapting the user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 1.3 Editing a SIMATIC project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 1.3.1 Structured representation of project data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 1.3.2 Project data and editors for a PLC station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 1.3.3 Creating and editing a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 1.3.4 Creating and editing libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 2 SIMATIC S7-400 automation system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 2.1 Components of an S7-400 station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 2.2 S7-400 CPUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 2.2.1 CPU versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 2.2.2 Control and display elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 2.2.3 SIMATIC memory card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 2.2.4 Memory areas in an S7-400 station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 2.2.5 Bus interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 2.2.6 IF 964-DP interface module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 2.3 Signal modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 2.3.1 Digital input modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 2.3.2 Digital output modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 2.3.3 Analog input modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 2.3.4 Analog output module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 2.4 Function modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 2.5 Communication modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 2.6 Other modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 2.6.1 Interface modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 2.6.2 Power supply modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 2.7 SIPLUS S7-400 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
  • 14.
    Table of contents 9 3Device configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 3.2 Configuring a station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 3.2.1 Adding a PLC station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 3.2.2 Adding a module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 3.2.3 Adding an expansion unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 3.3 Parameterization of modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 3.3.1 Parameterization of CPU properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 3.3.2 Addressing modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 3.3.3 Assigning parameters to signal modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 3.4 Configuring the network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 3.4.1 Introduction, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 3.4.2 Networking stations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 3.4.3 Node addresses in a subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 3.4.4 Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 3.4.5 Configuring an MPI subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 3.4.6 Configuring a PROFIBUS subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 3.4.7 Configuring a PROFINET subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 3.4.8 Configuring a PtP subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4 Tags, addressing, and data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 4.1 Operands and tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 4.1.1 Introduction, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 4.1.2 Operand areas: inputs and outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 4.1.3 Operand area: bit memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 4.1.4 Operand area: data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 4.1.5 Operand area temporary local data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 4.2 Addressing of operands and tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 4.2.1 Signal path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 4.2.2 Absolute addressing of tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 4.2.3 Symbolic addressing of tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 4.2.4 Addressing constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 4.3 Indirect addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 4.3.1 Memory-indirect addressing with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 4.3.2 Register-indirect addressing with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 4.3.3 Working with the address registers with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 4.3.4 Direct access to complex local tags with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 4.3.5 Indirect addressing with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 4.4 Elementary data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 4.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 4.4.2 Bit-serial data types BOOL, BYTE, WORD, and DWORD . . . . . . . . . . . . . . . . . . . 122 4.4.3 BCD numbers BCD16 and BCD32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 4.4.4 Fixed-point data types with sign INT and DINT . . . . . . . . . . . . . . . . . . . . . . . . . 122 4.4.5 Floating-point data type REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 4.4.6 Data type CHAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 4.4.7 Data types for durations and points in time . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 4.5 Complex data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 4.5.1 STRING data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 4.5.2 Data type ARRAY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 4.5.3 Data type STRUCT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
  • 15.
    Table of contents 10 4.6Parameter types and pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 4.6.1 Parameter types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 4.6.2 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 4.6.3 “Variable” ANY pointer with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 4.6.4 “Variable” ANY pointer with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 4.7 PLC data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 4.8 Start information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 5 Program execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 5.1 Operating states of the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 5.1.1 STOP operating state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 5.1.2 STARTUP operating state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 5.1.3 RUN operating state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 5.1.4 HOLD operating state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 5.1.5 Reset CPU memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 5.1.6 Restoring the factory settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 5.1.7 Retentive behavior of operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 5.2 Creating a user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 5.2.1 Program draft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 5.2.2 Program execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 5.2.3 Block types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 5.2.4 Editing block properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 5.2.5 Block interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 5.2.6 Example of use of block parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 5.3 Calling blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 5.3.1 General information on calling of code blocks . . . . . . . . . . . . . . . . . . . . . . . . . 165 5.3.2 Calling functions (FC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 5.3.3 Calling function blocks (FB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 5.3.4 “Passing on” of block parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 5.4 Startup program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 5.4.1 Startup organization blocks OB 100, OB 101, and OB 102 . . . . . . . . . . . . . . . 171 5.4.2 Determining a module address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 5.4.3 Parameterization of modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 5.5 Main program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 5.5.1 Organization block OB 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 5.5.2 Process image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 5.5.3 Cycle time and response time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 5.5.4 Minimum cycle time and background processing . . . . . . . . . . . . . . . . . . . . . . 184 5.5.5 Compress, hold, stop, and protect program . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 5.5.6 Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 5.5.7 Determine system time and OB runtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 5.5.8 Runtime meter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 5.6 Interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 5.6.1 Introduction to interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 5.6.2 Priority classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 5.6.3 Time-of-day interrupts, organization blocks OB 10 to OB 17 . . . . . . . . . . . . . 199 5.6.4 Time-delay interrupts, organization blocks OB 20 to OB 23 . . . . . . . . . . . . . . 202 5.6.5 Cyclic interrupts, organization blocks OB 30 to OB 38 . . . . . . . . . . . . . . . . . . 205 5.6.6 Hardware interrupts, organization blocks OB 40 to OB 47 . . . . . . . . . . . . . . . 207 5.6.7 Interrupts for DPV1 organization blocks OB 55 to OB 57 . . . . . . . . . . . . . . . . 208 5.6.8 Synchronous cycle interrupts, organization blocks OB 61 to OB 64 . . . . . . . 209
  • 16.
    Table of contents 11 5.6.9Reading additional interrupt information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 5.7 Error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 5.7.1 Causes of errors and error responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 5.7.2 Synchronous error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 5.7.3 Enabling and disabling synchronous error processing . . . . . . . . . . . . . . . . . . 215 5.7.4 Enter substitute value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 5.7.5 Asynchronous errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 5.7.6 Disable, delay, and enable interrupts and asynchronous errors . . . . . . . . . . . 224 5.8 Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 5.8.1 Diagnostics interrupt, organization block OB 82 . . . . . . . . . . . . . . . . . . . . . . . 226 5.8.2 Read system state list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 5.8.3 Read start information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 5.8.4 Determine connection status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 5.8.5 System diagnostics with Report System Errors . . . . . . . . . . . . . . . . . . . . . . . . . 231 5.9 Configure alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 5.9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 5.9.2 Configuring alarms according to the message numbering . . . . . . . . . . . . . . . 236 5.9.3 Message blocks for PLC alarms with instance data . . . . . . . . . . . . . . . . . . . . . . 241 5.9.4 Message blocks for PLC alarms without instance data . . . . . . . . . . . . . . . . . . . 244 5.9.5 Blocks for working with alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 5.9.6 Configuring a user diagnostic alarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 5.9.7 CPU alarm display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 6 Program editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 6.2 PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 6.2.1 Editing PLC tag tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 6.2.2 Defining PLC tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 6.2.3 Exporting and importing a PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 6.2.4 Constants tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 6.3 Programming a code block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 6.3.1 Creating a new code block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 6.3.2 Working area of program editor for code blocks . . . . . . . . . . . . . . . . . . . . . . . . 258 6.3.3 Specifying code block properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 6.3.4 Programming a block interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 6.3.5 Programming a control function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 6.3.6 Editing tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 6.3.7 Working with program comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 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 . . . . . . . . . . . . . . . . . . . . . . . . 270 6.4.3 Defining properties for data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271 6.4.4 Declaring data tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 6.4.5 Entering data tags in global data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 6.5 Compiling blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 6.5.1 Starting the compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 6.5.2 Compiling SCL blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274 6.5.3 Eliminating errors following compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 6.6 Program information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 6.6.1 Cross-reference list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 6.6.2 Assignment list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
  • 17.
    Table of contents 12 6.6.3Call structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 6.6.4 Dependency structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 6.6.5 Consistency check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 6.6.6 Memory utilization of the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 7 Ladder logic LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283 7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283 7.1.1 Programming with LAD in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283 7.1.2 Program elements of ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 7.2 Programming binary logic operations with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . 286 7.2.1 NO and NC contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 7.2.2 Series and parallel connection of contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 7.2.3 T branch, open parallel branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 7.2.4 Negating result of logic operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 7.2.5 Edge evaluation of a binary tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 7.2.6 Comparison contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 7.3 Programming memory functions with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 7.3.1 Simple coil, assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 7.3.2 Set and reset coils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292 7.3.3 Retentive response due to latching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292 7.3.4 Coils with time response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 7.3.5 Coils with counter response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 7.4 Programming Q boxes with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 7.4.1 Memory boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 7.4.2 Edge evaluation of current flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 7.4.3 SIMATIC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 7.4.4 SIMATIC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 7.4.5 IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 7.4.6 IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 7.5 Programming EN/ENO boxes with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 7.5.1 Transfer function, MOVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 7.5.2 Arithmetic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 7.5.3 Math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 7.5.4 Conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 7.5.5 Shift functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 7.5.6 Word logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 7.6 Controlling the program flow with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 7.6.1 Working with status bits in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 7.6.2 EN/ENO mechanism with LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309 7.6.3 Jump functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 7.6.4 Block functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 7.6.5 Master Control Relay (MCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 8 Function block diagram FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 8.1.1 Programming with FBD in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 8.1.2 Program elements of the function block diagram . . . . . . . . . . . . . . . . . . . . . . 317 8.2 Programming binary logic operations with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . 318 8.2.1 Scanning for signal states “1” and “0” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 8.2.2 Programming a binary logic operation in the function block diagram . . . . . 319
  • 18.
    Table of contents 13 8.2.3AND function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 8.2.4 OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 8.2.5 Exclusive OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 8.2.6 Combined binary logic operations, negating result of logic operation . . . . . 321 8.2.7 T branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322 8.2.8 Edge evaluation of binary tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322 8.2.9 Comparison functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 8.3 Programming standard boxes with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 8.3.1 Assign box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 8.3.2 Set and reset boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 8.3.3 Standard boxes with time response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326 8.3.4 Standard boxes with counter response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326 8.4 Programming Q boxes with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 8.4.1 Memory boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 8.4.2 Edge evaluation of result of logic operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 8.4.3 SIMATIC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 8.4.4 SIMATIC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 8.4.5 IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 8.4.6 IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 8.5 Programming EN/ENO boxes with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 8.5.1 Transfer function MOVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 8.5.2 Arithmetic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 8.5.3 Math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 8.5.4 Conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 8.5.5 Shift functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 8.5.6 Word logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 8.6 Controlling the program flow with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340 8.6.1 Working with status bits in the function block diagram . . . . . . . . . . . . . . . . . . 340 8.6.2 EN/ENO mechanism with FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342 8.6.3 Jump functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 8.6.4 Block functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344 8.6.5 Master Control Relay (MCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346 9 Statement list STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348 9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348 9.1.1 Programming with STL in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348 9.1.2 Structure of an STL statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349 9.2 Programming binary logic operations with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . 350 9.2.1 Processing of a binary logic operation, operation step . . . . . . . . . . . . . . . . . . . 350 9.2.2 Scanning for signal states “1” and “0” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352 9.2.3 Programming a binary logic operation in the statement list . . . . . . . . . . . . . . 353 9.2.4 AND function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354 9.2.5 OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354 9.2.6 Exclusive OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354 9.2.7 Combined binary logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 9.2.8 Control of result of logic operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357 9.3 Programming memory functions with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358 9.3.1 Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 9.3.2 Setting and resetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 9.3.3 Edge evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
  • 19.
    Table of contents 14 9.4Programming timer and counter functions with STL . . . . . . . . . . . . . . . . . . . . . . 361 9.4.1 SIMATIC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 9.4.2 SIMATIC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363 9.4.3 IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364 9.4.4 IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 9.5 Programming digital functions with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366 9.5.1 Transfer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 9.5.2 Comparison functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 9.5.3 Arithmetic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370 9.5.4 Math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373 9.5.5 Conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 9.5.6 Shift functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 9.5.7 Word logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377 9.6 Controlling the program flow with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 9.6.1 Working with status bits in the statement list . . . . . . . . . . . . . . . . . . . . . . . . . . 380 9.6.2 EN/ENO mechanism with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382 9.6.3 Jump functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 9.6.4 Jump list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 9.6.5 Loop jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 9.6.6 Block functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 9.6.7 Master Control Relay (MCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 9.7 Further STL functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 9.7.1 Accumulator functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 9.7.2 Adding of constants to accumulator 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 9.7.3 Decrementing, incrementing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394 9.7.4 Null instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 10 Structured Control Language SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397 10.1 Introduction to programming with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397 10.1.1 Programming with SCL in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397 10.1.2 SCL statements and operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398 10.2 Programming binary logic operations with SCL . . . . . . . . . . . . . . . . . . . . . . . . . 401 10.2.1 Scanning for signal states “1” and “0” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 10.2.2 AND function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402 10.2.3 OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 10.2.4 Exclusive OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 10.2.5 Combined binary logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 10.2.6 Negating result of logic operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404 10.3 Programming memory functions with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404 10.3.1 Value assignment of a binary tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405 10.3.2 Setting and resetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405 10.3.3 Edge evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405 10.4 Programming timer and counter functions with SCL . . . . . . . . . . . . . . . . . . . . . 406 10.4.1 SIMATIC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406 10.4.2 SIMATIC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407 10.4.3 IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408 10.4.4 IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408 10.5 Programming digital functions with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409 10.5.1 Transfer function, value assignment of a digital tag . . . . . . . . . . . . . . . . . . . 410 10.5.2 Comparison functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410 10.5.3 Arithmetic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411 10.5.4 Math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
  • 20.
    Table of contents 15 10.5.5Conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413 10.5.6 Shift functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414 10.5.7 Word logic operations, logic expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415 10.6 Controlling the program flow with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 10.6.1 Working with the ENO tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 10.6.2 EN/ENO mechanism with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417 10.6.3 Control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419 10.6.4 Block functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428 11 S7-GRAPH sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 11.1.1 What is a sequential control? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 11.1.2 Properties of a sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432 11.1.3 Program for a sequential control, quantity framework . . . . . . . . . . . . . . . . . 433 11.1.4 Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 11.1.5 Procedure for configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 11.2 Elements of a sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 11.2.1 Steps and transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 11.2.2 Jumps in a sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 11.2.3 Branching of a sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 11.2.4 GRAPH-specific tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 11.2.5 Permanent instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438 11.2.6 Step and transition functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439 11.2.7 Processing of actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442 11.3 Configuring a sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448 11.3.1 Programming the GRAPH function block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448 11.3.2 Configuring the sequencer structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449 11.3.3 Programming steps and transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451 11.3.4 Programming permanent instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452 11.3.5 Configuring block-independent alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453 11.3.6 Attributes of the GRAPH function block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453 11.3.7 Using the GRAPH function block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454 11.4 Testing the sequential control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455 11.4.1 Loading the GRAPH function block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456 11.4.2 Settings for program testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456 11.4.3 Using operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457 11.4.4 Synchronization a sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458 11.4.5 Testing with program status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458 12 Basic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461 12.1 Binary logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461 12.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461 12.1.2 Working with binary signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462 12.1.3 AND function, series connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464 12.1.4 OR function, parallel connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465 12.1.5 Exclusive OR function, non-equivalence function . . . . . . . . . . . . . . . . . . . . . . 465 12.1.6 Negate result of logic operation, NOT contact . . . . . . . . . . . . . . . . . . . . . . . . . 466 12.2 Memory functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468 12.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468 12.2.2 Standard coil, assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
  • 21.
    Table of contents 16 12.2.3Single setting and resetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469 12.2.4 Dominant setting and resetting, memory function . . . . . . . . . . . . . . . . . . . . 471 12.2.5 Edge evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472 12.3 SIMATIC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477 12.3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477 12.3.2 Programming a timer function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480 12.3.3 Timer response as pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482 12.3.4 Timer response as extended pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484 12.3.5 Timer response as ON delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486 12.3.6 Timer response as retentive ON delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487 12.3.7 Timer response as OFF delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489 12.4 IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491 12.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491 12.4.2 Pulse generation TP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492 12.4.3 ON delay TON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493 12.4.4 OFF delay TOF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494 12.5 SIMATIC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495 12.5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495 12.5.2 Programming a counter function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498 12.5.3 Principle of operation of a counter function . . . . . . . . . . . . . . . . . . . . . . . . . . 499 12.5.4 Enabling a counter function with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501 12.6 IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502 12.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502 12.6.2 Up counter CTU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503 12.6.3 Down counter CTD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504 12.6.4 Up/down counter CTUD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505 13 Digital functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507 13.1 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507 13.2 Transfer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508 13.2.1 General information on the “simple” transfer function . . . . . . . . . . . . . . . . 508 13.2.2 MOVE box with LAD and FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508 13.2.3 Loading and transferring with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510 13.2.4 Value assignments with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511 13.2.5 Copying and filling a data area in the work memory . . . . . . . . . . . . . . . . . . . 513 13.2.6 Control memory area with MCR dependency . . . . . . . . . . . . . . . . . . . . . . . . . 515 13.3 Comparison functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518 13.3.1 Execution of “simple” comparison function . . . . . . . . . . . . . . . . . . . . . . . . . . 518 13.3.2 Comparison function T_COMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520 13.3.3 Comparison function S_COMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 13.4 Arithmetic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 13.4.1 General function description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523 13.4.2 Data types and status bits for an arithmetic function . . . . . . . . . . . . . . . . . . 523 13.4.3 Execution of the arithmetic function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524 13.4.4 Arithmetic functions for date and time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525 13.5 Math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527 13.5.1 General function description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527 13.5.2 General execution of a math function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527 13.5.3 Trigonometric functions SIN, COS, TAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528 13.5.4 Arc functions ASIN, ACOS, ATAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529 13.5.5 Additional math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
  • 22.
    Table of contents 17 13.6Conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 13.6.1 Implicit data type conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 13.6.2 Data type conversion of fixed-point numbers . . . . . . . . . . . . . . . . . . . . . . . . . 532 13.6.3 Data type conversion of floating-point numbers . . . . . . . . . . . . . . . . . . . . . . . 535 13.6.4 Data type conversion for date/time with T_CONV . . . . . . . . . . . . . . . . . . . . . . 537 13.6.5 Data type conversion for data type STRING with S_CONV . . . . . . . . . . . . . . . 539 13.6.6 Data type conversion of hexadecimal numbers . . . . . . . . . . . . . . . . . . . . . . . . 540 13.6.7 Scaling and unscaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 13.6.8 Further conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543 13.7 Shift functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544 13.7.1 General function description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544 13.7.2 General execution of a shift function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544 13.7.3 Shift to right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546 13.7.4 Shift to left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547 13.7.5 Rotate to right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547 13.7.6 Rotate to left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548 13.7.7 Rotating by the condition code bit CC1 (STL) . . . . . . . . . . . . . . . . . . . . . . . . . . 549 13.8 Logic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549 13.8.1 Word logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549 13.8.2 Invert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552 13.8.3 Code bit and set bit number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552 13.8.4 Selection and limiting functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553 13.9 Functions for strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556 14 Program flow control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560 14.1 Status bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561 14.1.1 Description of the status bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561 14.1.2 Controlling the status bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563 14.1.3 Setting and resetting the result of logic operation . . . . . . . . . . . . . . . . . . . . . 563 14.1.4 Controlling the binary result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565 14.1.5 Evaluating the status bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566 14.2 Jump functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568 14.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568 14.2.2 Absolute jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568 14.2.3 Conditional jump functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570 14.2.4 Jump functions depending on status bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572 14.3 Block end functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575 14.3.1 Block end function RET (LAD and FBD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575 14.3.2 Block end functions BEC, BEU, and BE (STL) . . . . . . . . . . . . . . . . . . . . . . . . . . 576 14.3.3 RETURN statement (SCL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576 14.4 Calling of code blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576 14.4.1 General information on block calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576 14.4.2 Calling a function (FC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577 14.4.3 Calling a function block (FB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579 14.4.4 Change to a block without block parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . 581 14.5 Data block functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583 14.5.1 Opening a data block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583 14.5.2 Additional data block functions with STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584 14.5.3 Creating, deleting, and testing data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . 585 14.6 Master control relay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587 14.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587 14.6.2 MCR dependency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
  • 23.
    Table of contents 18 14.6.3MCR area and MCR zone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589 14.6.4 MCR area and MCR zone with a block change . . . . . . . . . . . . . . . . . . . . . . . . . 589 14.6.5 Statements for the master control relay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591 15 Online operation and program test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592 15.1 Connection of a programming device to the PLC station . . . . . . . . . . . . . . . . . . 593 15.1.1 Settings on the programming device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593 15.1.2 Connecting the programming device to the PLC station . . . . . . . . . . . . . . . . 594 15.1.3 Switching on online mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595 15.2 Transferring project data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596 15.2.1 Loading project data for the first time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596 15.2.2 Reloading the project data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598 15.2.3 Protection of the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599 15.2.4 Editing of online project without offline project . . . . . . . . . . . . . . . . . . . . . . 600 15.2.5 Working with the memory card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601 15.3 Block handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602 15.3.1 Downloading a block to the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602 15.3.2 Editing the online version of a block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603 15.3.3 Deleting a block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603 15.3.4 Packing the work memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603 15.3.5 Offline/online data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604 15.3.6 Comparing blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605 15.4 Hardware diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608 15.4.1 Status displays on the modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608 15.4.2 Diagnostic information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609 15.4.3 Diagnostic buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609 15.4.4 Diagnostic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610 15.4.5 Online tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611 15.4.6 Further diagnostic information via the programming device . . . . . . . . . . . 612 15.5 Testing the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613 15.5.1 Process and test modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613 15.5.2 Defining the call environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614 15.5.3 Testing with program status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614 15.5.4 Testing in single step mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618 15.5.5 Monitoring of PLC tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621 15.5.6 Monitoring of data tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621 15.5.7 Testing with watch tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622 15.5.8 Enable peripheral outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627 15.5.9 Testing with the force table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628 16 Distributed I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631 16.1 Introduction, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631 16.2 ET 200 distributed I/O system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632 16.2.1 ET 200L . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632 16.2.2 ET 200M . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632 16.2.3 ET 200S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633 16.2.4 ET 200iSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634 16.2.5 ET 200R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634 16.2.6 ET 200eco . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634 16.2.7 ET 200pro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
  • 24.
    Table of contents 19 16.3PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636 16.3.1 PROFINET IO components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636 16.3.2 Addresses with PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638 16.3.3 Special PROFINET configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641 16.3.4 Configuring PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642 16.3.5 Coupling modules for PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646 16.3.6 Real-time communication with PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . 647 16.4 PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649 16.4.1 PROFIBUS DP components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649 16.4.2 Addresses with PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652 16.4.3 Configuring PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656 16.4.4 Coupling modules for PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659 16.4.5 Special functions for PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661 16.5 System blocks for distributed I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665 16.5.1 System blocks for PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665 16.5.2 System blocks for PROFIBUS DP and PROFINET IO . . . . . . . . . . . . . . . . . . . . . 668 16.5.3 System block for PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672 17 Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674 17.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674 17.2 S7 basic communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675 17.2.1 Basics of station-internal S7 basic communication . . . . . . . . . . . . . . . . . . . . . 675 17.2.2 Configuring of station-internal S7 basic communication . . . . . . . . . . . . . . . 676 17.2.3 System blocks for station-internal S7 basic communication . . . . . . . . . . . . . 676 17.2.4 Basics of station-external S7 basic communication . . . . . . . . . . . . . . . . . . . . . 678 17.2.5 Configuring of station-external S7 basic communication . . . . . . . . . . . . . . . 679 17.2.6 System blocks for station-external S7 basic communication . . . . . . . . . . . . . 679 17.3 S7 Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682 17.3.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682 17.3.2 Configuring S7 communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684 17.3.3 One-way data exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685 17.3.4 Two-way data exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686 17.3.5 Control functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688 17.3.6 Monitoring functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690 17.3.7 Send print data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691 17.4 Open user communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692 17.4.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692 17.4.2 Establishing and terminating connections . . . . . . . . . . . . . . . . . . . . . . . . . . . 693 17.4.3 Data transfer with TCP native or ISO-on-TCP . . . . . . . . . . . . . . . . . . . . . . . . . . 696 17.4.4 Data transfer with UDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698 17.5 Point-to-point communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700 17.5.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700 17.5.2 Data transmission with the 3964 (R) procedure . . . . . . . . . . . . . . . . . . . . . . . 702 17.5.3 Data transmission with the RK 512 protocol . . . . . . . . . . . . . . . . . . . . . . . . . . 702 17.5.4 Data transmission with the ASCII driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705 18 Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707 18.1 Working with source files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707 18.1.1 General procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707 18.1.2 Programming a logic block in the source file . . . . . . . . . . . . . . . . . . . . . . . . . 708
  • 25.
    Table of contents 20 18.1.3Programming a data block in the source file . . . . . . . . . . . . . . . . . . . . . . . . . 714 18.1.4 Programming a PLC data type in the source file . . . . . . . . . . . . . . . . . . . . . . 715 18.2 Migrating projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716 18.3 Simulation with the TIA Portal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720 18.3.1 Differences from a real CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720 18.3.2 Starting and saving the simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720 18.3.3 Using the simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722 18.3.4 Testing the program with the simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724 18.3.5 Additional functions of PLCSIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725 18.4 Web server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727 18.4.1 Enable web server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727 18.4.2 Reading out web information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728 18.4.3 Standard web pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728 18.5 Storage of local tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731 18.5.1 Storage in global data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731 18.5.2 Storage in instance data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732 18.5.3 Storage in the temporary local data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733 18.5.4 Data storage of the block parameters of a function (FC) . . . . . . . . . . . . . . . . 734 18.5.5 Data storage of the block parameters of a function block (FB) . . . . . . . . . . . 736 18.5.6 Data storage of a local instance in a multi-instance . . . . . . . . . . . . . . . . . . . . 739 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
  • 26.
    1.1 Overview ofthe S7-400 automation system 21 1 Introduction 1.1 Overview of the S7-400 automation system SIMATIC S7-400 is the modular control system for the medium and upper perfor- mance range (Fig. 1.1). Different versions of the controllers allow the performance to be matched to the respective application. Depending on the requirements, the programmable controller can be modularly expanded by input/output modules for digital and analog signals in up to 21 racks with up to 18 modules. Further expansion with input/output modules is made possible by the distributed I/O over PROFIBUS or PROFINET. Special designs of these modules for increased mechanical demands allow their installation directly on site on the machine or plant. STEP 7 is used to configure and program the SIMATIC S7-400controllers. Data Fig. 1.1 Components of the SIMATIC S7-400 automation system SIMATIC NET SIMATIC DP STEP 7 Professional S S SIMATIC S7-400 automation system SIMATIC S7-400
  • 27.
    1 Introduction 22 exchange betweenthe controllers, the distributed I/O, and the programming device is carried out over SIMATIC NET. 1.1.1 SIMATIC S7-400 programmable controller The most important components of an S7-400 programmable controller are shown in Fig. 1.2. The CPU contains the operating system and the user program. The user program is in the load memory of the CPU, which can be expanded with a SIMATIC Memory Card (MC). The user program is executed in the CPU's work memory. The bus inter- faces present on the CPU establish the connection to other programmable control- lers. Fig. 1.2 Components of an S7-400 controller Expansion rack Central rack IM module Components of an S7-400 controller The racka are available in various widths: 18, 9, and 4 slots. CPU module PS module SM modules FM modules CP modules Rack On the racks are pluggable:
  • 28.
    1.1 Overview ofthe S7-400 automation system 23 Signal modules (SM) are responsible for the connection to the controlled plant. These input and output modules are available for digital and analog signals. The function modules (FM) are signal-preprocessing, “intelligent” I/O modules which prepare 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. Function modules are responsible for handling functions which the CPU cannot usually execute quickly enough, such as counting pulses, positioning, or controlling drives. The CP modules allow data transfer in excess of the possibilities provided by the standard interfaces on the CPU with regard to protocols and communication func- tions. In the case of an expansion, the interface modules (IM) connect the central rack to a maximum of 21 expansion racks. Finally, a power supply module provides the internal voltages required by the pro- grammable controller. Load voltages or load currents must be provided via external load current supply units. 1.1.2 Overview of STEP 7 Professional V11 STEP 7 is the central automation tool for SIMATIC. STEP 7 requires authorization (li- censing) and is executed on the current Microsoft Windows operating systems. Configuration of an S7-400 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 project, create a new project, or migrate a project. A “project” is a data structure containing 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 (Fig. 1.3): b In the Devices & networks portal you configure the programmable controllers, i.e. you position the modules in a rack and set their parameters. b In the PLC programming portal you create the user program in the form of indi- vidual sections referred to as “blocks”. b The Visualization portal provides the most important tools for configuration and simulation of HMI systems using SIMATIC WinCC. b The Online & Diagnostics portal allows you to connect the programming device online to a CPU. You can control the CPU's operating modes and transfer and test the user program. The Project view is an object-oriented view with several windows whose contents change depending on the current activity. 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 (Fig. 1.4). A further window – the inspector window – displays the properties of the selected module,
  • 29.
    1 Introduction 24 Fig. 1.3Tools in the Start portal of STEP 7 Professional V11 Fig. 1.4 Example of a Project view: working area of the device configuration
  • 30.
    Another Random Documenton Scribd Without Any Related Topics
  • 31.
    “It was toobad, Oliver, not to come for me!” she cried. “I meant to be home in time; I did indeed, Jane,” he answered; “but somehow the evening slipped on.” “Were you at Mr. Paul’s?” “No; I was with MacEveril.” “At billiards, I suppose!—and it’s very foolish of you, Oliver, for you know you can’t afford billiards.” “I can’t afford anything, Janey, as it seems to me,” returned Oliver, kicking up the dust in the road as they walked along. “Billiards don’t cost much; it’s only the tables: anyway, MacEveril paid for all.” “Has MacEveril talked any more about going away?” “He talks of nothing else; is full of it,” answered Oliver. “His uncle says he is not to go; and old Paul stopped him at the first half-word, saying he could not be spared from the office. Dick says he shall start all the same, leave or no leave.” “Dick will be very silly to go just now, when we are about to be so gay,” remarked Jane, “There’s the picnic coming off; and the dance at Mrs. Jacob Chandler’s; and no end of tea-parties.” For just now the neighbourhood was putting on a spurt of gaiety, induced to it perhaps by the lovely summer sunshine. Oliver’s face wore a look of gloom, and he made no answer to Jane’s remark. Several matters, cross and contrary, were trying Oliver Preen; not the least of them that he seemed to make no way whatever with Miss Emma. When we left school for the midsummer holidays that year, Mr. and Mrs. Todhetley were staying at Crabb Cot. We got there on Friday, the eleventh of June.
  • 32.
    On the followingMonday morning the Squire went to his own small sitting-room after breakfast to busy himself with his accounts and papers. Presently I heard him call me. “Have you a mind for a walk, Johnny?” “Yes, sir; I should be glad of one.” Tod had gone to the Whitneys for a couple of days, and without him I felt like a fish out of water. “Well, I want you to go as far as Massock’s. He is a regular cheat; that man, Johnny, needs looking after—— What is it, Thomas?” For old Thomas had come in, a card between his fingers. “It’s Mr. Gervais Preen, sir,” he said, in answer, putting the card on the Squire’s table. “Can you see him?” “Oh, yes, I can see him; show him in. Wait a bit, though, Thomas,” broke off the Squire. “Johnny, I expect Preen has come about that pony. I suppose we may as well keep him?” “Tod said on Saturday, sir, that we should not do better,” I answered. “He tried him well, and thinks he is worth the price.” “Ay; ten pounds, wasn’t it? We’ll keep him, then. Mr. Preen can come in, Thomas.” Some few days before this the Squire had happened to say in Preen’s hearing that he wanted a pony for the two children to ride, Hugh and Lena. Preen caught up the words, saying he had one for sale—a very nice pony, sound and quiet. So the pony had been sent to Crabb Cot upon trial, and we all liked him. His name was Taffy. Mr. Preen came into the room, his small face cool and dark as usual; he had driven from Duck Brook. “A fine morning,” he remarked, as he sat down; but it would be fiery hot by-and-by, too hot for the middle of June, and we should probably pay for it later. The Squire asked if he would take anything, but he declined.
  • 33.
    “What of thepony—Taffy—Squire?” went on Mr. Preen. “Do you like him?” “Yes, we like him very well,” said the Squire, heartily, “and we mean to keep him, Preen.” “All right,” said Mr. Preen. “You will not repent it.” Then they fell to talking of horses in general, and of other topics. I stayed on, sitting by the window, not having received the message for Massock. Mr. Preen stayed also, making no move to go away; when it suddenly occurred to the Squire—he mentioned it later—that perhaps Preen might be waiting for the money. “Ten pounds, I think, was the price agreed upon,” observed the Squire with ready carelessness. “Would you like to be paid now?” “If it does not inconvenience you.” The Squire unlocked his shabby old bureau, which stood against the wall, fingered his stock of money, and brought forth a ten-pound bank-note. This he handed to Preen, together with a sheet of paper, that he might give a receipt. When the receipt was written, Mr. Preen took up the note, looked at it for a moment or two, and then passed it back again. “Would you mind writing your name on this note, Squire?” The Squire laughed gently. “Not at all,” he answered; “but why should I? Do you think it is a bad one? No fear, Preen; I had it from the Old Bank at Worcester.” “No, I do not fear that,” said Preen, speaking quietly. “But since a disagreeable trouble which happened to me some years ago, I have always liked, when receiving a bank-note, to get, if possible, the donor’s name upon it in his own handwriting.” “What was the trouble?”
  • 34.
    “I was playingcards at the house of a man of fashion, who was brother to an earl, and lived in a fashionable square at the West End of London, and I had a ten-pound note paid me, for I won, by a man who, I understood, had recently retired with honours from the army, a Major D——. I will not give you his name. The next day, or next but one, I paid this note away to a tradesman, and it was found to be forged; cleverly forged,” repeated Preen, with emphasis. “What did you do?” asked the Squire. “I got Major D.’s address from the house where we had played, carried the note to him, and inquired what it meant and whence he got it. Will you believe, Mr. Todhetley,” added the speaker, with slight agitation, “that the man utterly repudiated the note, saying——” “But how could he repudiate it?” interrupted the Squire, interested in the tale. “He said it was not the note he had paid me; he stood it out in the most impudent manner. I told him, and it was the pure truth, that it was impossible there could be any mistake. I was a poor man, down on my luck just then, and it was the only note I had had about me for some time past. All in vain. He held to it that it was not the note, and there the matter ended. I could not prove that it was the note except by my bare word. It was my word against his, you see, and naturally I went to the wall.” The Squire nodded. “Who was at the loss of the money?” “I was. Besides that, I had the cold shoulder turned upon me. Major D. was believed; I was doubted; some people went so far as to say I must have trumped up the tale. For some time after that I would not take a bank-note from any man unless he put his signature to it, and it has grown into a habit with me. So, if you don’t mind, Squire——” The Squire smiled goodnaturedly, drew the bank-note to him, and wrote upon the back in a corner, “J. Todhetley.”
  • 35.
    “There, Preen,” saidhe, returning it, “I won’t repudiate that. Couldn’t if I would.” Mr. Preen put the note into his pocket-book, and rose to leave. We strolled with him across the front garden to the gate, where his gig was waiting. “I have to go as far as Norton; and possibly after that on to Stoulton,” he remarked, as he took the reins in his hand and got in. “You will have a hot drive of it,” said the Squire. “Yes; but if one undertakes business it must be attended to,” said Preen, as he drove off.
  • 36.
    A TRAGEDY II.—IN THEBUTTERY I The windows of the room, called the Buttery, which Mr. Preen used as an office in his house at Duck Brook, were thrown open to the warm, pure air. It was about the hottest part of the afternoon. Oliver Preen sat back in his chair before the large table covered with papers, waiting in idleness and inward rebellion—rebellion against the untoward fate which had latterly condemned him to this dreary and monotonous life. Taking out his pocket-handkerchief with a fling, he passed it over his fair, mild face, which was very hot just now. To-day, of all days, Oliver had wanted to be at liberty, whereas he was being kept a prisoner longer than usual, and for nothing. When Mr. Preen rode out after breakfast in the morning he had left Oliver a couple of letters to copy as a beginning, remarking that there was a great deal to do that day, double work, and he should be back in half-an-hour. The double work arose from the fact that none had been done the day before, as Mr. Preen was out. For that day, Monday—this was Tuesday—was the day Mr. Preen had paid us a visit at Crabb Cott, to be paid for Taffy, the pony, and had then gone to Norton, and afterwards to Stoulton, and it had taken him the best part of the day. So the double work was waiting. But the half hours and the hours had passed on, and Mr. Preen had not yet returned. It was now three o’clock in the afternoon, and they had dined without him. Oliver, who did not dare to absent himself without permission, and perhaps was too conscientious to do so, left his chair for the
  • 37.
    window. The oldgarden was quite a wilderness of blossom and colour, with all kinds of homely flowers crowded into it. The young man stretched forth his hand and plucked a spray or two of jessamine, which grew against the wall. Idly smelling it, he lost himself in a vision of the days gone by; his careless, happy life at Tours, in his aunt’s luxurious home, when he had no fear of a dark future, had only to dress well and ride or drive out, and idly enjoy himself. Suddenly he was brought back to reality. The sound of hoofs clattering into the fold-yard behind the house struck upon his ear, and he knew his father had come home. Ten minutes yet, or more, and then Mr. Preen came into the room, his little dark face looking darker and more cross than usual. He had been snatching some light refreshment, and sat down at once in his place at the table, facing the windows; Oliver sat opposite to him. “What have you done?” asked he. “I have only copied those two letters; there was nothing else to do,” replied Oliver. “Could you not have looked over the pile of letters which came this morning, to see whether there were any you could answer?” growled Mr. Preen. “Why, no, father,” replied Oliver in slight surprise; “I did not know I might look at them. And if I had looked I should not have known what to reply.” Mr. Preen began reading the letters over at railroad speed, dictating answers for Oliver to write, writing some himself. This took time. He had been unexpectedly detained at the other end of Captain Falkner’s land by some business which had vexed him. Most of these letters were from farmers and others, about the new patent agricultural implements for which Mr. Preen had taken the agency.
  • 38.
    G. Preen.” He wishedto push the sale of them, as it gave him a good percentage. The answers, addressed and stamped for the post, at length lay ready on the table. Mr. Preen then took out his pocket-book and extracted from it that ten-pound bank-note given him the previous morning by Mr. Todhetley for the children’s pony, the note he had got the Squire to indorse, as I have already told. Letting the bank- note lie open before him, Mr. Preen penned a few lines, as follows, Oliver looking on:— “Dear Sir,—I enclose you the ten pounds. Have not been able to send it before. Truly yours, Mr. Preen folded the sheet on which he had written this, put the bank-note within it, and enclosed all in a good-sized business envelope, which he fastened securely down. He then addressed it to John Paul, Esquire, Islip, and put on a postage stamp. “I shall seal this, Oliver,” he remarked; “it’s safer. Get the candle and the wax. Here, you can seal it,” he added, taking the signet ring from his finger, on which was engraved the crest of the Preen family. Oliver lighted a candle kept on a stand at the back for such purposes, brought it to the table, and sealed the letter with a large, imposing red seal. As he passed the ring and letter back to his father, he spoke. “If you are particularly anxious that the letter should reach Mr. Paul safely, father, and of course you are so, as it contains money, why did you not send it by hand? I would have taken it to him.” “There’s nothing safer than the post,” returned Mr. Preen, “and I want him to have it to-morrow morning.” Oliver laughed. “I could have taken it this evening, father. I can do so still, if you like.” “No, it shall go by post. You want to be off to MacEveril, I suppose.”
  • 39.
    “No, I donot,” replied Oliver. “Had I been able to finish here this morning I might have gone over this afternoon; it is too late now.” “You had nothing to do all day yesterday,” growled his father. “Oh, yes, I know. I am not grumbling.” Mr. Preen put the letter into his pocket, gathered up the pile of other letters, handed half of them to his son, for it was a pretty good heap, and they started for the post, about three minutes’ walk. The small shop containing the post-office at Duck Brook was kept by Mrs. Sym, who sold sweetstuff, also tapes and cottons. Young Sym, her son, a growing youth, delivered the letters, which were brought in by a mail-cart. She was a clean, tidy woman of middle age, never seen out of a muslin cap with a wide border and a black bow, a handkerchief crossed over her shoulders, and a checked apron. Oliver, of lighter step than his father, reached the post-office first and tumbled his portion of the letters into the box placed in the window to receive them. The next moment Mr. Preen put his in also, together with the letter addressed to Mr. Paul. “We are too late,” observed Oliver. “I thought we should be.” “Eh?” exclaimed Mr. Preen, in surprise, as he turned round. “Too late! Why how can the afternoon have gone on?” he continued, his eyes falling on the clock of the little grey church which stood beyond the triangle of houses, the hands of which were pointing to a quarter past five. “If you knew it was so late why did you not say so?” he asked sharply of his son. “I was not sure until I saw the clock; I only thought it must be late by the time we had been at work,” replied Oliver. “I might have sent you over with that letter as you suggested, had I known it would not go to-night. I wonder whether Dame Sym would
  • 40.
    give it backto me.” He dived down the two steps into the shop as he spoke, Oliver following. Dame Sym—so Duck Brook called her—stood knitting behind the little counter, an employment she took up at spare moments. “Mrs. Sym, I’ve just put some letters into the box, not perceiving that it was past five o’clock,” began Mr. Preen, civilly. “I suppose they’ll not go to-night?” “Can’t, sir,” replied the humble post-mistress. “The bag’s made up.” “There’s one letter that will hardly bear delay. It is for Mr. Paul of Islip. If you can return it me out of the box I will send it over by hand at once; my son will take it.” “But it is not possible, sir. Once a letter is put into the box I dare not give it back again,” remonstrated Mrs. Sym, gazing amiably at Mr. Preen through her spectacles, whose round glasses had a trick of glistening when at right angles with the light. “You might stretch a point for once, to oblige me,” returned Mr. Preen, fretfully. “And I’m sure I’d not need to be pressed to do it, sir, if I could,” she cried in her hearty way. “But I dare not break the rules, sir; I might lose my place. Our orders are not to open the receiving box until the time for making-up, or give a letter back on any pretence whatever.” Mr. Preen saw that further argument would be useless. She was a kindly, obliging old body, but upright to the last degree in all that related to her place. Anything that she believed (right or wrong) might not be done she stuck to. “Obstinate as the grave,” muttered he. Dame Sym did not hear; she had turned away to serve a child who came in for some toffee. Mr. Preen waited.
  • 41.
    “When will theletter go?” he asked, as the child went out. “By to-morrow’s day mail, sir. It will be delivered at Islip—I think you said Islip, Mr. Preen—about half-past four, or so, in the afternoon.” “Is the delay of much consequence, sir?” inquired Oliver, as he and his father turned out of the shop. “No,” said Mr. Preen. “Only I hate letters to be delayed uselessly in the post.” Tea was waiting when they got in. A mutton chop was served with it for Mr. Preen, as he had lost his dinner. Jane ran downstairs, drank a cup of tea in haste, and ran back again. She had been busy in her bedroom all day, smartening-up a dress. A picnic was to be held on Thursday, the next day but one; Jane and Oliver were invited to it, and Jane wanted to look as well as other girls. After tea Oliver sat for ever so long at the open window, reading the Worcester Journal. He then strolled out to the Inlets, sauntered beside the brook, and presently threw himself listlessly upon one of the benches facing it. The sun shone right upon his face there, so he tilted his straw hat over his eyes. That did not do, and he moved to another bench which the trees shaded. He often felt lonely and weary now; this evening especially so; even Jane was not with him. His thoughts turned to Emma Paul; and a glow, bright as the declining sun rays, shot up in his heart. As long as she filled it, he could not be all gloom. “If I had means to justify it I should speak to her,” mused he—as he had told himself forty times over, and forty more. “But when a fellow has no fortune, and no prospect of fortune; when it may be seen by no end of odd signs and tokens that he has not so much as a silver coin in his pocket, how can he ask a girl the one great question of life? Old Paul would send me to the right-about.”
  • 42.
    He leaned hishead sideways for a few minutes against the trunk of a tree, gazing at the reddening sky through the green tracery of the waving boughs; and fell to musing again. “If she loved me as I love her, she would be glad to wait on as things are, hoping for better times. Lovers, who are truly attached to each other, do wait for years and years, and are all the happier for it. Sometimes I feel inclined to enlist in a crack regiment. The worst of it is that a fellow rarely rises from the ranks in England to position and honour, as he does in France; they manage things better over there. If old Uncle Edward would only open his purse-strings and buy me a commission, I might—— Halloa!” A burst of girlish laughter, and a pair of girlish arms, flung round his neck from behind, disturbed Oliver’s castles-in-the-air. Jane came round and sat down beside him. “I thought I should find you here, Oliver,” she said. “Frock finished, Janey?” “Finished! why no,” she exclaimed. “It will hardly be finished by this time to-morrow.” “Why, how idle you must have been!” “Idle? You don’t understand things, or the time it takes to make an old frock into a new one. A dressmaker might have done it in a day, but I’m not a dressmaker, you know, Oliver.” “Is it a silk gown?” “It is a mousseline-de-laine, if you chance to be acquainted with that material,” answered Janey. “It was very pretty when it was new: pale pink and lilac blossoms upon a cream ground. But it has been washed, and that has made it shrink, and it has to be let out everywhere and lengthened, and the faded silk trimming has to be turned, and—oh, ever so much work. And now, I daresay you are as wise as you were before, Oliver.”
  • 43.
    “I’ve heard ofwashed-out dresses,” remarked Oliver. “They look like rags, don’t they?” “Some may. Mine won’t. It has washed like a pocket-handkerchief, and it looks as good as new.” “Wish my coats would wash,” said Oliver. “They are getting shabby, and I want some new ones.” Not having any consolation to administer in regard to the coats, Jane did not take up the subject. “What have you been doing all day, Oliver?” she asked. “Airing my patience in that blessed Buttery,” replied he. “Never stirred out of it at all, except for dinner.” “I thought you wanted to get over to Islip this afternoon.” “I might want to get over to the North Pole, and be none the nearer to it. MacEveril was bound for some place a mile or two across fields this afternoon, on business for the office, and I promised to go over to walk with him. Promises, though, are like pie-crust, Janey: made to be broken.” Jane nodded assent. “And a promise which you are obliged to break is sure to be one you particularly want to keep. I wish I had a pair of new gloves, Oliver. Pale grey.” “I wish I had half-a-dozen new pairs, for the matter of that. Just look at those little minnows, leaping in the water. How pretty they are!” He went to the edge of the brook and stood looking down at the small fry. Jane followed. Then they walked about in the Inlets, then sat down again and watched the sunset; and so the evening wore away until they went home. Jane was shut up again the following day, busy with her dress; Oliver, as usual, was in the Buttery with his father. At twelve o’clock
  • 44.
    Mr. Preen preparedto go out to keep an appointment at Evesham, leaving Oliver a lot of work to do, very much to his aggravation. “It’s a shame. It will take me all the afternoon to get through it,” ran his thoughts—and he would have liked to say so aloud. “You don’t look pleased, young man,” remarked his father. “Recollect you will be off duty to-morrow.” Oliver’s countenance cleared; his disposition was a pleasant one, never retaining anger long, and he set to his task with a good will. The morrow being the day of the picnic, he would have whole holiday. At five o’clock the young servant carried the tea-tray into the parlour. Presently Mrs. Preen came in, made the tea, and sat down to wait for her son and daughter. Tired and hot, she was glad of the rest. Jane ran downstairs, all happiness. “Mamma, it is finished,” she cried; “quite finished. It looks so well.” “It had need look well,” fretfully retorted Mrs. Preen, who had been unable to get at Jane for any useful purpose these two days, and resented it accordingly. “When all trades fail I can turn dressmaker,” said the girl, gaily. “Where’s Oliver?” “In the Buttery, I expect; he said he had a great deal to do there this afternoon, and I have not seen him about,” replied Mrs. Preen, as she poured out the tea. “Not that I should have been likely to see him—shut into that hot kitchen with the ironing.” Jane knew this was a shaft meant for herself. At ordinary times she did her share of the ironing. “I will tell Oliver that tea is ready, mamma,” she said, rising to go to the other room. “Why, there he is, sitting in the shade under the walnut tree,” she exclaimed, happening to look from the window.
  • 45.
    “Sitting out inthe cool,” remarked Mrs. Preen. “I don’t blame him, poring all day long over those accounts and things. Call him in, Jane.” “Coming,” said Oliver, in response to Jane’s call from the open window. He crossed the grass slowly, fanning himself with his straw hat. His fair face—an unusual thing with him—was scarlet. “You look red-hot, Oliver,” laughed his sister. “If it is as hot to-morrow as it is to-day we shall get a baking,” returned Oliver. “In this intense weather nothing makes one feel the heat like work, and I suppose you’ve been hard at it this afternoon,” said his mother in a tone of compassion, for she disliked work naturally very much herself. “Of course; I had to be,” answered Oliver. He and Jane sat together under the shade of the walnut tree after tea. When it grew a little cooler they went to the Inlets, that favourite resort of theirs; a spot destined to bear a strange significance for one of them in the days to come; a haunting remembrance. II The white mist, giving promise of a hot and glorious day, had hardly cleared itself from the earth, when, at ten o’clock on the Thursday morning, Jane and Oliver Preen set off in the gig for North Villa, both of them as spruce as you please; Jane in that pretty summer dress she had spent so much work over, a straw hat with its wreath of pink may shading her fair face, Oliver with a white rose in his button- hole. The party was first to assemble at Mrs. Jacob Chandler’s, and to go from thence in waggonettes. There had been some trouble
  • 46.
    about the gig,Mr. Preen wanting it himself that day, or telling Jane and Oliver that he did, and that they could walk. Jane almost cried, declaring she did not care to arrive at North Villa looking like a milkmaid, hot and red with walking; and Mr. Preen gave way. Oliver was to drive himself and Jane, Sam being sent on to Crabb to bring back the gig. Mr. Preen did not regard the picnic with favour. Mr. Preen could not imagine what anybody could want at one, he said, when ungraciously giving consent to Oliver’s absenting himself from that delightful Buttery for a whole day. Picnics in truth are nearly all alike, and are no doubt more agreeable to the young than to the old. This one was given conjointly by the Jacob Chandlers, the Letsoms, the Coneys, and the Ashtons of Timberdale. A few honorary guests were invited. I call them honorary because they had nothing to do with finding provisions. Tod got an invitation, myself also; and uncommonly vexed we were not to be able to arrive till late in the afternoon. The Beeles from Pigeon Green were coming to spend the day at Crabb Cot, and the Squire would not let us off earlier. The picnic was held upon Mrs. Cramp’s farm, not far from Crabb, and a charming spot for it. Gentle hills and dales, shady groves and mossy glens surrounded the house, which was a very good one. So that it may be said we all were chiefly Mrs. Cramp’s guests. Mrs. Cramp made a beaming hostess, and was commander-in-chief at her own tea-table. Tea was taken in her large parlour, to save the bother of carrying things out. Dinner had been taken in the dell, under shade of the high and wide-spreading trees. They were seated at tea when we got there. Such a large company at the long table; and such tempting things to eat! I found a seat by Emma Paul, the prettiest girl there; Oliver Preen was next her on the other side. Mary MacEveril made room for Tod beside her. The MacEverils were proud, exclusive people, and Miss MacEveril
  • 47.
    privately looked downon some of her fellow guests; but Tod was welcome; he was of her own order. Two or three minutes later Tom Chandler came in; he also had not been able to get away earlier. He shook hands with his aunt, Mrs. Cramp, nodded to the rest of us, and deftly managed to wedge himself in between Emma Paul and young Preen. Preen did not seem pleased, Emma did; and made all the room she could, by crushing me. “I wouldn’t be in your shoes to-morrow morning, young man,” began Mr. Chandler, in a serio-comic tone, as he looked at Dick MacEveril across the table. “To leave the office to its own devices the first thing this morning, in defiance of orders——” “Hang the musty old office!” interrupted MacEveril, with a genial laugh. Valentine Chandler had done the same by his office; pleasure first and business later always with both of them; but Valentine was his own master and MacEveril was not. In point of fact, Mr. Paul, not a man to be set at defiance by his clerks, was in a great rage with Dick MacEveril. I supposed the attractions of the picnic had been too powerful for Dick, and that he thought the sooner he got to it the better. But this proved to be a fallacy. Mrs. Cramp was setting her nephew right. “My dear Tom, you are mistaken. Mr. MacEveril did not come this morning; he only got here an hour ago—like two or three more of the young men.” “Oh, did he not, Aunt Mary Ann?” replied Tom, turning his handsome, pleasant face upon her. “Yes, and if you were not at the office I should like to know what you did with yourself all day, Dick,” severely cried Miss MacEveril, bending forward to regard her cousin.
  • 48.
    “I went tosee the pigeon-match,” said Dick, coolly. “To see the pigeon-match!” she echoed. “How cruel of you! You had better not let papa know.” “If anyone lets him know it will be yourself, Miss Mary. And suppose you hold your tongue now,” cried Dick, not very politely. This little passage-at-arms over, we went on with tea. Afterwards we strolled out of doors and disposed of ourselves at will. Some of the Chandler girls took possession of me, and I went about with them. When it was getting late, and they had talked me deaf, I began looking about for Tod, and found him on a bench within the Grove. A sheltered spot. Sitting there, you could look out, but people could not look in. Mary MacEveril and Georgiana Chandler were with him; Oliver Preen stood close by, leaning against the stump of a tree. I thought how sad his look was, and wondered what made it so. Within view of us, but not within hearing, in a dark, narrow walk Tom Chandler and Emma Paul were pacing side by side, absorbed evidently in one another. The sun had set, the lovely colours in the sky were giving place to twilight. It was the hour when matter-of- fact prosaic influences change into romance; when, if there’s any sentiment within us it is safe to come out.
  • 49.
    “It is thehour when from the boughs The nightingale’s high note is heard; It is the hour when lovers’ vows Seem sweet in every whispered word,” as Lord Byron says. And who could discourse on love—the true ring of it, mind you—as he did? “Do sing,” said Tod to Miss MacEveril; and I found they had been teasing her to do so for the last five minutes. She had a pleasant voice and sang well. “I’m sure you don’t care to hear me, Mr. Todhetley.” “But I’m sure I do,” answered Tod, who would flirt with pretty girls when the fit took him. Flirt and flatter too. “We should have everyone coming round us.” “Not a soul of them. They are all away somewhere, out of hearing. Do sing me one song.” She began at once, without more ado, choosing an old song that Mrs. Todhetley often chose; one that was a favourite of hers, as it was of mine: “Faithless Emma.” Those songs of the old days bore, all of them, a history. “I wandered once at break of day, While yet upon the sunless sea In wanton sighs the breeze delayed, And o’er the wavy surface played. Then first the fairest face I knew, First loved the eye of softest blue, And ventured, fearful, first to sip The sweets that hung upon the lip Of faithless Emma. So mixed the rose and lily white That nature seemed uncertain, quite,
  • 50.
    To deck hercheek which flower she chose, The lily or the blushing rose. I wish I ne’er had seen her eye, Ne’er seen her cheeks of doubtful dye, Nor ever, ever dared to sip The sweets that hung upon the lip Of faithless Emma. Now though from early dawn of day, I rove alone and, anxious, stray Till night with curtain dark descends, And day no more its glimmering lends; Yet still, like hers no cheek I find, No eye like hers, save in my mind, Where still I fancy that I sip The sweets that hung upon the lip Of faithless Emma.” “I think all Emmas are faithless,” exclaimed Georgiana, speaking at random, as the last sounds of the sweet song died away. “A sweeping assertion, Miss Georgie,” laughed Tod. “Any way, I knew two girls named Emma who were faithless to their engaged lovers, and one of them’s not married yet to any one else,” returned Georgie. “I think I know one Emma who will be true for ever and a day,” cried Tod, as he pointed significantly to Emma Paul, still walking side by side with Tom Chandler in the distance. “I could have told you that before now,” said Mary MacEveril. “I have seen it for a long time, though Miss Emma will never confess to it.” “And now, I fancy it will soon be a case,” continued Tod. “A case!” cried Georgie. “What do you mean?” “A regular case; dead, and gone, and done for,” nodded Tod. “Church bells and wedding gloves, and all the rest of the paraphernalia. Looks like it, anyhow, to-night.”
  • 51.
    Welcome to ourwebsite – the ideal destination for book lovers and knowledge seekers. With a mission to inspire endlessly, we offer a vast collection of books, ranging from classic literary works to specialized publications, self-development books, and children's literature. Each book is a new journey of discovery, expanding knowledge and enriching the soul of the reade Our website is not just a platform for buying books, but a bridge connecting readers to the timeless values of culture and wisdom. With an elegant, user-friendly interface and an intelligent search system, we are committed to providing a quick and convenient shopping experience. Additionally, our special promotions and home delivery services ensure that you save time and fully enjoy the joy of reading. Let us accompany you on the journey of exploring knowledge and personal growth! ebookname.com