Simatic: Programming with STEP 7

pdf
Số trang Simatic: Programming with STEP 7 650 Cỡ tệp Simatic: Programming with STEP 7 5 MB Lượt tải Simatic: Programming with STEP 7 0 Lượt đọc Simatic: Programming with STEP 7 20
Đánh giá Simatic: Programming with STEP 7
4.9 ( 11 lượt)
Nhấn vào bên dưới để tải tài liệu
Đang xem trước 10 trên tổng 650 trang, để tải xuống xem đầy đủ hãy nhấn vào bên trên
Chủ đề liên quan

Nội dung

s Preface Contents Introducing the Product and Installing the Software Installation SIMATIC Working Out the Automation Concept Basics of Designing a Program Structure Programming with STEP 7 Startup and Operation Manual Defining Symbols Setting Up and Editing the Project Editing Projects with Different Versions of STEP 7 Creating Blocks and Libraries Creating Logic Blocks Creating Data Blocks Parameter Assignment for Data Blocks Creating STL Source Files Displaying Reference Data Checking Block Consistency and Time Stamps as a Block Property Configuring Messages Controlling and Monitoring Variables Establishing an Online Connection and Making CPU Settings Downloading and Uploading Testing with the Variable Table This manual is part of the documentation package with the order number: 6ES7810-4CA08-8BW0 Testing Using Program Status Testing using the Simulation Program (Optional Package) Diagnostics Printing and Archiving Working with M7 Programmable Control Systems Tips and Tricks Edition 03/2006 A5E00706944-01 Appendix Index 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 A 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. ! indicates that death or severe personal injury may result if proper precautions are not taken. ! Warning 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. Siemens AG Automation and Drives Postfach 4848 90437 NÜRNBERG GERMANY A5E00706944-01 03/2006 Copyright © Siemens AG 2006 Technical data subject to change 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.4, 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 2000 Professional, MS Windows XP Professional or MS Windows Server 2003 operating system. Scope of the Manual This manual is valid for release 5.4 of the STEP 7 programming software package. You can find the latest information on the service packs: • in the "readme.wri" 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 A5E00706944-01 iii Preface 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 STEP 7 Basic Information with Basic information for technical 6ES7810-4CA08-8BW0 personnel describing the methods of implementing control tasks with STEP 7 and the S7-300/400 programmable controllers. • Working with STEP 7, Getting Started Manual • Programming with STEP 7 • Configuring Hardware and Communication Connections, STEP 7 • From S5 to S7, Converter Manual 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/400 Volume 1 and Volume 2 Order Number Provides reference information 6ES7810-4CA08-8BW1 and describes the programming languages LAD, FBD and STL, and standard and system function extending the scope of the STEP 7 basic information. Online Helps Purpose Help on STEP 7 Basic information on Part of the STEP 7 programming and configuring Standard software. hardware with STEP 7 in the form of an online help. Reference helps on AWL/KOP/FUP Reference help on SFBs/SFCs Reference help on Organization Blocks Context-sensitive reference information. iv Order Number Part of the STEP 7 Standard software. Programming with STEP 7 A5E00706944-01 Preface 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". Programming with STEP 7 A5E00706944-01 v Preface vi Programming with STEP 7 A5E00706944-01 Contents 1 Introducing the Product and Installing the Software 1.1 1.2 1.3 1.4 1.4.1 1.4.2 1.4.3 2 3 3-1 Basic Procedure for Planning an Automation Project ...................................... 3-1 Dividing the Process into Tasks and Areas ...................................................... 3-2 Describing the Individual Functional Areas ...................................................... 3-4 Listing Inputs, Outputs, and In/Outs ................................................................. 3-6 Creating an I/O Diagram for the Motors ........................................................... 3-6 Creating an I/O Diagram for the Valves............................................................ 3-7 Establishing the Safety Requirements.............................................................. 3-8 Describing the Required Operator Displays and Controls................................ 3-9 Creating a Configuration Diagram .................................................................. 3-10 Basics of Designing a Program Structure 4.1 4.2 4.2.1 4.2.2 4.2.3 4.2.3.1 4.2.3.2 4.2.3.3 4.2.3.4 4.2.3.5 4.2.3.6 2-1 Automation License Manager........................................................................... 2-1 User Rights Through The Automation License Manager ................................. 2-1 Installing the Automation License Manager...................................................... 2-4 Guidelines for Handling License Keys.............................................................. 2-5 Installing STEP 7 .............................................................................................. 2-6 Installation Procedure ....................................................................................... 2-8 Setting the PG/PC Interface ........................................................................... 2-11 Uninstalling STEP 7........................................................................................ 2-13 Working Out the Automation Concept 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4 Overview of STEP 7 ......................................................................................... 1-1 The STEP 7 Standard Package ....................................................................... 1-6 What's New in STEP 7, Version 5.4? ............................................................. 1-11 Extended Uses of the STEP 7 Standard Package ......................................... 1-14 Engineering Tools........................................................................................... 1-15 Run-Time Software......................................................................................... 1-17 Human Machine Interface............................................................................... 1-19 Installation 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.2.2 2.3 1-1 4-1 Programs in a CPU........................................................................................... 4-1 Blocks in the User Program .............................................................................. 4-2 Organization Blocks and Program Structure .................................................... 4-3 Call Hierarchy in the User Program.................................................................. 4-9 Block Types .................................................................................................... 4-11 Organization Block for Cyclic Program Processing (OB1) ............................. 4-11 Functions (FC) ................................................................................................ 4-16 Function Blocks (FB) ...................................................................................... 4-17 Instance Data Blocks ...................................................................................... 4-20 Shared Data Blocks (DB)................................................................................ 4-23 System Function Blocks (SFB) and System Functions (SFC) ....................... 4-24 Programming with STEP 7 A5E00706944-01 vii Contents 4.2.4 4.2.4.1 4.2.4.2 4.2.4.3 4.2.4.4 4.2.4.5 4.2.4.6 4.2.4.7 5 Startup and Operation 5.1 5.2 5.3 5.4 5.4.1 5.4.2 5.4.3 5.4.4 5.4.5 5.4.6 5.4.7 5.4.8 5.5 5.5.1 5.5.2 5.5.3 5.5.4 5.5.5 5.5.6 5.5.7 5.5.8 5.6 5.6.1 5.6.2 5.6.3 5.6.4 5.6.5 6 5-1 Starting STEP 7 ................................................................................................ 5-1 Starting STEP 7 with Default Start Parameters................................................ 5-3 Calling the Help Functions................................................................................ 5-5 Objects and Object Hierarchy........................................................................... 5-6 Project Object ................................................................................................... 5-8 Library Object ................................................................................................... 5-9 Station Object ................................................................................................. 5-10 Programmable Module Object........................................................................ 5-12 S7/M7 Program Object ................................................................................... 5-14 Block Folder Object ........................................................................................ 5-16 Source File Folder Object ............................................................................... 5-19 S7/M7 Program without a Station or CPU ...................................................... 5-20 User Interface and Operation ......................................................................... 5-21 Operating Philosophy ..................................................................................... 5-21 Window Arrangement ..................................................................................... 5-22 Elements in Dialog Boxes............................................................................... 5-23 Creating and Managing Objects ..................................................................... 5-24 Selecting Objects in a Dialog Box .................................................................. 5-29 Session Memory ............................................................................................. 5-30 Changing the Window Arrangement............................................................... 5-31 Saving and Restoring the Window Arrangement ........................................... 5-31 Keyboard Operation........................................................................................ 5-32 Key Combinations for Menu Commands........................................................ 5-32 Key Combinations for Moving the Cursor....................................................... 5-34 Key Combinations for Selecting Text ............................................................. 5-36 Key Combinations for Access to Online Help................................................. 5-36 Key Combinations for Toggling between Windows ........................................ 5-37 Setting Up and Editing the Project 6.1 6.2 6.3 6.4 6.5 6.6 6.6.1 6.6.2 6.6.3 6.7 6.7.1 viii Organization Blocks for Interrupt-Driven Program Processing....................... 4-26 Time-of-Day Interrupt Organization Blocks (OB10 to OB17) ......................... 4-26 Time-Delay Interrupt Organization Blocks (OB20 to OB23)........................... 4-28 Cyclic Interrupt Organization Blocks (OB30 to OB38).................................... 4-29 Hardware Interrupt Organization Blocks (OB40 to OB47).............................. 4-31 Startup Organization Blocks (OB100 / OB101 / OB102)................................ 4-32 Background Organization Block (OB90)......................................................... 4-34 Error Handling Organization Blocks (OB70 to OB87 / OB121 to OB122)...... 4-36 6-1 Project Structure ............................................................................................... 6-1 What You Should Know About Access Protection ........................................... 6-2 What You Should Know About The Change Log ............................................. 6-4 Using Foreign-Language Character Sets ......................................................... 6-5 Setting the MS Windows Language ................................................................. 6-8 Setting Up a Project.......................................................................................... 6-9 Creating a Project ............................................................................................. 6-9 Inserting Stations ............................................................................................ 6-11 Inserting an S7/M7 Program........................................................................... 6-12 Editing a Project.............................................................................................. 6-14 Checking Projects for Software Packages Used ............................................ 6-15 Programming with STEP 7 A5E00706944-01 Contents 6.8 6.8.1 6.8.2 6.8.3 6.8.4 6.8.5 6.8.6 6.9 6.9.1 6.9.2 6.9.3 6.9.4 7 Editing Projects with Different Versions of STEP 7 7.1 7.2 7.3 7.4 7.5 8 8-1 Absolute and Symbolic Addressing .................................................................. 8-1 Shared and Local Symbols............................................................................... 8-3 Displaying Shared or Local Symbols................................................................ 8-4 Setting the Address Priority (Symbolic/Absolute)............................................. 8-5 Symbol Table for Shared Symbols ................................................................... 8-9 Structure and Components of the Symbol Table ............................................. 8-9 Addresses and Data Types Permitted in the Symbol Table........................... 8-11 Incomplete and Non-Unique Symbols in the Symbol Table ........................... 8-12 Entering Shared Symbols ............................................................................... 8-13 General Tips on Entering Symbols................................................................. 8-13 Entering Single Shared Symbols in a Dialog Box .......................................... 8-14 Entering Multiple Shared Symbols in the Symbol Table ................................ 8-15 Using Upper and Lower Case for Symbols .................................................... 8-16 Exporting and Importing Symbol Tables......................................................... 8-18 File Formats for Importing/Exporting a Symbol Table .................................... 8-18 Editing Areas in Symbol Tables...................................................................... 8-21 Creating Blocks and Libraries 9.1 9.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.3 9.3.1 9.3.2 9.3.3 9.3.4 9.3.5 9.3.6 7-1 Editing Version 2 Projects and Libraries........................................................... 7-1 Expanding DP Slaves That Were Created with Previous Versions of STEP 7 ........................................................................... 7-1 Editing Current Configurations with Previous Versions of STEP 7 .................. 7-3 Appending SIMATIC PC Configurations of Previous Versions ........................ 7-4 Displaying Modules Configured with Later STEP 7 Versions or Optional Packages ....................................................................................... 7-6 Defining Symbols 8.1 8.2 8.3 8.4 8.5 8.5.1 8.5.2 8.5.3 8.6 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.6.6 8.6.7 9 Managing Multilingual Texts ........................................................................... 6-15 Types of Multilingual Texts ............................................................................. 6-17 Structure of the Export File ............................................................................. 6-18 Managing User Texts Whose Language Font is Not Installed ....................... 6-19 Information on the Log File............................................................................. 6-20 Optimizing the Source for Translation ............................................................ 6-21 Optimizing the Translation Process................................................................ 6-22 Micro Memory Card (MMC) as a Data Carrier................................................ 6-23 What You Should Know About Micro Memory Cards (MMC)......................... 6-23 Using a Micro Memory Card as a Data Carrier .............................................. 6-25 Memory Card File ........................................................................................... 6-25 Storing Project Data on a Micro Memory Card (MMC)................................... 6-26 9-1 Selecting an Editing Method............................................................................. 9-1 Selecting the Programming Language ............................................................. 9-2 Ladder Logic Programming Language (LAD)................................................... 9-4 Function Block Diagram Programming Language (FBD) ................................. 9-5 Statement List Programming Language (STL) ................................................. 9-6 S7 SCL Programming Language...................................................................... 9-7 S7-GRAPH Programming Language (Sequential Control) .............................. 9-8 S7 HiGraph Programming Language (State Graph) ........................................ 9-9 S7 CFC Programming Language ................................................................... 9-10 Creating Blocks............................................................................................... 9-11 Blocks Folder .................................................................................................. 9-11 User-Defined Data Types (UDT) .................................................................... 9-12 Block Properties.............................................................................................. 9-13 Displaying Block Lengths................................................................................ 9-15 Comparing Blocks........................................................................................... 9-16 Rewiring .......................................................................................................... 9-19 Programming with STEP 7 A5E00706944-01 ix Contents 9.3.7 9.4 9.4.1 9.4.2 10 Creating Logic Blocks 10.1 10.1.1 10.1.2 10.1.3 10.1.4 10.1.5 10.2 10.2.1 10.2.2 10.2.3 10.3 10.3.1 10.3.2 10.3.3 10.4 10.4.1 10.4.2 10.4.3 10.4.4 10.4.5 10.4.6 10.4.7 10.5 10.5.1 10.5.2 10.5.3 10.6 10.6.1 10.6.2 10.7 10.7.1 10.7.2 10.8 10.8.1 10.9 11 11.4.3 11.4.4 11.4.5 11.4.6 11.4.7 10-1 Basics of Creating Logic Blocks ..................................................................... 10-1 Structure of the Program Editor Window ........................................................ 10-1 Basic Procedure for Creating Logic Blocks .................................................... 10-3 Default Settings for the LAD/STL/FBD Program Editor.................................. 10-4 Access Rights to Blocks and Source Files ..................................................... 10-4 Instructions from the Program Elements Table .............................................. 10-5 Editing the Variable Declaration ..................................................................... 10-6 Using the Variable Declaration in Logic Blocks.............................................. 10-6 Interaction Between The Variable Detail View And The Instruction List ........ 10-8 Structure of the Variable Declaration Window................................................ 10-9 Multiple Instances in the Variable Declaration ............................................. 10-10 Using Multiple Instances............................................................................... 10-10 Rules for Declaring Multiple Instances ......................................................... 10-11 Entering a Multiple Instance in the Variable Declaration Window................ 10-11 General Notes on Entering Statements and Comments .............................. 10-12 Structure of the Code Section ...................................................................... 10-12 Procedure for Entering Statements .............................................................. 10-13 Entering Shared Symbols in a Program ....................................................... 10-14 Title and Comments for Blocks and Networks ............................................. 10-15 Entering Block Comments and Network Comments .................................... 10-16 Working with Network Templates ................................................................. 10-17 Search Function for Errors in the Code Section........................................... 10-18 Editing LAD Elements in the Code Section .................................................. 10-19 Settings for Ladder Logic Programming ....................................................... 10-19 Rules for Entering Ladder Logic Elements ................................................... 10-19 Illegal Logic Operations in Ladder ................................................................ 10-22 Editing FBD Elements in the Code Section .................................................. 10-23 Settings for Function Block Diagram Programming ..................................... 10-23 Rules for Entering FBD Elements................................................................. 10-24 Editing STL Statements in the Code Section ............................................... 10-26 Settings for Statement List Programming..................................................... 10-26 Rules for Entering STL Statements .............................................................. 10-26 Updating Block Calls..................................................................................... 10-27 Changing Interfaces...................................................................................... 10-28 Saving Logic Blocks...................................................................................... 10-29 Creating Data Blocks 11.1 11.2 11.3 11.4 11.4.1 11.4.2 x Attributes for Blocks and Parameters ............................................................. 9-19 Working with Libraries .................................................................................... 9-20 Hierarchical Structure of Libraries .................................................................. 9-22 Overview of the Standard Libraries ................................................................ 9-22 11-1 Basic Information on Creating Data Blocks .................................................... 11-1 Declaration View of Data Blocks .................................................................... 11-2 Data View of Data Blocks ............................................................................... 11-3 Editing and Saving Data Blocks ..................................................................... 11-4 Entering the Data Structure of Shared Data Blocks ....................................... 11-4 Entering and Displaying the Data Structure of Data Blocks Referencing an FB (Instance DBs) ........................................ 11-5 Entering the Data Structure of User-Defined Data Types (UDT) ................... 11-7 Entering and Displaying the Structure of Data Blocks Referencing a UDT.... 11-8 Editing Data Values in the Data View............................................................. 11-9 Resetting Data Values to their Initial Values .................................................. 11-9 Saving Data Blocks....................................................................................... 11-10 Programming with STEP 7 A5E00706944-01
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.