Docsity
Docsity

Prepare-se para as provas
Prepare-se para as provas

Estude fácil! Tem muito documento disponível na Docsity


Ganhe pontos para baixar
Ganhe pontos para baixar

Ganhe pontos ajudando outros esrudantes ou compre um plano Premium


Guias e Dicas
Guias e Dicas

PROGRAMANDO COM S7 V54 e, Notas de estudo de Tecnologia Industrial

Uma apostila onde realmente aprende a programar um PLC.

Tipologia: Notas de estudo

2010

Compartilhado em 20/08/2010

aislan-de-lima-gabardo-2
aislan-de-lima-gabardo-2 🇧🇷

7 documentos

1 / 650

Toggle sidebar

Esta página não é visível na pré-visualização

Não perca as partes importantes!

bg1
s
Preface
Contents
Introducing the Product and Installing
the Software
1
Installation
2
Working Out the Automation Concept
3
Basics of Designing a Program
Structure
4
Startup and Operation
5
Setting Up and Editing the Project
6
Editing Projects with Different
Versions of STEP 7
7
Defining Symbols
8
Creating Blocks and Libraries
9
Creating Logic Blocks
10
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 Property
15
Configuring Messages
16
Controlling and Monitoring Variables
17
Establishing an Online Connection
and Making CPU Settings
18
Downloading and Uploading
19
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
Working with M7 Programmable
Control Systems
25
SIMATIC
Programming with STEP 7
Manual
This manual is part of the documentation
package with the order number:
6ES7810-4CA08-8BW0
Tips and Tricks
26
Appendix
A
Edition 03/2006
A5E00706944-01
Index
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Pré-visualização parcial do texto

Baixe PROGRAMANDO COM S7 V54 e e outras Notas de estudo em PDF para Tecnologia Industrial, somente na Docsity!

s

Preface

Contents

Introducing the Product and Installing

the Software^1

Installation 2

Working Out the Automation Concept^3

Basics of Designing a Program

Structure^4

Startup and Operation 5

Setting Up and Editing the Project 6

Editing Projects with Different

Versions of STEP 7^7

Defining Symbols 8

Creating Blocks and Libraries 9

Creating Logic Blocks 10

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 Property^15

Configuring Messages^16

Controlling and Monitoring Variables 17

Establishing an Online Connection

and Making CPU Settings^18

Downloading and Uploading 19

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

Working with M7 Programmable

Control Systems^25

SIMATIC

Programming with STEP 7

Manual

This manual is part of the documentation package with the order number: 6ES7810-4CA08-8BW

Tips and Tricks 26

Edition 03/2006 Appendix A A5E00706944-

Index

Siemens AG Automation and Drives Postfach 4848 90437 NÜRNBERG GERMANY

A5E00706944- 03/

Copyright © Siemens AG 2006 Technical data subject to change

Safety Guidelines

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 to property damage only have no safety alert symbol. The 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 with a safety alert symbol indicates that minor personal injury can result if proper precautions are not taken.

Caution without a safety alert symbol indicates that property damage can result if proper precautions are not taken.

Notice indicates that an unintended result or situation can occur if the corresponding notice is not taken into account. 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 device/system may only be set up and used in conjunction with this documentation. Commissioning and operation of a device/system may only be performed by qualified personnel. Within the context of the safety notices in this documentation qualified persons are defined as persons who are authorized to commission, ground and label devices, systems and circuits in accordance with established safety practices and standards.

Prescribed Usage

Note the following:

!

Warning This device and its components may only be used for the applications described in the catalog or the technical description, and only in connection with devices or components from other manufacturers which have been approved or recommended by Siemens. Correct, reliable operation of the product requires proper transport, storage, positioning and assembly as well as careful operation and maintenance.

Trademarks

All names identified by ® are registered trademarks of the 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.

Preface

Programming with STEP 7 iv A5E00706944-

STEP 7 Documentation Packages

This manual is part of the documentation package "STEP 7 Basic Information.“ The following table displays an overview of the STEP 7 documentation:

Documentation Purpose Order Number STEP 7 Basic Information with

  • Working with STEP 7, Getting Started Manual
  • Programming with STEP 7
  • Configuring Hardware and Communication Connections, STEP 7
  • From S5 to S7, Converter Manual

Basic information for technical personnel describing the methods of implementing control tasks with STEP 7 and the S7-300/ programmable controllers.

6ES7810-4CA08-8BW

STEP 7 Reference with

  • Ladder Logic (LAD) / Function Block Diagram (FDB) / Statement List (STL) for S7-300/400 manuals
  • Standard and System Function for S7-300/ Volume 1 and Volume 2

Provides reference information and describes the programming languages LAD, FBD and STL, and standard and system function extending the scope of the STEP 7 basic information.

6ES7810-4CA08-8BW

Online Helps Purpose Order Number Help on STEP 7 Basic information on programming and configuring hardware with STEP 7 in the form of an online help.

Part of the STEP 7 Standard software.

Reference helps on AWL/KOP/FUP Reference help on SFBs/SFCs Reference help on Organization Blocks

Context-sensitive reference information.

Part of the STEP 7 Standard software.

Preface

Programming with STEP 7 A5E00706944-01 v

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 here 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 90327 Nuremberg, Germany for details: Telephone: +49 (911) 895-3200. Internet: http://www.sitrain.com

Technical Support

You can reach the Technical Support for all A&D products

  • Via the Web formula for the Support Request http://www.siemens.com/automation/support-request
  • Phone: + 49 180 5050 222
  • Fax: + 49 180 5050 223 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 Automation & Drives.
  • Information on field service, repairs, spare parts and more under "Services".

