s Preface
______________
______________
Introducing the Product and
1
Installing the Software
______________
2
SIMATIC Installation
______________
Working Out the Automation
3
Concept
Programming with STEP 7
______________
Basics of Designing a
4
Program Structure
______________
5
Startup and Operation
Function Manual
______________
Setting Up and Editing the
6
Project
______________
Editing Projects with
7
Different Versions of STEP 7
______________
8
Defining Symbols
______________
Creating Blocks and
9
Libraries
______________
Basics of Creating Logic
10
Blocks
Creating Data Blocks 11
Parameter Assignment for
Data Blocks 12
Creating STL Source Files 13
Displaying Reference Data 14
Checking Block Consistency
and Time Stamps as a Block 15
Property
04/2017 Continued on next page
A5E41552389-AA
Siemens AG A5E41552389-AA Copyright © Siemens AG 2017.
Division Digital Factory Ⓟ 04/2017 Subject to change All rights reserved
Postfach 48 48
90026 NÜRNBERG
GERMANY
s Continued
Configuring Messages 16
Controlling and Monitoring
SIMATIC Variables 17
Establishing an Online
Programming with STEP 7 Connection and Making CPU 18
Settings
Downloading and Uploading 19
Function Manual Testing with the Variable
Table 20
Testing Using Program
Status 21
Testing using the Simulation
Program (Optional Package) 22
Diagnostics 23
Printing and Archiving 24
Tips and Tricks 25
Appendix 26
04/2017
A5E41552389-AA
Legal information
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent
damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert
symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are
graded according to the degree of danger.
DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.
WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.
CAUTION
indicates that minor personal injury can result if proper precautions are not taken.
NOTICE
indicates that property damage can result if proper precautions are not taken.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will
be used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to
property damage.
Qualified Personnel
The product/system described in this documentation may be operated only by personnel qualified for the specific
task in accordance with the relevant documentation, in particular its warning notices and safety instructions.
Qualified personnel are those who, based on their training and experience, are capable of identifying risks and
avoiding potential hazards when working with these products/systems.
Proper use of Siemens products
Note the following:
WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical
documentation. If products and components from other manufacturers are used, these must be recommended
or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and
maintenance are required to ensure that the products operate safely and without any problems. The permissible
ambient conditions must be complied with. The information in the relevant documentation must be observed.
Trademarks
All names identified by ® are registered trademarks of Siemens AG. The remaining trademarks in this publication
may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software
described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the
information in this publication is reviewed regularly and any necessary corrections are included in subsequent
editions.
Siemens AG A5E41552389-AA Copyright © Siemens AG 2017.
Division Digital Factory Ⓟ 04/2017 Subject to change All rights reserved
Postfach 48 48
90026 NÜRNBERG
GERMANY
Preface
Purpose
This manual provides a complete overview of programming with STEP 7. It is designed to support
you when installing and commissioning the software. It explains how to proceed when creating
programs and describes the components of user programs.
The manual is intended for people who are involved in carrying out control tasks using STEP 7 and
SIMATIC S7 automation systems.
We recommend that you familiarize yourself with the examples in the manual "Working with
STEP 7 V5.5, Getting Started." These examples provide an easy introduction to the topic
"Programming with STEP 7".
Basic Knowledge Required
In order to understand this manual, general knowledge of automation technology is required. In
addition, you must be familiar with using computers or PC-similar tools (for example, programming
devices) with the MS Windows XP, MS Windows Server 2003 or MS Windows 7 operating system.
Scope of the Manual
This manual is valid for release 5.6 of the STEP 7 programming software package.
You can find the latest information on the service packs:
• in the "readme.rtf" file
• in the updated STEP 7 online help.
The topic "What's new?" in the online help offers an excellent introduction and overview of the
newest STEP 7 innovations.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 5
Preface
Online Help
The manual is complemented by an online help which is integrated in the software.
This online help is intended to provide you with detailed support when using the software.
The help system is integrated in the software via a number of interfaces:
• There are several menu commands which you can select in the Help menu:
The Contents command opens the index for the Help on STEP 7.
• Using Help provides detailed instructions on using the online help.
The context-sensitive help offers information on the current context, for example, an open dialog
box or an active window. You can open the contextsensitive help by clicking the "Help" button or by
pressing F1.
• The status bar offers another form of context-sensitive help. It displays a short explanation for
each menu command when the mouse pointer is positioned on the menu command.
• A brief explanation is also displayed for each icon in the toolbar when the mouse pointer is
positioned on the icon for a short time.
If you prefer to read the information from the online help in printed format, you can print out
individual help topics, books, or the entire online help.
This manual, as well as the manuals "Configuring Hardware and Communication Connections
STEP 7", "Modifiying the System During Operation via CiR" and "Automation System S7-400H -
Fault-Tolerant Systems" is an extract from the HTML-based Help on STEP 7. For detailed
procedures please refer to the STEP 7 help. As the manuals and the online help share an almost
identical structure, it is easy to switch between the manuals and the online help.
You can find the electronic manuals after installing STEP 7 via the Windows Start menu: Start >
SIMATIC > Documentation.
Further Support
If you have any technical questions, please get in touch with your Siemens representative or
responsible agent.
You will find your contact person at:
http://www.siemens.com/automation/partner
You will find a guide to the technical documentation offered for the individual SIMATIC Products
and Systems at:
http://www.siemens.com/simatic-tech-doku-portal
The online catalog and order system is found under:
http://mall.automation.siemens.com/
Training Centers
Siemens offers a number of training courses to familiarize you with the SIMATIC S7 automation
system. Please contact your regional training center or our central training center in
D 90026 Nuremberg, Germany for details:
Internet: http://www.sitrain.com
Programming with STEP 7
6 Manual, 04/2017, A5E41552389-AA
Preface
Technical Support
You can reach the Technical Support for all Industry Automation and Drive Technology products
• Via the Web formula for the Support Request
http://www.siemens.com/automation/support-request Additional information about our Technical
Support can be found on the Internet pages http://www.siemens.com/automation/service
Service & Support on the Internet
In addition to our documentation, we offer our Know-how online on the internet at:
http://www.siemens.com/automation/service&support
where you will find the following:
• The newsletter, which constantly provides you with up-to-date information on your products.
• The right documents via our Search function in Service & Support.
• A forum, where users and experts from all over the world exchange their experiences.
• Your local representative for Industry Automation and Drive Technology.
• Information on field service, repairs, spare parts and consulting.
Security Information:
Siemens provides products and solutions with industrial security functions that support the secure
operation of plants, systems, machines and networks.
In order to protect plants, systems, machines and networks against cyber threats, it is necessary to
implement - and continuously maintain - a holistic, state-of-the-art industrial security concept.
Siemens' products and solutions only form one element of such a concept.
Customer is responsible to prevent unauthorized access to its plants, systems, machines and
networks. Systems, machines and components should only be connected to the enterprise network
or the internet if and to the extent necessary and with appropriate security measures (e.g. use of
firewalls and network segmentation) in place.
Additionally, Siemens' guidance on appropriate security measures should be taken into account.
For more information about industrial security, please visit
http://www.siemens.com/industrialsecurity.
Siemens' products and solutions undergo continuous development to make them more secure.
Siemens strongly recommends to apply product updates as soon as available and to always use
the latest product versions. Use of product versions that are no longer supported, and failure to
apply latest updates may increase customer's exposure to cyber threats.
To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed
under
http://www.siemens.com/industrialsecurity.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 7
Preface
Programming with STEP 7
8 Manual, 04/2017, A5E41552389-AA
Table of Contents
Preface ............................................................................................................................................................. 5
Table of Content ............................................................................................................................................... 9
1 Introducing the Product and Installing the Software ............................................................................... 21
1.1 Overview of STEP 7 ..................................................................................................................... 21
1.2 The STEP 7 Standard Package ................................................................................................... 25
1.3 What's New in STEP 7, Version 5.6? .......................................................................................... 30
1.4 Extended Uses of the STEP 7 Standard Package ...................................................................... 31
1.4.1 Engineering Tools ........................................................................................................................ 32
1.4.2 Run-Time Software ...................................................................................................................... 34
1.4.3 Human Machine Interface ............................................................................................................ 35
2 Installation ............................................................................................................................................ 37
2.1 Automation License Manager ...................................................................................................... 37
2.1.1 User Rights Through The Automation License Manager ............................................................ 37
2.1.2 Installing the Automation License Manager ................................................................................. 40
2.1.3 Guidelines for Handling License Keys ......................................................................................... 41
2.2 Installing STEP 7.......................................................................................................................... 42
2.2.1 Installation Procedure .................................................................................................................. 44
2.2.2 Setting the PG/PC Interface......................................................................................................... 46
2.3 Uninstalling STEP 7 ..................................................................................................................... 48
2.4 User Rights .................................................................................................................................. 48
3 Working Out the Automation Concept ................................................................................................... 51
3.1 Basic Procedure for Planning an Automation Project .................................................................. 51
3.2 Dividing the Process into Tasks and Areas ................................................................................. 52
3.3 Describing the Individual Functional Areas .................................................................................. 54
3.4 Listing Inputs, Outputs, and In/Outs ............................................................................................ 56
3.5 Creating an I/O Diagram for the Motors ....................................................................................... 56
3.6 Creating an I/O Diagram for the Valves ....................................................................................... 57
3.7 Establishing the Safety Requirements ......................................................................................... 58
3.8 Describing the Required Operator Displays and Controls ........................................................... 59
3.9 Creating a Configuration Diagram ............................................................................................... 60
4 Basics of Designing a Program Structure .............................................................................................. 61
4.1 Programs in a CPU ...................................................................................................................... 61
4.2 Blocks in the User Program ......................................................................................................... 62
4.2.1 Organization Blocks and Program Structure ............................................................................... 63
4.2.2 Call Hierarchy in the User Program ............................................................................................. 69
4.2.3 Block Types .................................................................................................................................. 71
4.2.3.1 Organization Block for Cyclic Program Processing (OB1) .......................................................... 71
4.2.3.2 Functions (FC) ............................................................................................................................. 77
4.2.3.3 Function Blocks (FB) .................................................................................................................... 79
4.2.3.4 Instance Data Blocks ................................................................................................................... 82
4.2.3.5 Shared Data Blocks (DB) ............................................................................................................. 85
4.2.3.6 System Function Blocks (SFB) and System Functions (SFC) ..................................................... 86
4.2.4 Organization Blocks for Interrupt-Driven Program Processing .................................................... 88
4.2.4.1 Time-of-Day Interrupt Organization Blocks (OB10 to OB17) ....................................................... 88
4.2.4.2 Time-Delay Interrupt Organization Blocks (OB20 to OB23) ........................................................ 91
4.2.4.3 Cyclic Interrupt Organization Blocks (OB30 to OB38) ................................................................. 92
4.2.4.4 Hardware Interrupt Organization Blocks (OB40 to OB47) ........................................................... 94
4.2.4.5 Startup Organization Blocks (OB100 / OB101 / OB102) ............................................................. 95
4.2.4.6 Background Organization Block (OB90) ...................................................................................... 97
4.2.4.7 Error Handling Organization Blocks (OB70 to OB87 / OB121 to OB122) ................................... 99
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 9
Table of Contents
5 Startup and Operation ......................................................................................................................... 101
5.1 Starting STEP 7 ......................................................................................................................... 101
5.2 Starting STEP 7 with Default Start Parameters ......................................................................... 102
5.3 Calling the Help Functions ......................................................................................................... 104
5.4 Objects and Object Hierarchy .................................................................................................... 105
5.4.1 Project Object............................................................................................................................. 107
5.4.2 Library Object ............................................................................................................................. 108
5.4.3 Station Object............................................................................................................................. 109
5.4.4 Programmable Module Object ................................................................................................... 110
5.4.5 S7 Program Object .................................................................................................................... 112
5.4.6 Block Folder Object .................................................................................................................... 114
5.4.7 Source File Folder Object .......................................................................................................... 117
5.4.8 S7 Program without a Station or CPU ....................................................................................... 118
5.5 User Interface and Operation..................................................................................................... 119
5.5.1 Operating Philosophy ................................................................................................................. 119
5.5.2 Window Arrangement ................................................................................................................ 120
5.5.3 Elements in Dialog Boxes .......................................................................................................... 121
5.5.4 Creating and Managing Objects ................................................................................................ 122
5.5.5 Selecting Objects in a Dialog Box .............................................................................................. 128
5.5.6 Session Memory ........................................................................................................................ 129
5.5.7 Changing the Window Arrangement .......................................................................................... 129
5.5.8 Saving and Restoring the Window Arrangement ....................................................................... 130
5.6 Keyboard Operation ................................................................................................................... 131
5.6.1 Keyboard Control ....................................................................................................................... 131
5.6.2 Key Combinations for Menu Commands ................................................................................... 131
5.6.3 Key Combinations for Moving the Cursor .................................................................................. 133
5.6.4 Key Combinations for Selecting Text ......................................................................................... 135
5.6.5 Key Combinations for Access to Online Help ............................................................................ 135
5.6.6 Key Combinations for Toggling between Windows ................................................................... 136
6 Setting Up and Editing the Project ....................................................................................................... 137
6.1 Project Structure ........................................................................................................................ 137
6.2 What You Should Know About Access Protection..................................................................... 139
6.3 What You Should Know About The Change Log....................................................................... 141
6.4 Using Foreign-Language Character Sets .................................................................................. 142
6.5 Setting the MS Windows Language ........................................................................................... 144
6.6 Setting Up a Project ................................................................................................................... 145
6.6.1 Creating a Project ...................................................................................................................... 145
6.6.2 Inserting Stations ....................................................................................................................... 147
6.6.3 Inserting an S7 Program ............................................................................................................ 148
6.7 Editing a Project ......................................................................................................................... 150
6.7.1 Checking Projects for Software Packages Used ....................................................................... 150
6.7.2 Managing Multilingual Texts ...................................................................................................... 151
6.7.2.1 Types of Multilingual Texts ........................................................................................................ 153
6.7.2.2 Structure of the Export File ........................................................................................................ 154
6.7.2.3 Information on the Log File ........................................................................................................ 156
6.7.2.4 Managing User Texts Whose Language Font is Not Installed .................................................. 157
6.7.2.5 Optimizing the Source for Translation........................................................................................ 158
6.7.2.6 Optimizing the Translation Process ........................................................................................... 159
6.7.2.7 Hiding Texts in Selected Languages ......................................................................................... 159
6.7.3 Micro Memory Card (MMC) as a Data Carrier ........................................................................... 160
6.7.3.1 What You Should Know About Micro Memory Cards (MMC) .................................................... 160
6.7.3.2 Using a Micro Memory Card as a Data Carrier .......................................................................... 161
6.7.3.3 Memory Card File....................................................................................................................... 161
6.7.3.4 Storing Project Data on a Micro Memory Card (MMC) .............................................................. 162
Programming with STEP 7
10 Manual, 04/2017, A5E41552389-AA
Table of Contents
7 Editing Projects with Different Versions of STEP 7 .............................................................................. 163
7.1 Editing Version 2 Projects and Libraries .................................................................................... 163
7.2 Expanding DP Slaves That Were Created with Previous Versions of STEP 7 ......................... 163
7.3 Editing Current Configurations with Previous Versions of STEP 7............................................ 165
7.4 Appending SIMATIC PC Configurations of Previous Versions .................................................. 166
7.5 Displaying Modules Configured with Later STEP 7 Versions or Optional Packages ................ 168
8 Defining Symbols ................................................................................................................................ 171
8.1 Absolute and Symbolic Addressing ........................................................................................... 171
8.2 Shared and Local Symbols ........................................................................................................ 173
8.3 Displaying Shared or Local Symbols ......................................................................................... 174
8.4 Setting the Address Priority (Symbolic/Absolute) ...................................................................... 175
8.5 Symbol Table for Shared Symbols ............................................................................................ 178
8.5.1 Structure and Components of the Symbol Table ....................................................................... 178
8.5.2 Addresses and Data Types Permitted in the Symbol Table ...................................................... 180
8.5.3 Incomplete and Non-Unique Symbols in the Symbol Table ...................................................... 181
8.6 Entering Shared Symbols .......................................................................................................... 182
8.6.1 General Tips on Entering Symbols ............................................................................................ 182
8.6.2 Entering Single Shared Symbols in a Dialog Box ...................................................................... 183
8.6.3 Entering Multiple Shared Symbols in the Symbol Table ............................................................ 184
8.6.4 Using Upper and Lower Case for Symbols ................................................................................ 185
8.6.5 Exporting and Importing Symbol Tables .................................................................................... 187
8.6.6 File Formats for Importing/Exporting a Symbol Table ............................................................... 188
8.6.7 Editing Areas in Symbol Tables ................................................................................................. 191
9 Creating Blocks and Libraries.............................................................................................................. 193
9.1 Selecting an Editing Method ...................................................................................................... 193
9.2 Selecting the Programming Language ...................................................................................... 194
9.2.1 Ladder Logic Programming Language (LAD) ............................................................................ 196
9.2.2 Function Block Diagram Programming Language (FBD) .......................................................... 197
9.2.3 Statement List Programming Language (STL) .......................................................................... 198
9.2.4 S7 SCL Programming Language ............................................................................................... 199
9.2.5 S7-GRAPH Programming Language (Sequential Control) ........................................................ 200
9.2.6 S7 HiGraph Programming Language (State Graph).................................................................. 201
9.2.7 S7 CFC Programming Language............................................................................................... 202
9.3 Creating Blocks .......................................................................................................................... 203
9.3.1 Blocks Folder ............................................................................................................................. 203
9.3.2 Using UserDefined Data Types to Access Data ....................................................................... 204
9.3.3 Block Properties ......................................................................................................................... 207
9.3.4 Displaying Block Lengths ........................................................................................................... 209
9.3.5 Rewiring ..................................................................................................................................... 210
9.3.6 Comparing Blocks ...................................................................................................................... 211
9.3.7 Attributes for Blocks and Parameters ........................................................................................ 213
9.4 Working with Libraries ................................................................................................................ 214
9.4.1 Hierarchical Structure of Libraries.............................................................................................. 216
9.4.2 Overview of the Standard Libraries............................................................................................ 216
10 Basics of Creating Logic Blocks .......................................................................................................... 217
10.1 Basics of Creating Logic Blocks................................................................................................. 217
10.1.1 Structure of the Program Editor Window ................................................................................... 217
10.1.2 Basic Procedure for Creating Logic Blocks ............................................................................... 219
10.1.3 Default Settings for the LAD/STL/FBD Program Editor ............................................................. 220
10.1.4 Access Rights to Blocks and Source Files ................................................................................ 220
10.1.5 Instructions from the Program Elements Table ......................................................................... 221
10.2 Editing the Variable Declaration................................................................................................. 222
10.2.1 Using the Variable Declaration in Logic Blocks ......................................................................... 222
10.2.2 Interaction Between The Variable Detail View And The Instruction List.................................... 224
10.2.3 Structure of the Variable Declaration Window ........................................................................... 225
10.3 Multiple Instances in the Variable Declaration ........................................................................... 226
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 11
Table of Contents
10.3.1 Using Multiple Instances ............................................................................................................ 226
10.3.2 Rules for Declaring Multiple Instances ...................................................................................... 227
10.3.3 Entering a Multiple Instance in the Variable Declaration Window ............................................. 227
10.4 General Notes on Entering Statements and Comments ........................................................... 228
10.4.1 Structure of the Code Section .................................................................................................... 228
10.4.2 Procedure for Entering Statements............................................................................................ 229
10.4.3 Entering Shared Symbols in a Program .................................................................................... 230
10.4.4 Entering Block Comments and Network Comments.................................................................. 230
10.4.5 Title and Comments for Blocks and Networks ........................................................................... 231
10.4.6 Working with Network Templates .............................................................................................. 233
10.4.7 Search Function for Errors in the Code Section ........................................................................ 234
10.5 Editing LAD Elements in the Code Section ............................................................................... 235
10.5.1 Settings for Ladder Logic Programming .................................................................................... 235
10.5.2 Rules for Entering Ladder Logic Elements ................................................................................ 235
10.5.3 Illegal Logic Operations in Ladder ............................................................................................. 238
10.6 Editing FBD Elements in the Code Section ............................................................................... 239
10.6.1 Settings for Function Block Diagram Programming ................................................................... 239
10.6.2 Rules for Entering FBD Elements .............................................................................................. 240
10.7 Editing STL Statements in the Code Section ............................................................................. 242
10.7.1 Settings for Statement List Programming .................................................................................. 242
10.7.2 Rules for Entering STL Statements ........................................................................................... 242
10.8 Updating Block Calls .................................................................................................................. 243
10.8.1 Changing Interfaces ................................................................................................................... 243
10.9 Saving Logic Blocks ................................................................................................................... 244
11 Creating Data Blocks .......................................................................................................................... 247
11.1 Basic Information on Creating Data Blocks ............................................................................... 247
11.2 Declaration View of Data Blocks ................................................................................................ 248
11.3 Data View of Data Blocks .......................................................................................................... 249
11.4 Editing and Saving Data Blocks ................................................................................................. 250
11.4.1 Entering the Data Structure of Shared Data Blocks .................................................................. 250
11.4.2 Entering and Displaying the Data Structure of Data Blocks Referencing an FB
(Instance DBs) ........................................................................................................................... 251
11.4.3 Entering the Data Structure of User-Defined Data Types (UDT)............................................... 252
11.4.4 Entering and Displaying the Structure of Data Blocks Referencing a UDT ............................... 253
11.4.5 Editing Data Values in the Data View ........................................................................................ 254
11.4.6 Resetting Data Values to their Initial Values .............................................................................. 254
11.4.7 Saving Data Blocks .................................................................................................................... 255
12 Parameter Assignment for Data Blocks ............................................................................................... 257
12.1 Assigning Parameters to Technological Functions .................................................................... 257
13 Creating STL Source Files .................................................................................................................. 259
13.1 Basic Information on Programming in STL Source Files ........................................................... 259
13.2 Rules for Programming in STL Source Files ............................................................................. 260
13.2.1 Rules for Entering Statements in STL Source Files .................................................................. 260
13.2.2 Rules for Declaring Variables in STL Source Files .................................................................... 261
13.2.3 Rules for Block Order in STL Source Files ................................................................................ 262
13.2.4 Rules for Setting System Attributes in STL Source Files .......................................................... 262
13.2.5 Rules for Setting Block Properties in STL Source Files............................................................. 263
13.2.6 Permitted Block Properties for Each Block Type ....................................................................... 264
13.3 Structure of Blocks in STL Source Files .................................................................................... 266
13.3.1 Structure of Logic Blocks in STL Source Files ........................................................................... 266
13.3.2 Structure of Data Blocks in STL Source Files ............................................................................ 267
13.3.3 Structure of User-Defined Data Types in STL Source Files ...................................................... 267
13.4 Syntax and Formats for Blocks in STL Source Files ................................................................. 268
13.4.1 Format Table of Organization Blocks......................................................................................... 268
13.4.2 Format Table of Function Blocks ............................................................................................... 269
13.4.3 Format Table of Functions ......................................................................................................... 270
13.4.4 Format Table of Data Blocks ..................................................................................................... 271
Programming with STEP 7
12 Manual, 04/2017, A5E41552389-AA
Table of Contents
13.5 Creating STL Source Files ......................................................................................................... 272
13.5.1 Creating STL Source Files ......................................................................................................... 272
13.5.2 Editing S7 Source Files .............................................................................................................. 272
13.5.3 Setting The Layout of Source Code Text ................................................................................... 272
13.5.4 Inserting Block Templates in STL Source Files ......................................................................... 273
13.5.5 Inserting the Contents of Other STL Source Files ..................................................................... 273
13.5.6 Inserting Source Code from Existing Blocks in STL Source Files ............................................. 273
13.5.7 Inserting External Source Files .................................................................................................. 273
13.5.8 Generating STL Source Files from Blocks ................................................................................. 274
13.5.9 Importing Source Files ............................................................................................................... 275
13.5.10 Exporting Source Files ............................................................................................................... 275
13.6 Saving and Compiling STL Source Files and Executing a Consistency Check ........................ 276
13.6.1 Saving STL Source Files ........................................................................................................... 276
13.6.2 Checking Consistency in STL Source Files ............................................................................... 276
13.6.3 Debugging STL Source Files ..................................................................................................... 276
13.6.4 Compiling STL Source Files ...................................................................................................... 277
13.7 Examples of STL Source Files ................................................................................................... 277
13.7.1 Examples of Declaring Variables in STL Source Files .............................................................. 277
13.7.2 Example of Organization Blocks in STL Source Files ............................................................... 278
13.7.3 Example of Functions in STL Source Files ................................................................................ 279
13.7.4 Example of Function Blocks in STL Source Files ...................................................................... 282
13.7.5 Example of Data Blocks in STL Source Files ............................................................................ 284
13.7.6 Example of User-Defined Data Types in STL Source Files ....................................................... 285
14 Displaying Reference Data .................................................................................................................. 287
14.1 Overview of the Available Reference Data ................................................................................ 287
14.1.1 CrossReference List ................................................................................................................. 289
14.1.2 Program Structure ...................................................................................................................... 290
14.1.3 Assignment List .......................................................................................................................... 292
14.1.4 Unused Symbols ........................................................................................................................ 294
14.1.5 Addresses Without Symbols ...................................................................................................... 295
14.1.6 Displaying Block Information for LAD, FBD, and STL ............................................................... 295
14.2 Working with Reference Data .................................................................................................... 296
14.2.1 Ways of Displaying Reference Data .......................................................................................... 296
14.2.2 Displaying Lists in Additional Working Windows ....................................................................... 297
14.2.3 Generating and Displaying Reference Data .............................................................................. 298
14.2.4 Finding Address Locations in the Program Quickly ................................................................... 299
14.2.5 Example of Working with Address Locations ............................................................................. 300
15 Checking Block Consistency and Time Stamps as a Block Property .................................................... 303
15.1 Checking Block Consistency...................................................................................................... 303
15.2 Time Stamps as a Block Property and Time Stamp Conflicts ................................................... 305
15.3 Time Stamps in Logic Blocks ..................................................................................................... 306
15.4 Time Stamps in Shared Data Blocks ......................................................................................... 307
15.5 Time Stamps in Instance Data Blocks ....................................................................................... 307
15.6 Time Stamps in UDTs and Data Blocks Derived from UDTs .................................................... 308
15.7 Correcting the Interfaces in a Function, Function Block, or UDT .............................................. 308
15.8 Avoiding Errors when Calling Blocks ......................................................................................... 309
16 Configuring Messages ........................................................................................................................ 311
16.1 The Message Concept ............................................................................................................... 311
16.1.1 What Are the Different Messaging Methods? ............................................................................ 311
16.1.2 Choosing a Messaging Method ................................................................................................. 313
16.1.3 SIMATIC Components ............................................................................................................... 315
16.1.4 Parts of a Message .................................................................................................................... 316
16.1.5 Which Message Blocks Are Available? ..................................................................................... 317
16.1.6 Formal Parameters, System Attributes, and Message Blocks .................................................. 319
16.1.7 Message Type and Messages ................................................................................................... 320
16.1.8 How to Generate an STL Source File from Message-Type Blocks ........................................... 322
16.1.9 Assigning Message Numbers .................................................................................................... 322
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 13
Table of Contents
16.1.10 Differences Between Project-Oriented and CPU-Oriented Assignment
of Message Numbers ................................................................................................................. 323
16.1.11 Options for Modifying the Message Number Assignment of a Project ...................................... 324
16.2 Project-Oriented Message Configuration ................................................................................... 325
16.2.1 How to Assign Project-Oriented Message Numbers ................................................................. 325
16.2.2 Assigning and Editing BlockRelated Messages ....................................................................... 325
16.2.2.1 How to Create Block-Related Messages (Project-Oriented) ..................................................... 325
16.2.2.2 How to Edit Block-Related Messages (Project-Oriented) .......................................................... 328
16.2.2.3 How to Configure PCS 7 Messages (Project-Oriented)............................................................. 329
16.2.3 Assigning and Editing Symbol-Related Messages .................................................................... 330
16.2.3.1 How to Assign and Edit Symbol-Related Messages (Project-Oriented) .................................... 330
16.2.4 Creating and Editing UserDefined Diagnostic Messages ......................................................... 331
16.3 CPU-Oriented Message Configuration ...................................................................................... 332
16.3.1 How to Assign CPU-Oriented Message Numbers ..................................................................... 332
16.3.2 Assigning and Editing BlockRelated Messages ....................................................................... 332
16.3.2.1 How to Create Block-Related Messages (CPU-Oriented) ......................................................... 332
16.3.2.2 How to Edit Block-Related Messages (CPU-Oriented).............................................................. 335
16.3.2.3 How to Configure PCS 7 Messages (CPU-Oriented) ................................................................ 335
16.3.3 Assigning and Editing Symbol-Related Messages .................................................................... 337
16.3.3.1 How to Assign and Edit Symbol-Related Messages (CPU-Oriented) ....................................... 337
16.3.4 Creating and Editing User-Defined Diagnostic Messages ......................................................... 338
16.4 Tips for Editing Messages .......................................................................................................... 339
16.4.1 Adding Associated Values to Messages .................................................................................... 339
16.4.2 Integrating Texts from Text Libraries into Messages ................................................................. 342
16.4.3 Deleting Associated Values ....................................................................................................... 343
16.5 Translating and Editing Operator Related Texts........................................................................ 344
16.5.1 Translating and Editing User Texts ............................................................................................ 344
16.6 Translating and Editing Text Libraries ....................................................................................... 346
16.6.1 User Text Libraries ..................................................................................................................... 346
16.6.2 Creating User Text Libraries ...................................................................................................... 346
16.6.3 How to Edit User Text Libraries ................................................................................................. 347
16.6.4 System Text Libraries ................................................................................................................ 347
16.6.5 Translating Text Libraries .......................................................................................................... 348
16.7 Transferring Message Configuration Data to the Programmable Controller ............................. 350
16.7.1 Transferring Configuration Data to the Programmable Controller ............................................. 350
16.8 Displaying CPU Messages and UserDefined Diagnostic Messages........................................ 351
16.8.1 Configuring CPU Messages....................................................................................................... 354
16.8.2 Displaying Stored CPU Messages ............................................................................................. 354
16.9 Configuring the 'Report System Errors' ..................................................................................... 355
16.9.1 Overview of 'Report System Error' ............................................................................................. 355
16.9.2 Configuring the Reporting of System Errors .............................................................................. 355
16.9.3 Supported Components and Functional Scope ......................................................................... 357
16.9.4 Settings for "Report System Error" ............................................................................................ 361
16.9.5 Generating Blocks for Reporting System Errors ........................................................................ 361
16.9.6 Generated Error OBs ................................................................................................................. 363
16.9.7 Generated Blocks....................................................................................................................... 365
16.9.8 Assignment of System Errors to Error Classes ......................................................................... 367
16.9.9 Generating Foreign-Language Message Texts in 'Report System Error' .................................. 369
17 Controlling and Monitoring Variables ................................................................................................... 371
17.1 Configuring Variables for Operator Control and Monitoring ...................................................... 371
17.2 Configuring Operator Control and Monitoring Attributes with Statement List, Ladder Logic,
and Function Block Diagram ...................................................................................................... 373
17.3 Configuring Operator Control and Monitoring Attributes via the Symbol Table ......................... 374
17.4 Changing Operator Control and Monitoring Attributes with CFC ............................................... 375
17.5 Transferring Configuration Data to the Operator Interface Programmable Controller ............... 376
Programming with STEP 7
14 Manual, 04/2017, A5E41552389-AA
Table of Contents
18 Establishing an Online Connection and Making CPU Settings ............................................................. 377
18.1 Establishing Online Connections ............................................................................................... 377
18.1.1 Establishing an Online Connection via the "Accessible Nodes" Window .................................. 377
18.1.2 Establishing an Online Connection via the Online Window of the Project ................................ 379
18.1.3 Online Access to PLCs in a Multiproject .................................................................................... 380
18.1.4 Password Protection for Access to Programmable Controllers ................................................. 382
18.1.5 Updating the Window Contents ................................................................................................. 383
18.2 Displaying and Changing the Operating Mode .......................................................................... 384
18.3 Displaying and Setting the Time and Date ................................................................................ 385
18.3.1 CPU Clocks with Time Zone Setting and Summer/Winter Time ............................................... 386
18.4 Updating the Firmware ............................................................................................................... 388
18.4.1 Updating Firmware in Modules and Submodules Online........................................................... 388
19 Downloading and Uploading................................................................................................................ 393
19.1 Downloading from the PG/PC to the Programmable Controller ................................................ 393
19.1.1 Requirements for Downloading.................................................................................................. 393
19.1.2 Differences Between Saving and Downloading Blocks ............................................................. 394
19.1.3 Load Memory and Work Memory in the CPU ............................................................................ 395
19.1.4 Download Methods Dependent on the Load Memory ............................................................... 397
19.1.5 Updating Firmware in Modules and Submodules Online........................................................... 398
19.1.6 Downloading a Program to the S7 CPU .................................................................................... 401
19.1.6.1 Downloading with Project Management .................................................................................... 401
19.1.6.2 Downloading without Project Management ............................................................................... 401
19.1.6.3 Reloading Blocks in the Programmable Controller .................................................................... 401
19.1.6.4 Saving Downloaded Blocks on Integrated EPROM ................................................................... 402
19.1.6.5 Downloading via EPROM Memory Cards .................................................................................. 402
19.2 Compiling and Downloading Several Objects from the PG ....................................................... 403
19.2.1 Requirements for and Notes on Downloading ........................................................................... 403
19.2.2 Compiling and Downloading Objects ......................................................................................... 405
19.3 Uploading from the Programmable Controller to the PG/PC ..................................................... 407
19.3.1 Uploading a Station .................................................................................................................... 408
19.3.2 Uploading Blocks from an S7 CPU ............................................................................................ 409
19.3.3 Editing Uploaded Blocks in the PG/PC ...................................................................................... 409
19.3.3.1 Editing Uploaded Blocks if the User Program is on the PG/PC ................................................. 410
19.3.3.2 Editing Uploaded Blocks if the User Program is Not on the PG/PC .......................................... 410
19.4 Deleting on the Programmable Controller ................................................................................. 411
19.4.1 Erasing the Load/Work Memory and Resetting the CPU .......................................................... 411
19.4.2 Deleting S7 Blocks on the Programmable Controller ................................................................ 411
19.5 Compressing the User Memory (RAM) ...................................................................................... 412
19.5.1 Gaps in the User Memory (RAM) ............................................................................................... 412
19.5.2 Compressing the Memory Contents of an S7 CPU ................................................................... 413
20 Testing with the Variable Table ........................................................................................................... 415
20.1 Introduction to Testing with Variable Tables .............................................................................. 415
20.2 Basic Procedure when Monitoring and Modifying with the Variable Table ................................ 416
20.3 Editing and Saving Variable Tables ........................................................................................... 416
20.3.1 Creating and Opening a Variable Table .................................................................................... 416
20.3.1.1 How to Create and Open a Variable Table ................................................................................ 417
20.3.2 Copying/Moving Variable Tables ............................................................................................... 418
20.3.3 Saving a Variable Table ............................................................................................................. 418
20.4 Entering Variables in Variable Table ......................................................................................... 419
20.4.1 Inserting Addresses or Symbols in a Variable Table ................................................................. 419
20.4.2 Inserting a Contiguous Address Range in a Variable Table ...................................................... 421
20.4.3 Inserting Modify Values .............................................................................................................. 421
20.4.4 Upper Limits for Entering Timers ............................................................................................... 422
20.4.5 Upper Limits for Entering Counters............................................................................................ 423
20.4.6 Inserting Comment Lines ........................................................................................................... 423
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 15
Table of Contents
20.4.7 Examples ................................................................................................................................... 424
20.4.7.1 Example of Entering Addresses in Variable Tables................................................................... 424
20.4.7.2 Example of Entering a Contiguous Address Range .................................................................. 425
20.4.7.3 Examples of Entering Modify and Force Values ........................................................................ 426
20.5 Establishing a Connection to the CPU ....................................................................................... 429
20.6 Monitoring Variables .................................................................................................................. 430
20.6.1 Introduction to Monitoring Variables .......................................................................................... 430
20.6.2 Defining the Trigger for Monitoring Variables ............................................................................ 430
20.7 Modifying Variables .................................................................................................................... 432
20.7.1 Introduction to Modifying Variables ............................................................................................ 432
20.7.2 Defining the Trigger for Modifying Variables .............................................................................. 433
20.8 Forcing Variables ....................................................................................................................... 435
20.8.1 Safety Measures When Forcing Variables ................................................................................ 435
20.8.2 Introduction to Forcing Variables ............................................................................................... 436
20.8.3 Differences Between Forcing and Modifying Variables ............................................................. 438
21 Testing Using Program Status ............................................................................................................. 439
21.1 Testing Using Program Status ................................................................................................... 439
21.2 Program Status Display ............................................................................................................. 440
21.3 What You Should Know About Testing in Single-Step Mode/Breakpoints ................................ 442
21.4 What You Should Know About the HOLD Mode ....................................................................... 444
21.5 Program Status of Data Blocks .................................................................................................. 445
21.5.1 Setting the Display for Program Status ...................................................................................... 446
22 Testing using the Simulation Program (Optional Package) .................................................................. 447
22.1 Testing using the Simulation Program S7 PLCSIM (Optional Package) ................................... 447
23 Diagnostics ......................................................................................................................................... 449
23.1 Hardware Diagnostics and Troubleshooting .............................................................................. 449
23.2 Diagnostics Symbols in the Online View ................................................................................... 451
23.3 Diagnosing Hardware: Quick View ............................................................................................ 453
23.3.1 Calling the Quick View ............................................................................................................... 453
23.3.2 Information Functions in the Quick View ................................................................................... 453
23.4 Diagnosing Hardware: Diagnostic View ..................................................................................... 454
23.4.1 Calling the Diagnostic View ....................................................................................................... 454
23.4.2 Information Functions in the Diagnostic View ............................................................................ 456
23.5 Module Information .................................................................................................................... 457
23.5.1 Options for Displaying the Module Information .......................................................................... 457
23.5.2 Module Information Functions.................................................................................................... 458
23.5.3 Scope of the Module Type-Dependent Information ................................................................... 461
23.5.4 Displaying the Module Status of PA Field Devices and DP Slaves After a Y-Link .................... 463
23.6 Diagnosing in STOP Mode ........................................................................................................ 465
23.6.1 Basic Procedure for Determining the Cause of a STOP ........................................................... 465
23.6.2 Stack Contents in STOP Mode .................................................................................................. 466
23.7 Checking Scan Cycle Times to Avoid Time Errors .................................................................... 467
23.7.1 Checking Scan Cycle Times to Avoid Time Errors .................................................................... 467
23.8 Flow of Diagnostic Information................................................................................................... 468
23.8.1 System Status List SSL ............................................................................................................. 469
23.8.2 Sending Your Own Diagnostic Messages ................................................................................. 471
23.8.3 Diagnostic Functions .................................................................................................................. 472
23.9 Program Measures for Handling Errors ..................................................................................... 473
23.9.1 Evaluating the Output Parameter RET_VAL ............................................................................. 474
23.9.2 Error OBs as a Reaction to Detected Errors .............................................................................. 475
23.9.3 Inserting Substitute Values for Error Detection.......................................................................... 480
23.9.4 I/O Redundancy Error (OB70) ................................................................................................... 482
23.9.5 CPU Redundancy Error (OB72)................................................................................................. 483
23.9.6 Time Error (OB80)...................................................................................................................... 484
23.9.7 Power Supply Error (OB81) ....................................................................................................... 485
23.9.8 Diagnostic Interrupt (OB82) ....................................................................................................... 486
23.9.9 Insert/Remove Module Interrupt (OB83) .................................................................................... 487
Programming with STEP 7
16 Manual, 04/2017, A5E41552389-AA
Table of Contents
23.9.10 CPU Hardware Fault (OB84) ..................................................................................................... 488
23.9.11 Program Sequence Error (OB85) .............................................................................................. 489
23.9.12 Rack Failure (OB86) .................................................................................................................. 490
23.9.13 Communication Error (OB87) .................................................................................................... 491
23.9.14 Programming Error (OB121) ...................................................................................................... 491
23.9.15 I/O Access Error (OB122) .......................................................................................................... 492
23.10 System Diagnostics with 'Report System Error'......................................................................... 493
23.10.1 Graphical Output of Diagnostic Events ...................................................................................... 493
23.10.2 Diagnostic Status ....................................................................................................................... 493
23.10.2.1 Overview of the Diagnostic Status............................................................................................. 493
23.10.2.2 PROFIBUS Diagnostic Status ................................................................................................... 493
23.10.2.3 Example of a DB 125 with a DP Slave ...................................................................................... 496
23.10.2.4 Example of a Request for the PROFIBUS DP DB .................................................................... 497
23.10.2.5 PROFINET Diagnostic Status ................................................................................................... 499
23.10.2.6 Example of a DB126 with an IO System 100 and Devices with Device Numbers 2, 3 and 4 ... 502
23.10.2.7 Example of a Request for the PROFINET IO DB ...................................................................... 503
23.10.2.8 Diagnostic Status DB ................................................................................................................. 504
23.10.2.9 Example of a Diagnostic Status DB Query................................................................................ 508
23.10.2.10 Importing Error and Help Texts ............................................................................................ 511
24 Printing and Archiving ......................................................................................................................... 513
24.1 Printing Project Documentation ................................................................................................. 513
24.1.1 Basic Procedure when Printing .................................................................................................. 514
24.1.2 Print Functions ........................................................................................................................... 514
24.1.3 Special Note on Printing the Object Tree .................................................................................. 515
24.2 Archiving Projects and Libraries ................................................................................................ 516
24.2.1 Archiving Projects and Libraries ................................................................................................ 516
24.2.2 Uses for Saving/Archiving .......................................................................................................... 517
24.2.3 Requirements for Archiving ........................................................................................................ 517
24.2.4 Procedure for Archiving/Retrieving ............................................................................................ 518
25 Tips and Tricks ................................................................................................................................... 519
25.1 Exchanging Modules in the Configuration Table ....................................................................... 519
25.2 Projects with a Large Number of Networked Stations ............................................................... 519
25.3 Rearranging ............................................................................................................................... 520
25.4 Editing Symbols Across Multiple Networks ................................................................................ 520
25.5 Testing with the Variable Table.................................................................................................. 521
25.6 Modifying Variables With the Program Editor ............................................................................ 522
25.7 Virtual Work Memory ................................................................................................................. 523
26 Appendix............................................................................................................................................. 525
26.1 Operating Modes........................................................................................................................ 525
26.1.1 Operating Modes and Mode Transitions .................................................................................... 525
26.1.2 STOP Mode ............................................................................................................................... 528
26.1.3 STARTUP Mode ........................................................................................................................ 529
26.1.4 RUN Mode ................................................................................................................................. 537
26.1.5 HOLD Mode ............................................................................................................................... 538
26.2 Memory Areas of S7 CPUs ........................................................................................................ 539
26.2.1 Distribution of the Memory Areas............................................................................................... 539
26.2.2 Load Memory and Work Memory............................................................................................... 540
26.2.3 System Memory ......................................................................................................................... 542
26.2.3.1 Using the System Memory Areas .............................................................................................. 542
26.2.3.2 Process-Image Input/Output Tables .......................................................................................... 544
26.2.3.3 Local Data Stack ........................................................................................................................ 548
26.2.3.4 Interrupt Stack ............................................................................................................................ 550
26.2.3.5 Block Stack ................................................................................................................................ 550
26.2.3.6 Diagnostic Buffer ........................................................................................................................ 551
26.2.3.7 Evaluating the Diagnostic Buffer ................................................................................................ 551
26.2.3.8 Retentive Memory Areas on S7-300 CPUs ............................................................................... 553
26.2.3.9 Retentive Memory Areas on S7-400 CPUs ............................................................................... 554
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 17
Table of Contents
26.2.3.10 Configurable Memory Objects in the Work Memory.................................................................. 554
26.3 Data Types and Parameter Types ............................................................................................. 555
26.3.1 Introduction to Data Types and Parameter Types ..................................................................... 555
26.3.2 Elementary Data Types ............................................................................................................. 556
26.3.2.1 Format of the Data Type INT (16-Bit Integers) .......................................................................... 557
26.3.2.2 Format of the Data Type DINT (32-Bit Integers)........................................................................ 557
26.3.2.3 Format of the Data Type REAL (Floating-Point Numbers) ........................................................ 558
26.3.2.4 Format of the Data Types WORD and DWORD in Binary Coded Decimal Numbers ............... 562
26.3.2.5 Format of the Data Type S5TIME (Time Duration) .................................................................... 563
26.3.3 Complex Data Types ................................................................................................................. 564
26.3.3.1 Format of the Data Type DATE_AND_TIME ............................................................................. 565
26.3.3.2 Using Complex Data Types ....................................................................................................... 567
26.3.3.3 Using Arrays to Access Data ..................................................................................................... 568
26.3.3.4 Using Structures to Access Data ............................................................................................... 571
26.3.4 Parameter Types........................................................................................................................ 573
26.3.4.1 Format of the Parameter Types BLOCK, COUNTER, TIMER .................................................. 574
26.3.4.2 Format of the Parameter Type POINTER .................................................................................. 574
26.3.4.3 Using the Parameter Type POINTER ........................................................................................ 576
26.3.4.4 Block for Changing the Pointer .................................................................................................. 578
26.3.4.5 Format of the Parameter Type ANY .......................................................................................... 581
26.3.4.6 Using the Parameter Type ANY................................................................................................. 584
26.3.4.7 Assigning Data Types to Local Data of Logic Blocks ................................................................ 587
26.3.4.8 Permitted Data Types when Transferring Parameters .............................................................. 589
26.3.4.9 Transferring to IN_OUT Parameters of a Function Block .......................................................... 594
26.4 Working with Older Projects ....................................................................................................... 595
26.4.1 Converting Version 2 Projects ................................................................................................... 595
26.5 Expanding DP Slaves That Were Created with Previous Versions of STEP 7 ......................... 596
26.5.1 DP-Slaves with Missing or Faulty GSD Files ............................................................................. 597
26.6 Sample Programs ...................................................................................................................... 598
26.6.1 Sample Projects and Sample Programs .................................................................................... 598
26.6.2 Sample Program for an Industrial Blending Process ................................................................. 600
26.6.2.1 Defining Logic Blocks ................................................................................................................. 603
26.6.2.2 Assigning Symbolic Names ....................................................................................................... 604
26.6.2.3 Creating the FB for the Motor .................................................................................................... 606
26.6.2.4 Creating the FC for the Valves ................................................................................................... 611
26.6.2.5 Creating OB1 ............................................................................................................................. 613
26.6.3 Example of Handling Time-of-Day Interrupts ............................................................................. 619
26.6.3.1 Structure of the User Program "Time-of-Day Interrupts" ........................................................... 619
26.6.3.2 FC12 .......................................................................................................................................... 621
26.6.3.3 OB10 .......................................................................................................................................... 623
26.6.3.4 OB1 and OB80 ........................................................................................................................... 625
26.6.4 Example of Handling Time-Delay Interrupts .............................................................................. 627
26.6.4.1 Structure of the User Program "Time-Delay Interrupts"............................................................. 627
26.6.4.2 OB20 .......................................................................................................................................... 629
26.6.4.3 OB1 ............................................................................................................................................ 631
26.6.4.4 Example of Masking and Unmasking Synchronous Errors ....................................................... 633
26.6.4.5 Example of Disabling and Enabling Interrupts and Asynchronous Errors
(SFC39 and SFC40) .................................................................................................................. 637
26.6.4.6 Example of the Delayed Processing of Interrupts and Asynchronous Errors
(SFC41 and SFC42) .................................................................................................................. 638
Programming with STEP 7
18 Manual, 04/2017, A5E41552389-AA
Table of Contents
26.7 Accessing Process and I/O Data Areas ..................................................................................... 639
26.7.1 Accessing the Process Data Area ............................................................................................. 639
26.7.2 Accessing the Peripheral Data Area .......................................................................................... 641
26.8 Setting the Operating Behavior .................................................................................................. 643
26.8.1 Setting the Operating Behavior .................................................................................................. 643
26.8.2 Changing the Behavior and Properties of Modules ................................................................... 644
26.8.3 Updating the Firmware (of the Operating System) in Modules and Submodules Offline .......... 646
26.8.4 Using the Clock Functions ......................................................................................................... 647
26.8.5 Using Clock Memory and Timers ............................................................................................... 648
Index ........................................................................................................................................................... 649
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 19
Table of Contents
Programming with STEP 7
20 Manual, 04/2017, A5E41552389-AA
1 Introducing the Product and Installing the Software
1.1 Overview of STEP 7
What is STEP 7?
STEP 7 is the standard software package used for configuring and programming SIMATIC
programmable logic controllers. It is part of the SIMATIC industry software. There are the following
versions of the STEP 7 Standard package:
• STEP 7 Micro/DOS and STEP 7 Micro/Win for simpler stand-alone applications on the
SIMATIC S7-200.
• STEP 7 for applications on SIMATIC S7-300/S7-400 with a wider range of functions:
- Can be extended as an option by the software products in the SIMATIC Industry Software
(see also Extended Uses of the STEP 7 Standard Package)
- Opportunity of assigning parameters to function modules and communications processors
- Forcing and multicomputing mode
- Global data communication
- Event-driven data transfer using communication function blocks
- Configuring connections
STEP 7 is the subject of this documentation, STEP 7 Micro is described in the "STEP 7
Micro/DOS" documentation.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 21
Introducing the Product and Installing the Software
1.1 Overview of STEP 7
Basic Tasks
When you create an automation solution with STEP 7, there are a series of basic tasks. The
following figure shows the tasks that need to be performed for most projects and assigns them to a
basic procedure. It refers you to the relevant chapter thus giving you the opportunity of moving
through the manual to find task-related information.
Programming with STEP 7
22 Manual, 04/2017, A5E41552389-AA
Introducing the Product and Installing the Software
1.1 Overview of STEP 7
Alternative Procedures
As shown in the figure above, you have two alternative procedures:
• You can configure the hardware first and then program the blocks.
• You can, however, program the blocks first without configuring the hardware. This is
recommended for service and maintenance work, for example, to integrate programmed blocks
into in an existing project.
Brief Description of the Individual Steps
• Install STEP 7 and license keys
The first time you use STEP 7, install it and transfer the license keys from diskette to the hard
disk (see also Installing STEP 7 and Authorization).
• Plan your controller
Before you work with STEP 7, plan your automation solution from dividing the process into
individual tasks to creating a configuration diagram (see also Basic Procedure for Planning an
Automation Project).
• Design the program structure
Turn the tasks described in the draft of your controller design into a program structure using the
blocks available in STEP 7 (see also Blocks in the User Program).
• Start STEP 7
You start STEP 7 from the Windows user interface (see also Starting STEP 7).
• Create a project structure
A project is like a folder in which all data are stored in a hierarchical structure and are available
to you at any time. After you have created a project, all other tasks are executed in this project
(see also Project Structure).
• Configure a station
When you configure the station you specify the programmable controller you want to use; for
example, SIMATIC 300, SIMATIC 400, SIMATIC S5 (see also Inserting Stations).
• Configure hardware
When you configure the hardware you specify in a configuration table which modules you want
to use for your automation solution and which addresses are to be used to access the modules
from the user program. The properties of the modules can also be assigned using parameters
(see also Basic Procedure for Configuring Hardware) .
• Configure networks and communication connections
The basis for communication is a pre-configured network. For this, you will need to create the
subnets required for your automation networks, set the subnet properties, and set the network
connection properties and any communication connections required for the networked stations
(see also Procedure for Configuring a Subnet).
• Define symbols
You can define local or shared symbols, which have more descriptive names, in a symbol table
to use instead of absolute addresses in your user program (see also Creating a Symbol Table).
• Create the program
Using one of the available programming languages create a program linked to a module or
independent of a module and store it as blocks, source files, or charts (see also Basic
Procedure for Creating Logic Blocks and Basic Information on Programming in STL Source
Files).
• S7 only: generate and evaluate reference data
You can make use of these reference data to make debugging and modifying your user
program easier (see also Overview of the Available Reference Data).
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 23
Introducing the Product and Installing the Software
1.1 Overview of STEP 7
• Configure messages
You create block-related messages, for example, with their texts and attributes. Using the
transfer program you transfer the message configuration data created to the operator interface
system database (for example, SIMATIC WinCC, SIMATIC ProTool), see also Configuring
Messages.
• Configure operator control and monitoring variables
You create operator control and monitoring variables once in STEP 7 and assign them the
required attributes. Using the transfer program you transfer the operator control and monitoring
variables created to the database of the operator interface system WinCC (see also
Configuring Variables for Operator Control and Monitoring).
• Download programs to the programmable controller
After all configuration, parameter assignment, and programming tasks are completed, you can
download your entire user program or individual blocks from it to the programmable controller
(programmable module for your hardware solution). (See also Requirements for Downloading.)
The CPU already contains the operating system.
• Test programs
For testing you can either display the values of variables from your user program or a CPU,
assign values to the variables, or create a variable table for the variables that you want to
display or modify (see also Introduction to Testing with the Variable Table).
• Monitor operation, diagnose hardware
You determine the cause of a module fault by displaying online information about a module.
You determine the causes for errors in user program processing with the help of the diagnostic
buffer and the stack contents. You can also check whether a user program can run on a
particular CPU (see also Hardware Diagnostics and Displaying Module Information).
• Document the plant
After you have created a project/plant, it makes sense to produce clear documentation of the
project data to make further editing of the project and any service activities easier (see also
Printing Project Documentation). DOCPRO, the optional tool for creating and managing plant
documentation, allows you to structure the project data, put it into wiring manual form, and print
it out in a common format.
Specialized Topics
When you create an automation solution there are a number of special topics that may be of
interest to you:
• Multicomputing - Synchronous Operation of Several CPUs (see also Multicomputing -
Synchronous Operation of Several CPUs)
• More than One User Working in a Project (see also More than One User Editing Projects)
Programming with STEP 7
24 Manual, 04/2017, A5E41552389-AA
Introducing the Product and Installing the Software
1.2 The STEP 7 Standard Package
1.2 The STEP 7 Standard Package
Standards Used
The SIMATIC programming languages integrated in STEP 7 are compliant with EN 61131-3. The
standard package matches the graphic and object oriented operating philosophy of Windows and
runs under the operating systems MS Windows 7 Ultimate, Professional und Enterprise (64-bit),
MS Windows 10 Pro and Enterprise (64-bit) as well as MS Windows Server 2008 R2 SP1, 2012 R2
und 2016 (each 64-bit).
Functions of the standard package
The standard software supports you in all phases of the creation process of an automation task,
such as:
• Setting up and managing projects
• Configuring and assigning parameters to hardware and communications
• Managing symbols
• Creating programs, for example, for S7 programmable controllers
• Downloading programs to programmable controllers
• Testing the automation system
• Diagnosing plant failures
The STEP 7 software user interface has been designed to meet the latest state-of-the-art
ergonomics and makes it easy for you to get started.
The documentation for the STEP 7 software product provides all the information online in the online
Help and in electronic manuals in PDF format.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 25
Introducing the Product and Installing the Software
1.2 The STEP 7 Standard Package
Applications in STEP 7
The STEP 7 Standard package provides a series of applications (tools) within the software:
You do not need to open the tools separately; they are started automatically when you select the
corresponding function or open an object.
Programming with STEP 7
26 Manual, 04/2017, A5E41552389-AA
Introducing the Product and Installing the Software
1.2 The STEP 7 Standard Package
SIMATIC Manager
The SIMATIC Manager manages all the data that belong to an automation project. The tools
needed to edit the selected data are started automatically by the SIMATIC Manager.
Symbol Editor
With the Symbol Editor you manage all the shared symbols. The following functions are available:
• Setting symbolic names and comments for the process signals (inputs/outputs), bit memory,
and blocks
• Sort functions
• Import/export to/from other Windows programs
The symbol table created with this tool is available to all the other tools. Any changes to the
properties of a symbol are therefore recognized automatically by all tools.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 27
Introducing the Product and Installing the Software
1.2 The STEP 7 Standard Package
Diagnosing Hardware
These functions provide you with an overview of the status of the programmable controller. An
overview can display symbols to show whether every module has a fault or not. A double-click on
the faulty module displays detailed information about the fault. The scope of this information
depends on the individual module:
• Display general information about the module (for example, order number, version, name) and
the status of the module (for example, faulty)
• Display the module faults (for example, channel fault) for the central I/O and DP slaves
• Display messages from the diagnostic buffer
For CPUs the following additional information is displayed:
• Causes of faults in the processing of a user program
• Display the cycle duration (of the longest, shortest, and last cycle)
• MPI communication possibilities and load
• Display performance data (number of possible inputs/outputs, bit memory, counters, timers,
and blocks)
Programming Languages
The programming languages Ladder Logic, Statement List, and Function Block Diagram for S7-300
and S7-400 are an integral part of the standard package.
• Ladder Logic (or LAD) is a graphic representation of the STEP 7 programming language. Its
syntax for the instructions is similar to a relay ladder logic diagram: Ladder allows you to track
the power flow between power rails as it passes through various contacts, complex elements,
and output coils.
• Statement List (or STL) is a textual representation of the STEP 7 programming language,
similar to machine code. If a program is written in Statement List, the individual instructions
correspond to the steps with which the CPU executes the program. To make programming
easier, Statement List has been extended to include some highlevel language constructions
(such as structured data access and block parameters).
• Function Block Diagram (FBD) is a graphic representation of the STEP 7 programming
language and uses the logic boxes familiar from Boolean algebra to represent the logic.
Complex functions (for example, math functions) can be represented directly in conjunction
with the logic boxes.
Other programming languages are available as optional packages.
Programming with STEP 7
28 Manual, 04/2017, A5E41552389-AA
Introducing the Product and Installing the Software
1.2 The STEP 7 Standard Package
Hardware Configuration
You use this tool to configure and assign parameters to the hardware of an automation project. The
following functions are available:
• To configure the programmable controller you select racks from an electronic catalog and
arrange the selected modules in the required slots in the racks.
• Configuring the distributed I/O is identical to the configuration of the central I/O.
• In the course of assigning parameters to the CPU you can set properties such as startup
behavior and scan cycle time monitoring guided by menus. Multicomputing is supported. The
data entered are stored in system data blocks.
• In the course of assigning parameters to the modules, all the parameters you can set are set
using dialog boxes. There are no settings to be made using DIP switches. The assignment of
parameters to the modules is done automatically during startup of the CPU. This means, for
example, that a module can be exchanged without assigning new parameters.
• Assigning parameters to function modules (FMs) and communications processors (CPs) is also
done within the Hardware Configuration tool in exactly the same way as for the other modules.
Module-specific dialog boxes and rules exist for every FM and CP (included in the scope of the
FM/CP function package). The system prevents incorrect entries by only offering valid options
in the dialog boxes.
NetPro (Network Configuration)
Using NetPro time-driven cyclic data transfer via the MPI is possible where you:
• Select the communication nodes
• Enter the data source and data target in a table; all blocks (SDBs) to be downloaded are
generated automatically and completely downloaded to all CPUs automatically
Event-driven data transfer is also possible where you:
• Set the communication connections
• Select the communication or function blocks from the integrated block library
• Assign parameters to the selected communication or function blocks in your chosen
programming language
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 29
Introducing the Product and Installing the Software
1.3 What's New in STEP 7, Version 5.6?
1.3 What's New in STEP 7, Version 5.6?
The following subject areas have been updated:
• Operating Systems
• Configuring and Diagnosing Hardware
• System Diagnostics
• SIMATIC_Manager
• Checking Block Consistency
Operating systems
• The operating systems MS Windows 10 Pro and Enterprise MS Windows Server 2012 and MS
Windows Server 2016 are supported as of STEP 7 V5.6. You can find more detailed
information on this in the accompanying file "Readme.rtf".
Configuring and Diagnosing Hardware
• As of STEP 7 V5.6, you can update the firmware for CPUs 410 as of V8.2 in two separate
steps. You can find more detailed information on this under Online Update of the Firmware for
Modules.
System Diagnostics
• As of STEP 7 V5.6, you can read out security events for CPU 410-5H as of firmware version
V8.2 and save them on your PG/PC via the "Save Security Events" dialog box.
• In STEP 7 V5.6, the "Process Objects" tab of the module status is renamed to "SEC" (SEC
means System Expansion Card.), and further properties are dsplayed for the license status.
SIMATIC Manager
• As of STEP 7 V5.6, the number of selected objects is shown in the status bar.
Checking Block Consistency
• As of STEP 7 V5.6, you can perform an extended consistency check with symbolic addressing.
You can find more detailed information on this in the help for block consistency under the entry
"Extended consistency check".
Programming with STEP 7
30 Manual, 04/2017, A5E41552389-AA
Introducing the Product and Installing the Software
1.4 Extended Uses of the STEP 7 Standard Package
1.4 Extended Uses of the STEP 7 Standard Package
The standard package can be extended by optional software packages that are grouped into the
following three software classes:
• Engineering Tools;
these are higher-level programming languages and technology-oriented software.
• Run-Time Software;
these contain off-the-shelf run-time software for the production process.
• Human Machine Interfaces (HMI);
this is software especially for operator control and monitoring.
The following table shows the optional software you can use depending on your programmable
control system:
S7-300
S7-400
Engineering Tools
• Borland C/C++
1)
• CFC +
• DOCPRO +
• HARDPRO +
1)
• S7-GRAPH +
• S7-HiGraph +
• S7-PDIAG +
• S7-PLCSIM +
• S7-SCL +
• TeleService +
Runtime Software
• Fuzzy Control +
• Modular PID Control +
• • PRODAVE MPI +
• PC-DDE-Server +
• Standard PID Control +
Human Machine Interface
• ProAgent
• SIMATIC ProTool
• SIMATIC ProTool/Lite
• SIMATIC WinCC
o = absolutely required
+ = optional
1)
= recommended as of S7-400
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 31
Introducing the Product and Installing the Software
1.4 Extended Uses of the STEP 7 Standard Package
1.4.1 Engineering Tools
Engineering Tools are task-oriented tools that can be used to extend the standard package.
Engineering Tools include:
• High-level languages for programmers
• Graphic languages for technical staff
• Supplementary software for diagnostics, simulation, remote maintenance, plant documentation
etc.
High-Level Languages
The following languages are available as optional packages for use in programming the SIMATIC
S7-300/S7400 programmable logic controllers:
• S7 GRAPH is a programming language used to program sequential controls (steps and
transitions). In this language, the process sequence is divided into steps. The steps contain
actions to control the outputs. The transition from one step to another is controlled by switching
conditions.
• S7 HiGraph is a programming language used to describe asynchronous, nonsequential
processes in the form of state graphs. To do this, the plant is broken down into individual
functional units which can each take on different states. The functional units can be
synchronized by exchanging messages between the graphs.
• S7 SCL is a high-level text-based language to EN 61131-3 (IEC 1131-3). It contains language
constructs similar to those found in the programming languages C and Pascal. S7 SCL is
therefore particularly suitable for users familiar with highlevel language programming. S7 SCL
can be used, for example, to program complex or frequently recurring functions.
Programming with STEP 7
32 Manual, 04/2017, A5E41552389-AA
Introducing the Product and Installing the Software
1.4 Extended Uses of the STEP 7 Standard Package
Graphic Language
CFC for S7 is a programming language for interconnecting functions graphically. These functions
cover a wide range of simple logic operations through to complex controls and control circuits. A
large number of such function blocks are available in the form of blocks in a library. You program
by copying the blocks into a chart and interconnecting the blocks with connecting lines.
Supplementary Software
• With DOCPRO you can organize all configuration data created under STEP 7 into wiring
manuals. These wiring manuals make it easy to manage the configuration data and allow the
information to be prepared for printing according to specific standards.
• HARDPRO is the hardware configuration system for S7-300 with user support for large-scale
configuration of complex automation tasks.
• You can use S7 PLCSIM (S7 only) to simulate S7 programmable controllers connected to the
programming device or PC for purposes of testing.
• S7 PDIAG (S7 only) allows standardized configuration of process diagnostics for SIMATIC S7-
300/S7-400. Process diagnostics let you detect faults and faulty states of PLC I/O (for example,
limit switch not reached).
• TeleService is a solution providing functions for online programming and servicing of remote
S7 PLCs via the telecommunications network with your PG/PC.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 33
Introducing the Product and Installing the Software
1.4 Extended Uses of the STEP 7 Standard Package
1.4.2 Run-Time Software
Runtime software provides ready-to-use solutions you can call in user program and is directly
implemented in the automation solution. It includes:
• Controllers for SIMATIC S7, for example, standard, modular and fuzzy logic control
• Tools for linking the programmable controllers with Windows applications
Controllers for SIMATIC S7
• Standard PID Control allows you to integrate closed-loop controllers, pulse controllers, and
step controllers into the user program. The parameter assignment tool with integrated controller
setting allows you to set the controller up for optimum use in a very short time.
• Modular PID Control comes into play if a simple PID controller is not sufficient to solve your
automation task. You can interconnect the included standard function blocks to create almost
any controller structure.
• With Fuzzy Control you can create fuzzy logic systems. These systems are used if the
mathematical definition of processes is impossible or highly complex, if processes and
sequencers do not react as expected, if linearity errors occur and if, on the other hand,
information on the process is available.
Tools for Linking with Windows
• PRODAVE MPI is a toolbox for process data traffic between a PC and S7/M7/C7. It
automatically controls the data flow across the MPI interface.
Programming with STEP 7
34 Manual, 04/2017, A5E41552389-AA
Introducing the Product and Installing the Software
1.4 Extended Uses of the STEP 7 Standard Package
1.4.3 Human Machine Interface
Human Machine Interface (HMI) is a software especially designed for operator control and
monitoring in SIMATIC.
• The open process visualization systems SIMATIC WinCC and SIMATIC WinCC flexible are
basic systems that are not restricted to specific industrial sectors or technology and provide all
the important operator control and monitoring functions.
• SIMATIC ProTool and SIMATIC ProTool/Lite are modern tools for configuring SIMATIC
operator panels (OPs).
• ProAgent is a diagnostics software that acquires information on the location and cause of
errors in plants and machinery and thus offers fast and aimed process diagnostics.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 35
Introducing the Product and Installing the Software
1.4 Extended Uses of the STEP 7 Standard Package
Programming with STEP 7
36 Manual, 04/2017, A5E41552389-AA
2 Installation
2.1 Automation License Manager
2.1.1 User Rights Through The Automation License Manager
Automation License Manager
To use STEP 7 programming software, you require a product-specific license key (user rights).
Starting with STEP 7 V5.3, this key is installed with the Automation License Manager.
The Automation License Manager is a software product from Siemens AG. It is used to manage the
license keys (license modules) for all systems.
The Automation License Manager is located in the following places:
• On the installation device for a software product requiring a license key
• On a separate installation device
• As a download from the Internet page of A&D Customer Support at Siemens AG
The Automation License Manager has its own integrated online help. To obtain help after the
license manager is installed, press F1 or select the Help > Help on License Manager. This online
help contains detailed information on the functionality and operation of the Automation License
Manager.
Licenses
Licenses are required to use STEP 7 program packages whose legal use is protected by licenses.
A license gives the user a legal right to use the product. Evidence of this right is provided by the
following:
• The CoL (Certificate of License), and
• The license key
Certificate of License (CoL)
The "Certificate of License" that is included with a product is the legal evidence that a right to use
this product exists. This product may only be used by the owner of the Certificate of License (CoL)
or by those persons authorized to do so by the owner.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 37
Installation
2.1 Automation License Manager
License Keys
The license key is the technical representation (an electronic "license stamp") of a license to use
software.
SIEMENS AG issues a license key for all of its software that is protected by a license. When the
computer has been started, such software can only be used in accordance with the applicable
license and terms of use after the presence of a valid license key has been verified.
Notes
• You can use the standard software without a license key to familiarize yourself with the user
interface and functions.
• However, a license is required and necessary for full, unrestricted use of the STEP 7 software
in accordance with the license agreement
• If you have not installed the license key, you will be prompted to do so at regular intervals.
License Keys can be stored and transferred among various types of storage devices as follows:
• On license key diskettes or USB memory stick
• On the local hard disk
• On network hard disk
If software products for which no license is available are installed, you can then determine which
license key is needed and order it as required.
For further information on obtaining and using license keys, please refer to the online help for the
Automation License Manager.
Programming with STEP 7
38 Manual, 04/2017, A5E41552389-AA
Installation
2.1 Automation License Manager
Types of Licenses
The following different types of application-oriented user licenses are available for software
products from Siemens AG. The actual behavior of the software is determined by which type
license key is installed for it. The type of use can be found on the accompanying Certificate of
License.
License Type Description
Single License The software can be used on any single computer desired for an unlimited
amount of time.
Floating License The software can be used on a computer network ("remote use") for an
unlimited amount of time.
Trial License The software can be used subject to the following restrictions:
• A period of validity of up to a maximum of 14 days,
• A total number of operating days after the day of first use,
• A use for tests and validation (exemption from liability).
Rental License The software can be used subject to the following restrictions:
• A period of validity of up to a maximum of 50 hours.
Upgrade License Certain requirements in the existing system may apply with regard to software
upgrades:
• An upgrade license may be used to convert an "old version X" of the
software to a newer version X+.
• An upgrade may be necessary due to an increase in the volume of data
being handled in the given system.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 39
Installation
2.1 Automation License Manager
2.1.2 Installing the Automation License Manager
The Automation License Manager is installed by means of an MSI setup process. The installation
software for the Automation License Manager is included on the STEP 7 product DVD.
You can install the Automation License Manager at the same time you install STEP 7 or at a later
time.
.
Notes
For detailed information on how to install the Automation License Manager, please refer to the current
Readme file
The online help for the Automation License Manager contains all the information you need on the function and
handling of License Keys.
Subsequent installation of license keys
If you start the STEP 7 software and no license keys are available, a warning message indicating
this condition will be displayed.
Notes
• You can use the standard software without a license key to familiarize yourself with the user
interface and functions.
• However, a license is required and necessary for full, unrestricted use of the STEP 7 software
in accordance with the license agreement
If you have not installed the license key, you will be prompted to do so at regular intervals.
You can subsequently install license keys in the following ways:
• Install license keys from diskettes or USB memory stick
• Install license keys downloaded from the Internet. In this case, the license keys must be
ordered first.
• Use floating license keys available in a network
For detailed information on installing license keys, refer to the online help for the Automation
License Manager. To access this help, press F1 or select the Help > Help on License Manager
menu command.
Notes
In Windows XP/Server 2003, license keys will only be operational if they are installed on a local hard disk and
have write-access status.
Floating licenses can also be used within a network ("remote" use).
Programming with STEP 7
40 Manual, 04/2017, A5E41552389-AA
Installation
2.1 Automation License Manager
2.1.3 Guidelines for Handling License Keys
! Caution
Please note the information on handling license keys that is available in the online help on the
Automation License Manager and also in the STEP 7 Readme file on the installation DVD. If you
do not follow these guidelines, the license keys may be irretrievably lost.
To access online help for the Automation License Manager, press F1 for context-sensitive help or
select the Help > Help on License Manager menu command.
This help section contains all the information you need on the function and handling of license
keys.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 41
Installation
2.2 Installing STEP 7
2.2 Installing STEP 7
The STEP 7 Setup program performs an automatic installation. The complete installation
procedure is menu controlled. Execute Setup using the standard Windows XP/7/Server 2003
software installation procedure.
The major stages in the installation are:
• Copying the data to your programming device
• Configuration of EPROM and communication drivers
• Installing the license keys (if desired)
Note
Siemens programming devices are shipped with the STEP 7 software on the hard disk ready for
installation.
Installation requirements
• Operating system:
MS Windows 7 Professional and Enterprise (standard installation).
• Basic hardware:
Programming device or PC with:
• Pentium processor (600 MHz)
• At least 512 MB RAM.
• Color monitor, keyboard and mouse, all of which are supported by Microsoft Windows
A programming device (PG) is a PC with a special compact design for industrial use. It is fully
equipped for programming SIMATIC PLCs.
• Hard disk space:
Refer to the Readme file for information on required hard disk space.
• MPI interface (optional):
An MPI interface is only required to interconnect the PG/PC and the PLC if you want to use it
for communication with the PLC under STEP 7.
In this case you require:
• A PC USB adapter that is connected to the communications port of your device, or
• An MPI module (for example, CP 5611) that is installed in your device.
Programming with STEP 7
42 Manual, 04/2017, A5E41552389-AA
Installation
2.2 Installing STEP 7
PGs are supplied with an MPI interface.
• External prommer (optional)
An external prommer is only required if you want to program EPROMs with a PC.
Note
Refer to the information on STEP 7 installation in the Readme file and the "List of SIMATIC
Software Packages compatible to the versions of the standard STEP 7 software package."
The readme file and the compatibility list is found, for example under MS Windows 7 via the Start
menu, under Start > All Programs > Siemens Automation > Documentation.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 43
Installation
2.2 Installing STEP 7
2.2.1 Installation Procedure
Starting the Installation Program
To install the software, proceed as follows:
1. Insert the DVD and double click on the file "SETUP.EXE".
2. Follow the on-screen step-by-step instructions of the installation program.
The program guides you through all steps of the installation. You can go to the next step or return
to the previous step.
During installation, the dialog boxes prompt you to make your choice from the displayed options.
The following notes will help you to quickly and easily find the right answers.
If a Version of STEP 7 Is Already Installed...
If Setup detects another version of STEP 7 on the programming device, a corresponding message
is displayed. You can then choose to:
• Abort the installation (so that you can uninstall the old STEP 7 version under Windows and
then restart Setup, or
• Continue Setup and overwrite the previous version.
For well organized software management you should always uninstall any older versions before
installing the new version. the disadvantage of overwriting previous versions with a new version is
that when you subsequently uninstall the old software version some components of the old version
may not be removed.
Selecting the Installation Options
You have three was to select the scope of the installation:
• Standard setup: all dialog languages for the user interface, all applications, and all examples.
Refer to the current Product Information for information on memory space required for this type
of configuration.
• Basic setup: only one dialog language, no examples. Refer to the current Product Information
for information on memory space required for this type of configuration.
• Userdefined ("custom") setup: you can determine the scope of the installation, e.g. the
programs, databases, examples, and communication functions.
ID Number
You will be prompted during setup to enter an ID number (found on the Software Product
Certificate or on your license key storage medium).
Installing License Keys
During setup, the program checks to see whether a corresponding license key is installed on the
hard disk. If no valid license key is found, a message stating that the software can be used only
with a license key is displayed. If you want, you can install the license key immediately or continue
setup and then install the key later. If you want to install the license key now, insert the
authorization diskette or use the A&D license stick when prompted to do so.
Programming with STEP 7
44 Manual, 04/2017, A5E41552389-AA
Installation
2.2 Installing STEP 7
PG/PC Interface Settings
During installation, a dialog box is displayed where you can assign parameters to the programming
device/PC interface. You will find more information on it in "Setting the PG/PC Interface."
Assigning Parameters to Memory Cards
During installation, a dialog box is displayed where you can assign parameters to Memory Cards.
• You do not need an EPROM driver if you are not using any Memory Cards . Select the option
"No EPROM Driver".
• Otherwise, select the entry which applies to your PG.
• If you are using a PC, you can select a driver for an external prommer. Here you must specify
the port to which the prommer is connected (for example, LPT1).
You can change the set parameters after installation by calling the program "Memory Card
Parameter Assignment" in the STEP 7 program group or in the Control Panel.
Flash-File Systems
In the dialog box for assigning memory card parameters, you can select to install a flashfile
system.
The flashfile system is required, for example under SIMATIC M7 when you write individual files to
an EPROM memory card without changing other contents of the Memory Card.
If you are using a suitable programming device (PG 720/PG 740/PG 760, Field PG and Power PG)
or external prommer and you want to use this function, install the flashfile system.
If Errors Occur during the Installation
Setup may be cancelled due to the following errors:
• If an initialization error occurs immediately after the start of Setup, more than likely setup was
not started under Windows.
• Insufficient hard disk space: For the basic software, you require approximately 650 MB to 900
MB of free space on your hard disk depending on the scope of your installation.
• Bad DVD: If the DVD is faulty, please contact your local Siemens representative.
• Operator error: Restart setup follow the instructions carefully.
After the installation has been completed…
An on-screen message reports the successful installation.
If any changes were made to system files during the installation, you are prompted to restart
Windows. After this restart (warm restart) you can start the STEP 7 application, the SIMATIC
Manager.
After successful installation, a program group for STEP 7 has been set up.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 45
Installation
2.2 Installing STEP 7
2.2.2 Setting the PG/PC Interface
Here you configure the communication between the PG/PC and the PLC. During installation, you
are displayed a dialog for assigning parameters to the PG/PC interface. You can also open this
dialog box after installation, by calling the program "Setting PG/PC Interface" in the STEP 7
program group. This enables you to modify the interface parameters at a later time, independently
of the installation.
Basic Procedure
To operate an interface, you will require the following:
• Configurations in the operating system
• A suitable interface configuration
If you are using a PC with an MPI card or communications processors (CP), you should check the
interrupt and address assignments in the Windows "Control Panel" to ensure that there are no
interrupt conflicts and no address areas overlap.
In Windows 2000, Windows XP and Server 2003, the ISA component MPI-ISA card is no longer
supported and therefore no longer offered for installation.
In order to make it easier to assign parameters to the programming device/PC interface, a dialog
box will display a selection list of default basic parameter sets (interface configurations).
Assigning Parameters to the PG/PC Interface
Procedure (Detail are found in the Online Help):
1. Doubleclick on "Setting PG/PC Interface" in the "Control Panel" of Windows.
2. Set the "Access Point of Application" to "S7ONLINE."
3. In the list "Interface parameter set used", select the required interface parameter set. If the
required interface parameter set is not displayed, you must first install a module or protocol via
the "Select" button. The interface parameter set is then generated automatically. On plug-and-
play systems, you can not install plug and play CPs manually (CP 5611 and CP 5511). They
are integrated automatically in "Setting PG/PC Interface" after you have installed the hardware
in your PG/PC.
- If you select an interface which is capable of automatic recognition of bus parameters
(for example, CP 5611 (Auto)), you can connect the programming device or the PC to the
MPI or PROFIBUS without having to set bus parameters. If the transmission rate is < 187.5
Kbps, there may be a delay of up to one minute while the bus parameters are read.
Requirement for automatic recognition: Masters who broadcast bus parameters
cyclically are connected to the bus. All new MPI components do this; for PROFIBUS
subnets the cyclic broadcast of bus parameters must be enabled (default PROFIBUS
network setting).
4. If you select an interface which does not automatically recognize the bus parameters, you
can display the properties and adapt them to match the subnet.
Programming with STEP 7
46 Manual, 04/2017, A5E41552389-AA
Installation
2.2 Installing STEP 7
Changes will also be necessary if conflicts with other settings arise (for example, interrupt or
address assignments). In this case, make the appropriate changes with the hardware recognition
and Control Panel in Windows (see below).
! Caution
Do not remove any "TCP/IP" parameters from your interface configuration.
This could cause malfunctioning of other applications.
Checking the Interrupt and Address Assignments
If you use a PC with an MPI card, you should always check whether the default interrupt and the
default address area are free.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 47
Installation
2.3 Uninstalling STEP 7
2.3 Uninstalling STEP 7
Use the standard Windows method to uninstall STEP 7:
1. Double-click on the "Add/Remove Programs" icon in the "Control Panel." to start the Windows
software installation dialog box.
2. Select the STEP 7 entry in the displayed list of installed software. Click the button to
"Add/Remove" the software.
3. If the "Remove Shared File" dialog box appears, click the "No" button if you are uncertain.
2.4 User Rights
Specifying Access Rights in the Operating System
When you install STEP 7, the user group "Siemens TIA Engineer" is created automatically. This
allows the users entered there to configure the PG/PC interface and to install selected Hardware
Support Packages. To allow manual IP configuration (for PROFINET without DHCP), the user must
also be included in the "Network Configuration Operators" group that is preinstalled by the
operating system.
These rights can only be assigned to the user by the administrator.
Including users in the user groups "Siemens TIA Engineer" and "Network Configuration
Operators"
Enter the local users who can access STEP 7 with their login in the "Siemens TIA Engineer" group.
Follow the steps below:
1. Open the Control Panel in Windows and select "User Accounts".
2. In the navigation window, select the entry "Manage User Accounts."
3. In the "Advanced" tab, select the "Advanced" entry in the "Advanced User Management"
section.
4. In the navigation window, select the entry "Local Users and Groups > Users". All users are
displayed in the data window.
5. Using the context menu, open the "New User" and create an account with the same login for
every user that needs to access STEP 7.
6. Select the "Properties" context menu command for each user you create.
7. In the dialog box that opens, select the "Member of" and the click the "Add..." button.
8. In the "Select Groups" dialog, enter the user group "Siemens TIA Engineer" in the "Enter the
object names to select" box and confirm with "OK".
9. Follow the same procedure for the users to be included in the "Network Configuration
Operators" user group.
Programming with STEP 7
48 Manual, 04/2017, A5E41552389-AA
Installation
2.4 User Rights
Creating the global domain user group "Siemens TIA Engineer"
When working in a domain, you have the alternative of creating a global domain user group that is
then mapped to the local user groups "Siemens TIA Engineer" and "Network Configuration
Operators".
The following requirements must be met first:
• The domain administrator has created a global domain user group.
• The domain administrator has included the users with whose login STEP 7 can be accessed in
the global domain user group.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 49
Installation
2.4 User Rights
Programming with STEP 7
50 Manual, 04/2017, A5E41552389-AA
3 Working Out the Automation Concept
3.1 Basic Procedure for Planning an Automation Project
This chapter outlines the basic tasks involved in planning an automation project for a
programmable controller (PLC). Based on an example of automating an industrial blending
process, you are guided step by step through the procedure.
There are many ways of planning an automation project. The basic procedure that you can use for
any project is illustrated in the following figure.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 51
Working Out the Automation Concept
3.2 Dividing the Process into Tasks and Areas
3.2 Dividing the Process into Tasks and Areas
An automation process consists of a number of individual tasks. By identifying groups of related
tasks within a process and then breaking these groups down into smaller tasks, even the most
complex process can be defined.
The following example of an industrial blending process can be used to illustrate how to organize a
process into functional areas and individual tasks:
Programming with STEP 7
52 Manual, 04/2017, A5E41552389-AA
Working Out the Automation Concept
3.2 Dividing the Process into Tasks and Areas
Determining the Areas of a Process
After defining the process to be controlled, divide the project into related groups or areas:
As each group is divided into smaller tasks, the tasks required for controlling that part of the
process become less complicated.
In our example of an industrial blending process you can identify four distinct areas (see table
below). In this example, the area for ingredient A contains the same equipment as the area for
ingredient B.
Functional Area Equipment Used
Ingredient A Feed pump for ingredient A
Inlet valve for ingredient A
Feed valve for ingredient A
Flow sensor for ingredient A
Ingredient B Feed pump for ingredient B
Inlet valve for ingredient B
Feed valve for ingredient B
Flow sensor for ingredient B
Mixing tank Agitator motor
Switch for tank level measurement
Drain Drain valve
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 53
Working Out the Automation Concept
3.3 Describing the Individual Functional Areas
3.3 Describing the Individual Functional Areas
As you describe each area and task within your process, you define not only the operation of each
area, but also the various elements that control the area. These include:
• Electrical, mechanical, and logical inputs and outputs for each task
• Interlocks and dependencies between the individual tasks
The sample industrial blending process uses pumps, motors, and valves. These must be described
precisely to identify the operating characteristics and type of interlocks required during operation.
The following tables provide examples of the description of the equipment used in an industrial
blending process. When you have completed description, you could also use it to order the
required equipment.
Ingredients A/B: Feed Pump Motors
The feed pump motors convey ingredients A and B to the mixing tank.
• Flow rate: 400 l (100 gallons) per minute
• Rating: 100 kW (134 hp) at 1200 rpm
The pumps are controlled (start/stop) from an operator station located near the mixing tank. The number of
starts is counted for maintenance purposes. Both the counters and the display can be reset with one button.
The following conditions must be satisfied for the pumps to operate:
• The mixing tank is not full.
• The drain valve of the mixing tank is closed.
• The emergency off is not activated.
The pumps are switched off if the following condition is satisfied:
• The flow sensor signals no flow 7 seconds after the pump motor is started.
• The flow sensor signals that the flow has ceased.
Ingredients A/B: Inlet and Feed Valves
The inlet and feed valves for ingredients A and B allow or prevent the flow of the ingredients into the mixing
tank. The valves have a solenoid with a spring return.
• When the solenoid is activated, the valve is opened.
• When the solenoid is deactivated, the valve is closed.
The inlet and feed valves are controlled by the user program.
For the valves to be activated, the following condition must be satisfied:
• The feed pump motor has been running for at least 1 second.
The pumps are switched off if the following condition is satisfied:
• The flow sensor signals no flow.
Programming with STEP 7
54 Manual, 04/2017, A5E41552389-AA
Working Out the Automation Concept
3.3 Describing the Individual Functional Areas
Agitator Motor
The agitator motor mixes ingredient A with ingredient B in the mixing tank.
• Rating: 100 kW (134 hp) at 1200 rpm
The agitator motor is controlled (start/stop) from an operator station located near the mixing tank. The
number of starts is counted for maintenance purposes. Both the counters and the display can be reset with
one button.
The following conditions must be satisfied for the pumps to operate:
• The tank level sensor is not signaling "Tank below minimum."
• The drain valve of the mixing tank is closed.
• The emergency off is not activated.
The pumps are switched off if the following condition is satisfied:
• The tachometer does not indicate that the rated speed has been reached within 10 seconds of starting
the motor.
Drain Valve
The drain valve allows the mixture to drain (using gravity feed) to the next stage in the process. The valve
has a solenoid with a spring return.
• If the solenoid is activated, the outlet valve is opened.
• If the solenoid is deactivated, the outlet valve is closed.
The outlet valve is controlled (open/close) from an operator station.
The drain valve can be opened under the following conditions:
• The agitator motor is off.
• The tank level sensor is not signaling "Tank empty."
• The emergency off is not activated.
The pumps are switched off if the following condition is satisfied:
• The tank level sensor is indicating "Tank empty."
Switches for Tank Level Measurement
The switches in the mixing tank indicate the level in the tank and are used to interlock the feed pumps and
the agitator motor.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 55
Working Out the Automation Concept
3.4 Listing Inputs, Outputs, and In/Outs
3.4 Listing Inputs, Outputs, and In/Outs
After writing a physical description of each device to be controlled, draw diagrams of the inputs and
outputs for each device or task area.
These diagrams correspond to the logic blocks to be programmed.
3.5 Creating an I/O Diagram for the Motors
Two feed pumps and one agitator are used in our example of an industrial blending process. Each
motor is controlled by its own "motor block" that is the same for all three devices. This block
requires six inputs: two to start or stop the motor, one to reset the maintenance display, one for the
motor response signal (motor running / not running), one for the time during which the response
signal must be received, and one for the number of the timer used to measure the time.
The logic block also requires four outputs: two to indicate the operating state of the motor, one to
indicate faults, and one to indicate that the motor is due for maintenance.
An in/out is also necessary to activate the motor. It is used to control the motor but at the same
time is also edited and modified in the program for the "motor block."
Programming with STEP 7
56 Manual, 04/2017, A5E41552389-AA
Working Out the Automation Concept
3.6 Creating an I/O Diagram for the Valves
3.6 Creating an I/O Diagram for the Valves
Each valve is controlled by its own "valve block" that is the same for all valves used. The logic
block has two inputs: one to open the valve and one to close the valve. It also has two outputs: one
to indicate that the valve is open and the other to indicate that it is closed.
The block has an in/out to activate the valve. It is used to control the valve but at the same time is
also edited and modified in the program for the "valve block."
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 57
Working Out the Automation Concept
3.7 Establishing the Safety Requirements
3.7 Establishing the Safety Requirements
Decide which additional elements are needed to ensure the safety of the process - based on legal
requirements and corporate health and safety policy. In your description, you should also include
any influences that the safety elements have on your process areas.
Defining Safety Requirements
Find out which devices require hardwired circuits to meet safety requirements. By definition, these
safety circuits operate independently of the programmable controller (although the safety circuit
generally provides an I/O interface to allow coordination with the user program). Normally, you
configure a matrix to connect every actuator with its own emergency off range. This matrix is the
basis for the circuit diagrams of the safety circuits.
To design safety mechanisms, proceed as follows:
• Determine the logical and mechanical/electrical interlocks between the individual automation
tasks.
• Design circuits to allow the devices belonging to the process to be operated manually in an
emergency.
• Establish any further safety requirements for safe operation of the process.
Creating a Safety Circuit
The sample industrial blending process uses the following logic for its safety circuit:
• One emergency off switch shuts down the following devices independent of the programmable
controller (PLC):
- Feed pump for ingredient A
- Feed pump for ingredient B
- Agitator motor
- Valves
• The emergency off switch is located on the operator station.
• An input to the controller indicates the state of the emergency off switch.
Programming with STEP 7
58 Manual, 04/2017, A5E41552389-AA
Working Out the Automation Concept
3.8 Describing the Required Operator Displays and Controls
3.8 Describing the Required Operator Displays and Controls
Every process requires an operator interface that allows human intervention in the process. Part of
the design specification includes the design of the operator console.
Defining an Operator Console
In the industrial blending process described in our example, each device can be started or stopped
by a pushbutton located on the operator console. This operator console includes indicators to show
the status of the operation (see figure below).
The console also includes display lamps for the devices that require maintenance after a certain
number of starts and the emergency off switch with which the process can be stopped immediately.
The console also has a reset button for the maintenance display of the three motors. Using this,
you can turn off the maintenance display lamps for the motors due for maintenance and reset the
corresponding counters to 0.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 59
Working Out the Automation Concept
3.9 Creating a Configuration Diagram
3.9 Creating a Configuration Diagram
After you have documented the design requirements, you must then decide on the type of control
equipment required for the project.
By deciding which modules you want to use, you also specify the structure of the programmable
controller. Create a configuration diagram specifying the following aspects:
• Type of CPU
• Number and type of I/O modules
• Configuration of the physical inputs and outputs
The following figure illustrates an example of an S7 configuration for the industrial blending
process.
Programming with STEP 7
60 Manual, 04/2017, A5E41552389-AA
4 Basics of Designing a Program Structure
4.1 Programs in a CPU
A CPU will principally run two different programs:
• The operating system and
• The user program.
Operating System
Every CPU comes with an integrated operating system that organizes all CPU functions and
sequences not associated with a specific control task. The tasks of the operating system include
the following:
• Handling restart (warm start) and hot restart
• Update of the process image table of the inputs and output of the process image table of the
outputs
• Calling the user program
• Acquisition of interrupt information and calling interrupt OBs
• Recognition of errors and error handling
• Management of the memory areas
• Communication with programming devices and other communication partners
You can influence CPU reactions in certain areas by modifying the operating system parameters
(operating system default settings).
User Program
You create the user program and download it to the CPU. It contains all the functions required to
process your specific automation task. The tasks of the user program include:
• Specifying the conditions for a restart (warm start) and hot restart on the CPU (for example,
initializing signals with a particular value)
• Processing process data (for example, generating logical links of binary signals, fetching and
evaluating analog signals, specifying binary signals for output, output of analog values)
• Reaction to interrupts
• Handling disturbances in the normal program cycle.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 61
Basics of Designing a Program Structure
4.2 Blocks in the User Program
4.2 Blocks in the User Program
The STEP 7 programming software allows you to structure your user program, in other words to
break down the program into individual, self-contained program sections. This has the following
advantages:
• Extensive programs are easier to understand.
• Individual program sections can be standardized.
• Program organization is simplified.
• It is easier to make modifications to the program.
• Debugging is simplified since you can test separate sections.
• Commissioning your system is made much easier.
The example of an industrial blending process illustrated the advantages of breaking down an
automation process into individual tasks. The program sections of a structured user program
correspond to these individual tasks and are known as the blocks of a program.
Block Types
There are several different types of blocks you can use within an S7 user program:
Block Brief Description of Function See Also
Organization blocks (OB) OBs determine the structure of the user Organization Blocks and
program. Program Structure
System function blocks (SFB) SFBs and SFCs are integrated in the S7 CPU System Function Blocks
and system functions (SFC) and allow you access to some important (SFB) and System
system functions. Functions (SFC)
Function blocks (FB) FBs are blocks with a "memory" which you can Function Blocks (FB)
program yourself.
Functions (FC) FCs contain program routines for frequently Functions (FC)
used functions.
Instance data blocks Instance DBs are associated with the block Instance Data Blocks
(instance DB) when an FB/SFB is called. They are created
automatically during compilation.
Data blocks (DB) DBs are data areas for storing user data. In Shared Data Blocks (DB)
addition to the data that are assigned to a
function block, shared data can also be defined
and used by any blocks.
OBs, FBs, SFBs, FCs, and SFCs contain sections of the program and are therefore also known as
logic blocks. The permitted number of blocks per block type and the permitted length of the blocks
is CPU-specific.
Programming with STEP 7
62 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
4.2.1 Organization Blocks and Program Structure
Organization blocks (OBs) represent the interface between the operating system and the user
program. Called by the operating system, they control cyclic and interruptdriven program
execution, startup behavior of the PLC and error handling. You can program the organization
blocks to determine CPU behavior.
Organization Block Priority
Organization blocks determine the sequence (start events) by which individual program sections
are executed. An OB call can interrupt the execution of another OB. Which OB is allowed to
interrupt another OB depends on its priority. Higher priority OBs can interrupt lower priority OBs.
The background OB has the lowest priority.
Types of Interrupt and Priority Classes
Start events triggering an OB call are known as interrupts. The following table shows the types of
interrupt in STEP 7 and the priority of the organization blocks assigned to them. Not all
organization blocks listed and their priority classes are available in all S7 CPUs (see "S7-300
Programmable Controller, Hardware and Installation Manual" and "S7-400 Programmable
Controller Module Specifications Reference Manual").
Type of Interrupt Organization Block Priority Class See also
(Default)
Main program OB1 1 Organization Block for Cyclic
scan Program Processing (OB1)
Time-of-day OB10 to OB17 2 Time-of-Day Interrupt
interrupts Organization Blocks (OB10 to
OB17)
Time-delay OB20 3 Time-Delay Interrupt Organization
interrupts OB21 4 Blocks (OB20 to OB23)
OB22 5
OB23 6
Cyclic interrupts OB30 7 Cyclic Interrupt Organization
OB31 8 Blocks (OB30 to OB38)
OB32 9
OB33 10
OB34 11
OB35 12
OB36 13
OB37 14
OB38 15
Hardware OB40 16 Hardware Interrupt Organization
interrupts OB41 17 Blocks (OB40 to OB47)
OB42 18
OB43 19
OB44 20
OB45 21
OB46 22
OB47 23
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 63
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Type of Interrupt Organization Block Priority Class See also
(Default)
DPV1 interrupts OB 55 2 Programming DPV1 Devices
OB 56 2
OB 57 2
Multicomputing OB60 Multicomputing 25 Multicomputing - Synchronous
interrupt Operation of Several CPUs
Synchronous cycle OB 61 25 Configuring Short and Equal-
interrupt OB 62 Length Process Reaction Times
on PROFIBUS-DP
OB 63
OB 64
Redundancy OB70 I/O Redundancy Error 25 "Error Handling Organization
errors (only in H systems) Blocks (OB70 to OB87 / OB121
OB72 CPU Redundancy 28 to OB122)"
Error (only in H systems)
2)
Asynchronous OB80 Time Error 26, 28 "Error Handling Organization
errors Blocks (OB70 to OB87 / OB
121 to OB122)"
2)
OB81 Power Supply Error 26, 28 with S7-
OB82 Diagnostic Interrupt 300,
2)
OB83 Insert/Remove Module 25, 28 with S7-
Interrupt 400 and CPU 318
OB84 CPU Hardware Fault
OB85 Program Cycle Error
OB86 Rack Failure
OB87 Communication Error
1)
Background cycle OB90 29 Background Organization Block
(OB90)
2)
Startup OB100 Restart (Warm start) 27 "Start-up Organization Blocks
OB101 Hot Restart 27
2) (OB100/OB101/OB102)"
2)
OB102 Cold Restart 27
Synchronous OB121 Programming Error Priority of the OB Error Handling Organization
errors OB122 Access Error that caused the Blocks (OB70 to OB87 / OB121
error to OB122)
1) The priority class 29 corresponds to priority 0.29. The background cycle has a lower priority than the free cycle.
2) The priority classes 27 and 28 are valid in the priority class model of the startup.
Programming with STEP 7
64 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Changing the Priority
Interrupts can be assigned parameters with STEP 7. With the parameter assignment you can for
example, deselect interrupt OBs or priority classes in the parameter blocks: timeofday interrupts,
timedelay interrupts, cyclic interrupts, and hardware interrupts.
The priority of organization blocks on S7-300 CPUs is fixed.
With S7-400 CPUs (and the CPU 318) you can change the priority of the following organization
blocks with STEP 7:
• OB10 to OB47
• OB70 to OB72 (only H CPUs) and OB81 to OB87 in RUN mode.
The following priority classes are permitted:
• Priority classes 2 to 23 for OB10 to OB47
• Priority classes 2 to 28 for OB70 to OB72
• Priority classes 24 to 26 for OB81 to OB87; for CPUs as of approx. The middle of 2001
(Firmware Version 3.0) the ranges where extended: Priority classes 2 to 26 can be set for OB
81 to OB 84 as well as for OB 86 and OB 87.
You can assign the same priority to several OBs. OBs with the same priority are processed in the
order in which their start events occur.
Error OBs started by synchronous errors are executed in the same priority class as the block being
executed when the error occurred.
Local Data
When creating logic blocks (OBs, FCs, FBs), you can declare temporary local data. The local data
area on the CPU is divided among the priority classes.
On S7-400, you can change the amount of local data per priority class in the "priority classes"
parameter block using STEP 7.
Start Information of an OB
Every organization block has start information of 20 bytes of local data that the operating system
supplies when an OB is started. The start information specifies the start event of the OB, the date
and time of the OB start, errors that have occurred, and diagnostic events.
For example, OB40, a hardware interrupt OB, contains the address of the module that generated
the interrupt in its start information.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 65
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Deselected Interrupt OBs
If you assign priority class 0 or assign less than 20 bytes of local data to a priority class, the
corresponding interrupt OB is deselected. The handling of deselected interrupt OBs is restricted as
follows:
• In RUN mode, they cannot be copied or linked into your user program.
• In STOP mode, they can be copied or linked into your user program, but when the CPU goes
through a restart (warm start) they stop the startup and an entry is made in the diagnostic
buffer.
By deselecting interrupt OBs that you do not require, you increase the amount of local data area
available, and this can be used to save temporary data in other priority classes.
Cyclic Program Processing
Cyclic program processing is the "normal" type of program execution on programmable logic
controllers, meaning the operating system runs in a program loop (the cycle) and calls the
organization block OB1 once in every loop in the main program. The user program in OB1 is
therefore executed cyclically.
Programming with STEP 7
66 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Event-Driven Program Processing
Cyclic program processing can be interrupted by certain events (interrupts). If such an event
occurs, the block currently being executed is interrupted at a command boundary and a different
organization block that is assigned to the particular event is called. Once the organization block has
been executed, the cyclic program is resumed at the point at which it was interrupted.
This means it is possible to process parts of the user program that do not have to be processed
cyclically only when needed. The user program can be divided up into "subroutines" and distributed
among different organization blocks. If the user program is to react to an important signal that
occurs relatively seldom (for example, a limit value sensor for measuring the level in a tank reports
that the maximum level has been reached), the subroutine that is to be processed when the signal
is output can be located in an OB whose processing is event-driven.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 67
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Linear Versus Structured Programming
You can write your entire user program in OB1 (linear programming). This is only advisable with
simple programs written for the S7-300 CPU and requiring little memory.
Complex automation tasks can be controlled more easily by dividing them into smaller tasks
reflecting the technological functions of the process or that can be used more than once. These
tasks are represented by corresponding program sections, known as the blocks (structured
programming).
Programming with STEP 7
68 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
4.2.2 Call Hierarchy in the User Program
For the user program to function, the blocks that make up the user program must be called. This is
done using special STEP 7 instructions, the block calls, that can only be programmed and started
in logic blocks.
Order and Nesting Depth
The order and nesting of the block calls is known as the call hierarchy. The number of blocks that
can be nested (the nesting depth) depends on the particular CPU.
The following figure illustrates the order and nesting depth of the block calls within a scan cycle.
There is a set order for creating blocks:
• You create the blocks from top to bottom, so you start with the top row of blocks.
• Every block that is called must already exist, meaning that within a row of blocks the order for
creating them is from right to left.
• The last block to be created is OB1.
Putting these rules into practice for the example in the figure produces the following sequence for
creating the blocks:
FC1 > FB1 + instance DB1 > DB1 > SFC1 > FB2 + instance DB2 > OB1
Note
If the nesting is too deep (too many levels), the local data stack may overflow (Also refer to Local
Data Stack).
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 69
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Block Calls
The following figure shows the sequence of a block call within a user program. The program calls
the second block whose instructions are then executed completely. Once the second or called
block has been executed, execution of the interrupted block that made the call is resumed at the
instruction following the block call.
Before you program a block, you must specify which data will be used by your program, in other
words, you must declare the variables of the block.
Note
OUT parameters must be described for each block call.
Note
The operating system resets the instances of SFB3 "TP" when a cold restart is performed. If you
want to initialize instances of this SFB after a cold restart, you must call up the relevant instances
of the SFB with PT = 0 ms via OB100. You can do this, for example, by performing an initialization
routine in the blocks which contain instances of the SFB.
Programming with STEP 7
70 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
4.2.3 Block Types
4.2.3.1 Organization Block for Cyclic Program Processing (OB1)
Cyclic program processing is the "normal" type of program execution on programmable logic
controllers. The operating system calls OB1 cyclically and with this call it starts cyclic execution of
the user program.
Sequence of Cyclic Program Processing
The following table shows the phases of cyclic program processing:
Step Sequence in CPUs to 10/98 Sequence in CPUs from 10/98
1 The operating system starts the cycle The operating system starts the cycle
monitoring time. monitoring time.
2 The CPU reads the state of the inputs of the The CPU writes the values from the process
input modules and updates the process image image table of the outputs to the output
table of the inputs. modules.
3 The CPU processes the user program and The CPU reads the state of the inputs of the
executes the instructions contained in the input modules and updates the process image
program. table of the inputs.
4 The CPU writes the values from the process The CPU processes the user program and
image table of the outputs to the output executes the instructions contained in the
modules. program.
5 At the end of a cycle, the operating system At the end of a cycle, the operating system
executes any tasks that are pending, for executes any tasks that are pending, for
example downloading and deleting blocks, example downloading and deleting blocks,
receiving and sending global data. receiving and sending global data.
6 Finally, the CPU returns to the start of the cycle Finally, the CPU returns to the start of the cycle
and restarts the cycle monitoring time. and restarts the cycle monitoring time.
Process Images
So that the CPU has a consistent image of the process signals during cyclic program processing,
the CPU does not address the input (I) and output (Q) address areas directly on the I/O modules
but rather accesses an internal memory area of the CPU that contains an image of the inputs and
outputs.
Programming Cyclic Program Processing
You program cyclic program processing by writing your user program in OB1 and in the blocks
called within OB1 using STEP 7.
Cyclic program processing begins as soon as the startup program is completed without errors.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 71
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Interrupts
Cyclic program processing can be interrupted by the following:
• An interrupt
• A STOP command (mode selector, menu option on the programming device, SFC46 STP,
SFB20 STOP)
• A power outage
• The occurrence of a fault or program error
Scan Cycle Time
The scan cycle time is the time required by the operating system to run the cyclic program and all
the program sections that interrupt the cycle (for example, executing other organization blocks) and
system activities (for example, updating the process image). This time is monitored.
The scan cycle time (TC) is not the same in every cycle. The following figures show different scan
cycle times (TC1 ≠ TC2) for CPUs up to 10/98 and CPUs from 10/98:
In the current cycle, OB1 is interrupted by a timeofday interrupt.
Programming with STEP 7
72 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Cycle Monitoring Time
With STEP 7, you can modify the default maximum cycle monitoring time. If this time expires, the
CPU either changes to STOP mode or OB80 is called in which you can specify how the CPU
should react to this error.
Minimum Cycle Time
With STEP 7, you can set a minimum cycle time for S7-400 CPUs and the CPU 318. This is useful
in the following situations:
• When the interval at which program execution starts in OB1 (main program scan) should
always be the same or
• When the process image tables would be updated unnecessarily often if the cycle time is too
short.
The following figures show the function of the cycle monitoring time in program processing in CPUs
up to 10/98 and in CPUs from 10/98.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 73
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Updating the Process Image
During cyclic program processing by the CPU, the process image is updated automatically. With
the S7-400 CPUs and the CPU 318 you can deselect the update of the process image if you want
to:
• Access the I/O directly instead or
• Update one or more process image input or output sections at a different point in the program
using system functions SFC26 UPDAT_PI and SFC27 UPDAT_PO.
Communication Load
You can use the CPU parameter "Scan Cycle Load from Communication" to control within a given
framework the duration of communication processes that always increase the scan cycle time.
Examples of communication processes include transmitting data to another CPU by means of MPI
or loading blocks by means of a programming device.
Test functions with a programming device are barely influenced by this parameter. However, you
can increase the scan cycle time considerably. In the process mode, you can limit the time set for
test functions (S7-300 only).
Programming with STEP 7
74 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
How the Parameter works
The operating system of the CPU constantly provides the communication with the configured
percent of the entire CPU processing capacity (time slice technique). If this processing capacity is
not needed for the communication, it is available to the rest of the processing.
Effect on the Actual Scan Cycle Time
Without additional asynchronous events, the OB1 scan cycle time is extended by a factor that can
be calculated according to the following formula:
100
100 - "Scan cycle load from communication (%)"
Example 1 (no additional asynchronous events):
When you set the load added to the cycle by communication to 50%, the OB1 scan cycle time can
be doubled.
At the same time, the OB1 scan cycle time is also influenced by asynchronous events (such as
hardware interrupts or cyclic interrupts). From a statistical point of view, even more asynchronous
events occur within an OB1 scan cycle because of the extension of the scan cycle time by the
communication portion. This causes an additional increase in the OB1 scan cycle. This increase
depends on how many events occur per OB1 scan cycle and on the duration of event processing.
Example 2 (additional asynchronous events considered):
For a pure OB1 execution time of 500 ms, a communication load of 50% can result in an actual
scan cycle time of up to 1000 ms (provided that the CPU always has enough communication jobs
to process). If, parallel to this, a cyclic interrupt with 20 ms processing time is executed every 100
ms, this cyclic interrupt would extend the scan cycle by a total of 5*20 ms = 100 ms without
communication load. That is, the actual scan cycle time would be 600 ms. Because a cyclic
interrupt also interrupts communication, it affects the scan cycle time by 10 * 20 ms with 50%
communication load. That is, in this case, the actual scan cycle time amounts to 1200 ms instead
of 1000 ms.
Note
Check the effects of changing the value of the "Scan Cycle Load from Communication" parameter while the
system is running.
The communication load must be taken into account when setting the minimum scan cycle time; otherwise
time errors will occur.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 75
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Recommendations
• Where possible, apply the default value.
• Increase this value only if you are using the CPU primarily for communication purposes and
your user program is not time critical.
• In all other cases, only reduce the value.
• Set the process mode (S7-300 only), and limit the time needed there for test functions.
Programming with STEP 7
76 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
4.2.3.2 Functions (FC)
Functions (FCs) belong to the blocks that you program yourself. A function is a logic block "without
memory." Temporary variables belonging to the FC are saved in the local data stack. This data is
then lost when the FC has been executed. To save data permanently, functions can also use
shared data blocks.
Since an FC does not have any memory of its own, you must always specify actual parameters for
it. You cannot assign initial values for the local data of an FC.
Application
An FC contains a program section that is always executed when the FC is called by a different
logic block. You can use functions for the following purposes:
• To return a function value to the calling block (example: math functions)
• To execute a technological function (example: single control function with a bit logic operation).
Assigning Actual Parameters to the Formal Parameters
A formal parameter is a dummy for the "actual" parameter. Actual parameters replace the formal
parameters when the function is called. You must always assign actual parameters to the formal
parameters of an FC (for example, an actual parameter "I 3.6" to the formal parameter "Start"). The
input, output and in/out parameters used by the FC are saved as pointers to the actual parameters
of the logic block that called the FC.
Important Differences Between the Output Parameters of FCs and FBs
In function blocks (FB), a copy of the actual parameters in the instance DB is used when accessing
the parameters. If an input parameter is not transferred or an output parameter is not write
accessed when a FB is called, the older values still stored in the instance DB /Instance DB =
memory of the FBs) will be used.
Functions (FC) have no memory. Contrary to FBs, the assignment of formal parameters to these
FCs is therefore not optional, but rather essentially. FC parameters are accessed via addresses
(pointers to targets across area boundaries). When an address of the data area (data block) or a
local variable of the calling block is used as actual parameter, a copy of the actual parameter is
saved temporarily to local data area of the calling block for the transfer of the parameter.
Caution
In this case, if no data are written to an OUTPUT parameter in an FC, the block may output random
values!
As the calling block's local data area which is reserved for the copy is not assigned to the OUTPUT
parameter, no data will be written to this area. It will therefore remain unchanged and the random
value stored at this location will be output, because local data are not automatically set to "0" by
default, for example.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 77
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Thus, observe the following points:
• If possible, initialize the OUTPUT parameters.
• Set and reset instructions depend on RLO. When these instructions are used to determine the
value at an OUTPUT parameter, no value is generated if the result of a previous logic
operation (RLO) = 0.
• Always ensure that data are written to the OUTPUT parameters - irrespective of any program
paths in the block. Pay special attention to jump instructions, to the ENO output in LAD and
FBD as well as to BEC (Block End Conditional) and the influence of MCR (Master Control
Relay) instructions.
Note
Although the OUTPUT parameters of an FB or the INOUT parameters of an FC and FB will not
output random values (the old output value - or input value as output value - is going to be
maintained even if no data are written to the parameter) you should still observe the points above
in order to avoid unintentional processing of "old" values.
Programming with STEP 7
78 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
4.2.3.3 Function Blocks (FB)
Function blocks (FBs) belong to the blocks that you program yourself. A function block is a block
"with memory." It is assigned a data block as its memory (instance data block). The parameters
that are transferred to the FB and the static variables are saved in the instance DB. Temporary
variables are saved in the local data stack.
Data saved in the instance DB are not lost when execution of the FB is complete. Data saved in the
local data stack are, however, lost when execution of the FB is completed.
Note
To avoid errors when working with FBs, read Permitted Data Types when Transferring Parameters
in the Appendix.
Application
An FB contains a program that is always executed when the FB is called by a different logic block.
Function blocks make it much easier to program frequently occurring, complex functions.
Function Blocks and Instance Data Blocks
An instance data block is assigned to every function block call that transfers parameters.
By calling more than one instance of an FB, you can control more than one device with one FB. An
FB for a motor type, can, for example, control various motors by using a different set of instance
data for each different motor. The data for each motor (for example, speed, ramping, accumulated
operating time etc.) can be saved in one or more instance DBs.
The following figure shows the formal parameters of an FB that uses the actual parameters saved
in the instance DB.
Variables of the Data Type FB
If your user program is structured so that an FB contains calls for further already existing function
blocks, you can include the FBs to be called as static variables of the data type FB in the variable
declaration table of the calling FB. This technique allows you to nest variables and concentrate the
instance data in one instance data block (multiple instance).
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 79
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Assigning Actual Parameters to the Formal Parameters
It is not generally necessary in STEP 7 to assign actual parameters to the formal parameters of an
FB. There are, however, exceptions to this. Actual parameters must be assigned in the following
situations:
• For an in/out parameter of a complex data type (for example, STRING, ARRAY or
DATE_AND_TIME)
• For all parameter types (for example TIMER, COUNTER, or POINTER)
STEP 7 assigns the actual parameters to the formal parameters of an FB as follows:
• When you specify actual parameters in the call statement: the instructions of the FB use the
actual parameters provided.
• When you do not specify actual parameters in the call statement: the instructions of the FB use
the value saved in the instance DB.
The following table shows which variables of the FB must be assigned actual parameters.
Data Type
Variable Elementary Data Type Complex Data Type Parameter Type
Input No parameter required No parameter required Actual parameter required
Output No parameter required No parameter required Actual parameter required
In/out No parameter required Actual parameter required −
Programming with STEP 7
80 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Assigning Initial Values to Formal Parameters
You can assign initial values to the formal parameters in the declaration section of the FB. These
values are written into the instance DB associated with the FB.
If you do not assign actual parameters to the formal parameters in the call statement, STEP 7 uses
the values saved in the instance DB. These values can also be the initial values that were entered
in the variable declaration table of an FB.
The following table shows which variables can be assigned an initial value. Since the temporary
data are lost after the block has been executed, you cannot assign any values to them.
Data Type
Variable Elementary Data Type Complex Data Type Parameter Type
Input Initial value permitted Initial value permitted −
Output Initial value permitted Initial value permitted −
In/out Initial value permitted − −
Static Initial value permitted Initial value permitted −
Temporary − − −
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 81
Basics of Designing a Program Structure
4.2 Blocks in the User Program
4.2.3.4 Instance Data Blocks
An instance data block is assigned to every function block call that transfers parameters. The
actual parameters and the static data of the FB are saved in the instance DB. The variables
declared in the FB determine the structure of the instance data block. Instance means a function
block call. If, for example, a function block is called five times in the S7 user program, there are
five instances of this block.
Creating an Instance DB
Before you create an instance data block, the corresponding FB must already exist. You specify
the number of the FB when you create the instance data block.
One Instance DB for Each Separate Instance
If you assign several instance data blocks to a function block (FB) that controls a motor, you can
use this FB to control different motors.
The data for each specific motor (for example, speed, runup time, total operating time) are saved
in different data blocks. The DB associated with the FB when it is called determines which motor is
controlled. With this technique, only one function block is necessary for several motors (see the
following figure).
Programming with STEP 7
82 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
One Instance DB for Several Instances of an FB (Multiple Instances)
You can also transfer the instance data for several motors at the same time in one instance DB. To
do this, you must program the calls for the motor controllers in a further FB and declare static
variables with the data type FB for the individual instances in the declaration section of the calling
FB.
If you use one instance DB for several instances of an FB, you save memory and optimize the use
of data blocks.
In the following figure, the calling FB is FB21 "Motor processing," the variables are of data type
FB22, and the instances are identified by Motor_1, Motor_2, and Motor_3.
In this example, FB22 does not need its own instance data block, since its instance data are saved
in the instance data block of the calling FB.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 83
Basics of Designing a Program Structure
4.2 Blocks in the User Program
One Instance DB for Several Instances of Different FBs (Multiple Instances)
In a function block you can call the instances of other existing FBs. You can assign the instance
data required for this to the instance data block of the calling FB, meaning you do not need any
additional data blocks for the called FBs in this case.
For these multiple instances in one instance data block, you must declare static variables with the
data type of the called function block for each individual instance in the declaration section of the
calling function block. The call within the function block does not then require an instance data
block, only the symbolic name of the variable.
In the example in this figure, the assigned instance data are stored in a common instance DB.
Programming with STEP 7
84 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
4.2.3.5 Shared Data Blocks (DB)
In contrast to logic blocks, data blocks do not contain STEP 7 instructions. They are used to store
user data, in other words, data blocks contain variable data with which the user program works.
Shared data blocks are used to store user data that can be accessed by all other blocks.
The size of DBs can vary. Refer to the description of your CPU for the maximum possible size.
You can structure shared data blocks in any way to suit your particular requirements.
Shared Data Blocks in the User Program
If a logic block (FC, FB, or OB) is called, it can occupy space in the local data area (L stack)
temporarily. In addition to this local data area, a logic block can open a memory area in the form of
a DB. In contrast to the data in the local data area, the data in a DB are not deleted when the DB is
closed, in other words, after the corresponding logic block has been executed.
Each FB, FC, or OB can read the data from a shared DB or write data to a shared DB. This data
remains in the DB after the DB is exited.
A shared DB and an instance DB can be opened at the same time. The following figure shows the
different methods of access to data blocks.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 85
Basics of Designing a Program Structure
4.2 Blocks in the User Program
4.2.3.6 System Function Blocks (SFB) and System Functions (SFC)
Preprogrammed Blocks
You do not need to program every function yourself. S7 CPUs provide you with preprogrammed
blocks that you can call in your user program.
Further information can be found in the reference help on system blocks and system functions
(Jumps to Language Descriptions and Help on Blocks and System Attributes).
System Function Blocks
A system function block (SFB) is a function block integrated on the S7 CPU. SFBs are part of the
operating system and are not loaded as part of the program. Like FBs, SFBs are blocks "with
memory." You must also create instance data blocks for SFBs and download them to the CPU as
part of the program.
S7 CPUs provide the following SFBs:
• For communication via configured connections
• For integrated special functions (for example, SFB29 "HS_COUNT" on the CPU 312 IFM and
the CPU 314 IFM).
System Functions
A system function is a preprogrammed function that is integrated on the S7 CPU. You can call the
SFC in your program. SFCs are part of the operating system and are not loaded as part of the
program. Like FCs, SFCs are blocks "without memory."
S7 CPUs provide SFCs for the following functions:
• Copying and block functions
• Checking the program
• Handling the clock and runtime meters
• Transferring data sets
• Transferring events from a CPU to all other CPUs in multicomputing mode
• Handling timeofday and timedelay interrupts
• Handling synchronous errors, interrupts, and asynchronous errors
• Information on static and dynamic system data, for example, diagnostics
• Process image updating and bit field processing
• Addressing modules
• Distributed I/O
• Global data communication
• Communication via nonconfigured connections
• Generating blockrelated messages
Programming with STEP 7
86 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Additional Information
For more detailed information about SFBs and SFCs, refer to the "System Software for S7-300 and
S7-400, System and Standard Functions" Reference Manual. The "S7-300 Programmable
Controller, Hardware and Installation Manual" and "S7-400 Programmable Controller Module
Specifications Reference Manual" explain which SFBs and SFCs are available.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 87
Basics of Designing a Program Structure
4.2 Blocks in the User Program
4.2.4 Organization Blocks for Interrupt-Driven Program Processing
By providing interrupt OBs, the S7 CPUs allow the following:
• Program sections can be executed at certain times or intervals (time-driven)
• Your program can react to external signals from the process.
The cyclic user program does not need to query whether or not interrupt events have occurred. If
an interrupt does occur, the operating system makes sure that the user program in the interrupt OB
is executed so that there is a programmed reaction to the interrupt by the programmable logic
controller.
Interrupt Types and Applications
The following table shows how the different types of interrupt can be used.
Type of Interrupt Interrupt OBs Application Examples
Time-of-day interrupt OB10 to OB17 Calculation of the total flow into a blending process at the end
of a shift
Time-delay interrupt OB20 to OB23 Controlling a fan that must continue to run for 20 seconds after
a motor is switched off
Cyclic interrupt OB30 to OB38 Scanning a signal level for a closed loop control system
Hardware interrupt OB40 to OB47 Signaling that the maximum level of a tank has been reached
4.2.4.1 Time-of-Day Interrupt Organization Blocks (OB10 to OB17)
The S7 CPUs provide the TimeOfDay interrupt OBs that can be executed at a specified date or at
certain intervals.
TimeOfDay interrupts can be triggered as follows:
• Once at a particular time (specified in absolute form with the date)
• Periodically by specifying the start time and the interval at which the interrupt should be
repeated (for example, every minute, every hour, daily).
Programming with STEP 7
88 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Rules for Time-of-Day Interrupts
TimeOfDay interrupts can only be executed when the interrupt has been assigned parameters
and a corresponding organization block exists in the user program. If this is not the case, an error
message is entered in the diagnostic buffer and asynchronous error handling is executed (OB80,
see Error Handling Organization Blocks (OB70 to OB87 / OB121 to OB122)).
Periodic TimeOfDay interrupts must correspond to a real date. Repeating an OB10 monthly
starting on January 31st is not possible. In this case, the OB would only be started in the months
that actually have 31 days (that is, not in February, April, June, etc.).
A TimeOfDay interrupt activated during startup (restart (warm restart) or hot restart) is only
executed after the startup is completed.
TimeOfDay interrupt OBs that are deselected by the parameter assignment cannot be started.
The CPU recognizes a programming error and changes to STOP mode.
Following a restart (warm restart), TimeOfDay interrupts must be set again (for example, using
SFC30 ACT_TINT in the startup program).
Starting the Time-of-Day Interrupt
To allow the CPU to start a TimeOfDay interrupt, you must first set and then activate the
TimeOfDay interrupt. There are three ways of starting the interrupt:
• Automatic start of the TimeOfDay interrupt by assigning appropriate parameters with STEP 7
(parameter block "TimeOfDay interrupts")
• Setting and activating the TimeOfDay interrupt with SFC28 SET_TINT and SFC30 ACT_TINT
from within the user program
• Setting the TimeOfDay interrupt by assigning parameters with STEP 7 and activating the
TimeOfDay interrupt with SFC30 ACT_TINT in the user program.
Querying the Time-of-Day Interrupt
To query which TimeOfDay interrupts are set and when they are set to occur, you can do one of
the following:
• Call SFC31 QRY_TINT
• Request the list "interrupt status" of the system status list.
Deactivating the Time-of-Day Interrupt
You can deactivate TimeOfDay interrupts that have not yet been executed with SFC29
CAN_TINT. Deactivated TimeOfDay interrupts can be set again using SFC28 SET_TINT and
activated with SFC30 ACT_TINT.
Priority of the Time-of-Day Interrupt OBs
All eight TimeOfDay interrupt OBs have the same priority class (2) as default and are therefore
processed in the order in which their start event occurs. You can, however, change the priority
class by selecting suitable parameters.
Changing the Set Time
You can change the TimeOfDay set for the interrupt as follows:
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 89
Basics of Designing a Program Structure
4.2 Blocks in the User Program
• A clock master synchronizes the time for masters and slaves.
• SFC0 SET_CLK can be called in the user program to set a new time.
Reaction to Changing the Time
The following table shows how TimeOfDay interrupts react after the time has been changed.
If... Then...
you move the time ahead and one or more OB80 is started and the TimeOfDay interrupts that
TimeOfDay interrupts were skipped, were skipped are entered in the start information of
OB80.
you have not deactivated the skipped TimeOfDay the skipped TimeOfDay interrupts are no longer
interrupts in OB80, executed.
you have not deactivated the skipped TimeOfDay the first skipped TimeOfDay interrupt is executed,
interrupts in OB80, the other skipped TimeOfDay interrupts are
ignored.
you move the time back, the start events for the the execution of the TimeOfDay interrupt is
TimeOfDay interrupts occur again, repeated with S7-300-CPUs
and not
repeated for S7-400-CPUs and CPU 318.
Programming with STEP 7
90 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
4.2.4.2 Time-Delay Interrupt Organization Blocks (OB20 to OB23)
The S7 CPUs provide time delay OBs with which you can program the delayed execution of parts
of your user program.
Rules for Time-Delay Interrupts
Time delay interrupts can only be executed when the corresponding organization block exists in the
CPU program. If this is not the case, an error message is entered in the diagnostic buffer and
asynchronous error handling is executed (OB80, see Error Handling Organization Blocks (OB70 to
OB87 / OB121 to OB122)).
Time delay interrupt OBs that were deselected by the parameter assignment cannot be started.
The CPU recognizes a programming error and changes to STOP mode.
Time delay interrupts are triggered when the delay time specified in SFC32 SRT_DINT has
expired.
Starting the Time-Delay Interrupt
To start a time delay interrupt, you must specify the delay time in SFC32 after which the
corresponding time delay interrupt OB is called. Refer to the "S7-300 Programmable Controller,
Hardware and Installation Manual" and "S7-400 Programmable Controller Module Specifications
Reference Manual" for the maximum permitted length of the delay time.
Priority of the Time-Delay Interrupt OBs
The default priority for the time-delay interrupt OBs is priority class 3 to 6. You can assign
parameters to change the priority classes.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 91
Basics of Designing a Program Structure
4.2 Blocks in the User Program
4.2.4.3 Cyclic Interrupt Organization Blocks (OB30 to OB38)
The S7 CPUs provide cyclic interrupt OBs that interrupt cyclic program processing at certain
intervals.
Cyclic interrupts are triggered at intervals. The time at which the interval starts is the mode
transition from STOP to RUN.
Rules for Cyclic Interrupts
When you specify the intervals, make sure that there is enough time between the start events of
the individual cyclic interrupts for processing the cyclic interrupts themselves.
If you assign parameters to deselect cyclic interrupt OBs, they can no longer be started. The CPU
recognizes a programming error and changes to STOP mode.
Starting the Cyclic Interrupt
To start a cyclic interrupt, you must specify the interval in the cyclic interrupts parameter block
using STEP 7. The interval is always a whole multiple of the basic clock rate of 1 ms.
Interval = n X basic clock rate 1 ms
Each of the nine available cyclic interrupt OBs has a default interval (see the following table). The
default interval becomes effective when the cyclic interrupt OB assigned to it is loaded. You can,
however, assign parameters to change the default values. Refer to your "S7-300 Programmable
Controller, Hardware and Installation Manual" and your "S7-400 Programmable Controller, Module
Specifications Reference Manual" for the upper limit.
Phase Offset in Cyclic Interrupts
To avoid cyclic interrupts of different cyclic interrupt OBs being started at the same point and
possibly causing a time error (cycle time exceeded) you can specify a phase offset. The phase
offset ensures that the execution of a cyclic interrupt is delayed by a certain time after the interval
has expired.
Phase offset = m X basic clock rate (where 0 ≤ m < n)
The following figure shows how a cyclic interrupt OB with phase offset (OB37) is executed in
contrast to a cyclic interrupt without phase offset (OB38).
Programming with STEP 7
92 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Priority of the Cyclic Interrupt OBs
The following table shows the default intervals and priority classes of the cyclic interrupt OBs. You
can assign parameters to change the interval and the priority class.
Cyclic Interrupt OB Interval in ms Priority Class
OB30 5000 7
OB31 2000 8
OB32 1000 9
OB33 500 10
OB34 200 11
OB35 100 12
OB36 50 13
OB37 20 14
OB38 10 15
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 93
Basics of Designing a Program Structure
4.2 Blocks in the User Program
4.2.4.4 Hardware Interrupt Organization Blocks (OB40 to OB47)
The S7 CPUs provide hardware interrupt OBs that react to signals from the modules (for example,
signal modules (SMs), communications processors (CPs), function modules (FMs)). With STEP 7,
you can decide which signal from a configurable digital or analog module starts the OB. With CPs
and FMs, use the appropriate parameter assignment dialogs.
Hardware interrupts are triggered when a signal module with hardware interrupt capability and with
an enabled hardware interrupt passes on a received process signal to the CPU or when a function
module of the CPU signals an interrupt.
Rules for Hardware Interrupts
Hardware interrupts can only be executed when the corresponding organization block exists in the
CPU program. If this is not the case, an error message is entered in the diagnostic buffer and
asynchronous error handling is executed (OB80, see Error Handling Organization Blocks (OB70 to
OB87 / OB121 to OB122)).
If you have deselected hardware interrupt OBs in the parameter assignment, these cannot be
started. The CPU recognizes a programming error and changes to STOP mode.
Assigning Parameters to Signal Modules with Hardware Interrupt Capability
Each channel of a signal module with hardware interrupt capability can trigger a hardware interrupt.
For this reason, you must specify the following in the parameter sets of signal modules with
hardware interrupt capability using STEP 7:
• What will trigger a hardware interrupt.
• Which hardware interrupt OB will be executed (the default for executing all hardware interrupts
is OB40).
Using STEP 7, you activate the generation of hardware interrupts on the function blocks. You
assign the remaining parameters in the parameter assignment dialogs of these function modules.
Priority of the Hardware Interrupt OBs
The default priority for the hardware interrupt OBs is priority class 16 to 23. You can assign
parameters to change the priority classes.
Programming with STEP 7
94 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
4.2.4.5 Startup Organization Blocks (OB100 / OB101 / OB102)
Startup Types
There are three distinct types of startup:
• Hot restart (not in S7-300 and S7-400H)
• Restart (warm restart)
• Cold restart
The following table shows which OB the operating system calls in each startup type.
Startup Type Related OB
Hot restart OB101
Restart (warm restart) OB100
Cold restart OB102
Start Events for Startup OBs
The CPU executes a startup after the following events:
• After power up
• After you switch the mode selector from STOP to RUN/RUN-P
• After a request from a communication function
• After synchronizing in multicomputing mode
• In an H system after link-up (only on the standby CPU)
Depending on the start event, the CPU used, and its set parameters the relevant startup OB
(OB100, OB101, or OB102) is called.
Startup Program
You can specify the conditions for starting up your CPU (initialization values for RUN, startup
values for I/O modules) by writing your program for the startup in the organization blocks OB100 for
restart (warm restart), OB101 for hot restart, or OB102 for cold restart.
There are no restrictions to the length of the startup program and no time limit since the cycle
monitoring is not active. Timedriven or interruptdriven execution is not possible in the startup
program. During the startup, all digital outputs have the signal state 0.
Startup Type After Manual Restart
On S7-300 CPUs only a manual restart (warm restart) or cold restart (CPU 318-2 only) is possible.
On some S7-400 CPUs, you can restart manually using the mode selector and the startup type
switch (CRST/WRST) if this is permitted by the parameter assignment you made with STEP 7. A
manual restart (warm restart) is possible without specifically assigning parameters.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 95
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Startup Type After Automatic Restart
On S7-300 CPUs, only a restart (warm restart) is possible following power up.
On S7-400 CPUs, you can specify whether an automatic startup following power up leads to a
restart (warm restart) or a hot restart.
Clearing the Process Image
When an S7-400 CPU is restarted, the remaining cycle is executed, and as default, the process
image output table is cleared. You can prevent the process image being cleared if you want the
user program to continue with the old values following a restart.
Module Exists/Type Monitoring
In the parameters, you can decide whether the modules in the configuration table are checked to
make sure they exist and that the module type matches before the startup.
If the module check is activated, the CPU will not start up if a discrepancy is found between the
configuration table and the actual configuration.
Monitoring Times
To make sure that the programmable controller starts up without errors, you can select the
following monitoring times:
• The maximum permitted time for transferring parameters to the modules
• The maximum permitted time for the modules to signal that they are ready for operation after
power up
• On S7-400 CPUs, the maximum time of an interruption during which a hot restart is permitted.
Once the monitoring times expire, the CPU either changes to STOP, or only a restart (warm
restart) is possible.
Programming with STEP 7
96 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
4.2.4.6 Background Organization Block (OB90)
If you have specified a minimum scan cycle time with STEP 7 and this is longer than the actual
scan cycle time, the CPU still has processing time available at the end of the cyclic program. This
time is used to execute the background OB. If OB90 does not exist on your CPU, the CPU waits
until the specified minimum scan cycle time has elapsed. You can therefore use OB90 to allow
processes where time is not critical to run and thus avoid wait times.
Priority of the Background OB
The background OB has priority class 29, which corresponds to priority 0.29. It is therefore the OB
with the lowest priority. Its priority class cannot be changed by reassigning parameters.
The following figure shows an example of processing the background cycle, the main program
cycle, and OB10 (in CPUs as of 10/98).
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 97
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Programming OB90
The run time of OB90 is not monitored by the CPU operating system so that you can program
loops of any length in OB90. Ensure that the data you use in the background program are
consistent by observing the following when programming:
• The reset events of OB90 (see the "System Software for S7-300 and S7-400, System and
Standard Functions" Reference Manual)
• The process image update asynchronous to OB90.
Programming with STEP 7
98 Manual, 04/2017, A5E41552389-AA
Basics of Designing a Program Structure
4.2 Blocks in the User Program
4.2.4.7 Error Handling Organization Blocks (OB70 to OB87 / OB121 to OB122)
Types of Errors
The errors that can be detected by the S7 CPUs and to which you can react with the help of
organization blocks can be divided into two basic categories:
• Synchronous errors: these errors can be assigned to a specific part of the user program. The
error occurs during the execution of a particular instruction. If the corresponding synchronous
error OB is not loaded, the CPU changes to STOP mode when the error occurs.
• Asynchronous errors: these errors cannot be directly assigned to the user program being
executed. These are priority class errors, faults on the programmable logic controller (for
example, a defective module), or redundancy errors. If the corresponding asynchronous error
OB is not loaded, the CPU changes to STOP mode when the error occurs (exceptions: OB70,
OB72, OB81, OB 87).
The following table shows the types of errors that can occur, divided up into the categories of the
error OBs.
Asynchronous Errors/Redundancy Errors Synchronous Errors
OB70 I/O Redundancy Error (only H CPUs) OB121 Programming Error (for example, DB is not
loaded)
OB72 CPU Redundancy Error (only in H CPUs, for OB122 I/O Access Error (for example, access to a
example, failure of a CPU) signal module that does not exist)
OB80 Time Error (for example, scan cycle time
exceeded)
OB81 Power Supply Error (for example, battery
failure)
OB82 Diagnostic Interrupt (for example, short circuit
in the input module)
OB83 Remove/Insert Interrupt (for example,
removing an input module)
OB84 CPU Hardware Fault (fault at the interface to
the MPI network)
OB85 Priority Class Error (for example, OB is not
loaded)
OB86 Rack Failure
OB87 Communication Error (for example, incorrect
message frame ID for global data communication)
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 99
Basics of Designing a Program Structure
4.2 Blocks in the User Program
Using OBs for Synchronous Errors
Synchronous errors occur during the execution of a particular instruction. When these errors occur,
the operating system makes an entry in the I stack and starts the OB for synchronous errors.
The error OBs called as a result of synchronous errors are executed as part of the program in the
same priority class as the block that was being executed when the error was detected. The details
about the error that triggered the OB call are in the start information for the OB. You can use this
information to react to the error condition and then to return to processing your program (for
example, if an access error occurs on an analog input module, you can specify a substitute value in
OB122 using SFC44 RPL_VAL). The local data of the error OBs, do, however, take up additional
space in the L stack of this priority class.
With S7-400 CPUs, one synchronous error OB can start a further synchronous error OB. This is
not possible with S7-300 CPUs.
Using OBs for Asynchronous Errors
If the operating system of the CPU detects an asynchronous error, it starts the corresponding error
OB (OB70 to OB73 and OB80 to OB87). The OBs for asynchronous errors have the highest priority
as default and they cannot be interrupted by other OBs if all asynchronous error OBs have the
same priority. If more than one asynchronous error OB with the same priority occurs
simultaneously, they are processed in the order they occurred.
Masking Start Events
Using system functions (SFCs), you can mask, delay, or disable the start events for several OBs.
For more detailed information about these SFCs and the organization blocks, refer to the "System
Software for S7-300 and S7-400, System and Standard Functions" Reference Manual.
Type of Error OB SFC Function of the SFC
Synchronous error OBs SFC36 MSK_FLT Masks individual synchronous errors. Masked errors
do not start an error OB and do not trigger
programmed reactions
SFC37 DMSK_FLT Unmasks synchronous errors
Asynchronous error OBs SFC39 DIS_IRT Disables all interrupts and asynchronous errors.
Disabled errors do not start an error OB in any of the
subsequent CPU cycles and do not trigger
programmed reactions
SFC40 EN_IRT Enables interrupts and asynchronous errors
SFC41 DIS_AIRT Delays higher priority interrupts and asynchronous
errors until the end of the OB
SFC42 EN_AIRT Enables higher priority interrupts and asynchronous
errors
Note
If you want interrupts to be ignored, it is more effective to disable them using an SFC, rather than
to download an empty OB (with the contents BE).
Programming with STEP 7
100 Manual, 04/2017, A5E41552389-AA
5 Startup and Operation
5.1 Starting STEP 7
When you start Windows, you will find an icon for the SIMATIC Manager, the starting point for
the STEP 7 software on the Windows interface.
The quickest method to start STEP 7 is to position the cursor on the icon and doubleclick. The
window containing the SIMATIC Manager is then opened. From here you can access all the
functions you have installed for the standard package and any optional packages.
Alternatively you can also start the SIMATIC Manager via the "Start" button in the taskbar of the
operating system. You will find the entry under "Simatic".
Note
You will find more information about standard Windows operation and options in your Windows
user's guide or in the online help of your Windows operating system.
SIMATIC Manager
The SIMATIC Manager is the basic application for configuring and programming. You can perform
the following functions in the SIMATIC Manager:
• Set up projects
• Configure and assign parameters to hardware
• Configure hardware networks
• Program blocks
• Debug and commission your programs
Access to the various functions is designed to be object oriented, and intuitive and easy to learn.
You can work with the SIMATIC Manager in one of two ways:
• Offline, without a programmable controller connected
• Online, with a programmable controller connected
Note the relevant safety notices in each case.
How to Proceed from Here
You create automation tasks in the form of "Projects." You will make it easier for yourself if you
read up on the following basic topics before you start work:
• User interface
• Some basic operating steps
• Online help
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 101
Startup and Operation
5.2 Starting STEP 7 with Default Start Parameters
5.2 Starting STEP 7 with Default Start Parameters
From STEP 7 V5.0 onwards, you can create several symbols in the SIMATIC Manager and specify
start parameters in the call line. By doing this, you can cause the SIMATIC Manager to position on
the object described by these parameters. This allows you to jump to the corresponding locations
in a project immediately just by double-clicking.
On calling s7tgtopx.exe, you can specify the following start parameters:
/e <complete physical project path>
/o <logical path of the object on which you want to position>
/h <ObjectID>
/onl
The start parameter /onl causes the project to be opened online and the specified path to be
called.
/off
The start parameter /off causes the project to be opened offline and the specified path to be called.
/keep
The start parameter /keep causes the following to occur:
If the SIMATIC Manager is open, the already displayed projects are opened in addition to the new
project to be explicitly opened by means of the command line. If the SIMATIC Manager is not yet
open, then the new project is opened along with the projects stored in the session memory of the
SIMATIC Manager. If this start parameter is not specified, the opened projects are closed first, the
session memory is ignored and only the one specified project is opened.
/noopen
The start parameter /noopen causes no project to be opened when SIMATIC Manager is started.
The easiest way to establish suitable parameters is described below.
Establishing Parameters by Copying and Pasting
Proceed as follows:
1. On your desktop, create a new link to the file s7tgtopx.exe. This file is located in the installation
directory under S7bin.
2. Display the properties dialog box.
3. Select the "Link" tab. The entry under "Target" should now be expanded as follows.
4. Select the required object in the SIMATIC Manager.
5. Copy the object to the clipboard using the key combination CTRL+ALT+C.
6. Position the cursor at the end of the "Target" entry in the "Link" tab.
7. Paste the contents of the clipboard using the key combination CTRL+V.
8. Close the dialog box by confirming with "OK."
Programming with STEP 7
102 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.2 Starting STEP 7 with Default Start Parameters
Example of Parameters:
/e F:\SIEMENS\STEP7\S7proj\MyConfig\MyConfig.s7p /keep
/o "1,8:MyConfig\SIMATIC 400(1)\CPU416-1\S7-Program(1)\Blocks\FB1"
/h T00112001;129;T00116001;1;T00116101;16e /keep
Note on the Structure of the Project Path
The project path is the physical path in the file system.
The complete logical path has the following structure:
[View ID,online ID]:project name\{object name\}*\ object name
Example: /o 1.8:MyConfig\SIMATIC 400(1)\CPU416-1\S7-Program(1)\Blocks\FB1
The path of network drives must be specified in UNC notation (= Universal Naming Convention, in
other words \\<servername>\<share>\...).
Example: \\<servername>\<share>\SIEMENS\STEP7\S7proj\MyConfig\MyConfig.s7p /keep
Note on the Structure of the Logical Path
The complete logical path and the Object ID can only be created using the copy and paste
functions.
However, it is also possible to specify the path which can be read by the user. In the example
above, that would be:
/o "MyConfig\SIMATIC 400(1)\CPU416-1\S7-Program(1)\Blocks\FB1". By adding /onl or /off the
user can specify whether the path is valid in the online or offline window. You do not need to
specify this if you use the copy and paste functions.
Important: If the path contains blanks, it must be placed within quotation marks.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 103
Startup and Operation
5.3 Calling the Help Functions
5.3 Calling the Help Functions
Online Help
The online help system provides you with information at the point where you can use it most
efficiently. You can use the online help to access information quickly and directly without having to
search through manuals. You will find the following types of information in the online help:
• Contents: offers a number of different ways of displaying help information
• Contextsensitive Help (F1 key): with the F1 key you access information on the object you
just selected with the mouse or on the active dialog box or window
• Introduction: gives a brief introduction to the use, the main features, and the functional scope
of an application
• Getting Started: summarizes the basic steps you need to execute to get started with the
application
• Using Help: provides a description of ways of finding specific information in the online help
• About: provides information on the current version of the application
Via the Help menu you can also access topics which relate to the current dialog situation from
every window.
Calling the Online Help
You can call the online help in one of the following ways:
• Select a menu command in the Help menu in the menu bar.
• Click the "Help" button in a dialog box. You are then shown help on this dialog box.
• Position the cursor in a window or dialog box on the topic you need help with and press the F1
key or select the menu command Help > Contextsensitive Help.
• Use the question mark cursor in Windows.
The last three of these ways of accessing the online help are known as contextsensitive help.
Calling the Quick Help
A quick help on buttons in the toolbar is displayed when you position the cursor on a button and
leave it there for a moment.
Programming with STEP 7
104 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.4 Objects and Object Hierarchy
5.4 Objects and Object Hierarchy
In the same way that the Windows Explorer shows the directory structure of folders and files, the
object hierarchy for projects and libraries in STEP 7 is shown in the SIMATIC Manager.
The following figure shows an example of an object hierarchy.
• Project Object
• Station Object
• Programmable Module Object
• S7 Program Object
• Source File Folder Object
• Block Folder Object
Objects have the following functions:
• Carriers of object properties,
• Folders,
• Carriers of functions (for example, to start a particular application).
Objects as Carriers of Properties
Objects can carry both functions and properties (such as settings). When you select an object, you
can perform one of the following functions with it:
• Edit the object using the menu command Edit > Open Object.
• Open a dialog box using the menu command Edit > Object Properties and set object-specific
options.
A folder can also be a carrier of properties.
Objects as Folders
A folder (directory) can contain other folders or objects. These are displayed when you open the
folder.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 105
Startup and Operation
5.4 Objects and Object Hierarchy
Objects as Carriers of Functions
When you open an object, a window is displayed in which you can edit the object.
An object is either a folder or a carrier of functions. An exception to this is stations: they are both
folders (for programmable modules) and carriers of functions (used to configure the hardware).
• If you double-click a station, the objects contained in it are displayed: the programmable
modules and the station configuration (station as a folder).
• If you open a station with the menu command Edit > Open Object, you can configure this
station and assign parameters to it (station as the carrier of a function). The menu command
has the same effect as a double-click on the "Hardware" object.
Programming with STEP 7
106 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.4 Objects and Object Hierarchy
5.4.1 Project Object
The project represents the entirety of all the data and programs in an automation solution, and is
located at the top of an object hierarchy.
Position in the Project View
Project Object
Station Object
Programmable Module Object
S7 Program Object
Source File Folder Object
Block Folder Object
Symbol Object Folder Selection of Important Functions
Project • Creating a Project
• Archiving Projects and Libraries
• Printing Project Documentation
• Managing Multilingual Texts
• Checking Projects for Optional Packages Used
• Rearranging
• Translating and Editing Operator Related Texts
• Inserting Operator Station Objects
• More than One User Editing Projects
• Converting Version 2 Projects
• Setting the PG/PC Interface
Symbol Objects in the Project Selection of Important Objects
Level
Station: • Inserting Stations
• Stations are both objects (project level) and object folder
SIMATIC 300 station (station level). Other functions can be found under Station
Object
SIMATIC 400 station
S7 program • S7 Program without a Station or CPU
• S7 programs are both objects (project level) and object
folders (program level). Other functions can be found under
S7 Program Object
Network for starting the • Properties of Subnets and Communication Nodes
tool for network • Overview: Global Data Communication
configuration and setting
• Procedure for Configuring Global Data Communication
the network properties.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 107
Startup and Operation
5.4 Objects and Object Hierarchy
5.4.2 Library Object
A library can contain S7 programs and is used to store blocks. A library is located at the top of an
object hierarchy.
• Library Object
• S7 Program Object
• Source File Folder Object
• Block Folder Object
Symbol Object Folder Selection of Important Functions
Library • Overview of the Standard Libraries
• Working with Libraries
• Archiving Projects and Libraries
Symbol Objects in the Library Selection of Important Functions
Level
S7 program • Inserting an S7 Program
• S7 programs are both objects (project level) and object
folders (program level). Other functions can be found under
S7 Program Object
Programming with STEP 7
108 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.4 Objects and Object Hierarchy
5.4.3 Station Object
A SIMATIC 300/400 station represents a S7 hardware configuration with one or more
programmable modules.
Position in the Project View
• Project Object
• Station Object
• Programmable Module Object
• S7 Program Object
• Source File Folder Object
• Block Folder Object
Symbol Object Folder Selection of Important Functions
Station • Inserting a Station
• Uploading a Station
• Downloading a Configuration to a Programmable Controller
• Uploading a Configuration from a Station
• Displaying CPU Messages and User-Defined Diagnostic
Messages
• Configuring the 'Reporting of System Errors'
• Diagnosing Hardware and Displaying Module Information
• Displaying and Changing the Operating Mode
• Displaying and Setting the Time and Date
• Erasing the Load/Work Memory and Resetting the CPU
SIMATIC PC Station • Creating and Assigning Parameters to SIMATIC PC Stations
(Not assigned) • Configuring Connections for a SIMATIC PC Station
• Uploading a SIMATIC PC Station
SIMATIC PC Station • Highlighting the SIMATIC PC Station to be Configured in the
(Assigned) Network View
Symbol Objects in the Station Selection of Important Functions
Level
Hardware • Basic Procedure for Configuring Hardware
• Basic Steps for Configuring a Station
• Overview: Procedure for Configuring and Assigning
Parameters to a Local Configuration
• Basic Procedure for Configuring a DP Master System
• Configuring Multicomputing Operation
Programmable module • Programmable modules are both objects (station level) and
object folders ("Programmable Modules" level). Other functions
can be found under Programmable Module Object
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 109
Startup and Operation
5.4 Objects and Object Hierarchy
5.4.4 Programmable Module Object
A programmable module represents the parameter assignment data of a programmable module
(CPUxxx, FMxxx, CPxxx). The system data of modules with no retentive memory (for example,
CP441) are loaded via the CPU of the station. For this reason, no "system data" object is assigned
to such modules and they are not displayed in the project hierarchy.
Position in the Project View
• Project Object
• Station Object
• Programmable Module Object
• S7 Program Object
• Source File Folder Object
• Block Folder Object
Symbol Object Folder Selection of Important Functions
Programmable module • Overview: Procedure for Configuring and Assigning
Parameters to a Local Configuration
• Displaying CPU Messages and User-Defined Diagnostic
Messages
• Configuring 'Reporting of System Errors'
• Diagnosing Hardware and Displaying Module Information
• Downloading via EPROM Memory Cards
• Password Protection for Access to Programmable Controllers
• Displaying the Force Values Window
• Displaying and Changing the Operating Mode
• Displaying and Setting the Time and Date
• Setting the Operating Behavior
• Erasing the Load/Work Memory and Resetting the CPU
• Diagnostics Symbols in the Online View
• Division of the Memory Areas
• Saving Downloaded Blocks on Integrated EPROM
• Updating the Operating System on the Programmable Logic
Controller
Object representing a • Displaying Modules Configured with Later STEP 7 Versions
programmable module
Programming with STEP 7
110 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.4 Objects and Object Hierarchy
Symbol Objects in the Selection of Important Functions
"Programmable
Modules" level
Programs: • Inserting an S7 Program
• S7 programs are both objects (project level) and object folders
S7 program (program level). Other functions can be found under S7
Program Object
Program
Connections for defining • Networking Stations within a Project
connections within the • Connection Types and Connection Partners
network
• What You Should Know About the Different Connection Types
• Entering a New Connection
• Configuring Connections for Modules in a SIMATIC Station
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 111
Startup and Operation
5.4 Objects and Object Hierarchy
5.4.5 S7 Program Object
A S7 program folder contains software for S7 CPU modules or software for non-CPU modules (for
example, programmable CP or FM modules).
Position in the Project View
• Project Object
• Station Object
• Programmable Module Object
• S7 Program Object
• Source File Folder Object
• Block Folder Object
Symbol Object Folder Selection of Important Functions
S7 Program • Inserting an S7-Program
• Setting the Address Priority
• Basic Procedure for Creating Logic Blocks
• Assigning Message Numbers
• How to Assign and Edit User-Specific Diagnostics Messages
(Project-Oriented)
• How to Assign and Edit User-Specific Diagnostics Messages
(CPU-Oriented)
• Translating and Editing Operator Related Texts
• Managing Multilingual Texts
• Displaying CPU Messages and User-Defined Diagnostic
Messages
• Program Measures for Handling Errors
Program • Creating the Software in the Project (General)
Programming with STEP 7
112 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.4 Objects and Object Hierarchy
Symbol Objects in the Program Selection of Important Functions
Level
Source file folder • Other functions can be found under Source File Folder Object
Block folder • Other functions can be found under Block Folder Object
Text libraries folder • User Text Libraries
Symbol table for • Absolute and Symbolic Addressing
assigning symbols to • Structure and Components of the Symbol Table
signals and other
• Entering Shared Symbols
variables
• General Tips on Entering Symbols
• How to Assign and Edit Symbol-Related Messages (Project-
Oriented)
• How to Assign and Edit Symbol-Related Messages ( CPU-
Oriented)
• Translating and Editing Operator Related Texts
• Configuring Operator Control and Monitoring Attributes via the
Symbol Table
• Editing the Communication Attribute
• Exporting and Importing Symbol Tables
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 113
Startup and Operation
5.4 Objects and Object Hierarchy
5.4.6 Block Folder Object
A block folder of an offline view can contain: logic blocks (OB, FB, FC, SFB, SFC), data blocks
(DB), user-defined data types (UDT) and variable tables. The system data object represents
system data blocks.
The block folder of an online view contains the executable program parts that have been
downloaded to the programmable controller.
Position in the Project View
• Project Object
• Station Object
• Programmable Module Object
• S7 Program Object
• Source File Folder Object
• Block Folder Object
Symbol Object Selection of Important Functions
Folder
Blocks • Downloading with Project Management
• Downloading without Project Management
• Overview of the Available Reference Data
• Rewiring
• Comparing Blocks
• Translating and Editing Operator Related Texts
• Jumps to Language Descriptions and Help on Blocks, System Attributes
Symbol Objects in Selection of Important Functions
the Block
Folder
Blocks in • Basic Procedure for Creating Logic Blocks
general • Creating Blocks
• Basic Information on Programming in STL Source Files
• Comparing Blocks
Organization Additional Functions:
Block (OB) • Introduction to Data Types and Parameter Types
• Requirements for Downloading
• Testing using Program Status
• What You Should Know About Testing in Single-Step Mode/Breakpoints
• Rewiring
• Help on Blocks
Programming with STEP 7
114 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.4 Objects and Object Hierarchy
Symbol Objects in Selection of Important Functions
the Block
Folder
Function (FC) Additional Functions:
• Introduction to Data Types and Parameter Types
• Requirements for Downloading
• Testing using Program Status
• What You Should Know About Testing in Single-Step Mode/Breakpoints
• Rewiring
• Attributes for Blocks and Parameters
Function Additional Functions:
Block (FB) • Introduction to Data Types and Parameter Types
• Using Multiple Instances
• Requirements for Downloading
• Testing Using Program Status
• What You Should Know about Testing in Single-Step Mode/Breakpoints
• Rewiring
• Attributes for Blocks and Parameters
• How to Assign and Edit Block-Related Messages (Project-Oriented)
• How to Create Block-Related Messages (CPU-Oriented)
• How to Configure PCS 7 Messages (Project-Oriented)
• How to Configure PCS 7 Messages (CPU-Oriented)
• Translating and Editing Operator Related Texts
• Assigning Monitor/Control Attributes to Function Block Parameters
User-Defined • Creating Blocks
Data Type • Basic Information on Programming in STL Source Files
(UDT)
• Introduction to Data Types and Parameter Types
• Using User-Defined Data Types to Access Data
• Attributes for Blocks and Parameters
DB (Global • Data View of Data Blocks
Data Blocks) • Declaration View of Data Blocks
• Requirements for Downloading
• Program Status of Data Blocks
• Introduction to Data Types and Parameter Types
• Using Multiple Instances
• Attributes for Blocks and Parameters
• How to Assign and Edit Block-Related Messages (Project-Oriented)
(Instance DBs Only)
• How to Assign and Edit Block-Related Messages (CPU-Oriented) (Instance
DBs Only)
• How to Configure PCS7 Messages (Project-Oriented) (Instance DBs Only)
• How to Configure PCS7 Messages (CPU-Oriented) (Instance DBs Only)
• Translating and Editing Operator Related Texts (Instance Data Blocks Only)
System • Requirements for Downloading
Function • Attributes for Blocks and Parameters
(SFC)
• Help on Blocks
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 115
Startup and Operation
5.4 Objects and Object Hierarchy
Symbol Objects in Selection of Important Functions
the Block
Folder
SFB (System • Requirements for Downloading
Function • Attributes for Blocks and Parameters
Blocks)
• How to Assign and Edit Block-Related Messages (Project-Oriented)
• How to Create Block-Related Messages (CPU-Oriented)
• How to Configure PCS7 Messages (Project-Oriented)
• How to Configure PCS7 Messages (CPU-Oriented)
• Translating and Editing Operator Related Texts
• Help on Blocks
Block with • Rules for Defining Block Properties in STL Sources
KNOW HOW • Block Properties
protection
Diagnostic- Additional information is available in the documentation for the S7-PDIAG
capable block optional package.
Block was Additional information is available in the documentation for the S7 Distributed
created with Safety optional package.
the F-FBD/-
LAD/-STL/-
DB
programming
language
Variable • Basic Procedure when Monitoring and Modifying with the Variable Table
Table (VAT) • Introduction to Testing with the Variable Table
• Introduction to Monitoring Variables
• Introduction to Modifying Variables
• Introduction to Forcing Variables
System Data System data blocks (SDBs) are only edited indirectly via functions:
Block • Introduction to Configuring Hardware
(SDB)
• Properties of Subnets and Communication Nodes
• Overview: Global Data Communication
• Assigning and Editing Symbol-Related Messages
• Requirements for Downloading
Programming with STEP 7
116 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.4 Objects and Object Hierarchy
5.4.7 Source File Folder Object
A source file folder contains source programs in text format.
Position in the Project View
• Project Object
• Station Object
• Programmable Module Object
• S7 Program Object
• Source File Folder Object
• Block Folder Object
Symbol Object Folder Selection of Important Functions
Source File Folder • Basic Information on Programming in STL Source Files
• Exporting Source Files
• Importing Source Files
Symbol Objects in Source File Selection of Important Functions
Folder
Source file • Basic Information on Programming in STL Source Files
(for example, STL source • Creating STL Source Files
file)
• Inserting Block Templates in STL Source Files
• Inserting Source Code from Existing Blocks in STL Source
Files
• Checking Consistency in STL Source Files
• Compiling STL Source Files
• Generating STL Source Files from Blocks
• Exporting Source Files
• Importing Source Files
Network template • Working with Network Templates
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 117
Startup and Operation
5.5 User Interface and Operation
5.4.8 S7 Program without a Station or CPU
You can create programs without having configured a SIMATIC station beforehand. This means
that you can initially work independently of the module and module settings you intend to program.
Creating an S7 Program
1. Open the relevant project using the menu command File > Open or activate the project
window.
2. Select the project in the project window of the offline view.
3. Select the menu commands Insert > Program > S7 Program.
The S7 program is added and arranged directly below the project in the project window. It
contains a folder for the blocks and an empty symbol table. You can now create and program
blocks.
Assigning a Program to a Programmable Module
When you insert programs that are not dependent on a particular module, you can easily assign
them to a module later on by copying or moving these programs to the module symbol using the
drag and drop function.
Adding a Program to a Library
If the program is to be used for a SIMATIC S7 programmable controller and you want to use it
many times as a "software pool," you can also insert it in a library. However, when testing, the
programs must lie directly under a project, because this is the only way in which to establish a
connection to the programmable controller.
Accessing a Programmable Controller
Select the online view of the project. You can make the address settings in the dialog box
containing the program properties.
Note
When deleting stations or programmable modules, you will be asked if you also want to delete the
program contained within. If you choose not to delete the program, it will be attached directly below
the project as a program without a station.
Programming with STEP 7
118 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.5 User Interface and Operation
5.5 User Interface and Operation
5.5.1 Operating Philosophy
The aim: Easy Operation
It is the aim of the graphic user interface to provide maximum and intuitive operating comfort. You
will therefore find objects you already know from your daily work, e.g. stations, modules, programs,
blocks.
Actions you perform under STEP 7 include the creation, selection and manipulation of such
objects.
Differences to Tool-Based Operation
When starting work with conventional tools, the first thing you have to do is to choose the
appropriate tool for a specific solution and then call this tool.
The basic procedure of object-oriented operation is to select an object and then open it for editing.
Object oriented operation does not require knowledge of special instruction syntax. On the GUI,
icons you can open via menu command or mouse click represent objects.
When you open an object, the application automatically calls the appropriate software component
for displaying or editing the content of the object.
Continue ...
Below we describe the basic actions for editing objects. Please pay proper attention to this topic, as
all subsequent topics will be based on these basic operations.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 119
Startup and Operation
5.5 User Interface and Operation
5.5.2 Window Arrangement
The standard components of a window are shown in the following figure:
Title Bar and Menu Bar
The title bar and menu bar are always found at the top of a window. The title bar contains the title
of the window and icons for controlling the window. The menu bar contains all menus available in
the window.
Toolbar
The toolbar contains icons (or tool buttons) which provide shortcuts to frequently used and
currently available menu bar commands available with a single mouse click. A brief description of
the function of the respective button is displayed together with additional information in the status
bar when you position the cursor briefly on the button.
If access to a button is not possible in the current configuration, the button is grayed out.
Status Bar
The status bar displays contextspecific information.
Programming with STEP 7
120 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.5 User Interface and Operation
5.5.3 Elements in Dialog Boxes
Making Entries in Dialog Boxes
In dialog boxes you can enter information which is required for executing a particular task. The
components which appear most frequently in dialog boxes are explained using the example in the
following figure.
List Boxes and Combination Boxes
Text boxes sometimes have an arrow pointing downwards beside them. This arrow shows that
there are more options available to choose from for this box. Click on the arrow to open a list box or
combination box. If you click on an entry in the list, it is automatically displayed in the text box.
Tabs in Dialog Boxes
The content of some dialog boxes is organized using tabs to improve the clarity of the information
by dividing the dialog box into tab cards (see figure below).
The names of the tab cards are shown on tabs along the top edge of the dialog box. To bring a
particular tab card to the foreground, you simply click on its tab.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 121
Startup and Operation
5.5 User Interface and Operation
5.5.4 Creating and Managing Objects
Some basic processing steps are the same for all objects and do not depend on the object type.
These standard handling sequences are summarized here. This knowledge of standard procedures
is required to move on to other sections in the manual.
The usual sequence of steps when handling objects is:
• Create an object
• Select an object
• Perform actions with the object (for example, copy, delete).
Setting the Path to Create New Projects/Libraries
New user projects, libraries and multiprojects are stored in the default folder
"\Siemens\Step7\S7proj". If you want to store them in another folder, you should set your custom
path for these objects before you save projects, libraries and multiprojects for the first time. To do
this, select the menu command Options > Customize. In the "General" tab of the dialog box
displayed you can specify the path name under which you want to store new projects or libraries.
Creating Objects
The STEP 7 wizard "New Project" offers support with creating a new project and inserting objects.
Use the menu command File > "New Project" Wizard to open the wizard. In the dialog boxes
displayed you can set the structure of your project and then have the wizard create the project for
you.
If you do not wish to use the wizard, you can create projects and libraries using the menu
command File > New. These objects form the starting point of an object hierarchy. You can create
all other objects in the hierarchy using the commands in the Insert menu, provided they are not
created automatically. The exception to this are the modules in a SIMATIC station which are
created when you configure the hardware or by using the "New Project" wizard.
Programming with STEP 7
122 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.5 User Interface and Operation
Opening Objects
There are a number of ways to open an object in the detailed view:
• Double-click on the object icon
• Select the object and then the menu command Edit > Open Object. This only works for
objects that are not folders.
Once you have opened an object, you can create or change its contents.
When you open an object that does not contain other objects, its contents are represented by a
suitable software component in a new window for editing purposes. You cannot change objects
whose contents are already being used elsewhere.
Note
Exception: Stations appear as folders for programmable modules (when you double-click them)
and for the station configuration. If you double-click the "Hardware" object, the application for
configuring hardware is started. Selecting the station and selecting the menu command Edit >
Open Object has the same effect.
Building an Object Hierarchy
Use the "New Project" wizard to create the object hierarchy. When you open a folder, the objects it
contains are displayed on the screen. You can now create more objects in the folder using the
Insert menu, for example, additional stations in a project. Only the commands for those objects
which can be inserted in the current folder are active in the Insert menu.
Setting Object Properties
Object properties are data belonging to the object which determine its behavior. The dialog box for
setting object properties appears automatically when you create a new object and properties have
to be set. The properties can also be changed at a later date.
Using the menu command Edit > Object Properties, a dialog box is opened in which you can
display or set the properties for the selected object.
Using the menu command Edit > Special Object Properties, you can open dialog boxes and
enter data required for operator control and monitoring functions and for configuring messages.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 123
Startup and Operation
5.5 User Interface and Operation
For example, in order to display the special object properties of a block for operator control and
monitoring, the block must be marked as being relevant for operator control and monitoring,
meaning that the system attribute "s7_m_c" must be set to the value "true" in the "Attributes" tab of
the block properties.
Note
Properties of the "System Data" folder and the "Hardware" object cannot be displayed or changed.
You cannot write in the dialog boxes for object properties of a read-only project. In this case, the input boxes
are grayed out.
If you display the properties of programmable modules, you cannot edit the displayed parameters for reasons
of consistency. To edit the parameters you must open the "Configuring Hardware" application.
If you change the settings for objects on the programming device (for example, the configuration data of a
module), they are not yet effective in the target system, because the system data blocks in which the settings
are saved have to be in the target system.
If you load an entire user program, the system data blocks are also automatically transferred. If you change
the settings after having loaded the program, you can reload the "System data" object in order to transfer the
settings to the target system.
It is strongly recommended to edit the folders exclusively with STEP 7, since they can be physically structured
in a different way than you see in the SIMATIC Manager.
Cutting, Pasting, Copying
Most objects can be cut, pasted, or copied as usual under Windows. The menu commands for
these functions are found in the Edit menu.
You can also copy objects by dragging and dropping. If you attempt to move or copy to an illegal
destination, the cursor displays a prohibited sign as a warning.
When you copy an object, the whole hierarchy beneath it is also copied. This enables components
you create in an automation task to be used again and again.
Note
The connection table in the "Connections" folder cannot be copied. Note that when you copy lists of
operator-relevant texts, only those languages installed in the destination object are accepted.
You will find a step-by-step guide to copying under Copying Objects.
Programming with STEP 7
124 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.5 User Interface and Operation
Renaming Objects
The SIMATIC Manager assigns standard names to some new objects. These names are generally
formed from the type of object (if a number of objects of this type can be created in the same
folder) and a number.
For example, the first S7 program will be named "S7 Program(1)", the second "S7 Program(2)" etc.
The symbol table is simply called "Symbols" as it can only exist once in each folder.
You can change the names of most objects and assign them names which are more relevant to
their content.
With projects, the directory names in the path must not have more than 8 characters. Otherwise,
there may be problems when archiving.
You can change the name of an object directly or using the object properties.
Directly:
When you slowly click twice on the name of a selected object, a frame appears around the text.
You can then edit the name using the keyboard.
Using the menu:
Select the required object in the project window and select the menu command Edit > Rename. A
frame appears around the text. You can then edit the name using the keyboard.
If you are not allowed to change the name:
If you are not allowed to change the name of an object, the input field is shown in gray in the dialog
box, the current name is displayed, and text entries are not possible.
Note
If you move the mouse pointer out of the name box while editing the name and execute another
action (for example, select a menu command), the edit procedure is terminated. The changed
name is accepted and entered if it is allowed.
You will find a step-by-step guide to renaming under Renaming Objects.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 125
Startup and Operation
5.5 User Interface and Operation
Moving Objects
With the SIMATIC Manager you can move objects from one folder to another even if the
destination is in another project. When you move a folder its contents are all moved as well.
Note
You cannot move the following objects:
• Connections
• System data blocks (SIB) in the online view
• System functions (SFC) and system function blocks (SFB) in the online view
You will find a step-by-step guide to moving under Moving Objects.
Sorting Objects
You can sort objects in the detailed view (menu command View > Details) according to their
attributes. To do this, click on the corresponding header of the required attribute. When you click
again, the sort order is reversed. Blocks of one type are sorted according to their numerical order,
for example, FB1, FB2, FB11, FB12, FB21, FC1.
Default Sort Order
When you re-open a project, the objects in the detailed view are displayed according to a default
sort order. Examples:
• Blocks are shown in the order "System data, OB, FB, FC, DB, DUTY, VAT, SFB, SFC."
• In a project, all stations are shown first and then the S7 programs.
The default is not therefore an alphanumeric ascending or descending sort order in the detailed
view.
Restoring the Default Sort Order
After resorting, for example, by clicking on the column header "Object Name," you can restore the
default order if you proceed as follows:
• Click the column header "Type" in the detailed view.
• Close the project and open it again.
Programming with STEP 7
126 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.5 User Interface and Operation
Deleting Objects
You can delete folders and objects. If you delete a folder, all the objects contained in it are also
deleted.
You cannot undo the delete procedure. If you are not sure whether you really no longer need an
object, it is better to archive the whole project first.
Note
You cannot delete the following objects:
• Connections
• System data blocks (SIB) in the online view
• System functions (SFC) and system function blocks (SFB) in the online view
You will find a step-by-step guide to deleting under Deleting Objects.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 127
Startup and Operation
5.5 User Interface and Operation
5.5.5 Selecting Objects in a Dialog Box
Selecting objects in a dialog box (browser) is an action which you will need regularly for a large
number of different edit steps.
Calling the Browser
You call the browser dialog in the hardware configuration application, for example, using menu
commands such as Station > New/Open (one exception is the basic application window "SIMATIC
Manager").
Structure of a Browser Dialog
In the browser you have the following selection options as shown in the following figure.
Programming with STEP 7
128 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.5 User Interface and Operation
5.5.6 Session Memory
The SIMATIC Manager can save the contents of windows (that is, the projects and libraries open),
and the layout of the windows.
• Using the menu command Options > Customize, you define whether the window contents
and layout are to be saved at the end of a session. At the start of the next session, these
window contents and layout are restored. In the open projects, the cursor is positioned on the
last folder selected.
• Using the menu command Window > Save Settings you save the current window contents
and the window arrangement.
• Using the menu command Window > Restore Settings you restore the window contents and
layout that you saved with the menu command Window > Save Settings. In the open projects,
the cursor is positioned on the last folder selected.
Note
The window contents of online projects, the contents of the "Accessible Nodes" window, and the
contents of the "S7 Memory Card" window are not saved.
Any passwords you may have entered for access to programmable controllers (S7-300/S7-400) are
not saved at the end of a session.
5.5.7 Changing the Window Arrangement
To cascade all the displayed windows one behind the other, select one of the following options:
• Select the menu command Window > Arrange > Cascade.
• Press the key combination SHIFT + F5.
To arrange all the displayed windows from top to bottom on the screen, select the menu command
Window > Arrange > Horizontally.
To arrange all the displayed windows from left to right on the screen, select the menu command
Window > Arrange > Vertically.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 129
Startup and Operation
5.5 User Interface and Operation
5.5.8 Saving and Restoring the Window Arrangement
The STEP 7 applications have a feature which enables you to save the current window
arrangement and restore it at a later stage. You can make the setting using the menu command
Options > Customize in the "General" tab.
What Is Saved?
When you save the window layout the following information is recorded:
• Position of the main window
• Opened projects and libraries and their respective window positions
• Order of any cascaded windows
Note
The window content of online projects, the content of the "Accessible Nodes" window, and the
content of the "S7 Memory Card" window are not saved.
Saving the Window Layout
To save the current window arrangement, select the menu command Window > Save Settings.
Restoring the Window Layout
To restore the saved window arrangement, select the menu command Window > Restore
Settings.
Note
When you restore a window, only the part of the hierarchy containing the object that was selected when the
window arrangement was saved is displayed in detail.
Programming with STEP 7
130 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.6 Keyboard Operation
5.6 Keyboard Operation
5.6.1 Keyboard Control
International Key Names German Key Names
HOME POS1
END ENDE
PAGE UP BILD AUF
PAGE DOWN BILD AB
CTRL STRG
ENTER Eingabetaste
DEL ENTF
INSERT EINFG
5.6.2 Key Combinations for Menu Commands
Every menu command can be selected by typing a key combination with the ALT key.
Press the following keys in the order shown:
• ALT key
• The letter underlined in the menu name you require (for example, ALT, F for the menu "File" - if
the menu "File" is included in the menu bar). The menu is opened.
• The letter underlined in the menu command you require (for example, N for the menu
command "New"). If the menu command has a submenu, the submenu is also opened.
Proceed as above until you have selected the whole menu command by typing the relevant
letters.
Once you have entered the last letter in the key combination, the menu command is executed.
Examples:
Menu Command Key Combination
File > Archive ALT, F, A
Window > Arrange > Cascade ALT, W, A, C
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 131
Startup and Operation
5.6 Keyboard Operation
Shortcuts for Menu Commands
Command Shortcut
New (File Menu) CTRL+N
Open (File Menu) CTRL+O
Save as ("File" Menu) CTRL+S
Print > Object Table ("File" Menu) CTRL+P
Print > Object Content ("File" Menu) CTRL+ALT+P
Exit ("File" Menu) ALT+F4
Cut ("Edit" Menu) CTRL+X
Copy ("Edit" Menu) CTRL+C
Paste ("Edit" Menu) CTRL+V
Delete ("Edit" Menu) DEL
Select All ("Edit" Menu) CTRL+A
Rename ("Edit" Menu) F2
Object Properties ("Edit" Menu) ALT+RETURN
Open Object ("Edit" Menu) CTRL+ALT+O
Compile ("Edit" Menu) CTRL+B
Download (PLC Menu) CTRL+L
Diagnostics/Setting CTRL+D
> Module Status ("PLC" Menu)
Diagnostics/Setting CTRL+I
> Operating Mode ("PLC" Menu)
Update ("View" Menu) F5
Updates the status display of the visible CPUs in the online view CTRL+F5
Customize ("Options" Menu) CTRL+ALT+E
Reference Data > Show ("Options" Menu) CTRL+ALT+R
Arrange > Cascade (Window Menu) SHIFT+F5
Arrange > Horizontally (Window Menu) SHIFT+F2
Arrange > Vertically (Window Menu) SHIFT+F3
ContextSensitive Help (Help Menu) F1
(If there is a current context, for
example, a selected menu command,
the relevant help topic is opened.
Otherwise the help contents page is
displayed.)
Programming with STEP 7
132 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.6 Keyboard Operation
5.6.3 Key Combinations for Moving the Cursor
Moving the Cursor in the Menu Bar/Pop-Up Menus
To Press
move to the menu bar F10
move to the pop-up menu SHIFT+F10
move to the menu that contains the letter or number ALT+underlined character in a menu title
underlined which you typed in
select the menu command whose underlined letter Underlined character in the menu command
or number corresponds to the letter you have typed
move one menu command to the left LEFT ARROW
move one menu command to the right RIGHT ARROW
move one menu command up UP ARROW
move one menu command down DOWN ARROW
activate the selected menu command ENTER
deselect the menu name or close the open menu ESC
and return to the text
Moving the Cursor When Editing Text
To move Press
one line up or one character to the left in a text UP ARROW
consisting of only one line
one line down or one character to the right in a text DOWN ARROW
consisting of only one line
one character to the right RIGHT ARROW
one character to the left LEFT ARROW
one word to the right CTRL+RIGHT ARROW
one word to the left CTRL+LEFT ARROW
to the beginning of the line HOME
to the end of the line END
to the previous screen PAGE UP
to the next screen PAGE DOWN
to the beginning of the text CTRL+HOME
to the end of the text CTRL+END
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 133
Startup and Operation
5.6 Keyboard Operation
Moving the Cursor When Editing Tables
To move Press
One row up UP ARROW
One row down DOWN ARROW
One character or cell to the left RIGHT ARROW
One character or cell to the right LEFT ARROW
To the beginning of the row CTRL+RIGHT ARROW
To the end of the row CTRL+LEFT ARROW
To the beginning of the cell HOME
To the end of the cell END
To the previous screen PAGE-UP
To the next screen PAGE-DOWN
To the beginning of the table CTRL+HOME
To the end of the table CTRL+END
In the symbol table only: to the "Symbol" column SHIFT+HOME
In the symbol table only: to the "Comment" column SHIFT+END
Moving the Cursor in Dialog Boxes
To Press
move from one input box to the next (from left to TAB
right and from top to bottom)
move one input box in the reverse direction SHIFT+TAB
move to the input box or option that contains the ALT+underlined character in a menu title
letter or number underlined which you typed in
select in a list of options an arrow key
open a list of options ALT+DOWN ARROW
select or deselect an item in a list SPACEBAR
confirm the entries and close the dialog box ("OK" ENTER
button)
close the dialog box without saving the changes ESC
("Cancel" button)
Programming with STEP 7
134 Manual, 04/2017, A5E41552389-AA
Startup and Operation
5.6 Keyboard Operation
5.6.4 Key Combinations for Selecting Text
To select or deselect text Press
one character at a time to the right SHIFT+RIGHT ARROW
one character to the left SHIFT+LEFT ARROW
to the beginning of a comment line SHIFT+HOME
to the end of a comment line SHIFT+END
one row in a table SHIFT+SPACE
one line of text up SHIFT+UP ARROW
one line of text down SHIFT+DOWN ARROW
to the previous screen SHIFT+PAGE UP
to the next screen SHIFT+PAGE DOWN
the text to the beginning of the file CTRL+SHIFT+HOME
the text to the end of the file CTRL+SHIFT+END
5.6.5 Key Combinations for Access to Online Help
To Press
open the Help F1
(If there is a current context, for example, a
selected menu command, the relevant help topic
is opened. Otherwise the help contents page is
displayed.)
activate the question mark symbol for context-sensitive SHIFT+F1
help
close the Help window and return to the application ALT+F4
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 135
Startup and Operation
5.6 Keyboard Operation
5.6.6 Key Combinations for Toggling between Windows
To Press
toggle between the panes in a window F6
return to the previous pane, if there is no dockable Shift+F6
window
toggle between the document window and a dockable Shift+F6
window in the document (for example, variable
declaration window).
If there are no dockable windows, you can use this key
combination to return to the previous pane.
toggle between document windows Ctrl+F6
return to the previous document window Shift+Ctrl+F6
toggle between non-document windows (application Alt+F6
framework and dockable windows in the application
framework;
when you return to the framework, this key combination
activates the document window that was last active)
return to the previous non-document window Shift+Alt+F6
close the active window Ctrl+F4
Programming with STEP 7
136 Manual, 04/2017, A5E41552389-AA
6 Setting Up and Editing the Project
6.1 Project Structure
Projects are used to store the data and programs which are created when you put together an
automation solution. The data collected together in a project include:
• Configuration data on the hardware structure and parameters for modules,
• Configuration data for communication in networks, and
• Programs for programmable modules.
The main task when you create a project is preparing these data for programming.
Data are stored in a project in object form. The objects in a project are arranged in a tree structure
(project hierarchy). The display of the hierarchy in the project window is similar to that of the
Windows Explorer. Only the object icons have a different appearance.
The top end of the project hierarchy is structured as follows:
1. 1st Level: Project
2. 2nd Level: Subnets, stations, or S7 programs
3. 3rd Level: depends on the object in level 2.
Project Window
The project window is split into two halves. The left half shows the tree structure of the project. The
right half shows the objects that are contained in the object open in the left half in the selected view
(large symbols, small symbols, list, or details).
Click in the left half of the window on the box containing a plus sign to display the full tree structure
of the project. The resulting structure will look something like the following figure.
At the top of the object hierarchy is the object "S7_Pro1" as the icon for the whole project. It can be
used to display the project properties and serves as a folder for networks (for configuring
networks), stations (for configuring the hardware), and for S7 programs (for creating software). The
objects in the project are displayed in the right half of the project window when you select the
project icon. The objects at the top of this type of object hierarchy (libraries as well as projects)
form the starting point in dialog boxes used to select objects.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 137
Setting Up and Editing the Project
6.1 Project Structure
Project View
You can display the project structure for the data available on the programming device in the
component view "offline" and for the data available on the programmable control system in the
component view "online" in project windows.
An additional view you can set is available if the respective optional package is installed: the plant
view.
Note
Configuring hardware and networks can only be done in the "offline" view.
Programming with STEP 7
138 Manual, 04/2017, A5E41552389-AA
Setting Up and Editing the Project
6.2 What You Should Know About Access Protection
6.2 What You Should Know About Access Protection
As of STEP 7 V5.4, you have the option of restricting access to projects and libraries by assigning
a project password. This functionality is available only if SIMATIC Logon is installed.
You can also enable, disable and display a change log.
If SIMATIC Logon is installed on your computer, the following dynamic menu commands are
available in the SIMATIC Manager. You can use these commands to manage access protection for
a project or library:
• Access Protection, Enable
• Access Protection, Disable
• Access Protection, Manage
• Access Protection, Adjust in Multiproject
• Remove Access Protection and Change Log
You activate access protection in SIMATIC Manager with the menu command Options > Access
Protection > Enable. If you enable access protection for the first time with this menu command, a
dialog opens in which you will need to log on with SIMATIC Logon. You will then be prompted to
assign a project password. The relevant project or library can then only be edited by an
authenticated user or after entering the project password.
The Remove Access Protection and Change Log menu command removes access protection
as well as the change log for a password-protected project or library. After removing the access
protection, you can once again edit projects with a STEP 7 version prior to V5.4.
Opening and Closing Access-protected Projects
The following situations can be distinguished:
PC with STEP 7 and PC with STEP 7 and PC with STEP 7 (no SIMATIC
SIMATIC Logon SIMATIC Logon Logon present)
1. The user logs on using The project with access The user opens the access-
SIMATIC Logon with a user protection is opened by protected project by entering the
name and password. another user. project password.
2. The project with access Editing of the project is possible,
protection is opened. however without the functions of
SIMATIC Logon.
3. The project is edited. The project is edited. After closing and reopening the
project, users must authenticate
themselves again with the project
password.
4. Closing the project does not Closing the project does not
mean logging off in SIMATIC mean logging off in SIMATIC
Logon. Logon.
5. The user must log off with
Options > SIMATIC Logon
Services > "Log Off" button.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 139
Setting Up and Editing the Project
6.2 What You Should Know About Access Protection
Note
To disable access protection, you must be authorized in SIMATIC Logon as project administrator.
The first time you enable access protection, the project format is changed. You will receive a message
indicating that the modified project can no longer be edited with older STEP 7 versions.
The Options > Access Protection >Remove Access Protection and Change Log function allows the
project or the library to be used with a STEP 7 version lower than V5.4. You do, however, lose the information
on the users that are allowed access to this project or library and all change logs.
The user currently logged on is displayed in the status bar of the SIMATIC Manager.
The currently logged on Logon user who enables access protection is entered as the project administrator and
is requested to assign the project password the first time access protection is enabled.
To open an access protected project, you must be authenticated in SIMATIC Logon as project administrator or
project user or you must know the password.
Remember that a logged-on user is entered in the project as project administrator when a project is opened
with the project password.
If the project/library access protection is active, the icon has a red key. If the multiproject only contains
projects/libraries with active access protection, the icon also has a red key.
If the project/library access protection is disabled, the icon has a white key. If the multiproject contains
projects/libraries both with active and deactivated access protection or projects/libraries with deactivated
access protection, the icon is also displayed with a white key.
Programming with STEP 7
140 Manual, 04/2017, A5E41552389-AA
Setting Up and Editing the Project
6.3 What You Should Know About The Change Log
6.3 What You Should Know About The Change Log
As of STEP 7 V5.4, after setting up access protection for projects and libraries, you have the option
of keeping a change log that records online actions.
Examples include:
• Activate / deactivate / configure the access protection and change log
• Open / close projects and libraries
• Download to PLC (system data)
• Selected operations for loading and copying blocks
• Activities for changing the operating mode
• Clear/reset
You can display the change log and enter comments such as those explaining changes that you
have made. This functionality is available only if SIMATIC Logon is installed.
To enable the change log, go to the SIMATIC Manager and select the menu command Options >
Change Log > Enable. After you have enabled the change log, your can view it with the
appropriate menu command or disable it again.
Depending on the object you have selected in the project structure (for example project folder or
lower-level station), the corresponding change log is displayed.
Note
The Options > Access Protection >Remove Access Protection and Change Log function allows the
project or the library to be used with a STEP 7 version lower than V5.4. You do, however, lose the information
on the users that are allowed access to this project or library and all change logs.
To use this function, you must be authenticated in SIMATIC Logon as project administrator and access
protection must be enabled for this project.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 141
Setting Up and Editing the Project
6.4 Using Foreign-Language Character Sets
6.4 Using Foreign-Language Character Sets
As of STEP 7 V5.3 SP2, you can enter texts in foreign languages in projects and libraries even if
these languages do not match the language that has been set for STEP 7. To do this, the
corresponding Windows language must be set in the Control Panel of the operating system. This
makes it possible, for example, to operate STEP 7 in the STEP 7 language English on a Chinese-
language version of Windows but still allows Chinese text be entered.
In this case, the following types and options for language settings must be distinguished:
Windows Language Setting
This setting is made in the Windows Control Panel. Texts pertaining to the operating system are
displayed in the language selected, and you can enter texts in foreign-language character strings.
Project Language
The project language is the language that is set in the Window Control Panel when a project is first
created. Once chosen, this project language cannot be changed. However, with the "language-
neutral" setting it is still possible to open a project on computers with other language settings in
Windows. Before changing the project language to "language-neutral", make sure that only
characters from the English-language character set (ASCII characters 0x2a - 0x7f) were previously
used in the project when entering text.
To find out the project language for a project or a library, select the Edit > Object Properties menu
command. In the dialog box that is then displayed you can also select the "Can be opened under
any Windows language setting (language-neutral)" option.
STEP 7 Language
The STEP 7 language is the one that you set in the SIMATIC Manager by using the Options >
Customize menu command. This language is the one use for interface elements, menu command,
dialog boxes and error messages in STEP 7.
If you are using another Windows language such as German, English, French, Italian or Spanish,
you can ensure that the STEP 7 interface is correctly displayed by selecting English as the STEP
7 language.
Rules
If you will be editing your projects or libraries on computers that have different language settings,
be sure to observe the following "rules and regulations" to prevent incompatibilities or data
corruption from occurring when using a foreign-language character set:
• Install STEP 7 only in folders with names that contain the characters of the English character
set (ASCII characters 0x2a - 0x7f).
• Only use project names and project paths with names that contain the characters of the
English character set (ASCII characters 0x2a - 0x7f). For example, if you use German umlauts,
Cyrillic or Chinese characters, then the project can only be opened on computers that have a
compatible language setting in Windows.
• In multiprojects, only use projects and libraries with the same project language or those that
are identified as being language-neutral ones. The multiproject itself is language-neutral.
Programming with STEP 7
142 Manual, 04/2017, A5E41552389-AA
Setting Up and Editing the Project
6.4 Using Foreign-Language Character Sets
• When creating libraries, always make them language-neutral to ensure than they can be used
on computers with different Windows language settings. When assigning names to library
projects, entering comments, or creating symbol names, etc. be sure to only use ASCII
characters (0x2a - 0x7f) so that the libraries can be used without any problems.
• When importing/exporting hardware configurations or symbol tables, make sure that you only
import/export language-compatible files.
• In the names of user-defined attributes, use only characters from the English-language
character set (ASCII characters 0x2a - 0x7f).
• If, in an STL source, you are using characters that are not in the English character set (ASCII
characters 0x2a - 0x7f) for the TITLE, AUTHOR, FAMILY block properties, then place these
entries in single quote marks.
Notes
If you change or copy projects or libraries that were created on a computer that is identified as being
language-neutral with respect to the Windows language setting but is not compatible with the setting on the
computer currently being used, data corruption may occur if characters that are not contained in the English
character set (ASCII characters 0x2a - 0x7f) were used in the project or library.
For this reason, before editing "foreign" projects or libraries, make sure to check whether the Windows
language setting on your computer matches the project language.
If you export hardware configurations or symbol tables that are to be imported in another Windows language
setting, make sure that only characters from the English-language character set (ASCII characters 0x2a -
0x7f) were previously used and that no other language-specific characters such as German umlauts,
Japanese characters or Cyrillic characters are present.
Exported hardware configurations or symbol tables that contain language-specific characters such as German
umlauts, Japanese characters or Cyrillic characters may only be imported in the same Windows language
setting from which they were exported. This means that if you import older symbol tables that might contain
such language-specific characters, be sure to check the results carefully: the symbols must be unique, must
not contain any question marks or other incorrect characters, and must be plausible.
If symbol tables contain special characters that are not defined in ("known to") the current Windows language
setting, then the question marks or other incorrect characters now part of the symbol names may cause
problems and errors when sorting by names and comments.
Please note that with symbolic addressing the symbolic names must be written in quotation marks
("<Symbolic Name>").
Basic Procedure
To be able to enter text in foreign-language character sets in projects and libraries, proceed as
follows:
1. In the Windows Control Panel, set the language setting to the language desired.
2. Create a project.
3. Enter the text in foreign-language characters.
For project and libraries that were created before STEP 7 V5.3 SP2, the project language is "not
yet specified". In this case, you can select the Edit > Object Properties menu command to set the
project language to the language currently set in Windows. Before doing so, make sure that the
project does not contain any characters that are not defined in ("known to") the current Windows
language setting.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 143
Setting Up and Editing the Project
6.5 Setting the MS Windows Language
6.5 Setting the MS Windows Language
To set the Windows language, proceed as follows:
Setting the Language in Windows XP and Windows Server 2003:
1. To set the desired display language for programs that do not support Unicode, select the
following menu command sequence:
Control Panel > Regional and Language Options > Advanced > Language for non-
Unicode programs.
2. To set the input language (standard regional settings properties), select the following menu
command sequence:
Control Panel > Regional and Language Options > Languages > Details.
3. To set the input language (standard regional settings properties), select the following menu
command sequence:
Control Panel > Regional and Language Options > Regional Settings (Standards and
Formats).
Setting the Language in Windows 7 and Windows Server 2008:
• Using Control Panel > Clock, Language and Region > Region and Language > Formats >
Format, set the required display language.
• Using Control Panel > Clock, Language and Region > Region and Language >Keyboards
and Languages > Change Keyboards, add the required input language.
• Using Control Panel > Clock, Language and Region > Region and Language >
Administrative Tools > Change System Locale..., set the display language for programs that
do not support unicode.
You can enter texts in the desired language and display them correctly only after you have made
all of these settings.
Programming with STEP 7
144 Manual, 04/2017, A5E41552389-AA
Setting Up and Editing the Project
6.6 Setting Up a Project
6.6 Setting Up a Project
6.6.1 Creating a Project
To construct a solution to your automation task using the framework of a project management, you
will need to create a new project. The new project is created in the directory you set for projects in
the "General" tab when you selected the menu command Options > Customize.
Note
The SIMATIC Manager allows names that are longer than eight characters. The name of the
project directory is, however, cut off to eight characters. Project names must therefore differ in their
first eight characters. The names are not case-sensitive.
You will find a step-by-step guide to creating a project under Creating a Project Manually or under
Creating a Project Using the Wizard.
Creating a Project Using the Wizard
The easiest way to create a new project is using the "New Project" wizard. Use the menu
command File > "New Project" Wizard to open the wizard. The wizard prompts you to enter the
required details in dialog boxes and then creates the project for you. In addition to the station, CPU,
program folder, source file folder, block folder, and OB1 you can even select existing OBs for error
and alarm processing.
The following figure shows an example of a project created with the wizard.
Creating a Project Manually
You can also create a new project using the menu command File > New in the SIMATIC Manager.
It already contains the "MPI Subnet" object.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 145
Setting Up and Editing the Project
6.6 Setting Up a Project
Alternative Procedures
When editing a project, you are flexible as to the order in which you perform most of the tasks.
Once you have created a project, you can choose one of the following methods:
• First configure the hardware and then create the software for it, or
• Start by creating the software independent of any configured hardware.
Alternative 1: Configure the Hardware First
If you want to configure the hardware first, proceed as described in Volume 2 of the Configuring
Hardware with STEP 7 Manual. When you have done this, the "S7 Program" folder required to
create software is already inserted. Then continue by inserting the objects required to create
programs. Then create the software for the programmable modules.
Alternative 2: Create Software First
You can also create software without first having to configure the hardware; this can be done later.
The hardware structure of a station does not have to be set for you to enter your programs.
The basic procedure is as follows:
1. Insert the required software folders (S7 Program without a Station or CPU) in your project.
2. Then create the software for the programmable modules.
3. Configure your hardware.
4. Once you have configured the hardware, you can link the S7 program to a CPU.
Programming with STEP 7
146 Manual, 04/2017, A5E41552389-AA
Setting Up and Editing the Project
6.6 Setting Up a Project
6.6.2 Inserting Stations
In a project, the station represents the hardware structure of a programmable controller and
contains the data for configuring and assigning parameters to individual modules.
New projects created with the "New Project" wizard already contain a station. Otherwise you can
create the station using the menu command Insert > Station.
You can choose between the following stations:
• SIMATIC 300 station
• SIMATIC 400 station
• SIMATIC H station
• SIMATIC PC station
• PC/programming device
• SIMATIC S5
• Other stations, meaning non- SIMATIC S7 and SIMATIC S5
The station is inserted with a preset name (for example, SIMATIC 300 Station(1), SIMATIC 300
Station(2), etc.). You can replace the name of the stations with a relevant name, if you wish.
You will find a step-by-step guide to inserting a station under Inserting a Station.
Configure the Hardware
When you configure the hardware you specify the CPU and all the modules in your programmable
controller with the aid of a module catalog. You start the hardware configuration application by
double-clicking the station.
For each programmable module you create in your configuration, an S7 program and a connection
table ("Connections" object) are created automatically once you have saved and exited the
hardware configuration. Projects created with the "New Project" wizard already contain these
objects.
You will find a step-by-step guide to configuring under Configuring the Hardware, and detailed
information under Basic Steps for Configuring a Station.
Creating a Connection Table
An (empty) connection table ("Connections" object) is created automatically for each
programmable module. The connection table is used to define communication connections
between programmable modules in a network. When it is opened, a window is displayed containing
a table in which you define connections between programmable modules.
You will find detailed information under Networking Stations within a Project.
Next Steps
Once you have created the hardware configuration, you can create the software for your
programmable modules (Also refer to Inserting a S7 Program).
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 147
Setting Up and Editing the Project
6.6 Setting Up a Project
6.6.3 Inserting an S7 Program
The software for programmable modules is stored in object folders. For SIMATIC S7 modules this
object folder is called "S7 Program."
The following figure shows an example of an S7 program in a programmable module in a
SIMATIC 300 station.
Existing Components
An S7 program is created automatically for each programmable module as a container for the
software:
The following objects already exist in a newly created S7 program:
• Symbol table ("Symbols" object)
• "Blocks" folder for containing the first block
• "Source Files" folder for source files
Creating S7 Blocks
You want to create Statement List, Ladder Logic, or Function Block Diagram programs. To do this,
select the existing "Blocks" object and then select the menu command Insert > S7 Block. In the
submenu, you can select the type of block you want to create (such as a data block, Userdefined
Data Type (UDT), function, function block, organization block, or variable table).
You can now open the (empty) block and start entering the Statement List, Ladder Logic, or
Function Block Diagram program. You will find more information on this in Basic Procedure for
Creating Logic Blocks and in the Statement List, Ladder Logic, and Function Block Diagram
manuals.
Note
The object "System Data" (SDB) which may exist in a user program was created by the system.
You can open it, but you cannot make changes to it for reasons of consistency. It is used to make
changes to the configuration once you have loaded a program and to download the changes to the
programmable controller.
Programming with STEP 7
148 Manual, 04/2017, A5E41552389-AA
Setting Up and Editing the Project
6.6 Setting Up a Project
Using Blocks from Standard Libraries
You can also use blocks from the standard libraries supplied with the software to create user
programs. You access the libraries using the menu command File > Open. You will find further
information on using standard libraries and on creating your own libraries in Working with Libraries
and in the online help.
Creating Source Files/CFC Charts
You want to create a source file in a particular programming language or a CFC chart. To do this,
select the "Source Files" or "Charts" object in the S7 program and then select the menu command
Insert > S7 Software. In the submenu, you can select the source file that matches your
programming language. You can now open the empty source file and start entering your program.
You will find more information under Basic Information on Programming in STL Source Files.
Creating a Symbol Table
An (empty) symbol table ("Symbols" object) is created automatically when the S7 program is
created. When you open the symbol table, the "Symbol Editor" window opens displaying a symbol
table where you can define symbols. You will find more information under Entering Multiple Shared
Symbols in the Symbol Table.
Inserting External Source Files
You can create and edit source files with any ASCII editor. You can then import these files into your
project and compile them to create individual blocks.
The blocks created when the imported source file is compiled are stored in the "Blocks" folder.
You will find more information under Inserting External Source Files.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 149
Setting Up and Editing the Project
6.7 Editing a Project
6.7 Editing a Project
Opening a Project
To open an existing project, enter the menu command File > Open. Then select a project in the
dialog boxes that follow. The project window is then opened.
Note
If the project you require is not displayed in the project list, click on the "Browse" button. In the
browser you can then search for other projects and include any projects you find in the project list.
You can change the entries in the project list using the menu command File > Manage.
Copying a Project
You copy a project by saving it under another name using the menu command File > Save As.
You copy parts of a project such as stations, programs, blocks etc. using the menu command Edit
> Copy.
You will find a step-by-step guide to copying a project under Copying a Project and Copying Part of
a Project.
Deleting a Project
You delete a project using the menu command File > Delete.
You delete parts of a project such as stations, programs, blocks etc. using the menu command
Edit > Delete.
You will find a step-by-step guide to deleting a project under Deleting a Project and Deleting Part of
a Project.
6.7.1 Checking Projects for Software Packages Used
If a project that you are editing contains objects that were created with another software package,
this software package is required to edit this project.
No matter what programming device you are using to work with multiprojects, projects or libraries,
STEP 7 assists you by showing you what software packages and versions are required to do so.
This information on the software packages required is complete under the following conditions:
• If the project (or all projects in a multiproject) or library was created in STEP 7 as of V5.2.
• If you yourself have checked the project for any software packages used in creating it. To do
this, first go to the SIMATIC Manager and select the project concerned. Then select the menu
command Edit > Object Properties. In the dialog box that is displayed, select the "Required
software packages" tab. The information in this tab will tell you whether you should check the
project for software packages.
Programming with STEP 7
150 Manual, 04/2017, A5E41552389-AA
Setting Up and Editing the Project
6.7 Editing a Project
6.7.2 Managing Multilingual Texts
STEP 7 offers the possibility of exporting text that has been created in a project in one language,
having it translated, re-importing it, and displaying it in the translated language.
The following text types can be managed in more than one language:
• Titles and comments
- Block titles and block comments (latter does not apply to PCS 7 projects)
- Network titles and network comments
- Line comments from STL programs
- Comments from symbol tables, variable declaration tables, user-defined data types, and
data blocks
- Comments, state names, and transition names in HiGraph programs
- Extensions of step names and step comments in S7-Graph programs
• Display texts
- Message texts generated by STEP 7, S7-Graph, S7-HiGraph, S7-PDIAG or ProTool
- System text libraries
- User-specific text libraries
- Operator-relevant texts
- User texts
Export
Exporting is done for all blocks and symbol tables located under the selected object. An export file
is created for each text type. This file contains a column for the source language and a column for
the target language. Text in the source language must not be changed.
Import
During import, the contents of the target-language columns (right-hand column) are integrated into
the project to which the selected object belongs. Only those translations whose source text
(exported text) matches an existing text in the "Source Language column are accepted.
Note
When you import the translated texts, these texts are replaced in the entire project. If, for example,
you have translated texts belonging to a certain CPU and these texts occur at other places in the
project, all the occurrences in the project will be replaced.
Changing Languages
When changing languages, you can choose from all the languages that were specified during
import into the selected project. The language change for "Title and Comments" is only applied to
the selected object. A language change for "Display Texts" is always applied to the complete
project.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 151
Setting Up and Editing the Project
6.7 Editing a Project
Deleting a Language
When a language is deleted all the texts in this language are deleted from the internal database.
One language should always be available as a reference language in your project. This can, for
example, be your local language. This language should not be deleted. During exporting and
importing always specify this reference language as the source language. The target language can
be set as desired.
Reorganize
During reorganization, the language is changed to the language currently set. The currently set
language is the language that you selected as the "Language for future blocks". Reorganization
only affects titles and comments.
Comment Management
You can specify how comments for blocks should be managed in projects with texts being
managed in many languages.
Basic Procedure
Programming with STEP 7
152 Manual, 04/2017, A5E41552389-AA
Setting Up and Editing the Project
6.7 Editing a Project
6.7.2.1 Types of Multilingual Texts
For export, a separate file will be created for each type of text. This file will have the text type as its
name and the export format as its extension (texttype.format: for example, SymbolComment.CSV
or SymbolComment.XLS). Files that do not satisfy the naming convention cannot be used as
source or target.
The translatable text within a project is divided into the following text types:
Text Type Description
BlockTitle Block title
BlockComment Block comments
NetworkTitle Network title
NetworkComment Network comments
LineComment Line comments in STL
InterfaceComment Var_Section comments (declaration tables in code
blocks) and
UDT comments (user-defined data types) and
Data block comments
SymbolComment Symbol comments
S7UserTexts Texts entered by the user which can be output on
display devices
S7SystemTextLibrary Texts of system libraries which are integrated into
messages can be updated dynamically during
runtime, and displayed on the PG or other display
devices
S7UserTextLibrary Texts of user libraries which are integrated into
messages can be updated dynamically during
runtime, and displayed on the PG or other display
devices
S7-HiGraph
HiGraphStateName State name
HiGraphStateComment State comment
HiGraphTansitionName Transition name
HiGraphTransitionComment Transition comment
S7-Graph
S7GraphStateName Step name extension
S7GraphStateComment Step comment
Editors in other optional packages (such as ProTool, WinCC, etc.) may have other application-
specific text types that are not described here.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 153
Setting Up and Editing the Project
6.7 Editing a Project
6.7.2.2 Structure of the Export File
The export file is structured as follows:
Example:
Fundamentally, the following applies:
1. The following may not be changed, overwritten, or deleted:
- Fields beginning with "$_" (these are keywords)
- The numbers for the language (in the example above: 9(1) for the source language English
(USA) and 7(1) for the target language German).
2. Each file holds the text for just a single test type. In the example, the text type is NetworkTitle
($_Type(NetworkTitle). The rules for the translator who will edit this file are contained in the
introductory text of the export file itself.
3. Additional information regarding the text or comments must always appear before the type
definition ($_Type…) or after the last column.
Note
If the column for the target language has been overwritten with "512(32) $_Undefined," no target language
was specified when the file was exported. To obtain a better overview, you can replace this text with the target
language, for example, "9(1) English (US)" When importing the translated files, you must verify the proposed
target language and, if necessary, select the correct language.
You can hide text not to be displayed in the target language by entering the keyword $_hide. This does not
apply to comments on variables (InterfaceComment) and to symbols (SymbolComment).
Programming with STEP 7
154 Manual, 04/2017, A5E41552389-AA
Setting Up and Editing the Project
6.7 Editing a Project
Export File Format
You specify the format in which export files are to be saved.
If you have decided to use CSV format, you must keep in mind when editing in Excel that a CSV
file can be only opened properly in Excel if the Open dialog is used. Opening a CSV file by
double-clicking in Explorer often results in an unusable file. You will find it easier to work with
CSV files in Excel if you use the following procedure:
1. Open the export file in Excel
2. Save the files as XLS files
3. Translate the text in the XLS files
4. Save the XLS files in Excel in CSV format.
Note
Export files may not be renamed.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 155
Setting Up and Editing the Project
6.7 Editing a Project
6.7.2.3 Information on the Log File
Error messages and warnings that appear when working with text managed in many languages are
output in a log file (TXT format). This file is stored in the same folder as the export files.
In general, the messages are self-explanatory. Any further explanations are listed below:
Warning: The Text 'xyz' in the 'xyz' file already exists. Further occurrences of the text were ignored.
Explanation
Regardless of its language, a text is used as the basis for the translation. If an identical text is used
for different terms in more than one language or more than once in one language, it can no longer
be uniquely identified and will thus not be translated.
Example:
This only applies to titles and comments.
Remedy
Rename the texts concerned in the exported file (in the example, a single German word must be
used instead of three different ones), and then re-import the texts.
Programming with STEP 7
156 Manual, 04/2017, A5E41552389-AA
Setting Up and Editing the Project
6.7 Editing a Project
6.7.2.4 Managing User Texts Whose Language Font is Not Installed
You can export user texts whose language font is not installed in your operating system, have them
translated and then import them back in and save them for use in your project.
However, such texts can only be displayed on a computer that has the appropriate language font
installed on it.
For example, if you have user texts that have to be translated into Russian and do not have a
Cyrillic font installed on you operating system, proceed as follows:
1. Export the user text to be translated with the source language "English" and target language
"Russian".
2. Send the export files to the translator, who will definitely have a Cyrillic font available.
3. Import the translated export files.
Result: The project is now available in English and Russian on you computer.
4. Save the whole project and send it to the customer who will use the Russian texts and will thus
have a Cyrillic font available to display them.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 157
Setting Up and Editing the Project
6.7 Editing a Project
6.7.2.5 Optimizing the Source for Translation
You can prepare the source material for translation by combining different terms and expressions.
Example
Before preparation (export file):
Combining to a single expression:
After preparation (that is, after import and subsequent export):
Programming with STEP 7
158 Manual, 04/2017, A5E41552389-AA
Setting Up and Editing the Project
6.7 Editing a Project
6.7.2.6 Optimizing the Translation Process
If you have projects where the structure and text are similar to a previous project, you can optimize
the translation process.
In particular, the following procedure is recommended for projects that were created by copying
and then modifying.
Prerequisite
There must be an existing translated export target.
Procedure
1. Copy the export files into the project folder for the new project to be translated.
2. Open the new project and export the text (menu command Options > Manage Multilingual
Texts > Export). Since the export target already exists, you will be asked whether the export
target should be extended or overwritten.
3. Click on the Add button.
4. Have the export files translated (only new text needs to be translated).
5. Then import the translated files.
6.7.2.7 Hiding Texts in Selected Languages
Texts you do not want displayed in the target language can be hidden with the "$_hide" keyword.
This does not apply to comments on variables (InterfaceComment) and symbols
(SymbolComment).
Example:
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 159
Setting Up and Editing the Project
6.7 Editing a Project
6.7.3 Micro Memory Card (MMC) as a Data Carrier
6.7.3.1 What You Should Know About Micro Memory Cards (MMC)
Micro Memory Cards (MMC) are plug-in memory cards, for example, for a CPU 31xC or an IM
151/CPU (ET 200S). Their most distinguishing feature is the highly compact design.
A new memory concept has been introduced for MMCs. It is briefly described below.
Content of the MMCs
The MMC serves as both the load memory and a data storage device (data carrier).
MMC as Load Memory
The MMCs contain the complete load memory for an MMC-compatible CPU. The load memory
contains the program with the blocks (OBs, DBs, FCs, ...) as well as the hardware configuration.
The contents of the load memory influence the functioning of the CPU. In the MMC's function as
load memory, blocks and the hardware configuration with loading functions can be transferred from
it (i.e. Download to CPU). Blocks downloaded to the CPU take effect immediately; however, the
hardware configuration does so only after the CPU is restarted.
Response to Memory Reset
The blocks stored on the MMC are retained after a memory reset.
Loading and Deleting
You can overwrite the blocks on the MMC.
You can erase the blocks on the MMC.
You cannot restore overwritten or erased blocks.
Accessing Data Blocks on the MMC
On the MMC, you can use data blocks and data block contents to handle larger quantities of data
or data rather scarcely required in the user program. New system operations are available for that
purpose:
• SFC 82: creating data blocks in the load memory
• SFC 83: reading from the data block in the load memory
• SFC 84: writing to a data block in the load memory
MMC and Password Protection
If a CPU (i.e. a CPU in the 300-C family) that is fitted with a Micro Memory Card (MMC) is
password-protected, then the user will also be prompted to enter this password when opening this
MMC in the SIMATIC Manager (on a programming device/PC).
Displaying Memory Assignment in STEP 7
The display of the load memory assignment in the module status dialog ("Memory" tab) shows both
the EPROM and the RAM area.
Blocks on MMCs show a 100% EPROM behavior.
Programming with STEP 7
160 Manual, 04/2017, A5E41552389-AA
Setting Up and Editing the Project
6.7 Editing a Project
6.7.3.2 Using a Micro Memory Card as a Data Carrier
A SIMATIC Micro Memory Card (MMC) can be used with STEP 7 in the same manner as any
other type of external data storage medium.
After you have determined that the MMC has enough capacity to accommodate all the data to be
stored, you can transfer any data visible in the operating system's file explorer to the MMC.
In this way, you can make additional drawings, service instructions and functional descriptions
pertaining to your plant available to other personnel.
6.7.3.3 Memory Card File
Memory Card files (*.wld) are generated for the
• Software PLC WinLC (WinAC Basis and WinAC RTX) and
• SlotPLCs CPU 41x-2 PCI (WinAC Slot 412 and WinAC Slot 416).
The blocks and system data for a WinLC or CPU 41x-2 PCI can be saved in a Memory Card file as
in an S7-Memory Card. The contents of these files then correspond to the contents of a
corresponding Memory Card for a S7-CPU.
This file can then be downloaded by a menu command of the operating panel of the WinLC or CPU
41x-2 PCI into their download memories, corresponding to the downloading of the user program
with STEP 7.
In the case of the CPUs 41x-2 PCI this file can be downloaded automatically when the PC
operating system is started up, if the CPU 41x-2 PCI is not buffered and is only operated with a
RAM Card ("Autoload" function).
Memory Card files are "normal" files in the sense of Windows, which can be moved, deleted or
transported with a data medium with the Explorer.
For further information please refer to the corresponding documentation of the WinAC products.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 161
Setting Up and Editing the Project
6.7 Editing a Project
6.7.3.4 Storing Project Data on a Micro Memory Card (MMC)
With STEP 7 you can store the data for your STEP 7 project as well as any other kind of data
(such as WORD or Excel files) on a SIMATIC Micro Memory Card (MMC) in a suitable CPU or a
programming device (PG)/PC. This allows you to access project data with programming devices
that do not have the project saved on them.
Requirements
You can only store project data on an MMC if it is inserted in the slot of a suitable CPU or a
programming device (PG)/PC and there is an online connection established.
Be sure that the MMC has enough capacity to accommodate all the data to be stored on it.
Data that can be stored on an MMC
After you have determined that the MMC has enough capacity to accommodate all the data to be
stored, you can transfer all data visible in the operating system's file explorer to the MMC. These
data can include the following:
• Complete project data for STEP 7
• Station configurations
• Symbol tables
• Blocks and sources
• Texts managed in many languages
• Any other kinds of data, such as WORD or Excel files
Programming with STEP 7
162 Manual, 04/2017, A5E41552389-AA
7 Editing Projects with Different Versions of STEP 7
7.1 Editing Version 2 Projects and Libraries
Version V5.2 of STEP 7 no longer supports Changes in V2 Projects. When you edit V2 projects
or libraries, inconsistencies can occur such that V2 projects or libraries can no longer be edited
with older versions of STEP 7.
In order to continue to edit V2 projects or libraries, a STEP 7 version older that V5.1 must be used.
7.2 Expanding DP Slaves That Were Created with Previous Versions
of STEP 7
Constellations That Can Be Formed by Importing New *.GSD Files
New DP slaves can be accepted by the HW Config if you install new device database files
(*.GSD files) into the Hardware Catalog. After installation, they are available in the Other Field
Devices folder.
You cannot reconfigure or expand a modular DP slave in the usual manner if all of the following
conditions exist:
• The slave was configured with a previous version of STEP 7.
• The slave was represented in the Hardware Catalog by a type file rather than a *.GSD file.
• A new *.GSD file was installed over the slave.
Remedy
If you want to use the DP slave with new modules that are described in the *.GSD file:
• Delete the DP slave and configure it again. Then the DP slave is described completely by the
*.GSD file, not by the type file.
If you do not want to use any new modules that are described only in the *.GSD file:
• Under PROFIBUS-DP in the Hardware Catalog window, select the "Other FIELD
DEVICES/Compatible PROFIBUS-DP Slaves" folder. STEP 7 moves the "old" type files into
this folder when they are replaced by new *.GSD files. In this folder you will find the modules
with which you can expand the already configured DP slave.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 163
Editing Projects with Different Versions of STEP 7
7.2 Expanding DP Slaves That Were Created with Previous Versions of STEP 7
Constellation after Replacement of Type Files by GSD Files in STEP 7 V5.1 Service Pack 4
As of STEP 7 V5.1, Service Pack 4, the type files have been either updated or largely replaced by
GSD files. This replacement only affects the catalog profiles supplied with STEP 7, not any catalog
profiles that you may have created yourself.
DP slaves whose properties were previously determined by type files and are now determined by
GSD files are still located in the same place in the hardware catalog.
The "old" type files were not deleted but moved to another place in the hardware catalog. They are
now located in the catalog folder "Other field devices\Compatible PROFIBUS DP slaves\...".
Expanding an Existing DP Configuration with STEP 7, as of V5.1 Service Pack 4
If you edit a project that was created with a previous version of STEP 7 (earlier than V5.1, SP4)
and you want to expand a modular DP slave, then you cannot use the modules or submodules
taken from the usual place in the hardware catalog. In this case, use the DP slave found at "Other
FIELD DEVICES\Compatible PROFIBUS DP slaves\...".
Editing a DP Configuration with an Earlier Version of STEP 7 V5.1, SP4)
If you configure an "updated" DP slave with STEP 7 as of V5.1, Service Pack 4 and then edit the
project with a previous version of STEP 7 (earlier than STEP 7 V5.1, SP4), you will not be able to
edit this DP slave since the GSD file used is unknown to the previous version.
Remedy: You can install the required GSD file in the previous version of STEP 7. In this case, the
GSD file is stored in the project. If the project is subsequently edited with the current STEP 7
version will use the newly installed GSD file for the configuration.
Programming with STEP 7
164 Manual, 04/2017, A5E41552389-AA
Editing Projects with Different Versions of STEP 7
7.3 Editing Current Configurations with Previous Versions of STEP 7
7.3 Editing Current Configurations with Previous Versions of STEP 7
Configuring Direct Data Exchange (Lateral Communication)
Configuring direct data exchange with a DP master without a DP master system:
• Not possible with STEP 7 V5.0, Service Pack 2 (or older version)
• Possible with STEP 7 V5.0, as of Service Pack 3 and as of STEP 7 V5.1
If you save a DP master without its own DP master system with configured assignments for direct
data exchange and you continue to edit this project with an older version of STEP 7 V5
(STEP 7 V5.0, Service Pack 2 (or older)), the following effects can occur:
• A DP master system is displayed with slaves that are used for a STEP 7-internal data storage
area of the assignments for direct data exchange. These DP slaves do not belong to the
displayed DP master system.
• You cannot connect a new or an orphaned DP master system to this DP master.
Online Connection to the CPU by Means of a PROFIBUS-DP Interface
Configuring the PROFIBUS-DP interface without a DP master system:
• STEP 7 V5.0, Service Pack 2 (or older): a connection to the CPU by means of this interface is
not possible.
• As of STEP 7 V5.0, Service Pack 3: During compilation, system data for the PROFIBUS-DP
interface are generated; a connection to the CPU by means of this interface is possible after
downloading.
Programming with STEP 7
Manual, 04/2017, A5E41552389-AA 165
Editing Projects with Different Versions of STEP 7
7.4 Appending SIMATIC PC Configurations of Previous Versions
7.4 Appending SIMATIC PC Configurations of Previous Versions
PC Configurations of STEP 7 V5.1 Projects (up to SP 1)
As of STEP 7 V5.1, Service Pack 2 you can download communications to the PC station in the
same way as to an S7-300 or S7-400 station (without having to take the roundabout via
configuration file). Nevertheless, a configuration file is always generated during a storing or
compiling operation in order to enable the transmission of the configuration to the target PC station
using this method.
This bears the consequence that "older" PC stations cannot interpret some of the information
included in the newly generated configuration files. STEP 7 automatically adapts itself to this
circumstance:
• If you create a new SIMATIC PC station configuration with STEP 7 as of V5.1, Service Pack 2,
STEP 7 assumes that the target PC station was configured with the help of SIMATIC NET DVD
as of 7/2001, that is, under the presumption that S7RTM (Runtime Manager) is installed. The
configuration files are generated in such a way that they can be interpreted by a "new" PC
station.
• If you append a SIMATIC PC station configuration of a previous version (for example, the PC
station was configured with STEP 7 V5.1, Service Pack 1),. STEP 7 does not presume that the
target PC station was configured with the help of SIMATIC NET DVD as of 7/2001. Those
configuration files are then generated in such a way that they can be interpreted by an "old" PC
station.
If this default behavior does not match your requirements, you can modify it as described below:
Setting in the Context Menu "Configuring H