SlideShare a Scribd company logo
Automating with SIMATIC S7 1200 Configuring
Programming and Testing with STEP 7 Basic Second
Edition Hans Berger pdf download
https://ebookgate.com/product/automating-with-
simatic-s7-1200-configuring-programming-and-testing-with-
step-7-basic-second-edition-hans-berger/
Get Instant Ebook Downloads – Browse at https://ebookgate.com
Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...
Automating with SIMATIC S7 300 inside TIA Portal
Configuring Programming and Testing with STEP 7
Professional 2nd Edition Hans Berger
https://ebookgate.com/product/automating-with-simatic-s7-300-inside-
tia-portal-configuring-programming-and-testing-with-
step-7-professional-2nd-edition-hans-berger/
ebookgate.com
Assembly Language Step by Step Programming with Linux 3rd
Edition Edition Jeff Duntemann
https://ebookgate.com/product/assembly-language-step-by-step-
programming-with-linux-3rd-edition-edition-jeff-duntemann/
ebookgate.com
Programming with Microsoft Visual Basic 2010 5th Edition
Diane Zak
https://ebookgate.com/product/programming-with-microsoft-visual-
basic-2010-5th-edition-diane-zak/
ebookgate.com
Davis s Basic Math Review for Nurses with Step by Step
Solutions 1st Edition Vicki Raines
https://ebookgate.com/product/davis-s-basic-math-review-for-nurses-
with-step-by-step-solutions-1st-edition-vicki-raines/
ebookgate.com
Automating Microsoft Azure with PowerShell 1st Edition
Aman Dhally
https://ebookgate.com/product/automating-microsoft-azure-with-
powershell-1st-edition-aman-dhally/
ebookgate.com
Programming with Mobile Applications Android iOS and
Windows Phone 7 1st Edition Thomas J. Duffy
https://ebookgate.com/product/programming-with-mobile-applications-
android-ios-and-windows-phone-7-1st-edition-thomas-j-duffy/
ebookgate.com
Object Oriented Programming with C 2 e Second Edition
Sahay
https://ebookgate.com/product/object-oriented-programming-
with-c-2-e-second-edition-sahay/
ebookgate.com
Structural Equation Modeling With AMOS Basic Concepts
Applications and Programming Multivariate Applications 2nd
edition Barbara Byrne
https://ebookgate.com/product/structural-equation-modeling-with-amos-
basic-concepts-applications-and-programming-multivariate-
applications-2nd-edition-barbara-byrne/
ebookgate.com
Programming the Raspberry Pi Second Edition Getting
Started with Python Simon Monk
https://ebookgate.com/product/programming-the-raspberry-pi-second-
edition-getting-started-with-python-simon-monk/
ebookgate.com
Automating with SIMATIC S7 1200 Configuring Programming and Testing with STEP 7 Basic Second Edition Hans Berger
Hans Berger
Automating with
SIMATIC S7-1200
Configuring, Programming and Testing
with STEP 7 Basic
Visualization with WinCC Basic
Second Edition
Berger Automating with SIMATIC S7-1200
Automating with SIMATIC S7 1200 Configuring Programming and Testing with STEP 7 Basic Second Edition Hans Berger
Automating with
SIMATIC S7-1200
Configuring, Programming and
Testing with STEP 7 Basic
Visualization with HMI Basic
by Hans Berger
2nd
enlarged and revised edition, 2013
Publicis Publishing
Bibliographic information published by the Deutsche Nationalbibliothek
The Deutsche Nationalbibliothek lists this publication in the Deutsche Nationalbibliografie;
detailed bibliographic data are available on the Internet at http://dnb.d-nb.de.
The author, translators and publisher have taken great care with all texts and
illustrations in this book. Nevertheless, errors can never be completely avoided.
The publisher, author and translators accept no liability, for whatever legal reasons,
for any damage resulting from the use of the programming examples.
www.publicis-books.de
Print ISBN: 978-3-89578-385-2
ePDF ISBN: 978-3-89578-901-4
2nd
edition, 2013
Editor: Siemens Aktiengesellschaft, Berlin and Munich
Publisher: Publicis Publishing, Erlangen
© 2013 by Publicis Erlangen, Zweigniederlassung der PWW GmbH
This 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 individual
illustrations or 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 concept permits uniform handling of all automa-
tion 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 management and
communication.
This book describes the newly developed SIMATIC S7-1200 automation system. The
S7-1200 programmable controllers are of compact design and allow modular ex-
pansion. Many small applications can be solved using the CPU module with
on-board I/O. The technological functions integrated in the CPU module mean that
extremely versatile use of the device is possible. Two established programming lan-
guages are available for solving automation tasks: ladder logic (LAD) and function
block diagram (FBD).
New SIMATIC HMI Basic Panels have been designed for operator control and moni-
toring appropriate to the S7-1200 programmable controllers, and provide a perfor-
mance and functionality optimized for small applications. A touch screen with var-
ious monitor sizes and coordinated communication over Industrial Ethernet are
ideal prerequisites for interaction with S7-1200.
The STEP 7 Basic engineering software makes it possible to use all S7-1200 control-
ler options. STEP 7 Basic is the common tool for hardware configuration, genera-
tion of the control program, and for debugging and diagnostics. The SIMATIC
WinCC Basic configuration software included in STEP 7 Basic is used to configure
the Basic Panels. Modern and intuitive user guidance allows efficient and task-ori-
ented engineering of control and visualization devices.
This book describes the S7-1200 automation system with S7-1200 programmable
controllers and HMI Basic Panels. The description focuses on the generation of the
control program using STEP 7 Basic engineering software Version 11 SP2.
Nuremberg, February 2013 Hans Berger
The contents of the book at a glance
6
The contents of the book at a glance
Start
Introduction
SIMATIC S7-1200: Overview of the SIMATIC S7-1200 automation system.
STEP 7 Basic: Introduction to the engineering software for SIMATIC S7-1200.
SIMATIC project: Basic functions for the automation solution.
Devices & networks
The hardware components of S7-1200
Modules: Overview of the SIMATIC S7-1200 modules.
Device configuration
Hardware configuration: Configuration of the hardware design.
Network configuration: Configuration of a communication network.
PLC programming
The control program
Operating modes: How the CPU module responds with STARTUP, RUN and STOP.
Processing modes: Restart characteristics, main program, interrupt processing, and
error handling define the processing of the control program.
Blocks: Organization blocks, function blocks, functions, and data blocks structure
the control program.
The program editor
Programming: How the control program is produced.
Program information: Tools for supporting programming.
Ladder logic and function block diagram as programming languages
Program elements: The characteristics of LAD and FBD programming; the use of contacts,
coils, standard boxes, Q boxes and EN/ENO boxes.
Tags and data types
Tags: Operand areas, project-wide and block-local tags, addressing.
Data types: Description of elementary and compound data types.
Description of the control functions
Basic functions: Binary operations, memory functions, edge evaluation, timer and
counter functions.
Digital functions: Move, comparison, arithmetic, math, conversion, shift, and
logic functions.
Program flow control: Jump functions, block end function, block calls.
The contents of the book at a glance
7
Online & diagnostics
Connection of programming device to PLC station
Online operation: Establish connection to PLC station.
Status LEDs: The modules signal an error.
Diagnostics information: Find the error using the diagnostics information.
Online tools: Control the CPU module using the online tools.
Online & offline project data
Download: Download control program into CPU memory.
Blocks: Edit and compare the blocks offline/online.
Test: Test the control function using program status and monitoring tables.
Data communication
Open user communication
Data transmission: Data exchange from PLC to PLC over Ethernet.
Point-to-point connection
PtP: Data transmission with CM modules via RS232 and RS485.
Visualization
Configuration of Basic Panels
Introduction: Overview of Basic Panels.
Start: Create an HMI project, the HMI device wizard.
Connection to the PLC: Create HMI tags and area pointers.
Create screens: Configuration of process screens – templates, layers and screen
changeover.
Working with image elements: Arrange and edit operator control and display elements,
configure a message system, create recipes, transfer data records, configure user manage-
ment.
Complete the HMI program
Simulation: Simulate the HMI program with PLC station or with tag table.
Connection: Transfer the HMI program to the HMI station.
Appendix
Integral and technological functions
Functions: High-speed counter, pulse generator, motion control, PID controller.
Global libraries
Overview: USS drive control, MODBUS blocks.
Table of contents
8
Table of contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.1 Overview of the S7-1200 automation system . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.1.1 SIMATIC S7-1200 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.1.2 Overview of STEP 7 Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.1.3 Three programming languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.1.4 Execution of the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.1.5 Data management in the SIMATIC automation system . . . . . . . . . . . . . . . 29
1.1.6 Operator control and monitoring with process images . . . . . . . . . . . . . . 30
1.2 Introduction to STEP 7 Basic for S7-1200 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.2.1 Installing STEP 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.2.2 Automation License Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.2.3 Starting STEP 7 Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1.2.4 Portal view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1.2.5 Help Information system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.2.6 The windows of the project view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
1.2.7 Adapting the user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
1.3 Editing a SIMATIC project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.3.1 Structured representation of project data . . . . . . . . . . . . . . . . . . . . . . . . . 38
1.3.2 Project data and editors for a PLC station . . . . . . . . . . . . . . . . . . . . . . . . . . 39
1.3.3 Creating and editing a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
1.3.4 Creating and editing libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2 SIMATIC S7-1200 automation system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.1 S7-1200 station components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.2 S7-1200 CPU modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.2.1 Integrated I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.2.2 PROFINET connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.2.3 Status LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2.2.4 SIMATIC Memory Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2.2.5 Expansions of the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2.3 Signal modules (SM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.3.1 Digital I/O modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.3.2 Analog input/output modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.3.3 Properties of the I/O connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.4 Communication modules (CM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.4.1 Point-to-point communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.4.2 PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.4.3 Actuator/sensor interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
2.4.4 GPRS transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
2.5 Further modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.5.1 Compact switch module (CSM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Table of contents
9
2.5.2 Power module (PM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.5.3 TS Adapter IE Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.5.4 SIM 1274 simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.6 SIPLUS S7-1200 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3 Device configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.2 Configuring a station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.2.1 Adding a PLC station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.2.2 Arranging modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.2.3 Adding an HMI station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.3 Assigning module parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.3.1 Parameterization of CPU properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.3.2 Addressing input and output signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.3.3 Parameterization of digital inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.3.4 Parameterization of digital outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.3.5 Parameterization of analog inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.3.6 Parameterization of analog outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.4 Configuring the network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.4.2 Networking stations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.4.3 Node addresses in a subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3.4.4 Connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.4.5 Configuring a PROFINET subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.4.6 Configuring a PROFIBUS subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
3.4.7 Configuring an AS-i subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
4 Variables and data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
4.1 Operands and tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
4.1.1 Introduction, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
4.1.2 Operand areas: inputs and outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
4.1.3 Operand area bit memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
4.1.4 Operand area data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
4.1.5 Operand area temporary local data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
4.2 Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
4.2.1 Signal path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
4.2.2 Absolute addressing of an operand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
4.2.3 Absolute addressing of an operand area . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
4.2.4 Symbolic addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
4.2.5 Addressing a tag part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
4.2.6 Addressing constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
4.2.7 Indirect addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
4.3 General information on data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
4.3.1 Overview of data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
4.3.2 Implicit data type conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
4.3.3 Overlaying tags (data type views) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
4.4 Elementary data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
4.4.1 Bit-serial data types BOOL, BYTE, WORD and DWORD . . . . . . . . . . . . . . . . 95
Table of contents
10
4.4.2 BCD-coded numbers BCD16 and BCD32 . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
4.4.3 Unsigned fixed-point data types USINT, UINT and UDINT . . . . . . . . . . . . 97
4.4.4 Fixed-point data types with sign SINT, INT and DINT . . . . . . . . . . . . . . . . 98
4.4.5 Floating-point data types REAL and LREAL . . . . . . . . . . . . . . . . . . . . . . . . . 98
4.4.6 Data type CHAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
4.4.7 Data type DATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
4.4.8 Data type TIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
4.4.9 TIME_OF_DAY (TOD) data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
4.5 Structured data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
4.5.1 Data type DTL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
4.5.2 Data type STRING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
4.5.3 Data type ARRAY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
4.5.4 Data type STRUCT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
4.6 Parameter types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
4.6.1 Parameter types for IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . 107
4.6.2 Parameter types for IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . 108
4.6.3 Parameter type VARIANT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
4.6.4 Parameter type VOID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
4.7 PLC data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
4.8 System data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
4.8.1 IEC_TIMER system data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
4.8.2 IEC_COUNTER system data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
4.8.3 TCON_Param data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
4.8.4 TADDR_Param data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
4.8.5 Data type ErrorStruct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
4.8.6 TimeTransformationRule data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
4.9 Hardware data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
5 Edit user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
5.1 Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
5.1.1 STOP mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
5.1.2 STARTUP mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
5.1.3 RUN mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
5.1.4 Retentive behavior of operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
5.2 Creating a user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
5.2.1 Program draft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
5.2.2 Program execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
5.2.3 Nesting depth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
5.3 Programming blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
5.3.1 Block types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
5.3.2 Editing block properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
5.3.3 Configuring know-how protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
5.3.4 Copy protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
5.3.5 Block interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
5.3.6 Programming block parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
5.4 Calling blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
5.4.1 General information on calling logic blocks . . . . . . . . . . . . . . . . . . . . . . 137
5.4.2 Calling a function (FC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Table of contents
11
5.4.3 Calling a function block (FB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
5.4.4 “Passing on” of block parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
5.5 Start-up routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
5.6 Main program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
5.6.1 Organization blocks for the main program . . . . . . . . . . . . . . . . . . . . . . . 143
5.6.2 Process image update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
5.6.3 Cycle time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
5.6.4 Reaction time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
5.6.5 Stop program execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
5.6.6 Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
5.6.7 Runtime meter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
5.7 Interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
5.7.1 Introduction to interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
5.7.2 Time-delay interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
5.7.3 Cyclic interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
5.7.4 Process interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
5.7.5 Assigning interrupts during runtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
5.7.6 Delay and enable interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
5.8 Troubleshooting, diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
5.8.1 Causes of errors and responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
5.8.2 Error display with the ENO output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
5.8.3 Time error OB 80 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
5.8.4 Local error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
5.8.5 Diagnostic functions in the user program . . . . . . . . . . . . . . . . . . . . . . . . 172
5.8.6 Diagnostics interrupt OB 82 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
6 Program editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
6.2 PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
6.2.1 Creating and editing the PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
6.2.2 Defining PLC tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
6.2.3 Editing a PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
6.2.4 Exporting and importing a PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . 181
6.2.5 Constants tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
6.3 Programming a code block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
6.3.1 Creating a new code block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
6.3.2 Working area of program editor for code blocks . . . . . . . . . . . . . . . . . . . 184
6.3.3 Specifying code block properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
6.3.4 Programming a block interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
6.3.5 Programming control functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
6.3.6 Editing tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
6.3.7 Working with program comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
6.4 Programming a data block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
6.4.1 Creating a new data block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
6.4.2 Working area of program editor for data blocks . . . . . . . . . . . . . . . . . . . 195
6.4.3 Defining properties for data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
6.4.4 Declaring data tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
6.4.5 Entering data tags in global data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Table of contents
12
6.5 Compiling blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
6.5.1 Starting the compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
6.5.2 Compiling SCL blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
6.5.3 Eliminating errors following compilation . . . . . . . . . . . . . . . . . . . . . . . . 200
6.6 Program information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
6.6.1 Cross-reference list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
6.6.2 Assignment list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
6.6.3 Call structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
6.6.4 Dependency structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
6.6.5 Consistency check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
6.6.6 CPU resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
6.7 Language setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
7 Ladder logic LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
7.1.1 Programming with LAD in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
7.1.2 Program elements of ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
7.2 Programming with contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
7.2.1 NO and NC contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
7.2.2 Consideration of sensor type in ladder logic . . . . . . . . . . . . . . . . . . . . . . 213
7.2.3 Series connection of contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
7.2.4 Parallel connection of contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
7.2.5 Mixed series and parallel connections . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
7.2.6 T branch, open parallel branch in the ladder logic . . . . . . . . . . . . . . . . . 217
7.2.7 Negating result of logic operation in the ladder logic . . . . . . . . . . . . . . . 218
7.2.8 Edge evaluation of a binary tag in ladder logic . . . . . . . . . . . . . . . . . . . . 218
7.2.9 OK contact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
7.2.10 Comparison contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
7.3 Programming with coils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
7.3.1 Simple and negated coils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
7.3.2 Set and reset coil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
7.3.3 Retentive response due to latching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
7.3.4 Edge evaluation with pulse output in the ladder logic . . . . . . . . . . . . . . 224
7.3.5 Multiple setting and resetting (filling of bit field) in the ladder logic . 225
7.3.6 Starting IEC timer functions in the ladder logic with coils . . . . . . . . . . . 225
7.4 Programming with Q boxes in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . 226
7.4.1 Arrangement of Q boxes in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . 226
7.4.2 Memory boxes in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
7.4.3 Edge evaluation of current flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
7.4.4 Example of binary scaler in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . 229
7.4.5 Controlling IEC timer functions in the ladder logic with Q boxes . . . . . 230
7.4.6 Controlling IEC counter functions in the ladder logic with Q boxes . . . 231
7.5 Programming with EN/ENO boxes in the ladder logic . . . . . . . . . . . . . . . . . . 233
7.5.1 Positioning of EN/ENO boxes in the ladder logic . . . . . . . . . . . . . . . . . . . 234
7.5.2 Transfer functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
7.5.3 Arithmetic functions for numerical values in the ladder logic . . . . . . . 236
7.5.4 Arithmetic functions for time values in the ladder logic . . . . . . . . . . . . 236
7.5.5 Math functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Table of contents
13
7.5.6 Conversion functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . 238
7.5.7 Shift functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
7.5.8 Logic functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
7.5.9 Functions for strings in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . 240
7.6 Functions for program flow control (LAD) . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
7.6.1 Jump functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
7.6.2 Jump list in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
7.6.3 Jump distributor in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
7.6.4 Block end function in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
7.6.5 Block call functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
8 Function block diagram FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
8.1.1 Programming with function block diagram in general . . . . . . . . . . . . . . 246
8.1.2 Program elements of the function block diagram . . . . . . . . . . . . . . . . . . 248
8.2 Programming of binary logic operations (FBD) . . . . . . . . . . . . . . . . . . . . . . . 249
8.2.1 Scanning for signal states “1” and “0” . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
8.2.2 Taking account of the sensor type in the function block diagram . . . . . 251
8.2.3 AND function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
8.2.4 OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
8.2.5 Exclusive OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
8.2.6 Mixed binary logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
8.2.7 T branch in the function block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 255
8.2.8 Negate result of logic operation in the function block diagram . . . . . . 255
8.2.9 Edge evaluation of binary tags in the function block diagram . . . . . . . 256
8.2.10 Validity checking of floating-point numbers in the function block
diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
8.2.11 Comparison functions in the function block diagram . . . . . . . . . . . . . 258
8.3 Programming with standard boxes (FBD) . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
8.3.1 Assignment and negated assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
8.3.2 Set and reset boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
8.3.3 Edge evaluation with pulse output in the function block diagram . . . . 261
8.3.4 Multiple setting and resetting (filling of bit field) in the function
block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
8.3.5 Starting IEC timer functions in the function block diagram with
standard boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
8.4 Programming with Q boxes (FBD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
8.4.1 Arrangement of Q boxes in the function block diagram . . . . . . . . . . . . . 264
8.4.2 Memory boxes in the function block diagram . . . . . . . . . . . . . . . . . . . . . 265
8.4.3 Edge evaluation of logic operation result in the function block
diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
8.4.4 Example of binary scaler in the function block diagram . . . . . . . . . . . . 267
8.4.5 Controlling IEC timer functions in the function block diagram
with Q boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
8.4.6 IEC counter functions in the function block diagram . . . . . . . . . . . . . . . 268
8.5 Programming with EN/ENO boxes (FBD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
8.5.1 Positioning of EN/ENO boxes in the function block diagram . . . . . . . . . 270
8.5.2 Transfer functions in the function block diagram . . . . . . . . . . . . . . . . . . 271
Table of contents
14
8.5.3 Arithmetic functions for numerical values in the function block
diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
8.5.4 Arithmetic functions with time values in the function block diagram . 273
8.5.5 Math functions in the function block diagram . . . . . . . . . . . . . . . . . . . . . 274
8.5.6 Conversion functions in the function block diagram . . . . . . . . . . . . . . . 275
8.5.7 Shift functions in the function block diagram . . . . . . . . . . . . . . . . . . . . . 276
8.5.8 Logic functions in the function block diagram . . . . . . . . . . . . . . . . . . . . 277
8.5.9 Functions for strings in the function block diagram . . . . . . . . . . . . . . . . 278
8.6 Functions for program flow control (FBD) . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
8.6.1 Jump functions in the function block diagram . . . . . . . . . . . . . . . . . . . . 280
8.6.2 Jump list in the function block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 281
8.6.3 Jump distributor in the function block diagram . . . . . . . . . . . . . . . . . . . 281
8.6.4 Block end function in the function block diagram . . . . . . . . . . . . . . . . . . 282
8.6.5 Block call functions in the function block diagram . . . . . . . . . . . . . . . . . 282
9 Structured Control Language SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
9.1 Introduction to programming with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
9.1.1 Programming with SCL in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
9.1.2 SCL statements and operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
9.2 Programming binary logic operations with SCL . . . . . . . . . . . . . . . . . . . . . . 288
9.2.1 Scanning for signal states “1” and “0” . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
9.2.2 Taking account of the sensor type for SCL . . . . . . . . . . . . . . . . . . . . . . . . 289
9.2.3 AND function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
9.2.4 OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
9.2.5 Exclusive OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
9.2.6 Combined binary logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
9.2.7 Negating the result of logic operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
9.3 Programming memory functions with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . 294
9.3.1 Value assignment of a binary tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
9.3.2 Setting and resetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
9.3.3 Edge evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
9.4 Programming timer and counter functions with SCL . . . . . . . . . . . . . . . . . . 296
9.4.1 IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
9.4.2 IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
9.5 Programming digital functions with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
9.5.1 Transfer function, value assignment of a digital tag . . . . . . . . . . . . . . . . 298
9.5.2 Conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
9.5.3 Comparison functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
9.5.4 Arithmetic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
9.5.5 Mathematical functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
9.5.6 Word logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
9.5.7 Shift functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
9.6 Controlling the program flow with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
9.6.1 Working with the ENO tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
9.6.2 EN/ENO mechanism with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
9.6.3 Control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
9.6.4 Block functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
9.7 Working with source files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Table of contents
15
9.7.1 General procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
9.7.2 Programming a logic block in the source file . . . . . . . . . . . . . . . . . . . . . . 321
9.7.3 Programming a data block in the source file . . . . . . . . . . . . . . . . . . . . . . 325
9.7.4 Programming a PLC data type in the source file . . . . . . . . . . . . . . . . . . . 327
10 Basic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
10.1 Binary logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
10.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
10.1.2 Scanning for signal states “1” and “0”, result of the scan . . . . . . . . . . . 329
10.1.3 Negating the result of the logic operation, NOT contact . . . . . . . . . . . . 329
10.1.4 Testing floating-point tag, OK contact, OK box . . . . . . . . . . . . . . . . . . . 330
10.1.5 AND function, series connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
10.1.6 OR function, parallel connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
10.1.7 Exclusive OR function, non-equivalence function . . . . . . . . . . . . . . . . . 333
10.2 Memory functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
10.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
10.2.2 Simple and negated coil, assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
10.2.3 Single set and reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
10.2.4 Multiple setting and resetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
10.2.5 Dominant setting and resetting, memory boxes . . . . . . . . . . . . . . . . . . 337
10.3 Edge evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
10.3.1 Functional principle of an edge evaluation . . . . . . . . . . . . . . . . . . . . . . 338
10.3.2 Edge evaluation of the result of the logic operation . . . . . . . . . . . . . . . 340
10.3.3 Edge evaluation of a binary tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
10.3.4 Edge evaluation with pulse output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
10.4 Time functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
10.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
10.4.2 Pulse generation TP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
10.4.3 On-delay TON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
10.4.4 OFF delay TOF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
10.4.5 Accumulating ON delay TONR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
10.5 Counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
10.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
10.5.2 Up counter CTU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
10.5.3 Down counter CTD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
10.5.4 Up-down counter CTUD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
11 Digital functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
11.1 Transfer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
11.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
11.1.2 Copy tag, MOVE box for LAD and FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
11.1.3 Copy string, S_MOVE box for LAD and FBD . . . . . . . . . . . . . . . . . . . . . . 357
11.1.4 Value assignments with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
11.1.5 Copy data area (MOVE_BLK, UMOVE_BLK) . . . . . . . . . . . . . . . . . . . . . . . 360
11.1.6 Filling the data area (FILL_BLK, UFILL_BLK) . . . . . . . . . . . . . . . . . . . . . 361
11.1.7 Read and write the load memory (READ_DBL, WRIT_DBL) . . . . . . . . . . 362
11.1.8 Swap bytes (SWAP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
11.2 Comparison functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
Table of contents
16
11.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
11.2.2 Comparison of two tag values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
11.2.3 Range comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
11.3 Arithmetic functions for numerical values . . . . . . . . . . . . . . . . . . . . . . . . . 366
11.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
11.3.2 Addition ADD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
11.3.3 Subtraction SUB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
11.3.4 Multiplication MUL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
11.3.5 Division DIV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
11.3.6 Division with remainder as result MOD . . . . . . . . . . . . . . . . . . . . . . . . . 368
11.3.7 Generation of absolute value ABS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
11.3.8 Negation NEG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
11.3.9 Decrement DEC, increment INC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
11.4 Arithmetic functions for time values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
11.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
11.4.2 Addition T_ADD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
11.4.3 Subtraction T_SUB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
11.4.4 Difference T_DIFF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
11.4.5 Combine T_COMBINE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
11.5 Mathematical functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
11.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
11.5.2 Trigonometric functions SIN, COS, TAN . . . . . . . . . . . . . . . . . . . . . . . . . 373
11.5.3 Arc functions ASIN, ACOS, ATAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
11.5.4 Formation of square SQR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
11.5.5 Extraction of square root SQRT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
11.5.6 Exponentiate to base e EXP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
11.5.7 Calculation of Napierian logarithm LN . . . . . . . . . . . . . . . . . . . . . . . . . . 374
11.5.8 Extracting decimal places FRAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
11.5.9 Exponentiation to any base EXPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
11.6 Conversion functions (Conversion of data type) . . . . . . . . . . . . . . . . . . . . . 376
11.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
11.6.2 Conversion function CONV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
11.6.3 Conversion functions for floating-point numbers . . . . . . . . . . . . . . . . . 378
11.6.4 Conversion functions SCALE_X and NORM_X . . . . . . . . . . . . . . . . . . . . 381
11.6.5 Conversion function T_CONV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
11.6.6 Conversion function S_CONV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
11.6.7 Conversion functions STRG_VAL and VAL_STRG . . . . . . . . . . . . . . . . . . 385
11.6.8 Conversion functions STRG_TO_CHARS and CHARS_TO_STRG . . . . . . 387
11.6.9 Conversion functions ATH and HTA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
11.7 Shift functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
11.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
11.7.2 Shift to right (SHR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
11.7.3 Shift to left (SHL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
11.7.4 Rotate to right (ROR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
11.7.5 Rotate to left (ROL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
11.8 Logic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
11.8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
11.8.2 Word logic operations (AND, OR, XOR) . . . . . . . . . . . . . . . . . . . . . . . . . . 392
11.8.3 Invert (INV) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Table of contents
17
11.8.4 Coding functions DECO and ENCO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
11.8.5 Selection functions SEL, MUX, and DEMUX . . . . . . . . . . . . . . . . . . . . . . 395
11.8.6 Minimum selection MIN, Maximum selection MAX . . . . . . . . . . . . . . . 397
11.8.7 Limiter LIMIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
11.9 Processing of strings (Data type STRING) . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
11.9.1 Output length of a string LEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
11.9.2 Combine strings CONCAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
11.9.3 Output left part of string LEFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
11.9.4 Output right part of string RIGHT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
11.9.5 Output middle part of string MID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
11.9.6 Delete part of a string DELETE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
11.9.7 Insert string INSERT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
11.9.8 Replace part of string REPLACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
11.9.9 Find part of string FIND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
11.10 Calculating with the CALCULATE box in LAD and FBD . . . . . . . . . . . . . . . 404
12 Program flow control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
12.1 Jump functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
12.1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
12.1.2 Absolute jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
12.1.3 Conditional jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
12.1.4 Jump list JMP_LIST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
12.1.5 Jump distributor SWITCH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
12.2 Block end function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
12.3 Calling of code blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
12.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
12.3.2 Calling a function FC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
12.3.3 Calling a function block (FB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
12.4 EN/ENO mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
12.4.1 EN/ENO mechanism with LAD and FBD . . . . . . . . . . . . . . . . . . . . . . . . . . 418
12.4.2 EN/ENO mechanism with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
12.4.3 EN/ENO for user blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
13 Online operation, diagnostics and debugging . . . . . . . . . . . . . . . . . . . . . 420
13.1 Connecting a programming device to the PLC station . . . . . . . . . . . . . . . . 421
13.1.1 IP addresses of the programming device . . . . . . . . . . . . . . . . . . . . . . . . 421
13.1.2 Connecting the programming device to the PLC station . . . . . . . . . . . 422
13.1.3 Assigning an IP address to the CPU module . . . . . . . . . . . . . . . . . . . . . . 424
13.1.4 Switching on the online mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
13.2 Transferring project data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
13.2.1 Loading project data for the first time . . . . . . . . . . . . . . . . . . . . . . . . . . 425
13.2.2 Delta downloading of project data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
13.2.3 Error message following downloading . . . . . . . . . . . . . . . . . . . . . . . . . . 428
13.2.4 Working with the memory card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
13.2.5 Processing blocks offline/online . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
13.2.6 Comparing blocks offline/online . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
13.2.7 Editing online project without offline project . . . . . . . . . . . . . . . . . . . . 433
13.2.8 Uploading project data from the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
Table of contents
18
13.3 Hardware diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
13.3.1 Status displays on the modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
13.3.2 Diagnostics information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
13.3.3 Diagnostics buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
13.3.4 Diagnostics functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
13.3.5 Online tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
13.3.6 Further diagnostics information via the programming device . . . . . . 440
13.4 Testing the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
13.4.1 Introduction to testing with program status . . . . . . . . . . . . . . . . . . . . . 441
13.4.2 Program status with LAD and FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
13.4.3 Program status in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
13.4.4 Monitoring with the PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
13.4.5 Monitoring of data tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
13.4.6 Testing with watch tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
13.4.7 Monitoring tags using watch tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
13.4.8 Modifying tags using watch tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
13.4.9 Enable peripheral outputs and “Modify now” . . . . . . . . . . . . . . . . . . . . 451
13.4.10 Forcing tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
14 Distributed I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
14.1 Introduction, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
14.2 PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
14.2.1 PROFINET IO components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
14.2.2 Addresses with PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
14.2.3 Configuring PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
14.2.4 Real-time communication with PROFINET IO . . . . . . . . . . . . . . . . . . . . . 461
14.3 PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
14.3.1 PROFIBUS DP components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
14.3.2 Addresses with PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
14.3.3 Configuring PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
14.3.4 System functions for PROFINET IO and PROFIBUS DP . . . . . . . . . . . . . . 470
14.4 Actuator/sensor interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
14.4.1 Components of actuator/sensor interface . . . . . . . . . . . . . . . . . . . . . . . . 473
14.4.2 Configuring an AS-i master CM 1243-2 . . . . . . . . . . . . . . . . . . . . . . . . . . 475
14.4.3 Configuring an AS-Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
14.4.4 Interface to user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
14.5 Communication via Modbus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
14.5.1 Modbus RTU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
14.5.2 Modbus TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
15 Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
15.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
15.2 Open user communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
15.2.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
15.2.2 Open user communication with TCP and ISO-on-TCP . . . . . . . . . . . . . . 485
15.2.3 Open user communication with the UDP protocol . . . . . . . . . . . . . . . . 487
15.2.4 Communication functions for open user communication . . . . . . . . . . 489
15.2.5 Configuring open user communication . . . . . . . . . . . . . . . . . . . . . . . . . 493
Table of contents
19
15.2.6 Configuring a PN interface with T_CONFIG . . . . . . . . . . . . . . . . . . . . . . 495
15.3 S7 communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
15.3.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
15.3.2 Data structure for one-way data exchange . . . . . . . . . . . . . . . . . . . . . . . 496
15.3.3 Communication functions for one-way data exchange . . . . . . . . . . . . . 497
15.3.4 Configuring S7 communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
15.4 Point-to-point communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
15.4.1 Introduction to point-to-point communication . . . . . . . . . . . . . . . . . . . 499
15.4.2 Configuring the CM 1241 communication module . . . . . . . . . . . . . . . . 500
15.4.3 Point-to-point communication functions . . . . . . . . . . . . . . . . . . . . . . . . 501
15.4.4 USS protocol for drives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
16 Visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
16.1 Introduction to visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
16.1.1 Overview of HMI Panels in STEP 7 Basic . . . . . . . . . . . . . . . . . . . . . . . . . 508
16.1.2 Creating a project with an HMI station . . . . . . . . . . . . . . . . . . . . . . . . . . 510
16.1.3 Cross-references for HMI objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
16.2 Creating HMI tags and area pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
16.2.1 Introduction to HMI tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
16.2.2 Creating an HMI tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
16.2.3 Creating an area pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
16.3 Configuring process screens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
16.3.1 Introduction to configuring process screens . . . . . . . . . . . . . . . . . . . . . 517
16.3.2 Working window for process screens . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
16.3.3 Working with screen layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
16.3.4 Working with templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
16.3.5 Working with function keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
16.3.6 Creating a new screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
16.3.7 Configuring a screen change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
16.3.8 Working with objects in process screens . . . . . . . . . . . . . . . . . . . . . . . . 522
16.3.9 Changing screen objects during runtime . . . . . . . . . . . . . . . . . . . . . . . . 524
16.3.10 Basic objects for screen configuration . . . . . . . . . . . . . . . . . . . . . . . . . 524
16.4 HMI functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
16.4.1 Input and display of process values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
16.4.2 Working with alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
16.4.3 Working with recipes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
16.4.4 Working with the user administration . . . . . . . . . . . . . . . . . . . . . . . . . . 539
16.5 Completing HMI configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
16.5.1 Compiling the HMI configuration (Consistency test) . . . . . . . . . . . . . . 542
16.5.2 Simulation of HMI configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
16.5.3 Downloading configuration to the HMI station . . . . . . . . . . . . . . . . . . . 543
16.5.4 Maintenance of the HMI station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
17 Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
17.1 Integral and technological functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
17.1.1 High-speed counter (HSC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
17.1.2 Pulse generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
17.1.3 Technology objects for motion control . . . . . . . . . . . . . . . . . . . . . . . . . . 557
Table of contents
20
17.1.4 Technology objects for PID control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
17.2 Telephone network connections with TeleService . . . . . . . . . . . . . . . . . . . . 564
17.3 Telecontrol with CP 1242-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
17.4 Web server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
17.4.1 Enable web server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
17.4.2 Reading out web information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
17.4.3 Standard web pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
17.5 Data logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
17.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
17.5.2 Using data logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
17.5.3 Functions for data logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
1.1 Overview of the S7-1200 automation system
21
1 Introduction
1.1 Overview of the S7-1200 automation system
The SIMATIC S7-1200 automation system consists of the four controllers S7-1211C,
S7-1212C, S7-1214C, and S7-1215C, which can exchange data with each other, with
SIMATIC HMI Basic Panels, or with other programmable controllers over SIMATIC
NET. STEP 7 (TIA Portal) is used to configure and program the devices (Fig. 1.1).
The SIMATIC S7-1200 controllers are programmable logic controllers (PLC) and
constitute the basis of the automation system. Four different controllers with
graded performances cover the low-end range of industrial controls.
SIMATIC HMI refers to the Human Machine Interface for operator control and
monitoring. The Basic Panels are designed such that they interact optimally with
SIMATIC S7-1200. The devices are available with display dimensions of 3.8, 5.7, 10.4
and 15 inches, and are operated using the touch screen. Except for the 15-inch
device, they have additional function keys.
Fig. 1.1 Components of the SIMATIC S7-1200 automation system
SIMATIC NET
SIMATIC HMI STEP 7
(TIA Portal)
SIMATIC S7-1200
Software for configuration
and programming
S
S
S S S
Components of the SIMATIC S7-1200 automation system
SIMATIC PLCs control the machine or plant
Networking for data exchange
and central online access
Operator control and monitoring func-
tions for control of plant during runtime
1 Introduction
22
SIMATIC NET links all SIMATIC stations, and allows trouble-free data exchange.
SIMATIC S7-1200 with PROFINET interface uses the Industrial Ethernet network to
exchange data with other PLC stations, HMI stations, and programming devices.
Communication modules expand the communication capabilities to other net-
works such as PROFIBUS DP, AS-Interface, or point-to-point coupling based on
RS232 or RS485.
The STEP 7 programming software provides the nesting function for Totally Inte-
grated Automation (TIA), the automation system with uniform configuration and
programming, data management, and data transfer. STEP 7 is used to configure
and parameterize the SIMATIC components, and STEP 7 is also used to generate and
debug the user program. The TIA Portal is the central user interface for manage-
ment of the tools and automation data. STEP 7 in the TIA Portal is available in the
versions STEP 7 Professional and STEP 7 Basic. Both versions can be used to config-
ure and program an S7-1200 station. This book describes the use of STEP 7 Basic.
1.1.1 SIMATIC S7-1200
SIMATIC S7-1200 is the modular microsystem for the lower and medium perfor-
mance range. The central processing unit (CPU) contains the operating system
and the user program. The user program is located in the load memory and is
power failure-proof. The parts of the user program relevant to execution are pro-
cessed in a work memory with fast access. Tags whose values are to be retained in
the event of a power failure or when switching off/on are stored in the retentive
memory (Fig. 1.2).
The user program can be transferred to the CPU using a plug-in memory card (MC)
– as an alternative to transfer via an online connection to the programming device.
The memory card can also be used as an external load memory or for updating the
firmware.
The connections to the plant or process are made by onboard inputs and outputs,
their number being determined by the CPU version. The onboard inputs and out-
puts are designed especially for operation of the integral high-speed counters
(HSC). The operating system additionally includes pulse generators with a pulse-
width modulated output and also the technology objects Axis for controlling step-
per motors and servo motors with pulse interface and PID Compact, a PID controller
with optimized self-tuning.
A signal board (SB) can be used to expand the onboard inputs and outputs. The
communication board (CB) creates a point-to-point connection for the CPU and the
battery board (BB) increases the power reserve of the integrated hardware clock to
about one year.
If further inputs and outputs are required, signal modules (SM) can be plugged
onto the CPU depending on its version. These are available for digital and analog
signals.
The PROFINET interface connects the CPU to the Industrial Ethernet subnet. The
programming device is connected to this interface if, for example, the user pro-
1.1 Overview of the S7-1200 automation system
23
gram is to be transferred online to the CPU and tested on the machine. Data is
exchanged with HMI stations and other automation devices via this interface.
If the CPU is only connected to one device over Ethernet, a standard or crossover
cable can be used. If more than two devices that only have a PROFINET interface are
networked, the connecting cables must be routed via a multiplier, e.g. the commu-
nication switch module (CSM). A CPU 1215 has two ports connected with a switch
so that they can be networked with the next programmable controller without an
interposed connection multiplier.
Communication modules (CM) permit the operation on further bus systems such
as PROFIBUS DP. Here, an S7-1200 station in a DP master system can be both DP
master and DP slave. An S7-1200 station can be the AS-Interface master on AS-Inter-
face and can control up to 62 AS-Interface field devices. The communication mod-
ule for the point-to-point connection is available with RS232 or RS485 interface, to
which, for example, a barcode or RFID reader can be connected.
Fig. 1.2 Connection options to a PLC station with CPU 1200
S
Connection options to a CPU 1200
Connection of
an HMI station
(Basic Panel).
Multiplication of Ethernet connec-
tion using the communication
switch module (CSM).
Connection of sensors, e.g.
buttons or limit switches, to the
onboard I/O, to the signal board
(SB) or to a signal module (SM).
Connection of a
further S7-1200
station or other
devices on the
basis of open user
communication.
A memory card (MC)
can be used to transfer
the control program
and upgrade the
operating system.
Connection of
a programming
device.
Connection of devices
using communication
modules (CM) with RS232
and RS485.
Connection of actuators, e.g.
contactors or lamps, to the
onboard I/O, to the signal board
(SB) or to a signal module (SM).
1 Introduction
24
1.1.2 Overview of STEP 7 Basic
STEP 7 is the central automation tool for SIMATIC. STEP 7 requires authorization
(licensing), and is executed on the current Microsoft Windows operating systems.
STEP 7 Basic can be used to configure the S7-1200 controllers and – with WinCC
Basic – the Basic Panels. Configuration 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
an (HMI) project. A “project” is a data structure containing all the programs and da-
ta required for your automation task. The most important STEP 7 tools and func-
tions 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 assign them 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 Basic Panels.
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
Fig. 1.3 Tools in the Start portal of STEP 7 Basic
1.1 Overview of the S7-1200 automation system
25
window – the inspector window – displays the properties of the selected module,
and the task window provides support by means of the hardware catalog with the
available modules. The Network view shows the networking between the devices
and permits the configuration of communication connections.
When carrying out PLC programming you edit the selected block in the working ar-
ea. You are again shown the properties of the selected object in the inspector win-
dow where you can adjust them. In this case, the task window contains the catalog
of statements with the available program elements and functions. The same applies
to the processing of PLC tags, to the online program test using watch tables, or to
configuration of an HMI device.
And you always have a view of the project tree. This contains all objects of the STEP
7 project. You can therefore select an object at any time, for example a program
block or watch table, and edit this object using the corresponding editors which
start automatically when the object is opened.
1.1.3 Three programming languages
You can select between three programming languages for the user program: lad-
der logic (LAD), function block diagram (FBD), and structured control language
(SCL). The user program can be structured into individual parts known as
“blocks”. The programming language is a property of a block, which means you
can use the programming language that is best suited to resolve the block func-
tion for every block in the user program.
Using the ladder logic, you program the control task based on the circuit diagram.
Operations on binary signal states are represented by serial or parallel arrange-
ment of contacts (Fig. 1.5). A current path is terminated by a coil. Complex func-
tions are represented by boxes which you handle like contacts or coils. Examples of
boxes are mathematical functions or functions for processing strings.
Using the function block diagram, you program the control task based on elec-
tronic circuitry systems. Binary operations are implemented by linking AND and OR
Fig. 1.4 Example of working area of device configuration
1 Introduction
26
functions and terminated by simple boxes (Fig. 1.6). Complex boxes are used to
handle the operations on digital tags, for example with mathematical functions or
functions for strings.
Structured control language is particularly suitable for programming complex
algorithms or for tasks in the area of data management. The program is made up of
SCL statements which, for example, can be value assignments, comparisons, or
control statements (Fig. 1.7).
Fig. 1.5 Example of binary operations in ladder logic representation
Fig. 1.6 Example of binary operations in function block diagram representation
Fig. 1.7 Example of SCL statements
1.1 Overview of the S7-1200 automation system
27
1.1.4 Execution of the user program
After the power supply has been switched on, the control processor checks the con-
sistency of the hardware and parameterizes the modules. A startup program is then
executed once, if present. The startup program belongs to the user program that
you program. Settings and initialization operations for the user program can be
present here.
The user program is usually divided into individual sections called “blocks”. The
organization blocks (OB) represent the interface between operating system and
user program. The operating system calls an organization block for specific events,
and the user program is then processed in it (Fig. 1.8).
Function blocks (FB) and functions (FC) are available for structuring the program.
Function blocks have a memory in which local tags are saved permanently, func-
tions do not have this memory.
Program statements are available for calling function blocks and functions (start of
execution). Each block call can be assigned inputs and outputs, referred to as
“block parameters”. During calling, tags can be transferred with which the pro-
gram in the block is to work. In this manner, a block can be repeatedly called with a
certain function (e.g. addition of three tags) but with different parameters sets
(e.g. for different calculations) (Fig. 1.9).
The data of the user program is saved in data blocks (DB). Instance data blocks have
a fixed assignment to a call of a function block; they are the tag memory of the func-
tion block. Global data blocks contain data which is not assigned to any block.
Fig. 1.8 Execution of the user program
Startup
program
Alarm and
error program
Main
program
Execution of the user program
Switching on
Updating of inputs
and outputs
Interruption
(alarm or error)
Operating mode
STARTUP
Operating system User program
Operating mode
RUN
OB
OB
FB
FC
FB
FC
FB
FC
FB
FC
FB
FC
FB
FC
OB
Interruption
1 Introduction
28
Following a restart, the control processor updates the input and output signals in
the process images and calls the organization block OB 1. The main program is
present here. Structuring is also possible (and recommended) in the main pro-
gram. Once the main program has been processed, the control processor returns to
the operating system, retains (for example) communication with the programming
device, updates the input and output signals, and then recommences with execu-
tion of the main program.
Cyclic program execution is a feature of programmable controllers. The user pro-
gram is also executed if no actions are requested “from outside”, such as if the con-
trolled machine is not running. This provides advantages when programming: For
example, you program the ladder logic as if you were drawing a circuit diagram, or
program the function block diagram as if you were connecting electronic compo-
nents. Roughly speaking, a programmable logic controller has characteristics like
those of a contactor or relay control: The many programmed operations are effec-
tive quasi simultaneously “in parallel”.
In addition to the cyclically executed main program it is possible to carry out inter-
rupt-controlled program execution. You must enable the corresponding interrupt
event for this. This can be a hardware interrupt, such as a request from the con-
trolled machine for a fast response, or a cyclic interrupt, in other words an event
which takes place at defined intervals.
The control processor interrupts execution of the main program when an event
occurs, and calls the assigned interrupt program. You can assign organization
blocks to certain events, and these blocks are then processed in such a case. Once
the interrupt program has been executed, the control processor continues execu-
tion of the main program from the point of interruption.
Fig. 1.9 Example of two block calls with different tags in each case
1.1 Overview of the S7-1200 automation system
29
1.1.5 Data management in the SIMATIC automation system
The automation data is present in various memory locations in the automation sys-
tem. Initially there is the programming device, referred to generally as the genera-
tion or engineering system. All automation data of a STEP 7 project is saved on its
hard disk. Configuration and programming of the project data with STEP 7 is car-
ried out in the main memory of the programming device (Fig. 1.10).
The automation data on the hard disk is also referred to as the offline project data.
Once STEP 7 has appropriately compiled the automation data, this can be
down-loaded to a programmable controller. The data downloaded into the user
memory of the CPU module are known as the online project data.
The user memory on the CPU is divided into three components: The load memory
contains the complete user program including the configuration data, the work
memory contains the executable user program with the current control data, and
the retentive memory contains the tags whose current values are saved power-fail-
ure-proof.
The memory card as a transfer card can transfer the user program to the CPU mem-
ory, or as a program card expand the CPU's internal load memory. When used as a
program card, the memory card remains inserted in the CPU during runtime.
Fig. 1.10 Data management in the SIMATIC automation system
Memory card
Work memory
Retentive memory
Main memory
Hard disk
Load memory
The load memory contains
the project data transferred
to the CPU. Together
with the current values of
the tags from the work
memory, they form the
online project data.
The control program
can be transferred to
the CPU by means of
the memory card.
The work memory
contains the executable
part of the control program
which is processed
during runtime.
The retentive memory
contains the tags whose
values are retained in the
event of a power failure
or when switching off/on.
The offline project
data is saved on
the hard disk.
All project data
is executed in the
programming device's
main memory.
Programming device CPU module
Transfer when
switching on
Saving the
project data
Data management in the SIMATIC automation system
Transfer with online connection
1 Introduction
30
1.1.6 Operator control and monitoring with process images
Procedures in the process (on the controlled machine) are manually controlled and
monitored using an HMI device. With the Basic Panels, a touch screen permits ac-
cess using control elements represented on the monitor. Control and display ele-
ments are combined in process images. A process image can map a plant, display
process sequences, output process values, or permit operator actions (Fig. 1.11).
The image sequence has a hierarchical structure. Commencing with a start screen
which is displayed when the HMI device is switched on, it is possible to select the
screens of the next level, from where the screens of the following level can be
selected, and so on. Displays can be changed manually using key or touch inputs, or
triggered by the user program.
Predefined objects are available for creating a screen, and can be inserted and
adapted according to your requirements. These can be static objects such as text or
graphics which do not change during process operation, or dynamic objects such
as texts, numerical values, trends and bar charts which change depending on pro-
cess values.
The functional scope of the Basic Panels also includes message control with bit and
analog messages, management of recipes, and user administration.
Fig. 1.11 Example of a process image in the configuration stage
1.2 Introduction to STEP 7 Basic for S7-1200
31
1.2 Introduction to STEP 7 Basic for S7-1200
1.2.1 Installing STEP 7
STEP 7 Basic V11 is a 32-bit applica-
tion, which executes with MS Win-
dows XP (Home with SP3 or Profes-
sional with SP3) or MS Windows 7
(Home Premium, Professional, Enter-
prise, or Ultimate, 32/64-bit). You
require administration rights in
order to install STEP 7, and to work
with STEP 7 you must at least be
logged-on as a main user.
The processor should at least be a Pentium 4 with 1.7 GHz or a comparable type.
A main memory of 1 GB is required for working with Windows XP, and should be
2 GB for Windows Vista. STEP 7 Basic requires approx. 2 GB on the hard disk.
An Ethernet interface (LAN adapter) is required on the programming device for the
online connection to a programmable controller or Basic Panel. If you wish to work
with a SIMATIC memory card, you require an SD card reader.
Installation is carried out using the setup program start.exe on the DVD. Deinstalla-
tion of STEP 7 Basic is carried out as usual in MS Windows using the Software pro-
gram in the Windows Control Panel. Parallel online use of STEP 7 Basic and STEP 7
has not been enabled.
1.2.2 Automation License Manager
You require a license (user authoriza-
tion) in order to use STEP 7. Licenses
are managed by the Automation
License Manager which is installed
together with STEP 7 Basic. The
license key for STEP 7 Basic is trans-
ferred to the hard disk during the
installation, and removed again from
the hard disk during deinstallation.
The license key is stored on the hard disk in specially identified blocks. To avoid un-
intentional destruction of the license key, you should observe the information for
handling license keys in the Help text of the Automation License Manager.
The Automation License Manager also manages the license keys of other SIMATIC
products, e.g. STEP 7 V5.4 and WinCC.
1 Introduction
32
1.2.3 Starting STEP 7 Basic
You start STEP 7 Basic either using the Start button of Windows
and Programs > Siemens Automation > TIA Portal V11, or by dou-
ble-clicking the icon on the Windows desktop. The Totally Inte-
grated Automation Portal is the user interface for STEP 7 and may
also contain other applications which use the same database. For
example, STEP 7 Basic V11 includes the WinCC Basic configuration software which
is displayed as an integrated “Visualization” editor in the Start portal.
1.2.4 Portal view
Following starting-up, STEP 7 Basic displays the Start portal. A portal makes avail-
able all functions and tools required for the respective range of tasks in the
portal view. The scope of the portals as well as the range of functions and tools de-
pends on the installed applications. The Start portal of STEP 7 Basic permit selection
of the following portals (Fig. 1.12):
b In the Devices & networks portal you can configure the hardware of the program-
mable controller, i.e. you select the hardware components, position them, and
set their properties. If several devices are networked, you can define the connec-
tions here.
b The PLC programming portal contains all the tools required for generating the
user program for a PLC station (programmable logic controller).
Fig. 1.12 Portal view: First steps after opening a project
1.2 Introduction to STEP 7 Basic for S7-1200
33
b In the Visualization portal you generate the operator control and monitoring
desktop for HMI stations. Here you can configure, for example, the process im-
ages, the control elements, and messages.
b Using the Online & Diagnostics portal you can connect the programming device
to a programmable controller, transfer and debug programs, and detect faults in
the automation system.
Additional functions included in the Start portal allow you to Create new project or
Open existing project. First steps informs you of what possibilities you have to con-
tinue the configuration after creating a project. Installed products provides an over-
view of further SIMATIC applications currently on the computer. You can call Help
in every portal.
1.2.5 Information system
The help function of STEP 7 provides
you when programming with compre-
hensive support for solving your auto-
mation task.
To call the help function, click on Help
in the Portal view or select the Help >
Display help command in the main
menu in the Project view. A window
appears with the Siemens Informa-
tion System (Fig. 1.13).
The online help is roughly divided ac-
cording to the project processing
steps: Configuration, parameteriza-
tion, and networking of devices, struc-
turing and programming of the user
program, visualization of processes,
and utilization of the online and diag-
nostics functions.
Readme provides general information
on STEP 7 and further information
which could no longer be included in
the online help.
A comprehensive description of all
available statements, including ex-
tended statements, can be found un-
der PLC programming > References.
Fig. 1.13 Information system
of STEP 7 Basic
1 Introduction
34
1.2.6 The windows of the project view
The project view shows all elements of a project in structured form in various pro-
cessing windows. You can move from the Portal view to the Project view using the
Project view link at the bottom left of the screen, or STEP 7 automatically switches to
the Project view depending on the selected tool.
Fig. 1.14 shows the windows of the Project view in an example of block program-
ming. Different window contents are displayed depending on the currently used
editor.
a Main menu and toolbar, shortcut menu
Underneath the title bar is the main menu with all menu commands. The menu
commands available for selection depend on the currently marked object; menu
commands which cannot be selected are displayed in gray. The same functionality
is available – somewhat user-friendlier – with the shortcut menu: if you click on an
object with the right mouse button, a window is opened with the currently select-
able menu commands. Underneath the main menu is the toolbar with the graphi-
cally represented “main functions”. The main menu and the toolbar are always
present in all editors.
Using Options > Customize in the main menu you can adapt the user interface.
For example, under “General” you can define the interface language in which
STEP 7 is used, and the mnemonics (the representation of the operands: “I” for in-
put (international), or “E” in German).
s Working window
In the center of the screen is the working window. The contents of the working win-
dow depend on the editor currently being used. In the case of device configuration,
the working window is divided in two: the objects (modules and stations) are dis-
played in graphic form in the top part, and in tabular form in the bottom part. When
programming the PLC, the top part of the working window contains the interface
description of the block, and the bottom part the program represented in LAD, FBD,
or SCL. You use the working window to configure the hardware of the automation
system, generate the user program, or configure the process screens for HMI
devices.
You can separate the working window completely from the project view so that it is
displayed as a separate window (“Release” icon in the title bar of the working win-
dow), and also insert it again (“Embed” icon). The “Maximize” icon closes all other
windows and displays the working window in maximum size.
d Inspector window
The inspector window underneath the working window shows the properties of the
objects marked in the latter, records the sequence of actions, and provides an over-
view of the diagnostics status of the connected devices.
1.2 Introduction to STEP 7 Basic for S7-1200
35
During configuration or programming you set the object properties in the inspec-
tor window, for example the addresses and symbol names of inputs and outputs,
the properties of the PROFINET interface, tag data types, or block attributes.
f Project tree
The project tree window is displayed with the same content for all editors.
Its hierarchical structure contains all project data and the required editors. With
the project open, it shows the folders for the PLC and HMI stations included in the
project, and further subfolders within these folders, e.g. for program blocks,
PLC tags and watch tables with a PLC station or e.g. the process images and the
HMI tags in the case of an HMI station.
A double-click on an object with project data automatically starts the associated ed-
itor. The project tree also includes editors such as “Add new device”, “Device config-
uration” or “Online & diagnostics” which you can start directly using a double-click.
The lower section of the project tree contains a details view of those objects which
are present in the hierarchy underneath the object marked in the project tree.
Fig. 1.14 Components of Project view using example of block programming
1 Introduction
36
g Task window
To the right of the working window is the task window with the task cards. This con-
tains further objects for processing in the working window. The contents of the task
window depend on the currently active editor. In the case of the hardware configu-
ration, for example the hardware catalog with the available components is shown
here, in the case of PLC programming the program elements catalog appears, with
online & diagnostics the online tools, and with the visualization the library for the
process image control and display elements.
You can also call the libraries in this window: global libraries supplied with STEP 7,
or the project library in which you can save reusable objects such as program
blocks, templates for process images, or control elements with special configura-
tions.
h Editor and status bar
At the bottom left of the Project view you can change to the Portal view. In the mid-
dle you can see the tabs of the open windows. Clicking on a tab results in its contents
being displayed in the top level of the working window. This makes it easy to change
quickly between different window contents. The far right of the status bar indicates
the current status of project processing.
1.2.7 Adapting the user interface
The language of the user interface can be changed. In the main menu select
Options > Settings and the “General” section. In the “Interface language” drop-down
list you can select the desired language from the installed languages. The texts of
the user interface are then immediately displayed in the new language. You can also
define here how the TIA Portal is to be displayed following the next restart.
You can show or hide the displayed window using the menu item View. You can al-
ways change the size of windows by dragging on the edge with the mouse. Windows
can be minimized into a symbol which appears in one of the navigation bars in the
left, bottom or right margin of the screen.
You can maximize the working window, or release it from the windows group and
display it as a separate window. The working window can be divided vertically or
horizontally, permitting you to view two working areas simultaneously.
You can change the width of table columns by dragging with the cursor in the table
header. In the case of columns that are too narrow, the entire content of the individ-
ual cells will appear as a tooltip when the cursor is briefly hovered over the relevant
field.
1.3 Editing a SIMATIC project
37
1.3 Editing a SIMATIC project
Fig. 1.15 shows all tools and data which can be of importance in an automation task.
Of prime importance is the Project which contains all the automation data required
for control and operation of the machine or plant. The project data is roughly divid-
ed into the data for the individual stations and the common project data which ap-
plies to all stations in the project.
A station can be a controller (PLC station) or an HMI device (HMI station). A project
can include several stations, but at least one station must be present. The data pres-
ent in a station is described further below. Common Project Data includes, for exam-
ple, centrally managed message texts or texts for multilingual projects.
A project library is created for each project. Objects which are used in several proj-
ects are combined in global libraries. Also relevant to a project is the programming
device design with interface modules (LAN adapters) and SD card readers.
Fig. 1.15 Project components, libraries and programming device design
Global Libraries
System Libraries
User Libraries
HMI Buttons-and-Switches
Online access
< User Library >
< Project Library >
Monitoring-and-control-objects
SIMATIC Card Reader
Documentation templates
Libraries delivered with STEP 7.
Libraries configured by users
themselves.
Contains the programming device
resources relevant to the project.
Contains all the data for a controller.
Contains text lists for system and user messages.
Contains all the data for an HMI device.
Contains document info, frames and cover sheets
PLC station
Common Data
HMI station
Documentation settings
Contains project texts, project languages and graphics.
Languages & resources
Stations
Project
Common Project Data
Project Library
All the data for the automation task is combined in
a project.
Stations can be controllers (PLC stations) or HMI devices
(HMI stations). A project includes at least one station.
Contains cross-station data.
Contains cross-station data compiled by the user.
Global libraries contain elements
for multiple use across projects.
Programming Device Design
1 Introduction
38
1.3.1 Structured representation of project data
The project tree in the Project view displays the project data and the programming
device configuration in a tree structure (Fig. 1.16).
The structure also includes the editors (tools) required for generating and editing
the data. The project tree does not include the project library. This is represented in
a task card together with the global libraries in the task window under “Libraries”.
You can replace the names shown in angle brackets by names more appropriate to
your automation task.
Fig. 1.16 Project structure in the project tree
< Project >
Online access
SIMATIC Card Reader
< HMI station >
Interface x1
< PLC station >
Common data
Interface x2
< PLC ... >
Languages&resources
Documentation settings
Add new device
Text lists
Project texts
Documentation
Information
Project languages
Frames
Project graphics
Cover pages
Devices & networks
Update accessible
devices
Add user-defined
card reader
Card reader
Adds a new PLC or HMI station to the project
Folder with the data of a found station
Text lists for user and system messages
List with project texts in different languages
Information for the documents to be printed
Selection of languages for display and message texts
Collection of frames
Collection of language-dependent graphic symbols
Collection of cover sheets
Starts the device and network configuration
Searches for stations connected to this interface module
Adds a card reader
Card reader present in the programming device
Folder for all data of an automation system
Folder for all LAN interface modules of the programming device
Folder for all SD card readers of the programming device
Folder for all data of an HMI station
LAN interface of programming device
Folder for all data of a PLC station
Folder for common data in the project
Further LAN interface modules if applicable
Folder for language-dependent objects
Folder for documentation settings
Project navigation with opened project
1.3 Editing a SIMATIC project
39
1.3.2 Project data and editors for a PLC station
If you add a PLC station (an S7-1200 controller) to the project, STEP 7 creates the
corresponding structure in the project data (Fig. 1.17). A PLC or HMI station is
always required for editing in a project so that STEP 7 can create the data structures
required for the PLC programming or HMI configuration. If you wish to write a user
program without previously selecting a specific CPU, you can select an “unspecified
CPU” from the hardware catalog and replace it later with a “real” CPU 1200 if nec-
essary.
Fig. 1.17 Structure of the project data for a PLC station
< PLC_12xxC >
Program blocks *)
Watch and force tables *)
PLC data types *)
Local modules
Technology objects
External source files *)
PLC tags *)
< Technology object_1 >
<Source file_1>
Device configuration
Add new block
Add new watch table
Add new data type
PLC_DataType_1
Add new object
Add new external file
Show all tags
Add new tag table
Default tag table [n]
Tag table_1 [m]
Online & diagnostics
< Block_1 >
Force table
< Watch table_1 >
Text lists
Program info
Starts the editor for the device configuration
Creates a new block and opens it
Main program (organization block OB 1)
Self-created block
Creates a new watch table and opens it
Creates a new PLC data type
Self-created PLC data type
Table with the forced tags
Self-created watch table
Station-specific texts for user and system alarms
Program structure, assignment list, memory utilization
Creates a new technology object and opens it
Imports a new source file
Displays the tags of all (sub-)tables
Adds a new tag table
Permanently available tag table with n tags
Self-created tag table with m tags
Starts the editor for the online connection and diagnostics
Folder for all data of a PLC station (name can be freely-selected)
Folder for all blocks of the user program
Folder for the force table and all watch tables
Folder for all PLC data types
Folder for the local modules of the PLC station
Folder for all technology objects
Folder for external source files (SCL)
Folder for all PLC tags (“symbol table”)
Self-created technology object
Imported source file
Data structure of a PLC station
*) Sub-groups can be generated
Main [OB 1]
1 Introduction
40
The user program which controls the machine or process is located in the Program
blocks folder. The program comprises blocks (separate program components)
which are either stored directly in the Program blocks folder or – if there is a large
number – in subfolders which you can create and configure yourself. The “Main”
block (the name is the symbol for the block and can be changed) is the organization
block OB 1 and is created automatically. The processing sequence of the blocks is
defined in the user program by “block calls” and is displayed by opening the Pro-
gram information object under Call structure.
The Technology objects folder contains the configuration data for the motion con-
trol objects (axes) and control loop objects (PID controllers).
SCL source files can be saved in the External sources files folder.
The PLC tags folder contains the assignment of the absolute address to the symbolic
address of global tags that are valid throughout the PLC station (inputs, outputs,
and bit memories).
The PLC data types folder contains user-defined, structured data types.
The force table and all created watch tables can be found in the Watch and force
tables folder. A watch table is used during testing of the user program. It contains
tags whose current value can be monitored and also changed during runtime. The
force tables can be used to set tags to fixed values that cannot be changed by the
program.
The program information shows the program structure (sequence and dependen-
cies of the block calls), the assignment list for inputs, outputs and bit memories,
and the memory usage.
Message texts are stored under Text lists. In the case of the user-defined text list, you
can specify the value ranges which trigger the messages and the associated texts;
with a system-defined text list, the contents are specified by STEP 7. Text lists creat-
ed under a PLC station contain station-specific texts, those created under a project
contain cross-station texts.
The Local modules folder contains all configured modules of the PLC station. Open-
ing a module initiates device configuration. The module properties are displayed in
the inspector window.
You start configuration of a station using the Device configuration editor which is
located in the first position in the project structure. There is no corresponding
folder for the data of the device configuration in the project tree. The configuration
data is located “behind” the Device configuration editor.
Online & diagnostics starts the editor for the online connection and online func-
tions. For example, you can use a (software) control panel to control the operating
modes of the CPU, to set the CPU's IP address and time, or read the CPU's diagnostics
buffer.
1.3 Editing a SIMATIC project
41
1.3.3 Creating and editing a project
Creating a new project
You can create a new project in the Portal view if you click in the Start portal on
Create new project. Assign a name to the project and set a path in which the project
is to be saved. After clicking the Create button, any project which is open is closed,
the new project is created, and the next steps displayed in the Start portal for selec-
tion:
b Configure a device
STEP 7 changes to the Devices & networks portal in which you can insert a new
CPU 1200 (a PLC station) into the project and open it for editing.
b Write PLC program
STEP 7 changes to the PLC programming portal in which you can edit the “Main”
block (organization block OB 1) or insert a new block and open it for editing. A
PLC station must first have been added to the project.
b Configure an HMI screen
STEP 7 changes to the Visualization portal in which you can create a new HMI sta-
tion or configure an already existing one. From this portal you start configura-
tion of the process images, editing of HMI tags and messages, and the simulator.
b Open the project view
STEP 7 changes to the Project view in which you can carry out the next steps
(insert and configure PLC stations, insert and program blocks, or insert and con-
figure HMI stations).
In the project tree you can create a new project using the Project > New menu com-
mand. Assign a name to the project in the dialog window, set the path in which the
project is to be saved, and click on the “Create” button.
Editing an existing project
You can open an existing project in either the Portal view or the Project view. Either
activate Open existing project in the Portal view or Project > Open in the Project view.
Select the desired project from the list of projects last used. Any project which is
open is closed, and the selected project is opened.
During editing in the Project view, you can save the entered project data using the
Project > Save or Project > Save as menu command. You can close the project using
Project > Close – following confirmation of whether changes are to be saved – with-
out exiting STEP 7.
You can delete a (closed) project from the hard disk – following confirmation –
using Project > Delete.
Compiling and downloading project data
Before project data can be downloaded to a station, it must be made readable for the
processor: it must be “compiled”. The project data is compiled station-by-station.
1 Introduction
42
The scope of the compilation can be varied depending on the type of station. For ex-
ample, the command from the Compile > Software pop-up menu only compiles
those software components which have been changed since the last compilation.
Printing project data
The project data can be printed in the form of a circuit manual. You can use the
documentation function to set the layout of the printout. Under Document settings
in the project tree, you adapt the existing template or create a new template, for
example in the sizes A3 or A4 in portrait or landscape format. You complete the text
fields under Document information (e.g. the title block). You can also position new
text fields or graphic symbols in the layout.
By means of the print preview or print output, you can specify the output with or
without cover page and as compact (abbreviated) or complete.
Converting a project from STEP 7 V10.5 to STEP V11
To convert a project created with STEP 7 V10.5, start STEP 7 V11 and select Project >
Open from the main menu. In the dialog window, click on the Browse button and
select the desired project from the file directory. In the open project folder, select
the file <Project_name>.ap10 and click the Open button. Confirm the conversion
messages with OK. The project is converted to Version V11, saved under the name
<Project_name>_<STEP7-Version>, and opened. You then compile every station and
clear any displayed faults and warnings.
1.3.4 Creating and editing libraries
Libraries are used to save reusable program components. These could include sta-
tions, blocks, PLC tag tables, process images or picture elements, for example. A
project library and global libraries are available. The libraries are displayed in a
task card of the task window.
A project library which you can fill with objects is automatically created when you
create a project. You can structure the contents of the project library using folders.
A project library is always opened, saved, and closed together with the project.
Components which can be used in multiple projects are saved in global libraries.
There are global system libraries which are supplied with STEP 7, and global user
libraries which you create yourself. A global library is opened, saved, and closed in-
dependent of the project. If you wish to use a global library simultaneously with
other users, the library must be opened as read-only.
2.1 S7-1200 station components
43
2 SIMATIC S7-1200 automation system
2.1 S7-1200 station components
A complete programmable controller including all I/O modules is referred to as a
“station”. This also includes distributed I/O modules connected to the CPU via a bus
system. An S7-1200 station comprises at least the CPU. Depending on the version,
it has digital and analog input/output channels and can be fitted with additional
input/output channels using a signal board (SB).
Depending on the type of CPU, up to eight signal modules can be plugged in which
expand the station by digital and analog input/output channels. A two-tier design is
possible using a 2-meter long extension cable.
The programming device is connected over Industrial Ethernet. Industrial Ethernet
can also be used to connect further SIMATIC stations or HMI devices to the CPU. Up
to three communication modules take over the connection to additional bus sys-
tems or to a point-to-point link.
Integral technological functions for measuring and counting tasks, closed-loop con-
trol, and motion control allow the CPU 1200 to be used in many complex machine
controls.
The SIMATIC Memory Card can be used to download configuration data, as an exter-
nal load memory, or for a firmware update.
Fig. 2.1 S7-1200 station with CPU S7-1214, two SMs (right) and one CM (left)
2 SIMATIC S7-1200 automation system
44
Mounting is on a standard 35 mm DIN rail either horizontally or vertically. Installa-
tion without a mounting rail is also possible. An extension cable (2 m long) enables
a two-tier design without changing the number of connectable signal modules.
Available accessories include an external power supply module, a connection multi-
plier (Ethernet switch), a TS Adapter, and two simulator modules. SIMATIC S7-1200
is also available as a SIPLUS version for particularly harsh environmental condi-
tions.
2.2 S7-1200 CPU modules
There are four types of CPU (CPU
1211, CPU 1212, CPU 1214, and CPU
1215), available in each case in the
versions DC/DC/DC, AC/DC/RLY,
DC/DC/RLY. The first item of data
refers to the module power supply
(DC = 24 V direct current, AC =
120/230 V alternating current). The
middle item of data refers to the
operating voltage of the onboard dig-
ital inputs (DC = 24 V direct current).
The last item of data refers to the type
of digital outputs (DC = 24 V direct
current electronic, RLY = up to 30 V
direct current or up to 250 V alternat-
ing current with relay).
The four CPU versions mainly differ in the supply voltage, the number of onboard
inputs and outputs, the memory size, and the expansion capability with signal
modules (Table 2.1).
The CPU 1215C can be integrated in STEP 7 Basic V11 with a hardware support pack-
age (HSP).
2.2.1 Integrated I/O
The digital inputs (DI) on the CPU module work with an operating voltage of 24 V
DC. Different numbers are available depending on the CPU version. The status of
the input signals is displayed by means of LEDs.
The digital outputs (DQ or DO) are available in electronic form (24 V DC and
0.5 A output current with a resistive load of 5 W) and as relay outputs (up to 30 V DC
and 2 A output current with a resistive load of 30 W or up to 250 V AC and 2 A output
current with a resistive load of 200 W). Different numbers of digital outputs are
available depending on the CPU version. The status of the output signals is dis-
played by means of LEDs.
Fig. 2.2 CPU 1214C DC/DC/DC
Another Random Scribd Document
with Unrelated Content
51
52
he should be caught in a jam, he would not elbow people right and
left; but would, while protecting his own person and those who are
dependent upon him from injury, find his own chance of getting out
of the tight place by helping others out.
In this selfish world nothing so quickly touches the popular
heart as that sort of Christlikeness which is recognized as
politeness to strangers in public places, and as carefulness in helping
the weak, and in refraining from adding burdens to those who are
hard-pressed by responsibilities. The man or woman who obtains
control of the highest quality of influence is the one who has either
from childhood been trained to think those thoughts that blossom
out into beautiful considerateness, or who has taken himself in hand,
and by vigorous self-training has pruned off the growth of selfish
heedlessness, and grafted in the gentler graces of the Spirit.
One W. C. T. U. lecturer had been painfully impressed by the fact
that baggagemen had to handle such heavy trunks. This was before
so many little wheeled contrivances had been placed at their
disposal. She accordingly supplied herself with two small
trunks in place of the one large one, for no other reason than
to save the backs of the men. Her kind intention was kept to herself
for years, and it went unrecognized at its full value until at length
one day she encountered a grumpy old baggageman, who seemed
to have a special grudge against any woman with two checks. He
was from the first moment very uncivil, and threatened her with a
charge for excess of baggage. She said but little, only went quietly
along the baggage-room with him, identified the two diminutive
parcels, and waited. He looked at them, then at her, colored like one
who was ashamed of himself, and said:—
“Be them all?”
“Yes, those are all.”
“Well, what made you make two of ’em?”
53
54
55
“That is my way of helping to lift one big trunk,” she said.
“Your what?”
“My way of helping you to lift one big trunk.”
“It is? Well, I never! You did it to save our backs?”
“Yes: I never wanted any old man or boy to strain himself over a big
trunk for me, so I divided mine in two.”
“Well!” ejaculated the grumpy old fellow, who evidently did not know
anything more to say. His whole heart had suddenly mellowed, his
eyes grew red, and his hands trembled as, taking off his cap, he
changed those checks with the air of one who was performing an act
of religion.
When he came with the two little bits of metal to the waiting
passenger, still carrying his cap in his hand, and when she took them
with a “Thank you,” and put them in her purse, he looked timidly
into her face as if to see if he could possibly be forgiven. She chose
not to make much of the incident, so she did not seem to notice his
perturbation, but with a simple “Good day,” left the baggage-
room. But she knew very well that that old baggageman would
never forget, and would perhaps be kinder to all the big trunks in
the future for the sake of those little twin products of her kind
intention.
56
VII.
“How I wish I knew just how one ought to behave in going into
public places, meetings, and lectures,” said a young woman recently.
Others have asked similar questions. I have heard something like
this more than once: “Isn’t it dreadful not to know the little things
that would prevent folks from looking at you and smiling in such a
mean way?”
It is “dreadful,” as well as unnecessary that children should be left to
grow up ignorant of any of those things, great or small, which will
make it possible for them to enter the schoolroom, the church, the
hall, and move about in such a manner as not to be objects of
unpleasant observation to those who make politeness a profession.
All that has been said about the opening and closing of doors, and
the rules of precedence, are always in full force, and should
become so automatic that they will never have to be
remembered. Even at home, and in the small country schoolhouse
place of worship they should be observed, if one hopes to always do
the “nice way.”
In a small congregation where “everybody knows everybody,” there
is a great temptation to fall into very lax manners, and so to
cultivate habits that are hard to overcome, and which will cause
chagrin by and by to the young man or woman who wants to appear
well among strangers. Therefore it is wise to train the children to
such deportment in the small church, or cottage meeting that they
shall never be in danger of bringing reproach on the home which
they have left behind them, by uncouth or disorderly behavior in any
public assembly.
57
58
59
Any place of worship should be entered quietly, children and parents
together, single file, in such order that there will be no jostling,
crowding, or changing of places. There are two ways of
seating a family, either of which is good form. In one case the father
enters first, followed in order by the mother, the youngest child, and
then the others according to age, so that the eldest comes last. At
the opening to the pew, or row of chairs, the father turns, standing
to face the others, and waits until all have passed in and are seated,
when he takes his place at the entrance. This arrangement gives the
mother the seat in the farther corner, with the “baby” beside her,
while the eldest child is next to the father.
In the other case the eldest child leads, and passes into the farther
end of the seat, followed by the other children in such order as to
leave the “baby” next to the mother, who sits in the second place
from the end, beside her husband.
Sometimes when there is a large family, it is necessary to separate
the children by placing the mother in the midst of them
between two restless ones. But whatever order is necessary,
let it be so matter-of-course that the coming in and seating shall be
in that decorous manner which will impress the children with the
sacredness of the service for which they have come.
Teach the child that in entering a seat or row of chairs, good form
requires that he shall pass clear in to the farthest vacant place, or
that if he has dropped down in the end or middle of the row, and
others come to claim seats beyond him, he should always either
arise, come out and stand to allow them to pass in, or himself go on
to the farthest place. Teach him, never, under any circumstances, to
make it necessary for any one to climb over his feet and legs to
reach a vacant place. This is one of the most common and worst
forms in which bad training in deportment manifests itself.
Also teach your child to refuse to climb over anybody’s feet.
Instruct him either to wait for a decent chance to enter that
60
61
seat or to find another. The ludicrous, not to say unbecoming
appearance of a woman who tries to drag herself over the knees of
some man who remains immovable in the end of the seat, or who
attempts to draw himself up to “make room” for her to pass, is
entirely out of harmony with the spirit which should prevail in a
place of worship; and the young man coming from home with this
habit, which has been formed by climbing over his brothers and
sisters, as well as parents and guests, and letting them climb over
him, will be left some sad day to wonder why people stop at the
entrance to the pew where he sits, wait an instant, look at him so
queerly, and then pass on, as if they were not willing to occupy the
same seat with him. He may think it is because he is from the
country, because he is not stylishly dressed, because they are very
“stuck up,” when it is simply because they do not choose to
climb over his legs to find a seat.
But your daughter should be so taught that if she must stand in the
aisle and wait for some man to get it into his head that he had
better move on, or come out so as to allow her to pass, she shall do
it kindly and without contempt; for, of course, the poor fellow would
do better if he only knew how.
Teach by precept and example that wraps and rubbers should not be
put on until after the benediction. If your boy should grow up to the
dignity of door-keeper in the house of the Lord, he should know that
extra seats should never be removed from the aisles, nor doors be
opened, until the last “amen” has been reverently uttered.
I believe that reverence and a proper understanding of the meaning
of the sacred hours of worship would be wholesomely inculcated by
the practise of sitting down in silence for two or three minutes
after the benediction, or long enough for any necessary things
to be done, such as the orderly passing out of the congregation
might require.
62
63
Good form requires that there be no loud talking, visiting, laughing,
bustling, or confusion of any sort in the breaking up of a
congregation. In fact, instead of a breaking up, it should be a
melting away, each for himself seeking to hold in thought, and carry
with him all that is possible of the subject which has been
considered, avoiding everything which tends to dissipate or to divert
the mind from its contemplation.
This is the good form which nominal Christians require and teach. It
is only the form, if you please, at the best dead, by which the
worldly professor seems to be trying to make up what may be
lacking in real spiritual worship; but that very fact proves it to be
more than ordinarily worthy of consideration and adoption by
the most spiritual. Upon the same principle that our
righteousness must exceed the righteousness of the scribes and
Pharisees should our courtesy and good breeding exceed that of the
most cultivated people of the world.
That behavior which everybody recognizes as becoming the house of
the Lord, is that which would most certainly distinguish Jesus if he
should come in among us; and the true worshiper who will clothe
himself with these gentle, Christlike graces of conduct will be no less
truly a Christian, while he will certainly be more quickly recognized
as such.
64
VIII.
One of the evils which the good-form code is intended to control is
that of the money and gift obligations, and the part they play in the
association of young people; and in this the burden of preserving the
just balance falls upon the young woman, although it is equally
necessary that both boys and girls shall be so instructed that they
shall each contribute an equal share of that mutual protection which
good form is intended to assure.
A sentiment still lingers in the social world—a relic of medieval
gallantry—to the effect that a young man must grant anything that a
lady asks, even if, to secure it, he must risk his life, or character, or
the last “quarter” with which he was to buy his dinner. This asking
on her part need not be really asking: it may be only suggesting, or
consenting to accept. She may only exclaim, “Oh, wouldn’t a
sleigh-ride be just too lovely for anything!” She may have
become naughty enough, without intending any harm, to say this on
purpose to make the boy whom she delights to tease begin mentally
to count over his small supply of change to see if he can possibly
afford the rig. Girls have been known to take a queer sort of delight
in leading a young fellow on to spend his last penny, to contract a
debt, and go hungry, because he did not bravely refuse to take the
hints that were intended to lead him into expenditure such as he
could not afford.
No girl who has been properly trained, or who has truth and the
elements of womanliness within, will ever resort to any such
expedient for her pleasure, but will keep herself from all or any such
social entanglements as would lead to anything so base. She will not
allow a young man to place her under obligation, even to the extent
of car-fare.
65
66
67
Teach your growing daughter that to receive a gift of any sort
from any boy or man outside of the immediate circle of
intimate, well-known family friends, is dangerous, if not disgraceful.
Gift-giving and gift-receiving has come to be a vice. It is often
intended as a sly, covert method of buying you. Gifts are employed
for “padlocking the mouth” of those who know something which, if
told, might spoil some selfish or criminal plot; and this is by no
means confined to Tammany Hall.
Many a girl has kept some dangerous bit of knowledge hidden in her
secret thought, and has been compromised by it, simply because
she had thoughtlessly accepted some bauble from some man whom
she supposed to be a friend until, the ulterior motive being revealed,
she discovered that the gift was a bribe, and its possession a
confession of dishonor; and then she has found herself in a great
strait between her desire to be free and yet to keep the trinket.
I had given a plain talk to a company of schoolgirls; and many
questions had been passed up to me, in answering which I
had touched some of these points. At the close of the meeting, a
few girls lingered to speak to me, each waiting to ask some
questions “all for herself alone.” So while the others waited at a safe
distance, they came, one by one, to whisper their perplexities in my
ear. How my heart was taken captive by those girls, as with
shamefacedness, with trembling lips and burning cheeks, they asked
me questions which were revelations both of the lack of early home
teaching and of the methods by which an evil world had tried to
make them wise!
“I have got afraid of a lovely necklace that my friend gave me,” said
one of them. “I’ve wished a hundred times he hadn’t given it; but
what in the world can I do with it?”
“Send it back to him,” I said; “tell him you know more now
than you did when you accepted it, and that you can not keep
it.”
68
69
“But that would make him furious. I—I—dare not make him angry.”
“Then if he is so dangerous, you certainly dare not have him for a
friend. If he is worthy of your friendship, he will understand and
respect you all the more for this course. If he is not worthy of your
friendship, the sooner you find it out, the better.”
“O—but—,” and the poor girl burst into bitter weeping. Then after a
few moments, with a sudden firm resolution expressed in her face,
she dried her eyes, looked up at me, clasped my hands as if to hold
herself by them, and said, “I’ll do it,—I’ll do it right off,—and if he
wants to make it hard for me, he may. I’ve kept honest,—God knows
I have,—and he knows it, though he hasn’t helped me, as he said he
would.”
“He promised to help you?” I asked.
“Yes, he did; he said I could trust him; that he’d never let a
girl be compromised in his company in the world; but if I had
done, and gone, as he insisted, lest if I didn’t he would have been
provoked, I should have been talked about long ago. I thank you so
much. I’ll get rid of it. He may have his old necklace, and keep it to
give to his wife.”
“That is right,” I said. “She is the only one who can wear or own it
with safety.”
The young man with a good heart, who is well taught in that which
is best in good form, will never offer to any lady outside his own
immediate family circle any gift but flowers; and those in the most
delicate unobtrusive manner, such as will leave her, in receiving
them, absolutely free to pass them on to some hospital patient if she
chooses. To make her feel, by even a look, that she is under any
obligation to wear a flower because he sends it, is to rob it of
its fragrance and beauty, and make it fit only for the dust
heap.
70
Because of the possibilities which I have suggested, and many
others to which they lead, good form requires that a young lady
shall make it practically impossible for any man not intimately related
to her to spend any money, or force any gifts, upon her.
71
72
IX.
I should not do my whole duty if I did not make some reference to
the “holy kiss,” nor yet contribute what I can to enlighten the
mothers who honor me by reading my book concerning the universal
but almost unspeakable questions that are always coming into the
minds of young people about this sacred form of salute. You may
know as much about these questions as I do, perhaps more; but
there is many a mother who never dreamed that they could infest
any brain but her own, and she never dared speak of such a thing.
One girl came to me, her face suffused with blushes, but with a
determined expression about her mouth, and said:—
“I am going to ask you something right out plain, because I think
you will not laugh. I’ve never dared ask anybody yet, because
everybody always laughs in such a mean way if you try to find
out anything about such things; and I’d like to know how girls
are going to know just what to do. Now it’s just this way: I am going
with Charley, and he is a nice boy; he wants to do what is right, I
know he does, but all the boys have such queer ideas about their
‘rights.’ When he takes me home from church or any place—and I’ve
just got so I dread to have him; and sometimes I think I won’t go
with another boy as long as I live, because, you see, when I go to
say ‘Good night,’ he—he thinks I am so queer because I won’t let
him kiss me. But I won’t; I never let anybody but my own folks. I
don’t like it. I don’t think it’s nice to do that way unless it’s
somebody you’re sure of, and love very much. He says I’m queer;
and he gets provoked, and says it’s his right, if he goes with me.
Now I want to know—is it?”
“No; it is not,” I said, positively, and perhaps with a little flavor
of indignation. “And no properly instructed young man would
73
74
make such a claim. He is not to blame, of course,” I added more
mildly, “for he is young, too; but your instincts are all right; they are
true; they are of God who made the kiss, and gave it its own place
in common human language. It belongs to the home, and to the
purest Christian fellowship between man and man, woman and
woman; to society, never.”
“Oh, I am so glad I asked you!” she said; “for I was sure my feeling
about it was right. But you know one doesn’t like to offend one’s
friend, and one doesn’t like to be called queer. But what does make
boys act so,—good boys, too, for Charley is a good boy?”
I can not bring into the compass of these pages all that followed in
our talk, but I would like to give the points of truth to the young
mothers for whom I write.
The answer to my young questioner is found in the fact that
boys, as well as girls, have been left in ignorance of the
principle, as it is in God, of which the kiss is one form of expression,
and have been left to catch up its perversion as Satan has
undertaken to work it into custom and habit, in the world. Anything
which Satan can not wholly spoil, he will counterfeit; or, better yet
for his purpose, make so common, if possible, that it shall become
worthless, as was the case with silver in the days of Solomon, when
it became as the stones of the street, and “was nothing accounted
of.”
The kiss, made common, is ridiculous. To be worth anything, it must
speak exclusively the language of a pure, changeless affection, such
as is represented in the love of God for his children. It belongs more
to the parent and child, brother and sister, than to friend and
companion. It is, as before intimated, fraternal, not social. As soon
as any attempt is made to drag it into society, it becomes
disgusting, and is always soon driven out by storms of ridicule.
Therefore good form has taken it in hand, and has determined its
sphere and office with the most arbitrary insistence. And again the
75
76
voice of society is but an echo of the voice of truth and purity. Good
form has decreed that the kiss, public and indiscriminate, is either an
indication of unmitigated rusticity, of shameless immorality, or is to
be understood as a joke,—very funny on its first spontaneous
utterance, but very flat if repeated. Indulged in private, outside the
sacred boundaries of the family, between men and women, it is
unpardonable,—unatonable, at least as far as the woman is
concerned. Good form requires that every young lady shall be so
well trained that she will keep her lips absolutely untouched for her
husband, after the words have been spoken that make him her
husband.
The “betrothal kiss” of the romancer has been brought under
suspicion in real life by the fact that betrothal is, in our day,
not by any means equivalent to marriage; and the young man who
knows the world, and yet sufficiently regards truth and purity to
seek them in a wife, would vastly prefer to find his lady friend rigidly
determined to keep her lips to herself as long as they two are yet
twain, rather than to find them always at even his command.
In the correspondence that has come to me as a result of “Studies in
Home and Child Life,” is to be found pitiful evidence of the ignorance
in which young people are allowed to grow up, even in a matter
which may seem, like this one, trivial and bordering on the
ridiculous.
The habit among children of kissing everybody is little short of
vicious. Kissing games of every description are considered vulgar,
anywhere outside the immediate family circle, and even then,
because of the trend of habit, they are not good form.
There is great possibility of infection in the kiss. The remains of old
teeth, the breath and lips of those who are in any wise diseased,
make kissing dangerous. It is well-nigh impossible to find a clean,
sweet mouth in these days of human degeneracy; and because of
these facts the little children are exposed to every malignant
77
78
disorder that is afloat, and many that are hidden deep in the foul
cisterns of the broken-down body of grandparents, father, mother,
and the strangers who straggle in and use their “rights” on the freely
rendered lips of the little innocents.
The warnings of science, of which so many make light, are timely,
and should be religiously regarded as the authority of God by every
one who does not know within himself that he has so faithfully
brought his whole being into conformity with every law of life
and health that he is clean through and through, so that the
sensitive lips of his babe can come to his with the same certainty of
a blessing in the caress that the bee has when he goes to the white
clover of the meadow.
He, and he only, who has brought himself fully into harmony with
both the letter and the spirit of Isaiah fifty-eight may freely give his
lips to his child, out of which to drink his fill of love. And the home
that is brought into this beautiful accord with Christ may be as the
garden of the Lord, from which all lips shall, with every caress,
gather that word of life that is sweeter than honey.
79
X.
The time is at hand when the truth must be taken into every lane
and walk of life—into king’s palaces, into halls of learning, into
banquet rooms, and into homes of refinement and culture, as well
as to the haunts of poverty and crime; for the whole earth must be
filled with the knowledge of the Lord. No soul must be left to arise in
the second resurrection and say, I did not know the way of life, or I
would not have been here. There are being prepared in all Christian
homes those who shall become the messengers of this gospel of the
kingdom to every rank, grade, and condition among men.
This is a consideration for every Christian mother and father. As
among the children of Israel every maiden held in her heart the
secret hope that she might be the mother of the promised seed of
David, so now, however humble and far away from every
center of influence your home may be, however meager its
furnishing, however much you may seem to lack incentive to noble
effort, there should be inspiration in the thought that the little child
playing about your feet, whose life and habits you are molding, may
be one who shall be called to bear the vessel of the Lord, which is
his Word, filled with the holy oil of his Spirit, before some council of
earth’s great men, and to answer for the principles by which the
world is to receive its final test.
By this I do not mean that he may be called to suffer martyrdom,—
although that is possible—but I refer to the fact that he may have
the yet grander ministry of standing up to be quizzed and catechized
by those learned in the wisdom of the world concerning all that he
has been taught of Christian principle, health, disease, and life in the
Holy Ghost.
80
81
82
Unquestionably, this work is waiting for some select few of our
young people in the not far distant future. Some great council
of physicians will wish to know all about what the medical missionary
physicians teach, and why; the chemists of the world will wish to
know the philosophy of the system of dietetics which will keep the
temple of God in repair; and, as is almost always the case among
the people of the world, there will be eating and drinking on a large
scale connected with all these investigations; and your boy or girl
may have to accept the place as guest of honor at some such feast,
and carry himself elegantly, for Christ’s sake and the truth’s; for the
banquet, the dinner, the lunch, play an important part in all social
affairs to-day, and will until the end of probation.
If a man of means and social standing becomes interested enough in
what you know of Christ to hear you out on it, he will make
you a dinner, invite a few friends, and give you a chance to
talk and tell all you know. And if you know how to take advantage of
the opportunity—how to avoid giving offense by your manner of
speech and habits of conduct; if you know how to charm and win by
your personality, you have placed at the command of truth an
instrument that can be made effective where, otherwise, no
entrance could be gained.
Nowhere is the observance of good form more necessary to one who
has work to do in the social world than at the table; for here bad
habits may be given such disgusting publicity as to render them a
cause of reproach to any good cause; and the obligation is upon
every Christian home to see that its children are so instructed that
they shall be ready to quickly fill any place to which the work may
call, and to stand with dignity for the truth in any place that can be
opened to its consideration.
A home of wealth and elaborate appliances is not necessary
for such training. A child who is instructed in the proper use of
the few simple things that constitute the furnishing of the most
humble home, and in those rules of good form that ought to be the
83
84
natural order in any place, will not be left to carry with him into
some important convocation careless table habits, which, under the
pressure of a sense of responsibility, would certainly come to the
front, in place of the few better ways that he might have picked up
and stored away for occasional and special use.
In “acting out just what is in him,” he will not bring himself and that
which he represents into ridicule; the opportunity of giving the truth
a chance to shine will not be lost, while honest souls are left in the
dark; the breath of personal contempt will not obscure the character
of Christ, which he is supposed to represent. He will be accepted,
first, because it is agreeable to look at him; he will be heard because
no good reason appears why he should not be; and after that,
everything will depend on what he really is and has down
under the surface, in the place where he lives alone with God.
“But,” you say, “the Lord, who calls a man to stand in any place, will
prevent any disaster to the cause, provided his servant is honest.”
Yes, God will be able to use even his servants’ infirmities after he
has “helped” them (Rom. 8:26); i. e., added to them his strength
and wisdom. And this which we are considering is all in the nature of
helps to infirmity and ignorance. It is in the direct line of legitimate
education for the very best Christian service.
The honest-hearted laborer for God, who, with his heart full of love,
starts out in his ignorance and awkwardness to “do something” for
God and souls, will find “something” to do; but we are now
considering a work which every man could not do, and yet which
some one must do.
85
XI.
I must believe that the parents who fail, from carelessness or from
“lack of ambition”—the holy sort, which is equivalent to consecration
and diligence—to give the child the best possible preparation for a
good work, will be held responsible for the failure that would have
resulted if God had not stepped in with some special helps and
prevented it.
Love for God will cover a multitude of social sins; but those who are
responsible for the sins will sometime have their reproach to bear.
God does not like to have to cover sins; he only does it so as to keep
things looking as tidy as possible, until they can be put entirely out
of the way. Covet the best gifts for your child, give him the best
possible social habits, and then turn him over to God for work, and
God will find rare service for him.
There are many teachings as to what constitutes good form at
table. It would be impossible for the ordinary mortal so to
acquaint himself with them as to become a “social success;” and this
is far from our purpose. All we need care about is to see that the
habits formed are free from anything offensive. Society is kind to
one who is not ambitious for social distinction,—one who has
something to say that is worth hearing, who represents a principle,
or some new thing the discussion of which may possibly furnish an
agreeable diversion,—very much after the manner of the Athenians
in Paul’s time; so that even if one does not “know all the ropes,” like
one “to the Manor born,” he will be received and heard, provided he
does not blunder into the few things which good form has decreed
that he must not do under any circumstances.
Among these prohibited things are thrusting out the elbows from the
side so as to push his neighbor at table; resting the elbows on the
86
87
88
table; and extending the legs under it so as to bring the feet
in the way of those belonging to the guest opposite. If any
guest does these things, he may be sure that there will be at least
three people over whom the best and truest things that he can say
will have very little influence.
The eyes of those who chance to glance his way will be seriously
offended and quickly averted if he should take up even a half-slice of
bread and bite into it. Good form says that bread must be broken off
in small bits, just when needed, not spread, but with a small lump of
butter placed upon it (provided one uses butter), conveyed to the
mouth with the thumb and finger of the left hand. You will be
permitted to bite the piece in two once if you wish, but no more;
that is, it must not be more than two “mouthfuls” to begin with.
Under no circumstances must anything, such as fruit-pits, etc.,
be ejected from the mouth into a spoon, fork, or plate, but
taken from the lips with the left thumb and finger, and placed on the
plate. Neither bread nor any refuse is ever to be placed on the cloth,
but on the side-dishes provided; or, lacking these, on the one plate
that is being used.
Food should not be conveyed to the mouth with a knife, but with a
fork, always excepting soup, and such sauce as must be handled
with a spoon.
Do teach your children not to thrust the point of the spoon into the
mouth, but to take its contents with the lips from that part nearest
the handle, without the least possible sound. Teach them not to lift
the spoon so full that it will drip; and as your boy grows up into
mustaches he will need to learn how to take soup and sauce without
defiling those manly ornaments, or else to let soup alone at the
banquet. But you can teach him from childhood to handle his
napkin so deftly as to keep his lips clean, even after they have
put on their thatch.
89
90
As to the napkin, by all means habituate the child to its use, even if
it be nothing more than a square of old calico or flour-sacking,
hemmed, or even unhemmed. He can learn on a piece of his
mother’s old apron how to use the fine linen of the king’s banquet-
hall, and do it so daintily that the apron and the mother who wore it
down to napkin dimensions will confer honor on the king’s damask.
O my sister mothers in the many humbler homes of those who love
our Lord and are looking for his appearing, has it seemed to you that
any of these things that I have written are trivial or burdensome,
wholly outside the sphere of life in which you and your children will
ever move? Are you so overburdened with many cares that you feel,
when the food is cooked and placed “anyhow,” that your part
is done; that the family may come “just as it happens” and
eat, simply to satisfy hunger, as do the cattle in the field? Have you
thought that if you could but get through the day anyhow, your duty
was done? Still you must meet the certainties that are before you.
Your children must bear a part in the closing scenes of the world’s
history,—ask yourself if there is not something for you in these
things that I have written. They have been written with a most
solemn sense of their importance. They are a part of the gospel
message; they concern the work which some one now in training
must do before the Lord can come.
The knowledge of how to prepare and serve a hygienic dinner, as
well as how to select suitable portions and decline others, at a
worldly banquet, may be absolutely necessary to the winning of
souls in the last call to the world.
91
XII.
Nothing is of more importance to success in any work than
conversation. How to converse so as to win and not wound, to both
give and gain, is an accomplishment which has very nearly passed
into the list of lost arts. And here again good form comes to the
rescue, and by its placid but arbitrary code offsets that lawlessness
into which even good men have fallen in excess of zeal.
Sixty years ago the rule for children was that they “should be seen
and not heard,” so that a child’s talk was almost unknown in a
company of adults. This was so wrong that it has reacted in a sort of
wild freedom upon the part of the children which, uncorrected,
develops into the adult chatter-box and gossip, than which no
character is more to be dreaded.
Bad habits of conversation are very hard to break, and since it is by
the “calves (or sacrifice) of the lips” that we are especially to
honor God, by “words fitly spoken,” and that we are to “give a
reason for the faith that is in us,” it is not of small importance that
we should know how to talk. Begin with the baby, therefore, so that
the child shall grow up into correct forms of speech, and into that
regard of all good form which shall not only give him at once the
ears, but the hearts of the people.
I scarcely need to say, Do not use slang, for this is universally
understood as out of harmony with Christian practise; but yet it may
not be amiss to say that even the world of society, whose laws of
behavior we are considering, would ostracize one whose language
was punctuated with much slang. An oath would be more tolerable
to so-called “polite ears.”
92
93
94
Money, or prominence, will for a time give a man social passport in
spite of all manner of ill-breeding. He can buy a place and
recognition even from those who despise him; but this is not
the sort of recognition in the interests of which I am writing. I
am pleading for that which shall gain a hearing for the custodians of
a truth without which no man can live, and for the reception of
which few are as yet prepared. It is for the sake of the honest souls
who are in the darkness of the world’s “culture” that I am pleading.
They have a right to know all that the Spirit of God has been
sending to his people concerning that all-round righteousness that
makes up the sum of that whole gospel for the whole man, which is
included in an uttermost salvation; and some tongues must be so
cultured as to talk the way open for truth just as effectually as a wag
can do it for fun, a singer open it for a song, or money open it for
blind boorishness; and the quiet mother in the home must have a
large share of this work.
To this end teach the child that he must listen when any other child
is speaking until he has finished; never to interrupt, or, if it is
necessary to give some information, to say, for instance: “I
beg your pardon, but,—” or, “Willie, if you please, was it not on
Wednesday instead of Tuesday?” Any interruption simply for getting
in a word should never be indulged. Teach him to wait patiently for a
fair chance to speak, no matter how great may be the temptation to
“thrust in his oar.” This should not be construed to include those
playful interruptions in the merry tangle of words which all children
delight in “once in a while,” “just for fun.”
Teach him to avoid all abrupt forms of expression, such as “Give me
that!” “Don’t!” “Stop!” “Quit!” “Get out!” “You sha’n’t!” “I won’t!” If
he never hears such phrases at home, he will not be apt to catch
them; but if he should, a few little experiences such as he would
certainly meet as a man upon entering the social world, with
the adult equivalents of these words, would teach him that
they were very unprofitable. Let him find out that he can get nothing
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebookgate.com

More Related Content

Similar to Automating with SIMATIC S7 1200 Configuring Programming and Testing with STEP 7 Basic Second Edition Hans Berger (20)

PDF
manuales y guías PLC siemens Simatic S7
SANTIAGO PABLO ALBERTO
 
PDF
Siemens win cc manual pcs 7 runtime
Dien Ha The
 
PDF
Br simatic pdm_en
Vahid RG-zadeh
 
PDF
IRJET- Design of SCADA based Wireless Monitoring and Control
IRJET Journal
 
PDF
Drives Software Programming – using PLC or Drive bespoke programming?
Optima Control Solutions
 
PDF
Manual del sistema del controlador programable S7-200
SANTIAGO PABLO ALBERTO
 
PDF
Siemens s7 300-400-testing your s7 programs with s7 plcsim
Dien Ha The
 
PDF
S7-1200 easy_book
quanglocbp
 
PDF
Siemens s7 300-400-simatic net - ncm s7 for profibus - fms 2
Dien Ha The
 
PDF
Siemens s7 300-400-ncm s7 for profibus
Dien Ha The
 
PDF
Basics_of_PLCs.pdf
EuclidSantiago
 
PDF
Basics of PLC-1 For Education in School and for Learn
AdiKendil
 
PDF
Siemens win cc manual pcs 7 wincc basic process control
Dien Ha The
 
PPT
Top Ten Siemens S7 Tips and Tricks
DMC, Inc.
 
PPT
Azeti Company And Products Presentation
arvardan
 
PDF
Cpu226
Slamet Pambudi
 
PDF
Siemens s7 300-400-ncm s7 for industrial ethernet
Dien Ha The
 
PDF
Siemens s7 300-400-s7 graph v5.1 for s7-300 400 programming sequential contro...
Dien Ha The
 
PPT
Pmo slides jun2010
Steve Turner
 
PDF
Simulation and Implementation of PLC Based for Detecting Burned Potato Chips ...
ijtsrd
 
manuales y guías PLC siemens Simatic S7
SANTIAGO PABLO ALBERTO
 
Siemens win cc manual pcs 7 runtime
Dien Ha The
 
Br simatic pdm_en
Vahid RG-zadeh
 
IRJET- Design of SCADA based Wireless Monitoring and Control
IRJET Journal
 
Drives Software Programming – using PLC or Drive bespoke programming?
Optima Control Solutions
 
Manual del sistema del controlador programable S7-200
SANTIAGO PABLO ALBERTO
 
Siemens s7 300-400-testing your s7 programs with s7 plcsim
Dien Ha The
 
S7-1200 easy_book
quanglocbp
 
Siemens s7 300-400-simatic net - ncm s7 for profibus - fms 2
Dien Ha The
 
Siemens s7 300-400-ncm s7 for profibus
Dien Ha The
 
Basics_of_PLCs.pdf
EuclidSantiago
 
Basics of PLC-1 For Education in School and for Learn
AdiKendil
 
Siemens win cc manual pcs 7 wincc basic process control
Dien Ha The
 
Top Ten Siemens S7 Tips and Tricks
DMC, Inc.
 
Azeti Company And Products Presentation
arvardan
 
Siemens s7 300-400-ncm s7 for industrial ethernet
Dien Ha The
 
Siemens s7 300-400-s7 graph v5.1 for s7-300 400 programming sequential contro...
Dien Ha The
 
Pmo slides jun2010
Steve Turner
 
Simulation and Implementation of PLC Based for Detecting Burned Potato Chips ...
ijtsrd
 

Recently uploaded (20)

PDF
epi editorial commitee meeting presentation
MIPLM
 
PDF
Vietnam Street Food & QSR Market 2025-1.pdf
ssuserec8cd0
 
PPTX
Difference between write and update in odoo 18
Celine George
 
PPTX
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
PDF
IMPORTANT GUIDELINES FOR M.Sc.ZOOLOGY DISSERTATION
raviralanaresh2
 
PDF
WATERSHED MANAGEMENT CASE STUDIES - ULUGURU MOUNTAINS AND ARVARI RIVERpdf
Ar.Asna
 
PPTX
How to Manage Expiry Date in Odoo 18 Inventory
Celine George
 
PPTX
PLANNING FOR EMERGENCY AND DISASTER MANAGEMENT ppt.pptx
PRADEEP ABOTHU
 
PPTX
ENGlish 8 lesson presentation PowerPoint.pptx
marawehsvinetshe
 
PPTX
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PDF
I3PM Industry Case Study Siemens on Strategic and Value-Oriented IP Management
MIPLM
 
PDF
I3PM Case study smart parking 2025 with uptoIP® and ABP
MIPLM
 
PPTX
How to Manage Allocation Report for Manufacturing Orders in Odoo 18
Celine George
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PPTX
Introduction to Indian Writing in English
Trushali Dodiya
 
PPTX
Light Reflection and Refraction- Activities - Class X Science
SONU ACADEMY
 
PPTX
Building Powerful Agentic AI with Google ADK, MCP, RAG, and Ollama.pptx
Tamanna36
 
PPTX
Ward Management: Patient Care, Personnel, Equipment, and Environment.pptx
PRADEEP ABOTHU
 
PDF
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
epi editorial commitee meeting presentation
MIPLM
 
Vietnam Street Food & QSR Market 2025-1.pdf
ssuserec8cd0
 
Difference between write and update in odoo 18
Celine George
 
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
IMPORTANT GUIDELINES FOR M.Sc.ZOOLOGY DISSERTATION
raviralanaresh2
 
WATERSHED MANAGEMENT CASE STUDIES - ULUGURU MOUNTAINS AND ARVARI RIVERpdf
Ar.Asna
 
How to Manage Expiry Date in Odoo 18 Inventory
Celine George
 
PLANNING FOR EMERGENCY AND DISASTER MANAGEMENT ppt.pptx
PRADEEP ABOTHU
 
ENGlish 8 lesson presentation PowerPoint.pptx
marawehsvinetshe
 
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
I3PM Industry Case Study Siemens on Strategic and Value-Oriented IP Management
MIPLM
 
I3PM Case study smart parking 2025 with uptoIP® and ABP
MIPLM
 
How to Manage Allocation Report for Manufacturing Orders in Odoo 18
Celine George
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
Horarios de distribución de agua en julio
pegazohn1978
 
Introduction to Indian Writing in English
Trushali Dodiya
 
Light Reflection and Refraction- Activities - Class X Science
SONU ACADEMY
 
Building Powerful Agentic AI with Google ADK, MCP, RAG, and Ollama.pptx
Tamanna36
 
Ward Management: Patient Care, Personnel, Equipment, and Environment.pptx
PRADEEP ABOTHU
 
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
Ad

Automating with SIMATIC S7 1200 Configuring Programming and Testing with STEP 7 Basic Second Edition Hans Berger

  • 1. Automating with SIMATIC S7 1200 Configuring Programming and Testing with STEP 7 Basic Second Edition Hans Berger pdf download https://ebookgate.com/product/automating-with- simatic-s7-1200-configuring-programming-and-testing-with- step-7-basic-second-edition-hans-berger/ Get Instant Ebook Downloads – Browse at https://ebookgate.com
  • 2. Instant digital products (PDF, ePub, MOBI) available Download now and explore formats that suit you... Automating with SIMATIC S7 300 inside TIA Portal Configuring Programming and Testing with STEP 7 Professional 2nd Edition Hans Berger https://ebookgate.com/product/automating-with-simatic-s7-300-inside- tia-portal-configuring-programming-and-testing-with- step-7-professional-2nd-edition-hans-berger/ ebookgate.com Assembly Language Step by Step Programming with Linux 3rd Edition Edition Jeff Duntemann https://ebookgate.com/product/assembly-language-step-by-step- programming-with-linux-3rd-edition-edition-jeff-duntemann/ ebookgate.com Programming with Microsoft Visual Basic 2010 5th Edition Diane Zak https://ebookgate.com/product/programming-with-microsoft-visual- basic-2010-5th-edition-diane-zak/ ebookgate.com Davis s Basic Math Review for Nurses with Step by Step Solutions 1st Edition Vicki Raines https://ebookgate.com/product/davis-s-basic-math-review-for-nurses- with-step-by-step-solutions-1st-edition-vicki-raines/ ebookgate.com
  • 3. Automating Microsoft Azure with PowerShell 1st Edition Aman Dhally https://ebookgate.com/product/automating-microsoft-azure-with- powershell-1st-edition-aman-dhally/ ebookgate.com Programming with Mobile Applications Android iOS and Windows Phone 7 1st Edition Thomas J. Duffy https://ebookgate.com/product/programming-with-mobile-applications- android-ios-and-windows-phone-7-1st-edition-thomas-j-duffy/ ebookgate.com Object Oriented Programming with C 2 e Second Edition Sahay https://ebookgate.com/product/object-oriented-programming- with-c-2-e-second-edition-sahay/ ebookgate.com Structural Equation Modeling With AMOS Basic Concepts Applications and Programming Multivariate Applications 2nd edition Barbara Byrne https://ebookgate.com/product/structural-equation-modeling-with-amos- basic-concepts-applications-and-programming-multivariate- applications-2nd-edition-barbara-byrne/ ebookgate.com Programming the Raspberry Pi Second Edition Getting Started with Python Simon Monk https://ebookgate.com/product/programming-the-raspberry-pi-second- edition-getting-started-with-python-simon-monk/ ebookgate.com
  • 5. Hans Berger Automating with SIMATIC S7-1200 Configuring, Programming and Testing with STEP 7 Basic Visualization with WinCC Basic Second Edition
  • 6. Berger Automating with SIMATIC S7-1200
  • 8. Automating with SIMATIC S7-1200 Configuring, Programming and Testing with STEP 7 Basic Visualization with HMI Basic by Hans Berger 2nd enlarged and revised edition, 2013 Publicis Publishing
  • 9. Bibliographic information published by the Deutsche Nationalbibliothek The Deutsche Nationalbibliothek lists this publication in the Deutsche Nationalbibliografie; detailed bibliographic data are available on the Internet at http://dnb.d-nb.de. The author, translators and publisher have taken great care with all texts and illustrations in this book. Nevertheless, errors can never be completely avoided. The publisher, author and translators accept no liability, for whatever legal reasons, for any damage resulting from the use of the programming examples. www.publicis-books.de Print ISBN: 978-3-89578-385-2 ePDF ISBN: 978-3-89578-901-4 2nd edition, 2013 Editor: Siemens Aktiengesellschaft, Berlin and Munich Publisher: Publicis Publishing, Erlangen © 2013 by Publicis Erlangen, Zweigniederlassung der PWW GmbH This 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 individual illustrations or extracts from the text. Printed in Germany
  • 10. 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 concept permits uniform handling of all automa- tion 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 management and communication. This book describes the newly developed SIMATIC S7-1200 automation system. The S7-1200 programmable controllers are of compact design and allow modular ex- pansion. Many small applications can be solved using the CPU module with on-board I/O. The technological functions integrated in the CPU module mean that extremely versatile use of the device is possible. Two established programming lan- guages are available for solving automation tasks: ladder logic (LAD) and function block diagram (FBD). New SIMATIC HMI Basic Panels have been designed for operator control and moni- toring appropriate to the S7-1200 programmable controllers, and provide a perfor- mance and functionality optimized for small applications. A touch screen with var- ious monitor sizes and coordinated communication over Industrial Ethernet are ideal prerequisites for interaction with S7-1200. The STEP 7 Basic engineering software makes it possible to use all S7-1200 control- ler options. STEP 7 Basic is the common tool for hardware configuration, genera- tion of the control program, and for debugging and diagnostics. The SIMATIC WinCC Basic configuration software included in STEP 7 Basic is used to configure the Basic Panels. Modern and intuitive user guidance allows efficient and task-ori- ented engineering of control and visualization devices. This book describes the S7-1200 automation system with S7-1200 programmable controllers and HMI Basic Panels. The description focuses on the generation of the control program using STEP 7 Basic engineering software Version 11 SP2. Nuremberg, February 2013 Hans Berger
  • 11. The contents of the book at a glance 6 The contents of the book at a glance Start Introduction SIMATIC S7-1200: Overview of the SIMATIC S7-1200 automation system. STEP 7 Basic: Introduction to the engineering software for SIMATIC S7-1200. SIMATIC project: Basic functions for the automation solution. Devices & networks The hardware components of S7-1200 Modules: Overview of the SIMATIC S7-1200 modules. Device configuration Hardware configuration: Configuration of the hardware design. Network configuration: Configuration of a communication network. PLC programming The control program Operating modes: How the CPU module responds with STARTUP, RUN and STOP. Processing modes: Restart characteristics, main program, interrupt processing, and error handling define the processing of the control program. Blocks: Organization blocks, function blocks, functions, and data blocks structure the control program. The program editor Programming: How the control program is produced. Program information: Tools for supporting programming. Ladder logic and function block diagram as programming languages Program elements: The characteristics of LAD and FBD programming; the use of contacts, coils, standard boxes, Q boxes and EN/ENO boxes. Tags and data types Tags: Operand areas, project-wide and block-local tags, addressing. Data types: Description of elementary and compound data types. Description of the control functions Basic functions: Binary operations, memory functions, edge evaluation, timer and counter functions. Digital functions: Move, comparison, arithmetic, math, conversion, shift, and logic functions. Program flow control: Jump functions, block end function, block calls.
  • 12. The contents of the book at a glance 7 Online & diagnostics Connection of programming device to PLC station Online operation: Establish connection to PLC station. Status LEDs: The modules signal an error. Diagnostics information: Find the error using the diagnostics information. Online tools: Control the CPU module using the online tools. Online & offline project data Download: Download control program into CPU memory. Blocks: Edit and compare the blocks offline/online. Test: Test the control function using program status and monitoring tables. Data communication Open user communication Data transmission: Data exchange from PLC to PLC over Ethernet. Point-to-point connection PtP: Data transmission with CM modules via RS232 and RS485. Visualization Configuration of Basic Panels Introduction: Overview of Basic Panels. Start: Create an HMI project, the HMI device wizard. Connection to the PLC: Create HMI tags and area pointers. Create screens: Configuration of process screens – templates, layers and screen changeover. Working with image elements: Arrange and edit operator control and display elements, configure a message system, create recipes, transfer data records, configure user manage- ment. Complete the HMI program Simulation: Simulate the HMI program with PLC station or with tag table. Connection: Transfer the HMI program to the HMI station. Appendix Integral and technological functions Functions: High-speed counter, pulse generator, motion control, PID controller. Global libraries Overview: USS drive control, MODBUS blocks.
  • 13. Table of contents 8 Table of contents 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.1 Overview of the S7-1200 automation system . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.1.1 SIMATIC S7-1200 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.1.2 Overview of STEP 7 Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.1.3 Three programming languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 1.1.4 Execution of the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.1.5 Data management in the SIMATIC automation system . . . . . . . . . . . . . . . 29 1.1.6 Operator control and monitoring with process images . . . . . . . . . . . . . . 30 1.2 Introduction to STEP 7 Basic for S7-1200 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.2.1 Installing STEP 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.2.2 Automation License Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.2.3 Starting STEP 7 Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 1.2.4 Portal view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 1.2.5 Help Information system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 1.2.6 The windows of the project view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 1.2.7 Adapting the user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 1.3 Editing a SIMATIC project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 1.3.1 Structured representation of project data . . . . . . . . . . . . . . . . . . . . . . . . . 38 1.3.2 Project data and editors for a PLC station . . . . . . . . . . . . . . . . . . . . . . . . . . 39 1.3.3 Creating and editing a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 1.3.4 Creating and editing libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 2 SIMATIC S7-1200 automation system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 2.1 S7-1200 station components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 2.2 S7-1200 CPU modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 2.2.1 Integrated I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 2.2.2 PROFINET connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 2.2.3 Status LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 2.2.4 SIMATIC Memory Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 2.2.5 Expansions of the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 2.3 Signal modules (SM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 2.3.1 Digital I/O modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 2.3.2 Analog input/output modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 2.3.3 Properties of the I/O connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 2.4 Communication modules (CM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 2.4.1 Point-to-point communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 2.4.2 PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 2.4.3 Actuator/sensor interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 2.4.4 GPRS transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 2.5 Further modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 2.5.1 Compact switch module (CSM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
  • 14. Table of contents 9 2.5.2 Power module (PM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 2.5.3 TS Adapter IE Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 2.5.4 SIM 1274 simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 2.6 SIPLUS S7-1200 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 3 Device configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 3.2 Configuring a station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 3.2.1 Adding a PLC station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 3.2.2 Arranging modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 3.2.3 Adding an HMI station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 3.3 Assigning module parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 3.3.1 Parameterization of CPU properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 3.3.2 Addressing input and output signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 3.3.3 Parameterization of digital inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 3.3.4 Parameterization of digital outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 3.3.5 Parameterization of analog inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 3.3.6 Parameterization of analog outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 3.4 Configuring the network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 3.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 3.4.2 Networking stations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 3.4.3 Node addresses in a subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 3.4.4 Connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 3.4.5 Configuring a PROFINET subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 3.4.6 Configuring a PROFIBUS subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 3.4.7 Configuring an AS-i subnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 4 Variables and data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 4.1 Operands and tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 4.1.1 Introduction, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 4.1.2 Operand areas: inputs and outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 4.1.3 Operand area bit memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 4.1.4 Operand area data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 4.1.5 Operand area temporary local data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 4.2 Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 4.2.1 Signal path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 4.2.2 Absolute addressing of an operand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4.2.3 Absolute addressing of an operand area . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4.2.4 Symbolic addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 4.2.5 Addressing a tag part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 4.2.6 Addressing constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 4.2.7 Indirect addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 4.3 General information on data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 4.3.1 Overview of data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 4.3.2 Implicit data type conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 4.3.3 Overlaying tags (data type views) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 4.4 Elementary data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 4.4.1 Bit-serial data types BOOL, BYTE, WORD and DWORD . . . . . . . . . . . . . . . . 95
  • 15. Table of contents 10 4.4.2 BCD-coded numbers BCD16 and BCD32 . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 4.4.3 Unsigned fixed-point data types USINT, UINT and UDINT . . . . . . . . . . . . 97 4.4.4 Fixed-point data types with sign SINT, INT and DINT . . . . . . . . . . . . . . . . 98 4.4.5 Floating-point data types REAL and LREAL . . . . . . . . . . . . . . . . . . . . . . . . . 98 4.4.6 Data type CHAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 4.4.7 Data type DATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 4.4.8 Data type TIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 4.4.9 TIME_OF_DAY (TOD) data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 4.5 Structured data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 4.5.1 Data type DTL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 4.5.2 Data type STRING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 4.5.3 Data type ARRAY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 4.5.4 Data type STRUCT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 4.6 Parameter types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 4.6.1 Parameter types for IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . 107 4.6.2 Parameter types for IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . 108 4.6.3 Parameter type VARIANT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 4.6.4 Parameter type VOID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 4.7 PLC data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 4.8 System data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 4.8.1 IEC_TIMER system data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 4.8.2 IEC_COUNTER system data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 4.8.3 TCON_Param data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 4.8.4 TADDR_Param data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 4.8.5 Data type ErrorStruct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 4.8.6 TimeTransformationRule data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 4.9 Hardware data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 5 Edit user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 5.1 Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 5.1.1 STOP mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 5.1.2 STARTUP mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 5.1.3 RUN mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 5.1.4 Retentive behavior of operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 5.2 Creating a user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 5.2.1 Program draft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 5.2.2 Program execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 5.2.3 Nesting depth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 5.3 Programming blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 5.3.1 Block types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 5.3.2 Editing block properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 5.3.3 Configuring know-how protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 5.3.4 Copy protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 5.3.5 Block interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 5.3.6 Programming block parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 5.4 Calling blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 5.4.1 General information on calling logic blocks . . . . . . . . . . . . . . . . . . . . . . 137 5.4.2 Calling a function (FC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
  • 16. Table of contents 11 5.4.3 Calling a function block (FB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 5.4.4 “Passing on” of block parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 5.5 Start-up routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 5.6 Main program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 5.6.1 Organization blocks for the main program . . . . . . . . . . . . . . . . . . . . . . . 143 5.6.2 Process image update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 5.6.3 Cycle time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 5.6.4 Reaction time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 5.6.5 Stop program execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 5.6.6 Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 5.6.7 Runtime meter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 5.7 Interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 5.7.1 Introduction to interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 5.7.2 Time-delay interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 5.7.3 Cyclic interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 5.7.4 Process interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 5.7.5 Assigning interrupts during runtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 5.7.6 Delay and enable interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 5.8 Troubleshooting, diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 5.8.1 Causes of errors and responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 5.8.2 Error display with the ENO output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 5.8.3 Time error OB 80 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 5.8.4 Local error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 5.8.5 Diagnostic functions in the user program . . . . . . . . . . . . . . . . . . . . . . . . 172 5.8.6 Diagnostics interrupt OB 82 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 6 Program editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 6.2 PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 6.2.1 Creating and editing the PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 6.2.2 Defining PLC tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 6.2.3 Editing a PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 6.2.4 Exporting and importing a PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . 181 6.2.5 Constants tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 6.3 Programming a code block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 6.3.1 Creating a new code block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 6.3.2 Working area of program editor for code blocks . . . . . . . . . . . . . . . . . . . 184 6.3.3 Specifying code block properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 6.3.4 Programming a block interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 6.3.5 Programming control functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 6.3.6 Editing tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 6.3.7 Working with program comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 6.4 Programming a data block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 6.4.1 Creating a new data block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 6.4.2 Working area of program editor for data blocks . . . . . . . . . . . . . . . . . . . 195 6.4.3 Defining properties for data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 6.4.4 Declaring data tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 6.4.5 Entering data tags in global data blocks . . . . . . . . . . . . . . . . . . . . . . . . . . 198
  • 17. Table of contents 12 6.5 Compiling blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 6.5.1 Starting the compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 6.5.2 Compiling SCL blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 6.5.3 Eliminating errors following compilation . . . . . . . . . . . . . . . . . . . . . . . . 200 6.6 Program information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 6.6.1 Cross-reference list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 6.6.2 Assignment list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 6.6.3 Call structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 6.6.4 Dependency structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 6.6.5 Consistency check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 6.6.6 CPU resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 6.7 Language setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 7 Ladder logic LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 7.1.1 Programming with LAD in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 7.1.2 Program elements of ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 7.2 Programming with contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 7.2.1 NO and NC contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 7.2.2 Consideration of sensor type in ladder logic . . . . . . . . . . . . . . . . . . . . . . 213 7.2.3 Series connection of contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 7.2.4 Parallel connection of contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 7.2.5 Mixed series and parallel connections . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 7.2.6 T branch, open parallel branch in the ladder logic . . . . . . . . . . . . . . . . . 217 7.2.7 Negating result of logic operation in the ladder logic . . . . . . . . . . . . . . . 218 7.2.8 Edge evaluation of a binary tag in ladder logic . . . . . . . . . . . . . . . . . . . . 218 7.2.9 OK contact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 7.2.10 Comparison contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 7.3 Programming with coils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 7.3.1 Simple and negated coils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 7.3.2 Set and reset coil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 7.3.3 Retentive response due to latching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 7.3.4 Edge evaluation with pulse output in the ladder logic . . . . . . . . . . . . . . 224 7.3.5 Multiple setting and resetting (filling of bit field) in the ladder logic . 225 7.3.6 Starting IEC timer functions in the ladder logic with coils . . . . . . . . . . . 225 7.4 Programming with Q boxes in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . 226 7.4.1 Arrangement of Q boxes in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . 226 7.4.2 Memory boxes in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 7.4.3 Edge evaluation of current flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 7.4.4 Example of binary scaler in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . 229 7.4.5 Controlling IEC timer functions in the ladder logic with Q boxes . . . . . 230 7.4.6 Controlling IEC counter functions in the ladder logic with Q boxes . . . 231 7.5 Programming with EN/ENO boxes in the ladder logic . . . . . . . . . . . . . . . . . . 233 7.5.1 Positioning of EN/ENO boxes in the ladder logic . . . . . . . . . . . . . . . . . . . 234 7.5.2 Transfer functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 7.5.3 Arithmetic functions for numerical values in the ladder logic . . . . . . . 236 7.5.4 Arithmetic functions for time values in the ladder logic . . . . . . . . . . . . 236 7.5.5 Math functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
  • 18. Table of contents 13 7.5.6 Conversion functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . 238 7.5.7 Shift functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 7.5.8 Logic functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 7.5.9 Functions for strings in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . 240 7.6 Functions for program flow control (LAD) . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 7.6.1 Jump functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 7.6.2 Jump list in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 7.6.3 Jump distributor in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 7.6.4 Block end function in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 7.6.5 Block call functions in the ladder logic . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 8 Function block diagram FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 8.1.1 Programming with function block diagram in general . . . . . . . . . . . . . . 246 8.1.2 Program elements of the function block diagram . . . . . . . . . . . . . . . . . . 248 8.2 Programming of binary logic operations (FBD) . . . . . . . . . . . . . . . . . . . . . . . 249 8.2.1 Scanning for signal states “1” and “0” . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 8.2.2 Taking account of the sensor type in the function block diagram . . . . . 251 8.2.3 AND function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 8.2.4 OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 8.2.5 Exclusive OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 8.2.6 Mixed binary logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 8.2.7 T branch in the function block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 255 8.2.8 Negate result of logic operation in the function block diagram . . . . . . 255 8.2.9 Edge evaluation of binary tags in the function block diagram . . . . . . . 256 8.2.10 Validity checking of floating-point numbers in the function block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 8.2.11 Comparison functions in the function block diagram . . . . . . . . . . . . . 258 8.3 Programming with standard boxes (FBD) . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 8.3.1 Assignment and negated assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 8.3.2 Set and reset boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 8.3.3 Edge evaluation with pulse output in the function block diagram . . . . 261 8.3.4 Multiple setting and resetting (filling of bit field) in the function block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 8.3.5 Starting IEC timer functions in the function block diagram with standard boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 8.4 Programming with Q boxes (FBD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 8.4.1 Arrangement of Q boxes in the function block diagram . . . . . . . . . . . . . 264 8.4.2 Memory boxes in the function block diagram . . . . . . . . . . . . . . . . . . . . . 265 8.4.3 Edge evaluation of logic operation result in the function block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 8.4.4 Example of binary scaler in the function block diagram . . . . . . . . . . . . 267 8.4.5 Controlling IEC timer functions in the function block diagram with Q boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 8.4.6 IEC counter functions in the function block diagram . . . . . . . . . . . . . . . 268 8.5 Programming with EN/ENO boxes (FBD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 8.5.1 Positioning of EN/ENO boxes in the function block diagram . . . . . . . . . 270 8.5.2 Transfer functions in the function block diagram . . . . . . . . . . . . . . . . . . 271
  • 19. Table of contents 14 8.5.3 Arithmetic functions for numerical values in the function block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 8.5.4 Arithmetic functions with time values in the function block diagram . 273 8.5.5 Math functions in the function block diagram . . . . . . . . . . . . . . . . . . . . . 274 8.5.6 Conversion functions in the function block diagram . . . . . . . . . . . . . . . 275 8.5.7 Shift functions in the function block diagram . . . . . . . . . . . . . . . . . . . . . 276 8.5.8 Logic functions in the function block diagram . . . . . . . . . . . . . . . . . . . . 277 8.5.9 Functions for strings in the function block diagram . . . . . . . . . . . . . . . . 278 8.6 Functions for program flow control (FBD) . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 8.6.1 Jump functions in the function block diagram . . . . . . . . . . . . . . . . . . . . 280 8.6.2 Jump list in the function block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 281 8.6.3 Jump distributor in the function block diagram . . . . . . . . . . . . . . . . . . . 281 8.6.4 Block end function in the function block diagram . . . . . . . . . . . . . . . . . . 282 8.6.5 Block call functions in the function block diagram . . . . . . . . . . . . . . . . . 282 9 Structured Control Language SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 9.1 Introduction to programming with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 9.1.1 Programming with SCL in general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 9.1.2 SCL statements and operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 9.2 Programming binary logic operations with SCL . . . . . . . . . . . . . . . . . . . . . . 288 9.2.1 Scanning for signal states “1” and “0” . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 9.2.2 Taking account of the sensor type for SCL . . . . . . . . . . . . . . . . . . . . . . . . 289 9.2.3 AND function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 9.2.4 OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 9.2.5 Exclusive OR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292 9.2.6 Combined binary logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292 9.2.7 Negating the result of logic operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 9.3 Programming memory functions with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . 294 9.3.1 Value assignment of a binary tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 9.3.2 Setting and resetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 9.3.3 Edge evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 9.4 Programming timer and counter functions with SCL . . . . . . . . . . . . . . . . . . 296 9.4.1 IEC timer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 9.4.2 IEC counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 9.5 Programming digital functions with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 9.5.1 Transfer function, value assignment of a digital tag . . . . . . . . . . . . . . . . 298 9.5.2 Conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 9.5.3 Comparison functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 9.5.4 Arithmetic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 9.5.5 Mathematical functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 9.5.6 Word logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 9.5.7 Shift functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 9.6 Controlling the program flow with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 9.6.1 Working with the ENO tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 9.6.2 EN/ENO mechanism with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 9.6.3 Control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 9.6.4 Block functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 9.7 Working with source files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
  • 20. Table of contents 15 9.7.1 General procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 9.7.2 Programming a logic block in the source file . . . . . . . . . . . . . . . . . . . . . . 321 9.7.3 Programming a data block in the source file . . . . . . . . . . . . . . . . . . . . . . 325 9.7.4 Programming a PLC data type in the source file . . . . . . . . . . . . . . . . . . . 327 10 Basic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 10.1 Binary logic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 10.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 10.1.2 Scanning for signal states “1” and “0”, result of the scan . . . . . . . . . . . 329 10.1.3 Negating the result of the logic operation, NOT contact . . . . . . . . . . . . 329 10.1.4 Testing floating-point tag, OK contact, OK box . . . . . . . . . . . . . . . . . . . 330 10.1.5 AND function, series connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 10.1.6 OR function, parallel connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 10.1.7 Exclusive OR function, non-equivalence function . . . . . . . . . . . . . . . . . 333 10.2 Memory functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 10.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 10.2.2 Simple and negated coil, assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 10.2.3 Single set and reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 10.2.4 Multiple setting and resetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 10.2.5 Dominant setting and resetting, memory boxes . . . . . . . . . . . . . . . . . . 337 10.3 Edge evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 10.3.1 Functional principle of an edge evaluation . . . . . . . . . . . . . . . . . . . . . . 338 10.3.2 Edge evaluation of the result of the logic operation . . . . . . . . . . . . . . . 340 10.3.3 Edge evaluation of a binary tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341 10.3.4 Edge evaluation with pulse output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342 10.4 Time functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344 10.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344 10.4.2 Pulse generation TP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346 10.4.3 On-delay TON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 10.4.4 OFF delay TOF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 10.4.5 Accumulating ON delay TONR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348 10.5 Counter functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349 10.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349 10.5.2 Up counter CTU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351 10.5.3 Down counter CTD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352 10.5.4 Up-down counter CTUD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353 11 Digital functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 11.1 Transfer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356 11.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356 11.1.2 Copy tag, MOVE box for LAD and FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . 356 11.1.3 Copy string, S_MOVE box for LAD and FBD . . . . . . . . . . . . . . . . . . . . . . 357 11.1.4 Value assignments with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358 11.1.5 Copy data area (MOVE_BLK, UMOVE_BLK) . . . . . . . . . . . . . . . . . . . . . . . 360 11.1.6 Filling the data area (FILL_BLK, UFILL_BLK) . . . . . . . . . . . . . . . . . . . . . 361 11.1.7 Read and write the load memory (READ_DBL, WRIT_DBL) . . . . . . . . . . 362 11.1.8 Swap bytes (SWAP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363 11.2 Comparison functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
  • 21. Table of contents 16 11.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364 11.2.2 Comparison of two tag values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364 11.2.3 Range comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 11.3 Arithmetic functions for numerical values . . . . . . . . . . . . . . . . . . . . . . . . . 366 11.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366 11.3.2 Addition ADD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 11.3.3 Subtraction SUB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 11.3.4 Multiplication MUL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 11.3.5 Division DIV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 11.3.6 Division with remainder as result MOD . . . . . . . . . . . . . . . . . . . . . . . . . 368 11.3.7 Generation of absolute value ABS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368 11.3.8 Negation NEG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 11.3.9 Decrement DEC, increment INC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 11.4 Arithmetic functions for time values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 11.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 11.4.2 Addition T_ADD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371 11.4.3 Subtraction T_SUB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371 11.4.4 Difference T_DIFF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371 11.4.5 Combine T_COMBINE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371 11.5 Mathematical functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372 11.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372 11.5.2 Trigonometric functions SIN, COS, TAN . . . . . . . . . . . . . . . . . . . . . . . . . 373 11.5.3 Arc functions ASIN, ACOS, ATAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373 11.5.4 Formation of square SQR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 11.5.5 Extraction of square root SQRT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 11.5.6 Exponentiate to base e EXP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 11.5.7 Calculation of Napierian logarithm LN . . . . . . . . . . . . . . . . . . . . . . . . . . 374 11.5.8 Extracting decimal places FRAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 11.5.9 Exponentiation to any base EXPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 11.6 Conversion functions (Conversion of data type) . . . . . . . . . . . . . . . . . . . . . 376 11.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 11.6.2 Conversion function CONV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377 11.6.3 Conversion functions for floating-point numbers . . . . . . . . . . . . . . . . . 378 11.6.4 Conversion functions SCALE_X and NORM_X . . . . . . . . . . . . . . . . . . . . 381 11.6.5 Conversion function T_CONV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 11.6.6 Conversion function S_CONV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 11.6.7 Conversion functions STRG_VAL and VAL_STRG . . . . . . . . . . . . . . . . . . 385 11.6.8 Conversion functions STRG_TO_CHARS and CHARS_TO_STRG . . . . . . 387 11.6.9 Conversion functions ATH and HTA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 11.7 Shift functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 11.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 11.7.2 Shift to right (SHR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 11.7.3 Shift to left (SHL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 11.7.4 Rotate to right (ROR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 11.7.5 Rotate to left (ROL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 11.8 Logic functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 11.8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 11.8.2 Word logic operations (AND, OR, XOR) . . . . . . . . . . . . . . . . . . . . . . . . . . 392 11.8.3 Invert (INV) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
  • 22. Table of contents 17 11.8.4 Coding functions DECO and ENCO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394 11.8.5 Selection functions SEL, MUX, and DEMUX . . . . . . . . . . . . . . . . . . . . . . 395 11.8.6 Minimum selection MIN, Maximum selection MAX . . . . . . . . . . . . . . . 397 11.8.7 Limiter LIMIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398 11.9 Processing of strings (Data type STRING) . . . . . . . . . . . . . . . . . . . . . . . . . . . 398 11.9.1 Output length of a string LEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 11.9.2 Combine strings CONCAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400 11.9.3 Output left part of string LEFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400 11.9.4 Output right part of string RIGHT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 11.9.5 Output middle part of string MID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 11.9.6 Delete part of a string DELETE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 11.9.7 Insert string INSERT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402 11.9.8 Replace part of string REPLACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 11.9.9 Find part of string FIND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 11.10 Calculating with the CALCULATE box in LAD and FBD . . . . . . . . . . . . . . . 404 12 Program flow control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406 12.1 Jump functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406 12.1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406 12.1.2 Absolute jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407 12.1.3 Conditional jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408 12.1.4 Jump list JMP_LIST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409 12.1.5 Jump distributor SWITCH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410 12.2 Block end function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412 12.3 Calling of code blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413 12.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413 12.3.2 Calling a function FC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413 12.3.3 Calling a function block (FB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415 12.4 EN/ENO mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417 12.4.1 EN/ENO mechanism with LAD and FBD . . . . . . . . . . . . . . . . . . . . . . . . . . 418 12.4.2 EN/ENO mechanism with SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418 12.4.3 EN/ENO for user blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419 13 Online operation, diagnostics and debugging . . . . . . . . . . . . . . . . . . . . . 420 13.1 Connecting a programming device to the PLC station . . . . . . . . . . . . . . . . 421 13.1.1 IP addresses of the programming device . . . . . . . . . . . . . . . . . . . . . . . . 421 13.1.2 Connecting the programming device to the PLC station . . . . . . . . . . . 422 13.1.3 Assigning an IP address to the CPU module . . . . . . . . . . . . . . . . . . . . . . 424 13.1.4 Switching on the online mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424 13.2 Transferring project data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425 13.2.1 Loading project data for the first time . . . . . . . . . . . . . . . . . . . . . . . . . . 425 13.2.2 Delta downloading of project data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427 13.2.3 Error message following downloading . . . . . . . . . . . . . . . . . . . . . . . . . . 428 13.2.4 Working with the memory card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428 13.2.5 Processing blocks offline/online . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 13.2.6 Comparing blocks offline/online . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432 13.2.7 Editing online project without offline project . . . . . . . . . . . . . . . . . . . . 433 13.2.8 Uploading project data from the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
  • 23. Table of contents 18 13.3 Hardware diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 13.3.1 Status displays on the modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 13.3.2 Diagnostics information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 13.3.3 Diagnostics buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 13.3.4 Diagnostics functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439 13.3.5 Online tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439 13.3.6 Further diagnostics information via the programming device . . . . . . 440 13.4 Testing the user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441 13.4.1 Introduction to testing with program status . . . . . . . . . . . . . . . . . . . . . 441 13.4.2 Program status with LAD and FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442 13.4.3 Program status in SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444 13.4.4 Monitoring with the PLC tag table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445 13.4.5 Monitoring of data tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446 13.4.6 Testing with watch tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447 13.4.7 Monitoring tags using watch tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449 13.4.8 Modifying tags using watch tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450 13.4.9 Enable peripheral outputs and “Modify now” . . . . . . . . . . . . . . . . . . . . 451 13.4.10 Forcing tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452 14 Distributed I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455 14.1 Introduction, overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455 14.2 PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456 14.2.1 PROFINET IO components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456 14.2.2 Addresses with PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457 14.2.3 Configuring PROFINET IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459 14.2.4 Real-time communication with PROFINET IO . . . . . . . . . . . . . . . . . . . . . 461 14.3 PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462 14.3.1 PROFIBUS DP components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462 14.3.2 Addresses with PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465 14.3.3 Configuring PROFIBUS DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467 14.3.4 System functions for PROFINET IO and PROFIBUS DP . . . . . . . . . . . . . . 470 14.4 Actuator/sensor interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473 14.4.1 Components of actuator/sensor interface . . . . . . . . . . . . . . . . . . . . . . . . 473 14.4.2 Configuring an AS-i master CM 1243-2 . . . . . . . . . . . . . . . . . . . . . . . . . . 475 14.4.3 Configuring an AS-Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476 14.4.4 Interface to user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477 14.5 Communication via Modbus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477 14.5.1 Modbus RTU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477 14.5.2 Modbus TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480 15 Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482 15.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482 15.2 Open user communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484 15.2.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484 15.2.2 Open user communication with TCP and ISO-on-TCP . . . . . . . . . . . . . . 485 15.2.3 Open user communication with the UDP protocol . . . . . . . . . . . . . . . . 487 15.2.4 Communication functions for open user communication . . . . . . . . . . 489 15.2.5 Configuring open user communication . . . . . . . . . . . . . . . . . . . . . . . . . 493
  • 24. Table of contents 19 15.2.6 Configuring a PN interface with T_CONFIG . . . . . . . . . . . . . . . . . . . . . . 495 15.3 S7 communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496 15.3.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496 15.3.2 Data structure for one-way data exchange . . . . . . . . . . . . . . . . . . . . . . . 496 15.3.3 Communication functions for one-way data exchange . . . . . . . . . . . . . 497 15.3.4 Configuring S7 communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498 15.4 Point-to-point communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499 15.4.1 Introduction to point-to-point communication . . . . . . . . . . . . . . . . . . . 499 15.4.2 Configuring the CM 1241 communication module . . . . . . . . . . . . . . . . 500 15.4.3 Point-to-point communication functions . . . . . . . . . . . . . . . . . . . . . . . . 501 15.4.4 USS protocol for drives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504 16 Visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507 16.1 Introduction to visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507 16.1.1 Overview of HMI Panels in STEP 7 Basic . . . . . . . . . . . . . . . . . . . . . . . . . 508 16.1.2 Creating a project with an HMI station . . . . . . . . . . . . . . . . . . . . . . . . . . 510 16.1.3 Cross-references for HMI objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512 16.2 Creating HMI tags and area pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513 16.2.1 Introduction to HMI tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513 16.2.2 Creating an HMI tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514 16.2.3 Creating an area pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515 16.3 Configuring process screens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517 16.3.1 Introduction to configuring process screens . . . . . . . . . . . . . . . . . . . . . 517 16.3.2 Working window for process screens . . . . . . . . . . . . . . . . . . . . . . . . . . . 518 16.3.3 Working with screen layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519 16.3.4 Working with templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519 16.3.5 Working with function keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520 16.3.6 Creating a new screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 16.3.7 Configuring a screen change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522 16.3.8 Working with objects in process screens . . . . . . . . . . . . . . . . . . . . . . . . 522 16.3.9 Changing screen objects during runtime . . . . . . . . . . . . . . . . . . . . . . . . 524 16.3.10 Basic objects for screen configuration . . . . . . . . . . . . . . . . . . . . . . . . . 524 16.4 HMI functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525 16.4.1 Input and display of process values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525 16.4.2 Working with alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528 16.4.3 Working with recipes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535 16.4.4 Working with the user administration . . . . . . . . . . . . . . . . . . . . . . . . . . 539 16.5 Completing HMI configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542 16.5.1 Compiling the HMI configuration (Consistency test) . . . . . . . . . . . . . . 542 16.5.2 Simulation of HMI configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542 16.5.3 Downloading configuration to the HMI station . . . . . . . . . . . . . . . . . . . 543 16.5.4 Maintenance of the HMI station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546 17 Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548 17.1 Integral and technological functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548 17.1.1 High-speed counter (HSC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548 17.1.2 Pulse generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554 17.1.3 Technology objects for motion control . . . . . . . . . . . . . . . . . . . . . . . . . . 557
  • 25. Table of contents 20 17.1.4 Technology objects for PID control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561 17.2 Telephone network connections with TeleService . . . . . . . . . . . . . . . . . . . . 564 17.3 Telecontrol with CP 1242-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565 17.4 Web server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567 17.4.1 Enable web server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567 17.4.2 Reading out web information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567 17.4.3 Standard web pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567 17.5 Data logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569 17.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569 17.5.2 Using data logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569 17.5.3 Functions for data logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
  • 26. 1.1 Overview of the S7-1200 automation system 21 1 Introduction 1.1 Overview of the S7-1200 automation system The SIMATIC S7-1200 automation system consists of the four controllers S7-1211C, S7-1212C, S7-1214C, and S7-1215C, which can exchange data with each other, with SIMATIC HMI Basic Panels, or with other programmable controllers over SIMATIC NET. STEP 7 (TIA Portal) is used to configure and program the devices (Fig. 1.1). The SIMATIC S7-1200 controllers are programmable logic controllers (PLC) and constitute the basis of the automation system. Four different controllers with graded performances cover the low-end range of industrial controls. SIMATIC HMI refers to the Human Machine Interface for operator control and monitoring. The Basic Panels are designed such that they interact optimally with SIMATIC S7-1200. The devices are available with display dimensions of 3.8, 5.7, 10.4 and 15 inches, and are operated using the touch screen. Except for the 15-inch device, they have additional function keys. Fig. 1.1 Components of the SIMATIC S7-1200 automation system SIMATIC NET SIMATIC HMI STEP 7 (TIA Portal) SIMATIC S7-1200 Software for configuration and programming S S S S S Components of the SIMATIC S7-1200 automation system SIMATIC PLCs control the machine or plant Networking for data exchange and central online access Operator control and monitoring func- tions for control of plant during runtime
  • 27. 1 Introduction 22 SIMATIC NET links all SIMATIC stations, and allows trouble-free data exchange. SIMATIC S7-1200 with PROFINET interface uses the Industrial Ethernet network to exchange data with other PLC stations, HMI stations, and programming devices. Communication modules expand the communication capabilities to other net- works such as PROFIBUS DP, AS-Interface, or point-to-point coupling based on RS232 or RS485. The STEP 7 programming software provides the nesting function for Totally Inte- grated Automation (TIA), the automation system with uniform configuration and programming, data management, and data transfer. STEP 7 is used to configure and parameterize the SIMATIC components, and STEP 7 is also used to generate and debug the user program. The TIA Portal is the central user interface for manage- ment of the tools and automation data. STEP 7 in the TIA Portal is available in the versions STEP 7 Professional and STEP 7 Basic. Both versions can be used to config- ure and program an S7-1200 station. This book describes the use of STEP 7 Basic. 1.1.1 SIMATIC S7-1200 SIMATIC S7-1200 is the modular microsystem for the lower and medium perfor- mance range. The central processing unit (CPU) contains the operating system and the user program. The user program is located in the load memory and is power failure-proof. The parts of the user program relevant to execution are pro- cessed in a work memory with fast access. Tags whose values are to be retained in the event of a power failure or when switching off/on are stored in the retentive memory (Fig. 1.2). The user program can be transferred to the CPU using a plug-in memory card (MC) – as an alternative to transfer via an online connection to the programming device. The memory card can also be used as an external load memory or for updating the firmware. The connections to the plant or process are made by onboard inputs and outputs, their number being determined by the CPU version. The onboard inputs and out- puts are designed especially for operation of the integral high-speed counters (HSC). The operating system additionally includes pulse generators with a pulse- width modulated output and also the technology objects Axis for controlling step- per motors and servo motors with pulse interface and PID Compact, a PID controller with optimized self-tuning. A signal board (SB) can be used to expand the onboard inputs and outputs. The communication board (CB) creates a point-to-point connection for the CPU and the battery board (BB) increases the power reserve of the integrated hardware clock to about one year. If further inputs and outputs are required, signal modules (SM) can be plugged onto the CPU depending on its version. These are available for digital and analog signals. The PROFINET interface connects the CPU to the Industrial Ethernet subnet. The programming device is connected to this interface if, for example, the user pro-
  • 28. 1.1 Overview of the S7-1200 automation system 23 gram is to be transferred online to the CPU and tested on the machine. Data is exchanged with HMI stations and other automation devices via this interface. If the CPU is only connected to one device over Ethernet, a standard or crossover cable can be used. If more than two devices that only have a PROFINET interface are networked, the connecting cables must be routed via a multiplier, e.g. the commu- nication switch module (CSM). A CPU 1215 has two ports connected with a switch so that they can be networked with the next programmable controller without an interposed connection multiplier. Communication modules (CM) permit the operation on further bus systems such as PROFIBUS DP. Here, an S7-1200 station in a DP master system can be both DP master and DP slave. An S7-1200 station can be the AS-Interface master on AS-Inter- face and can control up to 62 AS-Interface field devices. The communication mod- ule for the point-to-point connection is available with RS232 or RS485 interface, to which, for example, a barcode or RFID reader can be connected. Fig. 1.2 Connection options to a PLC station with CPU 1200 S Connection options to a CPU 1200 Connection of an HMI station (Basic Panel). Multiplication of Ethernet connec- tion using the communication switch module (CSM). Connection of sensors, e.g. buttons or limit switches, to the onboard I/O, to the signal board (SB) or to a signal module (SM). Connection of a further S7-1200 station or other devices on the basis of open user communication. A memory card (MC) can be used to transfer the control program and upgrade the operating system. Connection of a programming device. Connection of devices using communication modules (CM) with RS232 and RS485. Connection of actuators, e.g. contactors or lamps, to the onboard I/O, to the signal board (SB) or to a signal module (SM).
  • 29. 1 Introduction 24 1.1.2 Overview of STEP 7 Basic STEP 7 is the central automation tool for SIMATIC. STEP 7 requires authorization (licensing), and is executed on the current Microsoft Windows operating systems. STEP 7 Basic can be used to configure the S7-1200 controllers and – with WinCC Basic – the Basic Panels. Configuration 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 an (HMI) project. A “project” is a data structure containing all the programs and da- ta required for your automation task. The most important STEP 7 tools and func- tions 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 assign them 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 Basic Panels. 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 Fig. 1.3 Tools in the Start portal of STEP 7 Basic
  • 30. 1.1 Overview of the S7-1200 automation system 25 window – the inspector window – displays the properties of the selected module, and the task window provides support by means of the hardware catalog with the available modules. The Network view shows the networking between the devices and permits the configuration of communication connections. When carrying out PLC programming you edit the selected block in the working ar- ea. You are again shown the properties of the selected object in the inspector win- dow where you can adjust them. In this case, the task window contains the catalog of statements with the available program elements and functions. The same applies to the processing of PLC tags, to the online program test using watch tables, or to configuration of an HMI device. And you always have a view of the project tree. This contains all objects of the STEP 7 project. You can therefore select an object at any time, for example a program block or watch table, and edit this object using the corresponding editors which start automatically when the object is opened. 1.1.3 Three programming languages You can select between three programming languages for the user program: lad- der logic (LAD), function block diagram (FBD), and structured control language (SCL). The user program can be structured into individual parts known as “blocks”. The programming language is a property of a block, which means you can use the programming language that is best suited to resolve the block func- tion for every block in the user program. Using the ladder logic, you program the control task based on the circuit diagram. Operations on binary signal states are represented by serial or parallel arrange- ment of contacts (Fig. 1.5). A current path is terminated by a coil. Complex func- tions are represented by boxes which you handle like contacts or coils. Examples of boxes are mathematical functions or functions for processing strings. Using the function block diagram, you program the control task based on elec- tronic circuitry systems. Binary operations are implemented by linking AND and OR Fig. 1.4 Example of working area of device configuration
  • 31. 1 Introduction 26 functions and terminated by simple boxes (Fig. 1.6). Complex boxes are used to handle the operations on digital tags, for example with mathematical functions or functions for strings. Structured control language is particularly suitable for programming complex algorithms or for tasks in the area of data management. The program is made up of SCL statements which, for example, can be value assignments, comparisons, or control statements (Fig. 1.7). Fig. 1.5 Example of binary operations in ladder logic representation Fig. 1.6 Example of binary operations in function block diagram representation Fig. 1.7 Example of SCL statements
  • 32. 1.1 Overview of the S7-1200 automation system 27 1.1.4 Execution of the user program After the power supply has been switched on, the control processor checks the con- sistency of the hardware and parameterizes the modules. A startup program is then executed once, if present. The startup program belongs to the user program that you program. Settings and initialization operations for the user program can be present here. The user program is usually divided into individual sections called “blocks”. The organization blocks (OB) represent the interface between operating system and user program. The operating system calls an organization block for specific events, and the user program is then processed in it (Fig. 1.8). Function blocks (FB) and functions (FC) are available for structuring the program. Function blocks have a memory in which local tags are saved permanently, func- tions do not have this memory. Program statements are available for calling function blocks and functions (start of execution). Each block call can be assigned inputs and outputs, referred to as “block parameters”. During calling, tags can be transferred with which the pro- gram in the block is to work. In this manner, a block can be repeatedly called with a certain function (e.g. addition of three tags) but with different parameters sets (e.g. for different calculations) (Fig. 1.9). The data of the user program is saved in data blocks (DB). Instance data blocks have a fixed assignment to a call of a function block; they are the tag memory of the func- tion block. Global data blocks contain data which is not assigned to any block. Fig. 1.8 Execution of the user program Startup program Alarm and error program Main program Execution of the user program Switching on Updating of inputs and outputs Interruption (alarm or error) Operating mode STARTUP Operating system User program Operating mode RUN OB OB FB FC FB FC FB FC FB FC FB FC FB FC OB Interruption
  • 33. 1 Introduction 28 Following a restart, the control processor updates the input and output signals in the process images and calls the organization block OB 1. The main program is present here. Structuring is also possible (and recommended) in the main pro- gram. Once the main program has been processed, the control processor returns to the operating system, retains (for example) communication with the programming device, updates the input and output signals, and then recommences with execu- tion of the main program. Cyclic program execution is a feature of programmable controllers. The user pro- gram is also executed if no actions are requested “from outside”, such as if the con- trolled machine is not running. This provides advantages when programming: For example, you program the ladder logic as if you were drawing a circuit diagram, or program the function block diagram as if you were connecting electronic compo- nents. Roughly speaking, a programmable logic controller has characteristics like those of a contactor or relay control: The many programmed operations are effec- tive quasi simultaneously “in parallel”. In addition to the cyclically executed main program it is possible to carry out inter- rupt-controlled program execution. You must enable the corresponding interrupt event for this. This can be a hardware interrupt, such as a request from the con- trolled machine for a fast response, or a cyclic interrupt, in other words an event which takes place at defined intervals. The control processor interrupts execution of the main program when an event occurs, and calls the assigned interrupt program. You can assign organization blocks to certain events, and these blocks are then processed in such a case. Once the interrupt program has been executed, the control processor continues execu- tion of the main program from the point of interruption. Fig. 1.9 Example of two block calls with different tags in each case
  • 34. 1.1 Overview of the S7-1200 automation system 29 1.1.5 Data management in the SIMATIC automation system The automation data is present in various memory locations in the automation sys- tem. Initially there is the programming device, referred to generally as the genera- tion or engineering system. All automation data of a STEP 7 project is saved on its hard disk. Configuration and programming of the project data with STEP 7 is car- ried out in the main memory of the programming device (Fig. 1.10). The automation data on the hard disk is also referred to as the offline project data. Once STEP 7 has appropriately compiled the automation data, this can be down-loaded to a programmable controller. The data downloaded into the user memory of the CPU module are known as the online project data. The user memory on the CPU is divided into three components: The load memory contains the complete user program including the configuration data, the work memory contains the executable user program with the current control data, and the retentive memory contains the tags whose current values are saved power-fail- ure-proof. The memory card as a transfer card can transfer the user program to the CPU mem- ory, or as a program card expand the CPU's internal load memory. When used as a program card, the memory card remains inserted in the CPU during runtime. Fig. 1.10 Data management in the SIMATIC automation system Memory card Work memory Retentive memory Main memory Hard disk Load memory The load memory contains the project data transferred to the CPU. Together with the current values of the tags from the work memory, they form the online project data. The control program can be transferred to the CPU by means of the memory card. The work memory contains the executable part of the control program which is processed during runtime. The retentive memory contains the tags whose values are retained in the event of a power failure or when switching off/on. The offline project data is saved on the hard disk. All project data is executed in the programming device's main memory. Programming device CPU module Transfer when switching on Saving the project data Data management in the SIMATIC automation system Transfer with online connection
  • 35. 1 Introduction 30 1.1.6 Operator control and monitoring with process images Procedures in the process (on the controlled machine) are manually controlled and monitored using an HMI device. With the Basic Panels, a touch screen permits ac- cess using control elements represented on the monitor. Control and display ele- ments are combined in process images. A process image can map a plant, display process sequences, output process values, or permit operator actions (Fig. 1.11). The image sequence has a hierarchical structure. Commencing with a start screen which is displayed when the HMI device is switched on, it is possible to select the screens of the next level, from where the screens of the following level can be selected, and so on. Displays can be changed manually using key or touch inputs, or triggered by the user program. Predefined objects are available for creating a screen, and can be inserted and adapted according to your requirements. These can be static objects such as text or graphics which do not change during process operation, or dynamic objects such as texts, numerical values, trends and bar charts which change depending on pro- cess values. The functional scope of the Basic Panels also includes message control with bit and analog messages, management of recipes, and user administration. Fig. 1.11 Example of a process image in the configuration stage
  • 36. 1.2 Introduction to STEP 7 Basic for S7-1200 31 1.2 Introduction to STEP 7 Basic for S7-1200 1.2.1 Installing STEP 7 STEP 7 Basic V11 is a 32-bit applica- tion, which executes with MS Win- dows XP (Home with SP3 or Profes- sional with SP3) or MS Windows 7 (Home Premium, Professional, Enter- prise, or Ultimate, 32/64-bit). You require administration rights in order to install STEP 7, and to work with STEP 7 you must at least be logged-on as a main user. The processor should at least be a Pentium 4 with 1.7 GHz or a comparable type. A main memory of 1 GB is required for working with Windows XP, and should be 2 GB for Windows Vista. STEP 7 Basic requires approx. 2 GB on the hard disk. An Ethernet interface (LAN adapter) is required on the programming device for the online connection to a programmable controller or Basic Panel. If you wish to work with a SIMATIC memory card, you require an SD card reader. Installation is carried out using the setup program start.exe on the DVD. Deinstalla- tion of STEP 7 Basic is carried out as usual in MS Windows using the Software pro- gram in the Windows Control Panel. Parallel online use of STEP 7 Basic and STEP 7 has not been enabled. 1.2.2 Automation License Manager You require a license (user authoriza- tion) in order to use STEP 7. Licenses are managed by the Automation License Manager which is installed together with STEP 7 Basic. The license key for STEP 7 Basic is trans- ferred to the hard disk during the installation, and removed again from the hard disk during deinstallation. The license key is stored on the hard disk in specially identified blocks. To avoid un- intentional destruction of the license key, you should observe the information for handling license keys in the Help text of the Automation License Manager. The Automation License Manager also manages the license keys of other SIMATIC products, e.g. STEP 7 V5.4 and WinCC.
  • 37. 1 Introduction 32 1.2.3 Starting STEP 7 Basic You start STEP 7 Basic either using the Start button of Windows and Programs > Siemens Automation > TIA Portal V11, or by dou- ble-clicking the icon on the Windows desktop. The Totally Inte- grated Automation Portal is the user interface for STEP 7 and may also contain other applications which use the same database. For example, STEP 7 Basic V11 includes the WinCC Basic configuration software which is displayed as an integrated “Visualization” editor in the Start portal. 1.2.4 Portal view Following starting-up, STEP 7 Basic displays the Start portal. A portal makes avail- able all functions and tools required for the respective range of tasks in the portal view. The scope of the portals as well as the range of functions and tools de- pends on the installed applications. The Start portal of STEP 7 Basic permit selection of the following portals (Fig. 1.12): b In the Devices & networks portal you can configure the hardware of the program- mable controller, i.e. you select the hardware components, position them, and set their properties. If several devices are networked, you can define the connec- tions here. b The PLC programming portal contains all the tools required for generating the user program for a PLC station (programmable logic controller). Fig. 1.12 Portal view: First steps after opening a project
  • 38. 1.2 Introduction to STEP 7 Basic for S7-1200 33 b In the Visualization portal you generate the operator control and monitoring desktop for HMI stations. Here you can configure, for example, the process im- ages, the control elements, and messages. b Using the Online & Diagnostics portal you can connect the programming device to a programmable controller, transfer and debug programs, and detect faults in the automation system. Additional functions included in the Start portal allow you to Create new project or Open existing project. First steps informs you of what possibilities you have to con- tinue the configuration after creating a project. Installed products provides an over- view of further SIMATIC applications currently on the computer. You can call Help in every portal. 1.2.5 Information system The help function of STEP 7 provides you when programming with compre- hensive support for solving your auto- mation task. To call the help function, click on Help in the Portal view or select the Help > Display help command in the main menu in the Project view. A window appears with the Siemens Informa- tion System (Fig. 1.13). The online help is roughly divided ac- cording to the project processing steps: Configuration, parameteriza- tion, and networking of devices, struc- turing and programming of the user program, visualization of processes, and utilization of the online and diag- nostics functions. Readme provides general information on STEP 7 and further information which could no longer be included in the online help. A comprehensive description of all available statements, including ex- tended statements, can be found un- der PLC programming > References. Fig. 1.13 Information system of STEP 7 Basic
  • 39. 1 Introduction 34 1.2.6 The windows of the project view The project view shows all elements of a project in structured form in various pro- cessing windows. You can move from the Portal view to the Project view using the Project view link at the bottom left of the screen, or STEP 7 automatically switches to the Project view depending on the selected tool. Fig. 1.14 shows the windows of the Project view in an example of block program- ming. Different window contents are displayed depending on the currently used editor. a Main menu and toolbar, shortcut menu Underneath the title bar is the main menu with all menu commands. The menu commands available for selection depend on the currently marked object; menu commands which cannot be selected are displayed in gray. The same functionality is available – somewhat user-friendlier – with the shortcut menu: if you click on an object with the right mouse button, a window is opened with the currently select- able menu commands. Underneath the main menu is the toolbar with the graphi- cally represented “main functions”. The main menu and the toolbar are always present in all editors. Using Options > Customize in the main menu you can adapt the user interface. For example, under “General” you can define the interface language in which STEP 7 is used, and the mnemonics (the representation of the operands: “I” for in- put (international), or “E” in German). s Working window In the center of the screen is the working window. The contents of the working win- dow depend on the editor currently being used. In the case of device configuration, the working window is divided in two: the objects (modules and stations) are dis- played in graphic form in the top part, and in tabular form in the bottom part. When programming the PLC, the top part of the working window contains the interface description of the block, and the bottom part the program represented in LAD, FBD, or SCL. You use the working window to configure the hardware of the automation system, generate the user program, or configure the process screens for HMI devices. You can separate the working window completely from the project view so that it is displayed as a separate window (“Release” icon in the title bar of the working win- dow), and also insert it again (“Embed” icon). The “Maximize” icon closes all other windows and displays the working window in maximum size. d Inspector window The inspector window underneath the working window shows the properties of the objects marked in the latter, records the sequence of actions, and provides an over- view of the diagnostics status of the connected devices.
  • 40. 1.2 Introduction to STEP 7 Basic for S7-1200 35 During configuration or programming you set the object properties in the inspec- tor window, for example the addresses and symbol names of inputs and outputs, the properties of the PROFINET interface, tag data types, or block attributes. f Project tree The project tree window is displayed with the same content for all editors. Its hierarchical structure contains all project data and the required editors. With the project open, it shows the folders for the PLC and HMI stations included in the project, and further subfolders within these folders, e.g. for program blocks, PLC tags and watch tables with a PLC station or e.g. the process images and the HMI tags in the case of an HMI station. A double-click on an object with project data automatically starts the associated ed- itor. The project tree also includes editors such as “Add new device”, “Device config- uration” or “Online & diagnostics” which you can start directly using a double-click. The lower section of the project tree contains a details view of those objects which are present in the hierarchy underneath the object marked in the project tree. Fig. 1.14 Components of Project view using example of block programming
  • 41. 1 Introduction 36 g Task window To the right of the working window is the task window with the task cards. This con- tains further objects for processing in the working window. The contents of the task window depend on the currently active editor. In the case of the hardware configu- ration, for example the hardware catalog with the available components is shown here, in the case of PLC programming the program elements catalog appears, with online & diagnostics the online tools, and with the visualization the library for the process image control and display elements. You can also call the libraries in this window: global libraries supplied with STEP 7, or the project library in which you can save reusable objects such as program blocks, templates for process images, or control elements with special configura- tions. h Editor and status bar At the bottom left of the Project view you can change to the Portal view. In the mid- dle you can see the tabs of the open windows. Clicking on a tab results in its contents being displayed in the top level of the working window. This makes it easy to change quickly between different window contents. The far right of the status bar indicates the current status of project processing. 1.2.7 Adapting the user interface The language of the user interface can be changed. In the main menu select Options > Settings and the “General” section. In the “Interface language” drop-down list you can select the desired language from the installed languages. The texts of the user interface are then immediately displayed in the new language. You can also define here how the TIA Portal is to be displayed following the next restart. You can show or hide the displayed window using the menu item View. You can al- ways change the size of windows by dragging on the edge with the mouse. Windows can be minimized into a symbol which appears in one of the navigation bars in the left, bottom or right margin of the screen. You can maximize the working window, or release it from the windows group and display it as a separate window. The working window can be divided vertically or horizontally, permitting you to view two working areas simultaneously. You can change the width of table columns by dragging with the cursor in the table header. In the case of columns that are too narrow, the entire content of the individ- ual cells will appear as a tooltip when the cursor is briefly hovered over the relevant field.
  • 42. 1.3 Editing a SIMATIC project 37 1.3 Editing a SIMATIC project Fig. 1.15 shows all tools and data which can be of importance in an automation task. Of prime importance is the Project which contains all the automation data required for control and operation of the machine or plant. The project data is roughly divid- ed into the data for the individual stations and the common project data which ap- plies to all stations in the project. A station can be a controller (PLC station) or an HMI device (HMI station). A project can include several stations, but at least one station must be present. The data pres- ent in a station is described further below. Common Project Data includes, for exam- ple, centrally managed message texts or texts for multilingual projects. A project library is created for each project. Objects which are used in several proj- ects are combined in global libraries. Also relevant to a project is the programming device design with interface modules (LAN adapters) and SD card readers. Fig. 1.15 Project components, libraries and programming device design Global Libraries System Libraries User Libraries HMI Buttons-and-Switches Online access < User Library > < Project Library > Monitoring-and-control-objects SIMATIC Card Reader Documentation templates Libraries delivered with STEP 7. Libraries configured by users themselves. Contains the programming device resources relevant to the project. Contains all the data for a controller. Contains text lists for system and user messages. Contains all the data for an HMI device. Contains document info, frames and cover sheets PLC station Common Data HMI station Documentation settings Contains project texts, project languages and graphics. Languages & resources Stations Project Common Project Data Project Library All the data for the automation task is combined in a project. Stations can be controllers (PLC stations) or HMI devices (HMI stations). A project includes at least one station. Contains cross-station data. Contains cross-station data compiled by the user. Global libraries contain elements for multiple use across projects. Programming Device Design
  • 43. 1 Introduction 38 1.3.1 Structured representation of project data The project tree in the Project view displays the project data and the programming device configuration in a tree structure (Fig. 1.16). The structure also includes the editors (tools) required for generating and editing the data. The project tree does not include the project library. This is represented in a task card together with the global libraries in the task window under “Libraries”. You can replace the names shown in angle brackets by names more appropriate to your automation task. Fig. 1.16 Project structure in the project tree < Project > Online access SIMATIC Card Reader < HMI station > Interface x1 < PLC station > Common data Interface x2 < PLC ... > Languages&resources Documentation settings Add new device Text lists Project texts Documentation Information Project languages Frames Project graphics Cover pages Devices & networks Update accessible devices Add user-defined card reader Card reader Adds a new PLC or HMI station to the project Folder with the data of a found station Text lists for user and system messages List with project texts in different languages Information for the documents to be printed Selection of languages for display and message texts Collection of frames Collection of language-dependent graphic symbols Collection of cover sheets Starts the device and network configuration Searches for stations connected to this interface module Adds a card reader Card reader present in the programming device Folder for all data of an automation system Folder for all LAN interface modules of the programming device Folder for all SD card readers of the programming device Folder for all data of an HMI station LAN interface of programming device Folder for all data of a PLC station Folder for common data in the project Further LAN interface modules if applicable Folder for language-dependent objects Folder for documentation settings Project navigation with opened project
  • 44. 1.3 Editing a SIMATIC project 39 1.3.2 Project data and editors for a PLC station If you add a PLC station (an S7-1200 controller) to the project, STEP 7 creates the corresponding structure in the project data (Fig. 1.17). A PLC or HMI station is always required for editing in a project so that STEP 7 can create the data structures required for the PLC programming or HMI configuration. If you wish to write a user program without previously selecting a specific CPU, you can select an “unspecified CPU” from the hardware catalog and replace it later with a “real” CPU 1200 if nec- essary. Fig. 1.17 Structure of the project data for a PLC station < PLC_12xxC > Program blocks *) Watch and force tables *) PLC data types *) Local modules Technology objects External source files *) PLC tags *) < Technology object_1 > <Source file_1> Device configuration Add new block Add new watch table Add new data type PLC_DataType_1 Add new object Add new external file Show all tags Add new tag table Default tag table [n] Tag table_1 [m] Online & diagnostics < Block_1 > Force table < Watch table_1 > Text lists Program info Starts the editor for the device configuration Creates a new block and opens it Main program (organization block OB 1) Self-created block Creates a new watch table and opens it Creates a new PLC data type Self-created PLC data type Table with the forced tags Self-created watch table Station-specific texts for user and system alarms Program structure, assignment list, memory utilization Creates a new technology object and opens it Imports a new source file Displays the tags of all (sub-)tables Adds a new tag table Permanently available tag table with n tags Self-created tag table with m tags Starts the editor for the online connection and diagnostics Folder for all data of a PLC station (name can be freely-selected) Folder for all blocks of the user program Folder for the force table and all watch tables Folder for all PLC data types Folder for the local modules of the PLC station Folder for all technology objects Folder for external source files (SCL) Folder for all PLC tags (“symbol table”) Self-created technology object Imported source file Data structure of a PLC station *) Sub-groups can be generated Main [OB 1]
  • 45. 1 Introduction 40 The user program which controls the machine or process is located in the Program blocks folder. The program comprises blocks (separate program components) which are either stored directly in the Program blocks folder or – if there is a large number – in subfolders which you can create and configure yourself. The “Main” block (the name is the symbol for the block and can be changed) is the organization block OB 1 and is created automatically. The processing sequence of the blocks is defined in the user program by “block calls” and is displayed by opening the Pro- gram information object under Call structure. The Technology objects folder contains the configuration data for the motion con- trol objects (axes) and control loop objects (PID controllers). SCL source files can be saved in the External sources files folder. The PLC tags folder contains the assignment of the absolute address to the symbolic address of global tags that are valid throughout the PLC station (inputs, outputs, and bit memories). The PLC data types folder contains user-defined, structured data types. The force table and all created watch tables can be found in the Watch and force tables folder. A watch table is used during testing of the user program. It contains tags whose current value can be monitored and also changed during runtime. The force tables can be used to set tags to fixed values that cannot be changed by the program. The program information shows the program structure (sequence and dependen- cies of the block calls), the assignment list for inputs, outputs and bit memories, and the memory usage. Message texts are stored under Text lists. In the case of the user-defined text list, you can specify the value ranges which trigger the messages and the associated texts; with a system-defined text list, the contents are specified by STEP 7. Text lists creat- ed under a PLC station contain station-specific texts, those created under a project contain cross-station texts. The Local modules folder contains all configured modules of the PLC station. Open- ing a module initiates device configuration. The module properties are displayed in the inspector window. You start configuration of a station using the Device configuration editor which is located in the first position in the project structure. There is no corresponding folder for the data of the device configuration in the project tree. The configuration data is located “behind” the Device configuration editor. Online & diagnostics starts the editor for the online connection and online func- tions. For example, you can use a (software) control panel to control the operating modes of the CPU, to set the CPU's IP address and time, or read the CPU's diagnostics buffer.
  • 46. 1.3 Editing a SIMATIC project 41 1.3.3 Creating and editing a project Creating a new project You can create a new project in the Portal view if you click in the Start portal on Create new project. Assign a name to the project and set a path in which the project is to be saved. After clicking the Create button, any project which is open is closed, the new project is created, and the next steps displayed in the Start portal for selec- tion: b Configure a device STEP 7 changes to the Devices & networks portal in which you can insert a new CPU 1200 (a PLC station) into the project and open it for editing. b Write PLC program STEP 7 changes to the PLC programming portal in which you can edit the “Main” block (organization block OB 1) or insert a new block and open it for editing. A PLC station must first have been added to the project. b Configure an HMI screen STEP 7 changes to the Visualization portal in which you can create a new HMI sta- tion or configure an already existing one. From this portal you start configura- tion of the process images, editing of HMI tags and messages, and the simulator. b Open the project view STEP 7 changes to the Project view in which you can carry out the next steps (insert and configure PLC stations, insert and program blocks, or insert and con- figure HMI stations). In the project tree you can create a new project using the Project > New menu com- mand. Assign a name to the project in the dialog window, set the path in which the project is to be saved, and click on the “Create” button. Editing an existing project You can open an existing project in either the Portal view or the Project view. Either activate Open existing project in the Portal view or Project > Open in the Project view. Select the desired project from the list of projects last used. Any project which is open is closed, and the selected project is opened. During editing in the Project view, you can save the entered project data using the Project > Save or Project > Save as menu command. You can close the project using Project > Close – following confirmation of whether changes are to be saved – with- out exiting STEP 7. You can delete a (closed) project from the hard disk – following confirmation – using Project > Delete. Compiling and downloading project data Before project data can be downloaded to a station, it must be made readable for the processor: it must be “compiled”. The project data is compiled station-by-station.
  • 47. 1 Introduction 42 The scope of the compilation can be varied depending on the type of station. For ex- ample, the command from the Compile > Software pop-up menu only compiles those software components which have been changed since the last compilation. Printing project data The project data can be printed in the form of a circuit manual. You can use the documentation function to set the layout of the printout. Under Document settings in the project tree, you adapt the existing template or create a new template, for example in the sizes A3 or A4 in portrait or landscape format. You complete the text fields under Document information (e.g. the title block). You can also position new text fields or graphic symbols in the layout. By means of the print preview or print output, you can specify the output with or without cover page and as compact (abbreviated) or complete. Converting a project from STEP 7 V10.5 to STEP V11 To convert a project created with STEP 7 V10.5, start STEP 7 V11 and select Project > Open from the main menu. In the dialog window, click on the Browse button and select the desired project from the file directory. In the open project folder, select the file <Project_name>.ap10 and click the Open button. Confirm the conversion messages with OK. The project is converted to Version V11, saved under the name <Project_name>_<STEP7-Version>, and opened. You then compile every station and clear any displayed faults and warnings. 1.3.4 Creating and editing libraries Libraries are used to save reusable program components. These could include sta- tions, blocks, PLC tag tables, process images or picture elements, for example. A project library and global libraries are available. The libraries are displayed in a task card of the task window. A project library which you can fill with objects is automatically created when you create a project. You can structure the contents of the project library using folders. A project library is always opened, saved, and closed together with the project. Components which can be used in multiple projects are saved in global libraries. There are global system libraries which are supplied with STEP 7, and global user libraries which you create yourself. A global library is opened, saved, and closed in- dependent of the project. If you wish to use a global library simultaneously with other users, the library must be opened as read-only.
  • 48. 2.1 S7-1200 station components 43 2 SIMATIC S7-1200 automation system 2.1 S7-1200 station components A complete programmable controller including all I/O modules is referred to as a “station”. This also includes distributed I/O modules connected to the CPU via a bus system. An S7-1200 station comprises at least the CPU. Depending on the version, it has digital and analog input/output channels and can be fitted with additional input/output channels using a signal board (SB). Depending on the type of CPU, up to eight signal modules can be plugged in which expand the station by digital and analog input/output channels. A two-tier design is possible using a 2-meter long extension cable. The programming device is connected over Industrial Ethernet. Industrial Ethernet can also be used to connect further SIMATIC stations or HMI devices to the CPU. Up to three communication modules take over the connection to additional bus sys- tems or to a point-to-point link. Integral technological functions for measuring and counting tasks, closed-loop con- trol, and motion control allow the CPU 1200 to be used in many complex machine controls. The SIMATIC Memory Card can be used to download configuration data, as an exter- nal load memory, or for a firmware update. Fig. 2.1 S7-1200 station with CPU S7-1214, two SMs (right) and one CM (left)
  • 49. 2 SIMATIC S7-1200 automation system 44 Mounting is on a standard 35 mm DIN rail either horizontally or vertically. Installa- tion without a mounting rail is also possible. An extension cable (2 m long) enables a two-tier design without changing the number of connectable signal modules. Available accessories include an external power supply module, a connection multi- plier (Ethernet switch), a TS Adapter, and two simulator modules. SIMATIC S7-1200 is also available as a SIPLUS version for particularly harsh environmental condi- tions. 2.2 S7-1200 CPU modules There are four types of CPU (CPU 1211, CPU 1212, CPU 1214, and CPU 1215), available in each case in the versions DC/DC/DC, AC/DC/RLY, DC/DC/RLY. The first item of data refers to the module power supply (DC = 24 V direct current, AC = 120/230 V alternating current). The middle item of data refers to the operating voltage of the onboard dig- ital inputs (DC = 24 V direct current). The last item of data refers to the type of digital outputs (DC = 24 V direct current electronic, RLY = up to 30 V direct current or up to 250 V alternat- ing current with relay). The four CPU versions mainly differ in the supply voltage, the number of onboard inputs and outputs, the memory size, and the expansion capability with signal modules (Table 2.1). The CPU 1215C can be integrated in STEP 7 Basic V11 with a hardware support pack- age (HSP). 2.2.1 Integrated I/O The digital inputs (DI) on the CPU module work with an operating voltage of 24 V DC. Different numbers are available depending on the CPU version. The status of the input signals is displayed by means of LEDs. The digital outputs (DQ or DO) are available in electronic form (24 V DC and 0.5 A output current with a resistive load of 5 W) and as relay outputs (up to 30 V DC and 2 A output current with a resistive load of 30 W or up to 250 V AC and 2 A output current with a resistive load of 200 W). Different numbers of digital outputs are available depending on the CPU version. The status of the output signals is dis- played by means of LEDs. Fig. 2.2 CPU 1214C DC/DC/DC
  • 50. Another Random Scribd Document with Unrelated Content
  • 51. 51 52 he should be caught in a jam, he would not elbow people right and left; but would, while protecting his own person and those who are dependent upon him from injury, find his own chance of getting out of the tight place by helping others out. In this selfish world nothing so quickly touches the popular heart as that sort of Christlikeness which is recognized as politeness to strangers in public places, and as carefulness in helping the weak, and in refraining from adding burdens to those who are hard-pressed by responsibilities. The man or woman who obtains control of the highest quality of influence is the one who has either from childhood been trained to think those thoughts that blossom out into beautiful considerateness, or who has taken himself in hand, and by vigorous self-training has pruned off the growth of selfish heedlessness, and grafted in the gentler graces of the Spirit. One W. C. T. U. lecturer had been painfully impressed by the fact that baggagemen had to handle such heavy trunks. This was before so many little wheeled contrivances had been placed at their disposal. She accordingly supplied herself with two small trunks in place of the one large one, for no other reason than to save the backs of the men. Her kind intention was kept to herself for years, and it went unrecognized at its full value until at length one day she encountered a grumpy old baggageman, who seemed to have a special grudge against any woman with two checks. He was from the first moment very uncivil, and threatened her with a charge for excess of baggage. She said but little, only went quietly along the baggage-room with him, identified the two diminutive parcels, and waited. He looked at them, then at her, colored like one who was ashamed of himself, and said:— “Be them all?” “Yes, those are all.” “Well, what made you make two of ’em?”
  • 52. 53 54 55 “That is my way of helping to lift one big trunk,” she said. “Your what?” “My way of helping you to lift one big trunk.” “It is? Well, I never! You did it to save our backs?” “Yes: I never wanted any old man or boy to strain himself over a big trunk for me, so I divided mine in two.” “Well!” ejaculated the grumpy old fellow, who evidently did not know anything more to say. His whole heart had suddenly mellowed, his eyes grew red, and his hands trembled as, taking off his cap, he changed those checks with the air of one who was performing an act of religion. When he came with the two little bits of metal to the waiting passenger, still carrying his cap in his hand, and when she took them with a “Thank you,” and put them in her purse, he looked timidly into her face as if to see if he could possibly be forgiven. She chose not to make much of the incident, so she did not seem to notice his perturbation, but with a simple “Good day,” left the baggage- room. But she knew very well that that old baggageman would never forget, and would perhaps be kinder to all the big trunks in the future for the sake of those little twin products of her kind intention.
  • 53. 56 VII. “How I wish I knew just how one ought to behave in going into public places, meetings, and lectures,” said a young woman recently. Others have asked similar questions. I have heard something like this more than once: “Isn’t it dreadful not to know the little things that would prevent folks from looking at you and smiling in such a mean way?” It is “dreadful,” as well as unnecessary that children should be left to grow up ignorant of any of those things, great or small, which will make it possible for them to enter the schoolroom, the church, the hall, and move about in such a manner as not to be objects of unpleasant observation to those who make politeness a profession. All that has been said about the opening and closing of doors, and the rules of precedence, are always in full force, and should become so automatic that they will never have to be remembered. Even at home, and in the small country schoolhouse place of worship they should be observed, if one hopes to always do the “nice way.” In a small congregation where “everybody knows everybody,” there is a great temptation to fall into very lax manners, and so to cultivate habits that are hard to overcome, and which will cause chagrin by and by to the young man or woman who wants to appear well among strangers. Therefore it is wise to train the children to such deportment in the small church, or cottage meeting that they shall never be in danger of bringing reproach on the home which they have left behind them, by uncouth or disorderly behavior in any public assembly.
  • 54. 57 58 59 Any place of worship should be entered quietly, children and parents together, single file, in such order that there will be no jostling, crowding, or changing of places. There are two ways of seating a family, either of which is good form. In one case the father enters first, followed in order by the mother, the youngest child, and then the others according to age, so that the eldest comes last. At the opening to the pew, or row of chairs, the father turns, standing to face the others, and waits until all have passed in and are seated, when he takes his place at the entrance. This arrangement gives the mother the seat in the farther corner, with the “baby” beside her, while the eldest child is next to the father. In the other case the eldest child leads, and passes into the farther end of the seat, followed by the other children in such order as to leave the “baby” next to the mother, who sits in the second place from the end, beside her husband. Sometimes when there is a large family, it is necessary to separate the children by placing the mother in the midst of them between two restless ones. But whatever order is necessary, let it be so matter-of-course that the coming in and seating shall be in that decorous manner which will impress the children with the sacredness of the service for which they have come. Teach the child that in entering a seat or row of chairs, good form requires that he shall pass clear in to the farthest vacant place, or that if he has dropped down in the end or middle of the row, and others come to claim seats beyond him, he should always either arise, come out and stand to allow them to pass in, or himself go on to the farthest place. Teach him, never, under any circumstances, to make it necessary for any one to climb over his feet and legs to reach a vacant place. This is one of the most common and worst forms in which bad training in deportment manifests itself. Also teach your child to refuse to climb over anybody’s feet. Instruct him either to wait for a decent chance to enter that
  • 55. 60 61 seat or to find another. The ludicrous, not to say unbecoming appearance of a woman who tries to drag herself over the knees of some man who remains immovable in the end of the seat, or who attempts to draw himself up to “make room” for her to pass, is entirely out of harmony with the spirit which should prevail in a place of worship; and the young man coming from home with this habit, which has been formed by climbing over his brothers and sisters, as well as parents and guests, and letting them climb over him, will be left some sad day to wonder why people stop at the entrance to the pew where he sits, wait an instant, look at him so queerly, and then pass on, as if they were not willing to occupy the same seat with him. He may think it is because he is from the country, because he is not stylishly dressed, because they are very “stuck up,” when it is simply because they do not choose to climb over his legs to find a seat. But your daughter should be so taught that if she must stand in the aisle and wait for some man to get it into his head that he had better move on, or come out so as to allow her to pass, she shall do it kindly and without contempt; for, of course, the poor fellow would do better if he only knew how. Teach by precept and example that wraps and rubbers should not be put on until after the benediction. If your boy should grow up to the dignity of door-keeper in the house of the Lord, he should know that extra seats should never be removed from the aisles, nor doors be opened, until the last “amen” has been reverently uttered. I believe that reverence and a proper understanding of the meaning of the sacred hours of worship would be wholesomely inculcated by the practise of sitting down in silence for two or three minutes after the benediction, or long enough for any necessary things to be done, such as the orderly passing out of the congregation might require.
  • 56. 62 63 Good form requires that there be no loud talking, visiting, laughing, bustling, or confusion of any sort in the breaking up of a congregation. In fact, instead of a breaking up, it should be a melting away, each for himself seeking to hold in thought, and carry with him all that is possible of the subject which has been considered, avoiding everything which tends to dissipate or to divert the mind from its contemplation. This is the good form which nominal Christians require and teach. It is only the form, if you please, at the best dead, by which the worldly professor seems to be trying to make up what may be lacking in real spiritual worship; but that very fact proves it to be more than ordinarily worthy of consideration and adoption by the most spiritual. Upon the same principle that our righteousness must exceed the righteousness of the scribes and Pharisees should our courtesy and good breeding exceed that of the most cultivated people of the world. That behavior which everybody recognizes as becoming the house of the Lord, is that which would most certainly distinguish Jesus if he should come in among us; and the true worshiper who will clothe himself with these gentle, Christlike graces of conduct will be no less truly a Christian, while he will certainly be more quickly recognized as such.
  • 57. 64 VIII. One of the evils which the good-form code is intended to control is that of the money and gift obligations, and the part they play in the association of young people; and in this the burden of preserving the just balance falls upon the young woman, although it is equally necessary that both boys and girls shall be so instructed that they shall each contribute an equal share of that mutual protection which good form is intended to assure. A sentiment still lingers in the social world—a relic of medieval gallantry—to the effect that a young man must grant anything that a lady asks, even if, to secure it, he must risk his life, or character, or the last “quarter” with which he was to buy his dinner. This asking on her part need not be really asking: it may be only suggesting, or consenting to accept. She may only exclaim, “Oh, wouldn’t a sleigh-ride be just too lovely for anything!” She may have become naughty enough, without intending any harm, to say this on purpose to make the boy whom she delights to tease begin mentally to count over his small supply of change to see if he can possibly afford the rig. Girls have been known to take a queer sort of delight in leading a young fellow on to spend his last penny, to contract a debt, and go hungry, because he did not bravely refuse to take the hints that were intended to lead him into expenditure such as he could not afford. No girl who has been properly trained, or who has truth and the elements of womanliness within, will ever resort to any such expedient for her pleasure, but will keep herself from all or any such social entanglements as would lead to anything so base. She will not allow a young man to place her under obligation, even to the extent of car-fare.
  • 58. 65 66 67 Teach your growing daughter that to receive a gift of any sort from any boy or man outside of the immediate circle of intimate, well-known family friends, is dangerous, if not disgraceful. Gift-giving and gift-receiving has come to be a vice. It is often intended as a sly, covert method of buying you. Gifts are employed for “padlocking the mouth” of those who know something which, if told, might spoil some selfish or criminal plot; and this is by no means confined to Tammany Hall. Many a girl has kept some dangerous bit of knowledge hidden in her secret thought, and has been compromised by it, simply because she had thoughtlessly accepted some bauble from some man whom she supposed to be a friend until, the ulterior motive being revealed, she discovered that the gift was a bribe, and its possession a confession of dishonor; and then she has found herself in a great strait between her desire to be free and yet to keep the trinket. I had given a plain talk to a company of schoolgirls; and many questions had been passed up to me, in answering which I had touched some of these points. At the close of the meeting, a few girls lingered to speak to me, each waiting to ask some questions “all for herself alone.” So while the others waited at a safe distance, they came, one by one, to whisper their perplexities in my ear. How my heart was taken captive by those girls, as with shamefacedness, with trembling lips and burning cheeks, they asked me questions which were revelations both of the lack of early home teaching and of the methods by which an evil world had tried to make them wise! “I have got afraid of a lovely necklace that my friend gave me,” said one of them. “I’ve wished a hundred times he hadn’t given it; but what in the world can I do with it?” “Send it back to him,” I said; “tell him you know more now than you did when you accepted it, and that you can not keep it.”
  • 59. 68 69 “But that would make him furious. I—I—dare not make him angry.” “Then if he is so dangerous, you certainly dare not have him for a friend. If he is worthy of your friendship, he will understand and respect you all the more for this course. If he is not worthy of your friendship, the sooner you find it out, the better.” “O—but—,” and the poor girl burst into bitter weeping. Then after a few moments, with a sudden firm resolution expressed in her face, she dried her eyes, looked up at me, clasped my hands as if to hold herself by them, and said, “I’ll do it,—I’ll do it right off,—and if he wants to make it hard for me, he may. I’ve kept honest,—God knows I have,—and he knows it, though he hasn’t helped me, as he said he would.” “He promised to help you?” I asked. “Yes, he did; he said I could trust him; that he’d never let a girl be compromised in his company in the world; but if I had done, and gone, as he insisted, lest if I didn’t he would have been provoked, I should have been talked about long ago. I thank you so much. I’ll get rid of it. He may have his old necklace, and keep it to give to his wife.” “That is right,” I said. “She is the only one who can wear or own it with safety.” The young man with a good heart, who is well taught in that which is best in good form, will never offer to any lady outside his own immediate family circle any gift but flowers; and those in the most delicate unobtrusive manner, such as will leave her, in receiving them, absolutely free to pass them on to some hospital patient if she chooses. To make her feel, by even a look, that she is under any obligation to wear a flower because he sends it, is to rob it of its fragrance and beauty, and make it fit only for the dust heap.
  • 60. 70 Because of the possibilities which I have suggested, and many others to which they lead, good form requires that a young lady shall make it practically impossible for any man not intimately related to her to spend any money, or force any gifts, upon her.
  • 61. 71 72 IX. I should not do my whole duty if I did not make some reference to the “holy kiss,” nor yet contribute what I can to enlighten the mothers who honor me by reading my book concerning the universal but almost unspeakable questions that are always coming into the minds of young people about this sacred form of salute. You may know as much about these questions as I do, perhaps more; but there is many a mother who never dreamed that they could infest any brain but her own, and she never dared speak of such a thing. One girl came to me, her face suffused with blushes, but with a determined expression about her mouth, and said:— “I am going to ask you something right out plain, because I think you will not laugh. I’ve never dared ask anybody yet, because everybody always laughs in such a mean way if you try to find out anything about such things; and I’d like to know how girls are going to know just what to do. Now it’s just this way: I am going with Charley, and he is a nice boy; he wants to do what is right, I know he does, but all the boys have such queer ideas about their ‘rights.’ When he takes me home from church or any place—and I’ve just got so I dread to have him; and sometimes I think I won’t go with another boy as long as I live, because, you see, when I go to say ‘Good night,’ he—he thinks I am so queer because I won’t let him kiss me. But I won’t; I never let anybody but my own folks. I don’t like it. I don’t think it’s nice to do that way unless it’s somebody you’re sure of, and love very much. He says I’m queer; and he gets provoked, and says it’s his right, if he goes with me. Now I want to know—is it?” “No; it is not,” I said, positively, and perhaps with a little flavor of indignation. “And no properly instructed young man would
  • 62. 73 74 make such a claim. He is not to blame, of course,” I added more mildly, “for he is young, too; but your instincts are all right; they are true; they are of God who made the kiss, and gave it its own place in common human language. It belongs to the home, and to the purest Christian fellowship between man and man, woman and woman; to society, never.” “Oh, I am so glad I asked you!” she said; “for I was sure my feeling about it was right. But you know one doesn’t like to offend one’s friend, and one doesn’t like to be called queer. But what does make boys act so,—good boys, too, for Charley is a good boy?” I can not bring into the compass of these pages all that followed in our talk, but I would like to give the points of truth to the young mothers for whom I write. The answer to my young questioner is found in the fact that boys, as well as girls, have been left in ignorance of the principle, as it is in God, of which the kiss is one form of expression, and have been left to catch up its perversion as Satan has undertaken to work it into custom and habit, in the world. Anything which Satan can not wholly spoil, he will counterfeit; or, better yet for his purpose, make so common, if possible, that it shall become worthless, as was the case with silver in the days of Solomon, when it became as the stones of the street, and “was nothing accounted of.” The kiss, made common, is ridiculous. To be worth anything, it must speak exclusively the language of a pure, changeless affection, such as is represented in the love of God for his children. It belongs more to the parent and child, brother and sister, than to friend and companion. It is, as before intimated, fraternal, not social. As soon as any attempt is made to drag it into society, it becomes disgusting, and is always soon driven out by storms of ridicule. Therefore good form has taken it in hand, and has determined its sphere and office with the most arbitrary insistence. And again the
  • 63. 75 76 voice of society is but an echo of the voice of truth and purity. Good form has decreed that the kiss, public and indiscriminate, is either an indication of unmitigated rusticity, of shameless immorality, or is to be understood as a joke,—very funny on its first spontaneous utterance, but very flat if repeated. Indulged in private, outside the sacred boundaries of the family, between men and women, it is unpardonable,—unatonable, at least as far as the woman is concerned. Good form requires that every young lady shall be so well trained that she will keep her lips absolutely untouched for her husband, after the words have been spoken that make him her husband. The “betrothal kiss” of the romancer has been brought under suspicion in real life by the fact that betrothal is, in our day, not by any means equivalent to marriage; and the young man who knows the world, and yet sufficiently regards truth and purity to seek them in a wife, would vastly prefer to find his lady friend rigidly determined to keep her lips to herself as long as they two are yet twain, rather than to find them always at even his command. In the correspondence that has come to me as a result of “Studies in Home and Child Life,” is to be found pitiful evidence of the ignorance in which young people are allowed to grow up, even in a matter which may seem, like this one, trivial and bordering on the ridiculous. The habit among children of kissing everybody is little short of vicious. Kissing games of every description are considered vulgar, anywhere outside the immediate family circle, and even then, because of the trend of habit, they are not good form. There is great possibility of infection in the kiss. The remains of old teeth, the breath and lips of those who are in any wise diseased, make kissing dangerous. It is well-nigh impossible to find a clean, sweet mouth in these days of human degeneracy; and because of these facts the little children are exposed to every malignant
  • 64. 77 78 disorder that is afloat, and many that are hidden deep in the foul cisterns of the broken-down body of grandparents, father, mother, and the strangers who straggle in and use their “rights” on the freely rendered lips of the little innocents. The warnings of science, of which so many make light, are timely, and should be religiously regarded as the authority of God by every one who does not know within himself that he has so faithfully brought his whole being into conformity with every law of life and health that he is clean through and through, so that the sensitive lips of his babe can come to his with the same certainty of a blessing in the caress that the bee has when he goes to the white clover of the meadow. He, and he only, who has brought himself fully into harmony with both the letter and the spirit of Isaiah fifty-eight may freely give his lips to his child, out of which to drink his fill of love. And the home that is brought into this beautiful accord with Christ may be as the garden of the Lord, from which all lips shall, with every caress, gather that word of life that is sweeter than honey.
  • 65. 79 X. The time is at hand when the truth must be taken into every lane and walk of life—into king’s palaces, into halls of learning, into banquet rooms, and into homes of refinement and culture, as well as to the haunts of poverty and crime; for the whole earth must be filled with the knowledge of the Lord. No soul must be left to arise in the second resurrection and say, I did not know the way of life, or I would not have been here. There are being prepared in all Christian homes those who shall become the messengers of this gospel of the kingdom to every rank, grade, and condition among men. This is a consideration for every Christian mother and father. As among the children of Israel every maiden held in her heart the secret hope that she might be the mother of the promised seed of David, so now, however humble and far away from every center of influence your home may be, however meager its furnishing, however much you may seem to lack incentive to noble effort, there should be inspiration in the thought that the little child playing about your feet, whose life and habits you are molding, may be one who shall be called to bear the vessel of the Lord, which is his Word, filled with the holy oil of his Spirit, before some council of earth’s great men, and to answer for the principles by which the world is to receive its final test. By this I do not mean that he may be called to suffer martyrdom,— although that is possible—but I refer to the fact that he may have the yet grander ministry of standing up to be quizzed and catechized by those learned in the wisdom of the world concerning all that he has been taught of Christian principle, health, disease, and life in the Holy Ghost.
  • 66. 80 81 82 Unquestionably, this work is waiting for some select few of our young people in the not far distant future. Some great council of physicians will wish to know all about what the medical missionary physicians teach, and why; the chemists of the world will wish to know the philosophy of the system of dietetics which will keep the temple of God in repair; and, as is almost always the case among the people of the world, there will be eating and drinking on a large scale connected with all these investigations; and your boy or girl may have to accept the place as guest of honor at some such feast, and carry himself elegantly, for Christ’s sake and the truth’s; for the banquet, the dinner, the lunch, play an important part in all social affairs to-day, and will until the end of probation. If a man of means and social standing becomes interested enough in what you know of Christ to hear you out on it, he will make you a dinner, invite a few friends, and give you a chance to talk and tell all you know. And if you know how to take advantage of the opportunity—how to avoid giving offense by your manner of speech and habits of conduct; if you know how to charm and win by your personality, you have placed at the command of truth an instrument that can be made effective where, otherwise, no entrance could be gained. Nowhere is the observance of good form more necessary to one who has work to do in the social world than at the table; for here bad habits may be given such disgusting publicity as to render them a cause of reproach to any good cause; and the obligation is upon every Christian home to see that its children are so instructed that they shall be ready to quickly fill any place to which the work may call, and to stand with dignity for the truth in any place that can be opened to its consideration. A home of wealth and elaborate appliances is not necessary for such training. A child who is instructed in the proper use of the few simple things that constitute the furnishing of the most humble home, and in those rules of good form that ought to be the
  • 67. 83 84 natural order in any place, will not be left to carry with him into some important convocation careless table habits, which, under the pressure of a sense of responsibility, would certainly come to the front, in place of the few better ways that he might have picked up and stored away for occasional and special use. In “acting out just what is in him,” he will not bring himself and that which he represents into ridicule; the opportunity of giving the truth a chance to shine will not be lost, while honest souls are left in the dark; the breath of personal contempt will not obscure the character of Christ, which he is supposed to represent. He will be accepted, first, because it is agreeable to look at him; he will be heard because no good reason appears why he should not be; and after that, everything will depend on what he really is and has down under the surface, in the place where he lives alone with God. “But,” you say, “the Lord, who calls a man to stand in any place, will prevent any disaster to the cause, provided his servant is honest.” Yes, God will be able to use even his servants’ infirmities after he has “helped” them (Rom. 8:26); i. e., added to them his strength and wisdom. And this which we are considering is all in the nature of helps to infirmity and ignorance. It is in the direct line of legitimate education for the very best Christian service. The honest-hearted laborer for God, who, with his heart full of love, starts out in his ignorance and awkwardness to “do something” for God and souls, will find “something” to do; but we are now considering a work which every man could not do, and yet which some one must do.
  • 68. 85 XI. I must believe that the parents who fail, from carelessness or from “lack of ambition”—the holy sort, which is equivalent to consecration and diligence—to give the child the best possible preparation for a good work, will be held responsible for the failure that would have resulted if God had not stepped in with some special helps and prevented it. Love for God will cover a multitude of social sins; but those who are responsible for the sins will sometime have their reproach to bear. God does not like to have to cover sins; he only does it so as to keep things looking as tidy as possible, until they can be put entirely out of the way. Covet the best gifts for your child, give him the best possible social habits, and then turn him over to God for work, and God will find rare service for him. There are many teachings as to what constitutes good form at table. It would be impossible for the ordinary mortal so to acquaint himself with them as to become a “social success;” and this is far from our purpose. All we need care about is to see that the habits formed are free from anything offensive. Society is kind to one who is not ambitious for social distinction,—one who has something to say that is worth hearing, who represents a principle, or some new thing the discussion of which may possibly furnish an agreeable diversion,—very much after the manner of the Athenians in Paul’s time; so that even if one does not “know all the ropes,” like one “to the Manor born,” he will be received and heard, provided he does not blunder into the few things which good form has decreed that he must not do under any circumstances. Among these prohibited things are thrusting out the elbows from the side so as to push his neighbor at table; resting the elbows on the
  • 69. 86 87 88 table; and extending the legs under it so as to bring the feet in the way of those belonging to the guest opposite. If any guest does these things, he may be sure that there will be at least three people over whom the best and truest things that he can say will have very little influence. The eyes of those who chance to glance his way will be seriously offended and quickly averted if he should take up even a half-slice of bread and bite into it. Good form says that bread must be broken off in small bits, just when needed, not spread, but with a small lump of butter placed upon it (provided one uses butter), conveyed to the mouth with the thumb and finger of the left hand. You will be permitted to bite the piece in two once if you wish, but no more; that is, it must not be more than two “mouthfuls” to begin with. Under no circumstances must anything, such as fruit-pits, etc., be ejected from the mouth into a spoon, fork, or plate, but taken from the lips with the left thumb and finger, and placed on the plate. Neither bread nor any refuse is ever to be placed on the cloth, but on the side-dishes provided; or, lacking these, on the one plate that is being used. Food should not be conveyed to the mouth with a knife, but with a fork, always excepting soup, and such sauce as must be handled with a spoon. Do teach your children not to thrust the point of the spoon into the mouth, but to take its contents with the lips from that part nearest the handle, without the least possible sound. Teach them not to lift the spoon so full that it will drip; and as your boy grows up into mustaches he will need to learn how to take soup and sauce without defiling those manly ornaments, or else to let soup alone at the banquet. But you can teach him from childhood to handle his napkin so deftly as to keep his lips clean, even after they have put on their thatch.
  • 70. 89 90 As to the napkin, by all means habituate the child to its use, even if it be nothing more than a square of old calico or flour-sacking, hemmed, or even unhemmed. He can learn on a piece of his mother’s old apron how to use the fine linen of the king’s banquet- hall, and do it so daintily that the apron and the mother who wore it down to napkin dimensions will confer honor on the king’s damask. O my sister mothers in the many humbler homes of those who love our Lord and are looking for his appearing, has it seemed to you that any of these things that I have written are trivial or burdensome, wholly outside the sphere of life in which you and your children will ever move? Are you so overburdened with many cares that you feel, when the food is cooked and placed “anyhow,” that your part is done; that the family may come “just as it happens” and eat, simply to satisfy hunger, as do the cattle in the field? Have you thought that if you could but get through the day anyhow, your duty was done? Still you must meet the certainties that are before you. Your children must bear a part in the closing scenes of the world’s history,—ask yourself if there is not something for you in these things that I have written. They have been written with a most solemn sense of their importance. They are a part of the gospel message; they concern the work which some one now in training must do before the Lord can come. The knowledge of how to prepare and serve a hygienic dinner, as well as how to select suitable portions and decline others, at a worldly banquet, may be absolutely necessary to the winning of souls in the last call to the world.
  • 71. 91 XII. Nothing is of more importance to success in any work than conversation. How to converse so as to win and not wound, to both give and gain, is an accomplishment which has very nearly passed into the list of lost arts. And here again good form comes to the rescue, and by its placid but arbitrary code offsets that lawlessness into which even good men have fallen in excess of zeal. Sixty years ago the rule for children was that they “should be seen and not heard,” so that a child’s talk was almost unknown in a company of adults. This was so wrong that it has reacted in a sort of wild freedom upon the part of the children which, uncorrected, develops into the adult chatter-box and gossip, than which no character is more to be dreaded. Bad habits of conversation are very hard to break, and since it is by the “calves (or sacrifice) of the lips” that we are especially to honor God, by “words fitly spoken,” and that we are to “give a reason for the faith that is in us,” it is not of small importance that we should know how to talk. Begin with the baby, therefore, so that the child shall grow up into correct forms of speech, and into that regard of all good form which shall not only give him at once the ears, but the hearts of the people. I scarcely need to say, Do not use slang, for this is universally understood as out of harmony with Christian practise; but yet it may not be amiss to say that even the world of society, whose laws of behavior we are considering, would ostracize one whose language was punctuated with much slang. An oath would be more tolerable to so-called “polite ears.”
  • 72. 92 93 94 Money, or prominence, will for a time give a man social passport in spite of all manner of ill-breeding. He can buy a place and recognition even from those who despise him; but this is not the sort of recognition in the interests of which I am writing. I am pleading for that which shall gain a hearing for the custodians of a truth without which no man can live, and for the reception of which few are as yet prepared. It is for the sake of the honest souls who are in the darkness of the world’s “culture” that I am pleading. They have a right to know all that the Spirit of God has been sending to his people concerning that all-round righteousness that makes up the sum of that whole gospel for the whole man, which is included in an uttermost salvation; and some tongues must be so cultured as to talk the way open for truth just as effectually as a wag can do it for fun, a singer open it for a song, or money open it for blind boorishness; and the quiet mother in the home must have a large share of this work. To this end teach the child that he must listen when any other child is speaking until he has finished; never to interrupt, or, if it is necessary to give some information, to say, for instance: “I beg your pardon, but,—” or, “Willie, if you please, was it not on Wednesday instead of Tuesday?” Any interruption simply for getting in a word should never be indulged. Teach him to wait patiently for a fair chance to speak, no matter how great may be the temptation to “thrust in his oar.” This should not be construed to include those playful interruptions in the merry tangle of words which all children delight in “once in a while,” “just for fun.” Teach him to avoid all abrupt forms of expression, such as “Give me that!” “Don’t!” “Stop!” “Quit!” “Get out!” “You sha’n’t!” “I won’t!” If he never hears such phrases at home, he will not be apt to catch them; but if he should, a few little experiences such as he would certainly meet as a man upon entering the social world, with the adult equivalents of these words, would teach him that they were very unprofitable. Let him find out that he can get nothing
  • 73. Welcome to Our Bookstore - The Ultimate Destination for Book Lovers Are you passionate about books and eager to explore new worlds of knowledge? At our website, we offer a vast collection of books that cater to every interest and age group. From classic literature to specialized publications, self-help books, and children’s stories, we have it all! Each book is a gateway to new adventures, helping you expand your knowledge and nourish your soul Experience Convenient and Enjoyable Book Shopping Our website is more than just an online bookstore—it’s a bridge connecting readers to the timeless values of culture and wisdom. With a sleek and user-friendly interface and a smart search system, you can find your favorite books quickly and easily. Enjoy special promotions, fast home delivery, and a seamless shopping experience that saves you time and enhances your love for reading. Let us accompany you on the journey of exploring knowledge and personal growth! ebookgate.com