A5E00706944-01 vii

  • Programming with STEP
  • 1 Introducing the Product and Installing the Software 1- Contents
    • 1.1 Overview of STEP 7 1-
    • 1.2 The STEP 7 Standard Package 1-
    • 1.3 What's New in STEP 7, Version 5.4? 1-
    • 1.4 Extended Uses of the STEP 7 Standard Package 1-
    • 1.4.1 Engineering Tools........................................................................................... 1-
    • 1.4.2 Run-Time Software......................................................................................... 1-
    • 1.4.3 Human Machine Interface............................................................................... 1-
  • 2 Installation 2-
    • 2.1 Automation License Manager........................................................................... 2-
    • 2.1.1 User Rights Through The Automation License Manager 2-
    • 2.1.2 Installing the Automation License Manager...................................................... 2-
    • 2.1.3 Guidelines for Handling License Keys.............................................................. 2-
    • 2.2 Installing STEP 7 2-
    • 2.2.1 Installation Procedure 2-
    • 2.2.2 Setting the PG/PC Interface 2-
    • 2.3 Uninstalling STEP 7........................................................................................ 2-
  • 3 Working Out the Automation Concept 3-
    • 3.1 Basic Procedure for Planning an Automation Project 3-
    • 3.2 Dividing the Process into Tasks and Areas 3-
    • 3.3 Describing the Individual Functional Areas 3-
    • 3.4 Listing Inputs, Outputs, and In/Outs 3-
    • 3.5 Creating an I/O Diagram for the Motors 3-
    • 3.6 Creating an I/O Diagram for the Valves............................................................ 3-
    • 3.7 Establishing the Safety Requirements.............................................................. 3-
    • 3.8 Describing the Required Operator Displays and Controls................................ 3-
    • 3.9 Creating a Configuration Diagram 3-
  • 4 Basics of Designing a Program Structure 4-
    • 4.1 Programs in a CPU........................................................................................... 4-
    • 4.2 Blocks in the User Program 4-
    • 4.2.1 Organization Blocks and Program Structure 4-
    • 4.2.2 Call Hierarchy in the User Program.................................................................. 4-
    • 4.2.3 Block Types 4-
    • 4.2.3.1 Organization Block for Cyclic Program Processing (OB1) 4-
    • 4.2.3.2 Functions (FC) 4-
    • 4.2.3.3 Function Blocks (FB) 4-
    • 4.2.3.4 Instance Data Blocks 4-
    • 4.2.3.5 Shared Data Blocks (DB)................................................................................ 4-
    • 4.2.3.6 System Function Blocks (SFB) and System Functions (SFC) 4-
      • Programming with STEP Contents
  • viii A5E00706944-
    • 4.2.4 Organization Blocks for Interrupt-Driven Program Processing....................... 4-
    • 4.2.4.1 Time-of-Day Interrupt Organization Blocks (OB10 to OB17) 4-
    • 4.2.4.2 Time-Delay Interrupt Organization Blocks (OB20 to OB23)........................... 4-
    • 4.2.4.3 Cyclic Interrupt Organization Blocks (OB30 to OB38).................................... 4-
    • 4.2.4.4 Hardware Interrupt Organization Blocks (OB40 to OB47).............................. 4-
    • 4.2.4.5 Startup Organization Blocks (OB100 / OB101 / OB102)................................ 4-
    • 4.2.4.6 Background Organization Block (OB90)......................................................... 4-
    • 4.2.4.7 Error Handling Organization Blocks (OB70 to OB87 / OB121 to OB122)...... 4-
  • 5 Startup and Operation 5-
    • 5.1 Starting STEP 7 5-
    • 5.2 Starting STEP 7 with Default Start Parameters................................................ 5-
    • 5.3 Calling the Help Functions................................................................................ 5-
    • 5.4 Objects and Object Hierarchy........................................................................... 5-
    • 5.4.1 Project Object 5-
    • 5.4.2 Library Object 5-
    • 5.4.3 Station Object 5-
    • 5.4.4 Programmable Module Object........................................................................ 5-
    • 5.4.5 S7/M7 Program Object 5-
    • 5.4.6 Block Folder Object 5-
    • 5.4.7 Source File Folder Object 5-
    • 5.4.8 S7/M7 Program without a Station or CPU 5-
    • 5.5 User Interface and Operation 5-
    • 5.5.1 Operating Philosophy 5-
    • 5.5.2 Window Arrangement 5-
    • 5.5.3 Elements in Dialog Boxes............................................................................... 5-
    • 5.5.4 Creating and Managing Objects 5-
    • 5.5.5 Selecting Objects in a Dialog Box 5-
    • 5.5.6 Session Memory 5-
    • 5.5.7 Changing the Window Arrangement............................................................... 5-
    • 5.5.8 Saving and Restoring the Window Arrangement 5-
    • 5.6 Keyboard Operation........................................................................................ 5-
    • 5.6.1 Key Combinations for Menu Commands........................................................ 5-
    • 5.6.2 Key Combinations for Moving the Cursor....................................................... 5-
    • 5.6.3 Key Combinations for Selecting Text 5-
    • 5.6.4 Key Combinations for Access to Online Help................................................. 5-
    • 5.6.5 Key Combinations for Toggling between Windows 5-
  • 6 Setting Up and Editing the Project 6-
    • 6.1 Project Structure 6-
    • 6.2 What You Should Know About Access Protection 6-
    • 6.3 What You Should Know About The Change Log 6-
    • 6.4 Using Foreign-Language Character Sets 6-
    • 6.5 Setting the MS Windows Language 6-
    • 6.6 Setting Up a Project.......................................................................................... 6-
    • 6.6.1 Creating a Project 6-
    • 6.6.2 Inserting Stations 6-
    • 6.6.3 Inserting an S7/M7 Program........................................................................... 6-
    • 6.7 Editing a Project.............................................................................................. 6-
    • 6.7.1 Checking Projects for Software Packages Used 6-
  • Programming with STEP Contents
    • 6.8 Managing Multilingual Texts 6- A5E00706944-01 ix
    • 6.8.1 Types of Multilingual Texts 6-
    • 6.8.2 Structure of the Export File 6-
    • 6.8.3 Managing User Texts Whose Language Font is Not Installed 6-
    • 6.8.4 Information on the Log File............................................................................. 6-
    • 6.8.5 Optimizing the Source for Translation 6-
    • 6.8.6 Optimizing the Translation Process................................................................ 6-
    • 6.9 Micro Memory Card (MMC) as a Data Carrier................................................ 6-
    • 6.9.1 What You Should Know About Micro Memory Cards (MMC)......................... 6-
    • 6.9.2 Using a Micro Memory Card as a Data Carrier 6-
    • 6.9.3 Memory Card File 6-
    • 6.9.4 Storing Project Data on a Micro Memory Card (MMC)................................... 6-
  • 7 Editing Projects with Different Versions of STEP 7 7-
    • 7.1 Editing Version 2 Projects and Libraries........................................................... 7-
      • Previous Versions of STEP 7 7- 7.2 Expanding DP Slaves That Were Created with
    • 7.3 Editing Current Configurations with Previous Versions of STEP 7 7-
    • 7.4 Appending SIMATIC PC Configurations of Previous Versions 7-
      • or Optional Packages 7- 7.5 Displaying Modules Configured with Later STEP 7 Versions
  • 8 Defining Symbols 8-
    • 8.1 Absolute and Symbolic Addressing 8-
    • 8.2 Shared and Local Symbols............................................................................... 8-
    • 8.3 Displaying Shared or Local Symbols................................................................ 8-
    • 8.4 Setting the Address Priority (Symbolic/Absolute)............................................. 8-
    • 8.5 Symbol Table for Shared Symbols 8-
    • 8.5.1 Structure and Components of the Symbol Table 8-
    • 8.5.2 Addresses and Data Types Permitted in the Symbol Table........................... 8-
    • 8.5.3 Incomplete and Non-Unique Symbols in the Symbol Table 8-
    • 8.6 Entering Shared Symbols 8-
    • 8.6.1 General Tips on Entering Symbols................................................................. 8-
    • 8.6.2 Entering Single Shared Symbols in a Dialog Box 8-
    • 8.6.3 Entering Multiple Shared Symbols in the Symbol Table 8-
    • 8.6.4 Using Upper and Lower Case for Symbols 8-
    • 8.6.5 Exporting and Importing Symbol Tables......................................................... 8-
    • 8.6.6 File Formats for Importing/Exporting a Symbol Table 8-
    • 8.6.7 Editing Areas in Symbol Tables...................................................................... 8-
  • 9 Creating Blocks and Libraries 9-
    • 9.1 Selecting an Editing Method............................................................................. 9-
    • 9.2 Selecting the Programming Language 9-
    • 9.2.1 Ladder Logic Programming Language (LAD)................................................... 9-
    • 9.2.2 Function Block Diagram Programming Language (FBD) 9-
    • 9.2.3 Statement List Programming Language (STL) 9-
    • 9.2.4 S7 SCL Programming Language...................................................................... 9-
    • 9.2.5 S7-GRAPH Programming Language (Sequential Control) 9-
    • 9.2.6 S7 HiGraph Programming Language (State Graph) 9-
    • 9.2.7 S7 CFC Programming Language 9-
    • 9.3 Creating Blocks............................................................................................... 9-
    • 9.3.1 Blocks Folder 9-
    • 9.3.2 User-Defined Data Types (UDT) 9-
    • 9.3.3 Block Properties.............................................................................................. 9-
    • 9.3.4 Displaying Block Lengths................................................................................ 9-
    • 9.3.5 Comparing Blocks........................................................................................... 9-
    • 9.3.6 Rewiring 9- - Programming with STEP Contents
  • x A5E00706944-
    • 9.3.7 Attributes for Blocks and Parameters 9-
    • 9.4 Working with Libraries 9-
    • 9.4.1 Hierarchical Structure of Libraries 9-
    • 9.4.2 Overview of the Standard Libraries 9-
  • 10 Creating Logic Blocks 10-
    • 10.1 Basics of Creating Logic Blocks 10-
    • 10.1.1 Structure of the Program Editor Window 10-
    • 10.1.2 Basic Procedure for Creating Logic Blocks 10-
    • 10.1.3 Default Settings for the LAD/STL/FBD Program Editor.................................. 10-
    • 10.1.4 Access Rights to Blocks and Source Files 10-
    • 10.1.5 Instructions from the Program Elements Table 10-
    • 10.2 Editing the Variable Declaration 10-
    • 10.2.1 Using the Variable Declaration in Logic Blocks.............................................. 10-
    • 10.2.2 Interaction Between The Variable Detail View And The Instruction List 10-
    • 10.2.3 Structure of the Variable Declaration Window................................................ 10-
    • 10.3 Multiple Instances in the Variable Declaration 10-
    • 10.3.1 Using Multiple Instances............................................................................... 10-
    • 10.3.2 Rules for Declaring Multiple Instances 10-
    • 10.3.3 Entering a Multiple Instance in the Variable Declaration Window................ 10-
    • 10.4 General Notes on Entering Statements and Comments 10-
    • 10.4.1 Structure of the Code Section 10-
    • 10.4.2 Procedure for Entering Statements 10-
    • 10.4.3 Entering Shared Symbols in a Program 10-
    • 10.4.4 Title and Comments for Blocks and Networks 10-
    • 10.4.5 Entering Block Comments and Network Comments 10-
    • 10.4.6 Working with Network Templates 10-
    • 10.4.7 Search Function for Errors in the Code Section........................................... 10-
    • 10.5 Editing LAD Elements in the Code Section 10-
    • 10.5.1 Settings for Ladder Logic Programming 10-
    • 10.5.2 Rules for Entering Ladder Logic Elements 10-
    • 10.5.3 Illegal Logic Operations in Ladder 10-
    • 10.6 Editing FBD Elements in the Code Section 10-
    • 10.6.1 Settings for Function Block Diagram Programming 10-
    • 10.6.2 Rules for Entering FBD Elements................................................................. 10-
    • 10.7 Editing STL Statements in the Code Section 10-
    • 10.7.1 Settings for Statement List Programming..................................................... 10-
    • 10.7.2 Rules for Entering STL Statements 10-
    • 10.8 Updating Block Calls..................................................................................... 10-
    • 10.8.1 Changing Interfaces...................................................................................... 10-
    • 10.9 Saving Logic Blocks...................................................................................... 10-
  • 11 Creating Data Blocks 11-
    • 11.1 Basic Information on Creating Data Blocks 11-
    • 11.2 Declaration View of Data Blocks 11-
    • 11.3 Data View of Data Blocks 11-
    • 11.4 Editing and Saving Data Blocks 11-
    • 11.4.1 Entering the Data Structure of Shared Data Blocks 11-
      • of Data Blocks Referencing an FB (Instance DBs) 11- 11.4.2 Entering and Displaying the Data Structure
    • 11.4.3 Entering the Data Structure of User-Defined Data Types (UDT) 11-
    • 11.4.4 Entering and Displaying the Structure of Data Blocks Referencing a UDT.... 11-
    • 11.4.5 Editing Data Values in the Data View............................................................. 11-
    • 11.4.6 Resetting Data Values to their Initial Values 11-
    • 11.4.7 Saving Data Blocks....................................................................................... 11-
  • Programming with STEP Contents
  • 12 Parameter Assignment for Data Blocks 12- A5E00706944-01 xi
    • 12.1 Assigning Parameters to Technological Functions 12-
  • 13 Creating STL Source Files 13-
    • 13.1 Basic Information on Programming in STL Source Files................................ 13-
    • 13.2 Rules for Programming in STL Source Files 13-
    • 13.2.1 Rules for Entering Statements in STL Source Files 13-
    • 13.2.2 Rules for Declaring Variables in STL Source Files 13-
    • 13.2.3 Rules for Block Order in STL Source Files..................................................... 13-
    • 13.2.4 Rules for Setting System Attributes in STL Source Files 13-
    • 13.2.5 Rules for Setting Block Properties in STL Source Files 13-
    • 13.2.6 Permitted Block Properties for Each Block Type............................................ 13-
    • 13.3 Structure of Blocks in STL Source Files 13-
    • 13.3.1 Structure of Logic Blocks in STL Source Files 13-
    • 13.3.2 Structure of Data Blocks in STL Source Files 13-
    • 13.3.3 Structure of User-Defined Data Types in STL Source Files........................... 13-
    • 13.4 Syntax and Formats for Blocks in STL Source Files 13-
    • 13.4.1 Format Table of Organization Blocks 13-
    • 13.4.2 Format Table of Function Blocks.................................................................. 13-
    • 13.4.3 Format Table of Functions............................................................................ 13-
    • 13.4.4 Format Table of Data Blocks 13-
    • 13.5 Creating STL Source Files 13-
    • 13.5.1 Creating STL Source Files 13-
    • 13.5.2 Editing S7 Source Files 13-
    • 13.5.3 Setting The Layout of Source Code Text 13-
    • 13.5.4 Inserting Block Templates in STL Source Files............................................ 13-
    • 13.5.5 Inserting the Contents of Other STL Source Files........................................ 13-
    • 13.5.6 Inserting Source Code from Existing Blocks in STL Source Files................ 13-
    • 13.5.7 Inserting External Source Files..................................................................... 13-
    • 13.5.8 Generating STL Source Files from Blocks 13-
    • 13.5.9 Importing Source Files.................................................................................. 13-
    • 13.5.10 Exporting Source Files.................................................................................. 13-
      • a Consistency Check 13- 13.6 Saving and Compiling STL Source Files and Executing
    • 13.6.1 Saving STL Source Files 13-
    • 13.6.2 Checking Consistency in STL Source Files.................................................. 13-
    • 13.6.3 Debugging STL Source Files........................................................................ 13-
    • 13.6.4 Compiling STL Source Files 13-
    • 13.7 Examples of STL Source Files 13-
    • 13.7.1 Examples of Declaring Variables in STL Source Files 13-
    • 13.7.2 Example of Organization Blocks in STL Source Files 13-
    • 13.7.3 Example of Functions in STL Source Files................................................... 13-
    • 13.7.4 Example of Function Blocks in STL Source Files......................................... 13-
    • 13.7.5 Example of Data Blocks in STL Source Files 13-
    • 13.7.6 Example of User-Defined Data Types in STL Source Files 13-
  • 14 Displaying Reference Data 14-
    • 14.1 Overview of the Available Reference Data..................................................... 14-
    • 14.1.1 Cross-Reference List 14-
    • 14.1.2 Program Structure 14-
    • 14.1.3 Assignment List 14-
    • 14.1.4 Unused Symbols............................................................................................. 14-
    • 14.1.5 Addresses Without Symbols........................................................................... 14-
    • 14.1.6 Displaying Block Information for LAD, FBD, and STL 14- - Programming with STEP Contents
  • xii A5E00706944-
    • 14.2 Working with Reference Data....................................................................... 14-
    • 14.2.1 Ways of Displaying Reference Data............................................................. 14-
    • 14.2.2 Displaying Lists in Additional Working Windows 14-
    • 14.2.3 Generating and Displaying Reference Data 14-
    • 14.2.4 Finding Address Locations in the Program Quickly...................................... 14-
    • 14.2.5 Example of Working with Address Locations 14-
  • 15 Checking Block Consistency and Time Stamps as a Block Property 15-
    • 15.1 Checking Block Consistency 15-
    • 15.2 Time Stamps as a Block Property and Time Stamp Conflicts........................ 15-
    • 15.3 Time Stamps in Logic Blocks 15-
    • 15.4 Time Stamps in Shared Data Blocks.............................................................. 15-
    • 15.5 Time Stamps in Instance Data Blocks............................................................ 15-
    • 15.6 Time Stamps in UDTs and Data Blocks Derived from UDTs 15-
    • 15.7 Correcting the Interfaces in a Function, Function Block, or UDT 15-
    • 15.8 Avoiding Errors when Calling Blocks.............................................................. 15-
  • 16 Configuring Messages 16-
    • 16.1 The Message Concept.................................................................................... 16-
    • 16.1.1 What Are the Different Messaging Methods?................................................. 16-
    • 16.1.2 Choosing a Messaging Method 16-
    • 16.1.3 SIMATIC Components.................................................................................... 16-
    • 16.1.4 Parts of a Message......................................................................................... 16-
    • 16.1.5 Which Message Blocks Are Available? 16-
    • 16.1.6 Formal Parameters, System Attributes, and Message Blocks 16-
    • 16.1.7 Message Type and Messages........................................................................ 16-
    • 16.1.8 How to Generate an STL Source File from Message-Type Blocks.............. 16-
    • 16.1.9 Assigning Message Numbers....................................................................... 16-
      • Message Numbers........................................................................................ 16- 16.1.10 Differences Between Project-Oriented and CPU-Oriented Assignment of
    • 16.1.11 Options for Modifying the Message Number Assignment of a Project......... 16-
    • 16.2 Project-Oriented Message Configuration 16-
    • 16.2.1 How to Assign Project-Oriented Message Numbers 16-
    • 16.2.2 Assigning and Editing Block-Related Messages 16-
    • 16.2.2.1 How to Create Block-Related Messages (Project-Oriented) 16-
    • 16.2.2.2 How to Edit Block-Related Messages (Project-Oriented)............................. 16-
    • 16.2.2.3 How to Configure PCS 7 Messages (Project-Oriented) 16-
    • 16.2.3 Assigning and Editing Symbol-Related Messages....................................... 16-
    • 16.2.3.1 How to Assign and Edit Symbol-Related Messages (Project-Oriented) 16-
    • 16.2.4 Creating and Editing User-Defined Diagnostic Messages 16-
    • 16.3 CPU-Oriented Message Configuration 16-
    • 16.3.1 How to Assign CPU-Oriented Message Numbers........................................ 16-
    • 16.3.2 Assigning and Editing Block-Related Messages 16-
    • 16.3.2.1 How to Create Block-Related Messages (CPU-Oriented)............................ 16-
    • 16.3.2.2 How to Edit Block-Related Messages (CPU-Oriented) 16-
    • 16.3.2.3 How to Configure PCS 7 Messages (CPU-Oriented)................................... 16-
    • 16.3.3 Assigning and Editing Symbol-Related Messages....................................... 16-
    • 16.3.3.1 How to Assign and Edit Symbol-Related Messages (CPU-Oriented) 16-
    • 16.3.4 Assigning and Editing User-Specific Diagnostic Messages 16-
    • 16.4 Tips for Editing Messages 16-
    • 16.4.1 Adding Associated Values to Messages 16-
    • 16.4.2 Integrating Texts from Text Libraries into Messages 16-
    • 16.4.3 Deleting Associated Values.......................................................................... 16-
    • 16.5 Translating and Editing Operator Related Texts 16-
    • 16.5.1 Translating and Editing User Texts 16-
  • Programming with STEP Contents
    • 16.6 Translating and Editing Text Libraries 16- A5E00706944-01 xiii
    • 16.6.1 User Text Libraries 16-
    • 16.6.2 Creating User Text Libraries......................................................................... 16-
    • 16.6.3 How to Edit User Text Libraries.................................................................... 16-
    • 16.6.4 System Text Libraries 16-
    • 16.6.5 Translating Text Libraries 16-
    • 16.7 Transferring Message Configuration Data to the Programmable Controller 16-
    • 16.8 Displaying CPU Messages and User-Defined Diagnostic Messages 16-
    • 16.8.1 Configuring CPU Messages 16-
    • 16.8.2 Displaying Stored CPU Messages 16-
    • 16.9 Configuring the 'Reporting of System Errors' 16-
    • 16.9.1 Supported Components and Functional Scope............................................ 16-
    • 16.9.2 Settings for "Report System Error" 16-
    • 16.9.3 Generating Blocks for Reporting System Errors 16-
    • 16.9.4 Generated FB, DB 16-
    • 16.9.5 Creating Foreign-Language Message Texts in 'Report System Error'......... 16-
  • 17 Controlling and Monitoring Variables 17-
    • 17.1 Configuring Variables for Operator Control and Monitoring 17-
      • with Statement List, Ladder Logic, and Function Block Diagram................... 17- 17.2 Configuring Operator Control and Monitoring Attributes
      • via the Symbol Table 17- 17.3 Configuring Operator Control and Monitoring Attributes
    • 17.4 Changing Operator Control and Monitoring Attributes with CFC 17-
      • Operator Interface Programmable Controller 17- 17.5 Transferring Configuration Data to the
  • 18 Establishing an Online Connection and Making CPU Settings 18-
    • 18.1 Establishing Online Connections.................................................................... 18-
    • 18.1.1 Establishing an Online Connection via the "Accessible Nodes" Window....... 18-
    • 18.1.2 Establishing an Online Connection via the Online Window of the Project 18-
    • 18.1.3 Online Access to PLCs in a Multiproject......................................................... 18-
    • 18.1.4 Password Protection for Access to Programmable Controllers...................... 18-
    • 18.1.5 Updating the Window Contents 18-
    • 18.2 Displaying and Changing the Operating Mode............................................... 18-
    • 18.2.1 Displaying and Changing the Operating Mode............................................... 18-
    • 18.3 Displaying and Setting the Time and Date 18-
    • 18.3.1 CPU Clocks with Time Zone Setting and Summer/Winter Time 18-
    • 18.4 Updating the Firmware 18-
    • 18.4.1 Updating Firmware in Modules and Submodules Online 18-
  • 19 Downloading and Uploading 19-
    • 19.1 Downloading from the PG/PC to the Programmable Controller 19-
    • 19.1.1 Requirements for Downloading 19-
    • 19.1.2 Differences Between Saving and Downloading Blocks.................................. 19-
    • 19.1.3 Load Memory and Work Memory in the CPU................................................. 19-
    • 19.1.4 Download Methods Dependent on the Load Memory 19-
    • 19.1.5 Downloading a Program to the S7 CPU 19-
    • 19.1.5.1 Downloading with Project Management 19-
    • 19.1.5.2 Downloading without Project Management 19-
    • 19.1.5.3 Reloading Blocks in the Programmable Controller......................................... 19-
    • 19.1.5.4 Saving Downloaded Blocks on Integrated EPROM 19-
    • 19.1.5.5 Downloading via EPROM Memory Cards 19-
    • 19.2 Compiling and Downloading Several Objects from the PG............................ 19-
    • 19.2.1 Requirements for and Notes on Downloading................................................ 19-
    • 19.2.2 Compiling and Downloading Objects............................................................ 19-
      • Programming with STEP Contents
  • xiv A5E00706944-
    • 19.3 Uploading from the Programmable Controller to the PG/PC........................ 19-
    • 19.3.1 Uploading a Station 19-
    • 19.3.2 Uploading Blocks from an S7 CPU............................................................... 19-
    • 19.3.3 Editing Uploaded Blocks in the PG/PC......................................................... 19-
    • 19.3.3.1 Editing Uploaded Blocks if the User Program is on the PG/PC 19-
    • 19.3.3.2 Editing Uploaded Blocks if the User Program is Not on the PG/PC............. 19-
    • 19.4 Deleting on the Programmable Controller 19-
    • 19.4.1 Erasing the Load/Work Memory and Resetting the CPU 19-
    • 19.4.2 Deleting S7 Blocks on the Programmable Controller 19-
    • 19.5 Compressing the User Memory (RAM) 19-
    • 19.5.1 Gaps in the User Memory (RAM) 19-
    • 19.5.2 Compressing the Memory Contents of an S7 CPU...................................... 19-
  • 20 Testing with the Variable Table 20-
    • 20.1 Introduction to Testing with Variable Tables 20-
    • 20.2 Basic Procedure when Monitoring and Modifying with the Variable Table 20-
    • 20.3 Editing and Saving Variable Tables................................................................ 20-
    • 20.3.1 Creating and Opening a Variable Table 20-
    • 20.3.2 Copying/Moving Variable Tables.................................................................... 20-
    • 20.3.3 Saving a Variable Table.................................................................................. 20-
    • 20.4 Entering Variables in Variable Table 20-
    • 20.4.1 Inserting Addresses or Symbols in a Variable Table...................................... 20-
    • 20.4.2 Inserting a Contiguous Address Range in a Variable Table........................... 20-
    • 20.4.3 Inserting Modify Values 20-
    • 20.4.4 Upper Limits for Entering Timers.................................................................... 20-
    • 20.4.5 Upper Limits for Entering Counters 20-
    • 20.4.6 Inserting Comment Lines................................................................................ 20-
    • 20.4.7 Examples 20-
    • 20.5 Establishing a Connection to the CPU 20-
    • 20.6 Monitoring Variables 20-
    • 20.6.1 Introduction to Monitoring Variables 20-
    • 20.6.2 Defining the Trigger for Monitoring Variables 20-
    • 20.7 Modifying Variables 20-
    • 20.7.1 Introduction to Modifying Variables 20-
    • 20.7.2 Defining the Trigger for Modifying Variables 20-
    • 20.8 Forcing Variables.......................................................................................... 20-
    • 20.8.1 Safety Measures When Forcing Variables 20-
    • 20.8.2 Introduction to Forcing Variables.................................................................. 20-
    • 20.8.3 Differences Between Forcing and Modifying Variables................................ 20-
  • 21 Testing Using Program Status 21-
    • 21.1 Program Status Display 21-
    • 21.2 What You Should Know About Testing in Single-Step Mode/Breakpoints..... 21-
    • 21.3 What You Should Know About the HOLD Mode 21-
    • 21.4 Program Status of Data Blocks 21-
    • 21.5 Setting the Display for Program Status 21-
    • 21.6 Setting the Mode for the Test 21-
  • 22 Testing using the Simulation Program (Optional Package) 22-
    • 22.1 Testing using the Simulation Program S7-PLCSIM (Optional Package) 22-
  • Programming with STEP Contents
  • 23 Diagnostics 23- A5E00706944-01 xv
    • 23.1 Hardware Diagnostics and Troubleshooting................................................... 23-
    • 23.2 Diagnostics Symbols in the Online View 23-
    • 23.3 Diagnosing Hardware: Quick View 23-
    • 23.3.1 Calling the Quick View.................................................................................... 23-
    • 23.3.2 Information Functions in the Quick View 23-
    • 23.4 Diagnosing Hardware: Diagnostic View 23-
    • 23.4.1 Calling the Diagnostic View 23-
    • 23.4.2 Information Functions in the Diagnostic View................................................. 23-
    • 23.5 Module Information 23-
    • 23.5.1 Options for Displaying the Module Information 23-
    • 23.5.2 Module Information Functions 23-
    • 23.5.3 Scope of the Module Type-Dependent Information...................................... 23-
      • DP Slaves After a Y-Link 23- 23.5.4 Displaying the Module Status of PA Field Devices and
    • 23.6 Diagnosing in STOP Mode 23-
    • 23.6.1 Basic Procedure for Determining the Cause of a STOP 23-
    • 23.6.2 Stack Contents in STOP Mode..................................................................... 23-
    • 23.7 Checking Scan Cycle Times to Avoid Time Errors....................................... 23-
    • 23.8 Flow of Diagnostic Information 23-
    • 23.8.1 System Status List SSL 23-
    • 23.8.2 Sending Your Own Diagnostic Messages 23-
    • 23.8.3 Diagnostic Functions 23-
    • 23.9 Program Measures for Handling Errors........................................................ 23-
    • 23.9.1 Evaluating the Output Parameter RET_VAL 23-
    • 23.9.2 Error OBs as a Reaction to Detected Errors 23-
    • 23.9.3 Inserting Substitute Values for Error Detection 23-
    • 23.9.4 I/O Redundancy Error (OB70) 23-
    • 23.9.5 CPU Redundancy Error (OB72) 23-
    • 23.9.6 Time Error (OB80) 23-
    • 23.9.7 Power Supply Error (OB81).......................................................................... 23-
    • 23.9.8 Diagnostic Interrupt (OB82).......................................................................... 23-
    • 23.9.9 Insert/Remove Module Interrupt (OB83) 23-
    • 23.9.10 CPU Hardware Fault (OB84) 23-
    • 23.9.11 Program Sequence Error (OB85) 23-
    • 23.9.12 Rack Failure (OB86) 23-
    • 23.9.13 Communication Error (OB87) 23-
    • 23.9.14 Programming Error (OB121) 23-
    • 23.9.15 I/O Access Error (OB122)............................................................................. 23-
  • 24 Printing and Archiving 24-
    • 24.1 Printing Project Documentation 24-
    • 24.1.1 Basic Procedure when Printing 24-
    • 24.1.2 Print Functions................................................................................................ 24-
    • 24.1.3 Special Note on Printing the Object Tree 24-
    • 24.2 Archiving Projects and Libraries 24-
    • 24.2.1 Uses for Saving/Archiving............................................................................... 24-
    • 24.2.2 Requirements for Archiving 24-
    • 24.2.3 Procedure for Archiving/Retrieving................................................................. 24-
  • 25 Working with M7 Programmable Control Systems 25-
    • 25.1 Procedure for M7 Systems 25-
    • 25.2 Optional Software for M7 Programming 25-
    • 25.3 M7-300/M7-400 Operating Systems............................................................... 25- - Programming with STEP Contents
  • xvi A5E00706944-
  • 26 Tips and Tricks 26-
    • 26.1 Exchanging Modules in the Configuration Table............................................ 26-
    • 26.2 Projects with a Large Number of Networked Stations.................................... 26-
    • 26.3 Rearranging 26-
    • 26.4 Editing Symbols Across Multiple Networks 26-
    • 26.5 Testing with the Variable Table 26-
    • 26.6 Modifying Variables With the Program Editor................................................. 26-
    • 26.7 Virtual Work Memory 26-
  • A Appendix A-
    • A.1 Operating Modes ..............................................................................................A-
    • A.1.1 Operating Modes and Mode Transitions ..........................................................A-
    • A.1.2 STOP Mode ......................................................................................................A-
    • A.1.3 STARTUP Mode ...............................................................................................A-
    • A.1.4 RUN Mode ......................................................................................................A-
    • A.1.5 HOLD Mode....................................................................................................A-
    • A.2 Memory Areas of S7 CPUs.............................................................................A-
    • A.2.1 Distribution of the Memory Areas ...................................................................A-
    • A.2.2 Load Memory and Work Memory ...................................................................A-
    • A.2.3 System Memory..............................................................................................A-
    • A.2.3.1 Using the System Memory Areas ...................................................................A-
    • A.2.3.2 Process-Image Input/Output Tables...............................................................A-
    • A.2.3.3 Local Data Stack.............................................................................................A-
    • A.2.3.4 Interrupt Stack ................................................................................................A-
    • A.2.3.5 Block Stack .....................................................................................................A-
    • A.2.3.6 Diagnostic Buffer ............................................................................................A-
    • A.2.3.7 Evaluating the Diagnostic Buffer ....................................................................A-
    • A.2.3.8 Retentive Memory Areas on S7-300 CPUs ....................................................A-
    • A.2.3.9 Retentive Memory Areas on S7-400 CPUs ....................................................A-
    • A.2.3.10 Configurable Memory Objects in the Work Memory.......................................A-
    • A.3 Data Types and Parameter Types..................................................................A-
    • A.3.1 Introduction to Data Types and Parameter Types..........................................A-
    • A.3.2 Elementary Data Types ..................................................................................A-
    • A.3.2.1 Format of the Data Type INT (16-Bit Integers) ...............................................A-
    • A.3.2.2 Format of the Data Type DINT (32-Bit Integers) ............................................A-
    • A.3.2.3 Format of the Data Type REAL (Floating-Point Numbers).............................A-
      • Binary Coded Decimal Numbers ....................................................................A- A.3.2.4 Format of the Data Types WORD and DWORD in
    • A.3.2.5 Format of the Data Type S5TIME (Time Duration) ........................................A-
    • A.3.3 Complex Data Types ......................................................................................A-
    • A.3.3.1 Format of the Data Type DATE_AND_TIME..................................................A-
    • A.3.3.2 Using Complex Data Types ............................................................................A-
    • A.3.3.3 Using Arrays to Access Data ..........................................................................A-
    • A.3.3.4 Using Structures to Access Data....................................................................A-
    • A.3.3.5 Using User-Defined Data Types to Access Data ...........................................A-
    • A.3.4 Parameter Types ............................................................................................A-
    • A.3.4.1 Format of the Parameter Types BLOCK, COUNTER, TIMER .......................A-
    • A.3.4.2 Format of the Parameter Type POINTER ......................................................A-
    • A.3.4.3 Using the Parameter Type POINTER.............................................................A-
    • A.3.4.4 Block for Changing the Pointer.......................................................................A-
    • A.3.4.5 Format of the Parameter Type ANY ...............................................................A-
    • A.3.4.6 Using the Parameter Type ANY .....................................................................A-
    • A.3.4.7 Assigning Data Types to Local Data of Logic Blocks .....................................A-
    • A.3.4.8 Permitted Data Types when Transferring Parameters ...................................A-
    • A.3.4.9 Transferring to IN_OUT Parameters of a Function Block...............................A-
  • Programming with STEP Contents
    • A.4 Working with Older Projects ...........................................................................A- A5E00706944-01 xvii
    • A.4.1 Converting Version 1 Projects ........................................................................A-
    • A.4.2 Converting Version 2 Projects ........................................................................A-
    • A.4.3 Notes on STEP 7 V.2.1 Projects with GD Communication ............................A-
    • A.4.4 DP-Slaves with Missing or Faulty GSD Files..................................................A-
    • A.5 Sample Programs ...........................................................................................A-
    • A.5.1 Sample Projects and Sample Programs.........................................................A-
    • A.5.2 Sample Program for an Industrial Blending Process......................................A-
    • A.5.2.1 Defining Logic Blocks .....................................................................................A-
    • A.5.2.2 Assigning Symbolic Names ............................................................................A-
    • A.5.2.3 Creating the FB for the Motor .........................................................................A-
    • A.5.2.4 Creating the FC for the Valves .......................................................................A-
    • A.5.2.5 Creating OB1 ..................................................................................................A-
    • A.5.3 Example of Handling Time-of-Day Interrupts .................................................A-
    • A.5.3.1 Structure of the User Program "Time-of-Day Interrupts"................................A-
    • A.5.3.2 FC12 ...............................................................................................................A-
    • A.5.3.3 OB10.............................................................................................................A-
    • A.5.3.4 OB1 and OB80 .............................................................................................A-
    • A.5.4 Example of Handling Time-Delay Interrupts.................................................A-
    • A.5.4.1 Structure of the User Program "Time-Delay Interrupts" ...............................A-
    • A.5.4.2 OB20.............................................................................................................A-
    • A.5.4.3 OB1...............................................................................................................A-
    • A.5.4.4 Example of Masking and Unmasking Synchronous Errors ..........................A-
      • Asynchronous Errors (SFC39 and SFC40) ..................................................A- A.5.4.5 Example of Disabling and Enabling Interrupts and
      • Asynchronous Errors (SFC41 and SFC42) ..................................................A- A.5.4.6 Example of the Delayed Processing of Interrupts and
    • A.6 Accessing Process and I/O Data Areas .......................................................A-
    • A.6.1 Accessing the Process Data Area ................................................................A-
    • A.6.2 Accessing the Peripheral Data Area.............................................................A-
    • A.7 Setting the Operating Behavior ....................................................................A-
    • A.7.1 Changing the Behavior and Properties of Modules......................................A-
      • Modules and Submodules Offline.................................................................A- A.7.2 Updating the Firmware (of the Operating System) in
    • A.7.3 Using the Clock Functions ............................................................................A-
    • A.7.4 Using Clock Memory and Timers .................................................................A-
  • Index Index-

Programming with STEP 7 A5E00706944-01 1-

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, SIMATIC M7-300/M7-400, and SIMATIC C7 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.

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.

Introducing the Product and Installing the Software

Programming with STEP 7 1-2 A5E00706944-

,QVWDOO67(3

3ODQFRQWUROOHUFRQFHSW

DQGGHVLJQSURJUDPVWUXFWXUH

6WDUW67(3

DQGFUHDWHDSURMHFW

&RQILJXUHKDUGZDUHDQGDFRQQHFWLRQ

&RQILJXUHPRGXOHV

1HWZRUNVWDWLRQV

&RQILJXUHFRQQHFWLRQVWRSDUWQHU

'HILQHV\PEROV

&UHDWHXVHUSURJUDP

3URJUDPEORFNV

&DOOEORFNLQSURJUDP

'HILQHORFDOV\PEROV

*HQHUDWHUHIHUHQFHGDWD

&RQILJXUHKDUGZDUHDQGFRQQHFWLRQ

'RZQORDGSURJUDP

7HVWSURJUDPDQGGLDJQRVHHUURUV

3ULQWDQGDUFKLYH

&RQILJXUHKDUGZDUHQRZ"

6\PEROLFSURJUDPPLQJLQVWHDGRI

DEVROXWHSURJUDPPLQJ"

&UHDWHUHIHUHQFHGDWDQRZ" IRUH[DPSOHIRU GHEXJJLQJ

+DYH\RXDOUHDG\FRQILJXUHGWKHKDUGZDUH"

2SWLRQ 3URJUDPPHVVDJHV &RQILJXUHYDULDEOHVIRU2SHUDWRU&RQWURO DQG0RQLWRULQJ