graph

Upload: automation-hoang

Post on 13-Oct-2015

41 views

Category:

Documents


0 download

TRANSCRIPT

  • Important Notes,ContentsProduct Overview

    Installation and Authorization

    Designing a SequentialControl System based on theExample of a DrillWorking with S7-Graph

    Creating a Project

    Programming the Structure ofthe SequencerProgramming Actions andConditionsSaving and Compiling

    Assigning Parameters to andCalling the S7-Graph FBDownloading the S7-GraphFB and Instance DBMonitoring and Testing theSequential Control SystemPrinting the Sequencer

    Overview of All Actions

    Notes on Configuration

    Instance DB

    SIMATIC

    S7-GRAPH for S7-300/400Programming SequentialControl SystemsManualThis manual has the order number:6ES7 811-0CC03-8BA0

    05/99Edition 01 Glossary

    Index

    1

    2

    3

    4 5 6

    7 8 9

    10111213

    14

    15

  • Safety Guidelines

    This manual contains notices which you should observe to ensure your own personal safety, as well asto protect the product and connected equipment. These notices are highlighted in the manual by awarning triangle and are marked as follows according to the level of danger:

    ! Dangerindicates that death, severe personal injury or substantial property damage will result if properprecautions are not taken.

    ! Warningindicates that death, severe personal injury or substantial property damage can result if properprecautions are not taken.

    ! Cautionindicates that minor personal injury or property damage can result if proper precautions are not taken.Notedraws your attention to particularly important information on the product, handling the product, or to aparticular part of the documentation.

    Qualified Personnel

    Only qualified personnel should be allowed to install and work on this equipment. Qualified persons aredefined as persons who are authorized to commission, to ground, and to tag circuits, equipment, andsystems in accordance with established safety practices and standards.

    Correct Usage

    Note the following:

    ! WarningThis device and its components may only be used for the applications described in the catalog or thetechnical descriptions, and only in connection with devices or components from other manufacturerswhich have been approved or recommended by Siemens.

    This product can only function correctly and safely if it is transported, stored, set up, and installedcorrectly, and operated and maintained as recommended.

    TrademarksSIMATIC, SIMATIC HMI and SIMATIC NET are registered trademarks of SIEMENS AG.

    Some of other designations used in these documents are also registered trademarks; the owner's rightsmay be violated if they are used by third parties for their own purposes.

    Copyright Siemens AG 1999 All rights reservedThe reproduction, transmission or use of this document or itscontents is not permitted without express written authority.Offenders will be liable for damages. All rights, including rightscreated by patent grant or registration of a utility model or design,are reserved.

    Siemens AGBereich Automatisierungs- und AntriebstechnikGeschaeftsgebiet Industrie-AutomatisierungssystemePostfach 4848, D- 90327 Nuernberg

    Disclaimer of LiabilityWe have checked the contents of this manual for agreement withthe hardware and software described. Since deviations cannot beprecluded entirely, we cannot guarantee full agreement. However,the data in this manual are reviewed regularly and any necessarycorrections included in subsequent editions. Suggestions forimprovement are welcomed.

    Siemens AG 1999Technical data subject to change.

    Siemens Aktiengesellschaft 6ES 7811-0CC03-8BA0

  • S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 iii

    Important Notes

    Purpose of the ManualThis manual supports you when creating user programs in the S7-Graphprogramming language. It explains how to write programs and describes theelements of a sequencer.This manual applies to the S7-Graph V5.0 programming software package.

    Audience and RequirementsThis manual is intended for persons with the qualifications required for installation,operation, and programming of the described software product.They should be experienced in using computers or devices similar to PCs (forexample programming devices) under the Windows 95/98/ NT 4.0 operatingsystems and should know the STEP 7 standard software and its documentation.

    Manuals Purpose Order NumberSTEP 7 Basic Information with Working with STEP 7 V5.0

    Getting Started Programming with STEP 7 V5.0 Configuring Hardware and

    Communication ConnectionsSTEP 7 V5.0

    STEP 7 From S5 to S7Converter Manual

    Basic information for technicalpersonnel describing the methodsof implementing control tasks withSTEP 7 and the S7-300/400programmable controllers.

    6ES7810-0CC03-8BA0

    STEP 7 Reference with Manuals LAD/FBD/STL for

    S7-300 and 400 System and Standard Functions for

    S7-300 and 400

    Provides reference informationand describes the programminglanguages LAD, FBD and STLand standard and systemfunctions extending the scope ofSTEP 7 basic information.

    As electronic manualspart of theSTEP 7 softwarepackage

  • Important Notes

    S7-GRAPH for S7 300/400 Programming Sequential Control Systemsiv C79000-G7076-C526-01

    Manual and Online HelpThis manual is a reduced version of the online help. Online help contains moredetailed information, for example with step-by-step instructions. The manual andonline help have the same structure so that you can change from one to the otherwithout difficulty.

    Using the Online HelpYou can display the online help in the following ways: With the menu command Help > Help Topics. By activating context-sensitive help about the selected object with the menu

    command Help > Context-Sensitive Help, with the F1 function key, or byclicking the question mark in the toolbar.

    By displaying the Glossary for all STEP 7 applications with the Glossary button.Please note that every STEP 7 application has its own contents and its owncontext-sensitive help system.

    ReferencesReferences to other documentation are indicated by reference numbers in slashes/.../. Based on these numbers, you can check the exact title in the Referencessection in the Appendix.

    Remarks Form for DocumentationTo help us to provide the best possible documentation for you and future S7-Graphusers, we need your support. If you have comments or suggestions relating to thismanual or the online help, please complete the questionnaire at the end of themanual and send it to the address shown. Please include your own personal ratingof the documentation.

  • Important Notes

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 v

    SIMATIC Training CenterCourses are available to help you become familiar with the SIMATIC S7automation system and programmable controllers. Please contact your regionaltraining center or the central training center in Nuremberg, Germany (90327).Telephone: +49 (911) 895-3154.Open round the clock, world-wide

    Johnson City

    Nuremberg

    Singapur

    SIMATIC Hotline

    NurembergSIMATIC BASIC Hotline

    Johnson CitySIMATIC BASIC Hotline

    SingaporeSIMATIC BASIC Hotline

    Local time: Mo.-Fr. 7:00 to 17:00Telephone: +49 (911) 895-7000Fax: +49 (911) 895-7002E-mail: simatic.support@

    Nbgm.siemens.deGMT: +1:00

    Local time: Mo.-Fr. 7:00 to 17:00Telephone: +1 423 461-2522Fax: +1 423 461-2231E-mail: simatic.hotline@

    sea.siemens.comGMT: -5:00

    Local time: Mo.-Fr. 8:30 to 17:30Telephone: +65 740-7000Fax: +65 740-7001E-mail: simatic@

    singnet.com.sgGMT: +8:00

    NurembergSIMATIC Authorization Hotline

    NurembergSIMATIC Premium Hotline

    Local time: Mo.-Fr. 7:00 to 17:00Telephone: +49 (911) 895-7000Fax: +49 (911) 895-7201E-mail: authorization@

    Nbgm.siemens.deGMT: +1:00

    (Calls charged, only withSIMATIC Card)Time: Mo.-Fr. 0:00 to 24:00Telephone: +49 (911) 895-7777Fax: +49 (911) 895-7001GMT: +01:00

  • Important Notes

    S7-GRAPH for S7 300/400 Programming Sequential Control Systemsvi C79000-G7076-C526-01

    SIMATIC Customer Support Online ServicesThe SIMATIC Customer Support team provides you with comprehensive additionalinformation on SIMATIC products in its online services: You can obtain general current information:

    On the Internet at http://www.ad.siemens.de/simatic Current Product Information leaflets and downloads which you may find useful

    for your product are available: On the Internet at http://www.ad.siemens.de/simatic-cs Using the Bulletin Board System (BBS) in Nuremberg (SIMATIC

    Customer Support Mailbox) number +49 (911) 895-7100.To dial the mailbox, use a modem with up to V.34(28.8Kbps) with the followingparameter settings: 8, N, 1, ANSI, or dial via ISDN (x.75, 64 Kbps).

  • S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 vii

    Contents

    Important Notes ..................................................................................................................... iii

    1 Product Overview ................................................................................................. 1-1

    2 Installation and Authorization .............................................................................. 2-12.1 Authorization........................................................................................................... 2-12.2 Installing the Authorization ...................................................................................... 2-22.3 Upgrading the Authorization .................................................................................... 2-32.4 Uninstalling the Authorization .................................................................................. 2-42.5 Rules for Handling Authorizations............................................................................ 2-42.6 Installing S7-Graph ................................................................................................. 2-62.7 Uninstalling S7-Graph ............................................................................................. 2-9

    3 Designing a Sequential Control System based on the Example of a Drill.......... 3-13.1 Technological Task and Functional Diagram ........................................................... 3-33.2 Selecting the Structure of the Sequencer ................................................................ 3-43.3 Defining the System Signals.................................................................................... 3-63.4 Creating the Drill Project in the SIMATIC Manager .................................................. 3-73.5 Creating a Symbol Table......................................................................................... 3-73.6 Creating an S7-Graph FB and Programming a Sequencer ...................................... 3-93.7 Programming Step Actions.................................................................................... 3-123.8 Programming Transitions ...................................................................................... 3-123.9 Programming Monitoring Functions ....................................................................... 3-143.10 Specifying the Standard Function Block ................................................................ 3-153.11 Saving and Closing the Sequencer........................................................................ 3-153.12 Including the Sequencer in the STEP 7 Program................................................... 3-163.13 Downloading the Program to the CPU and Testing the Sequencer ........................ 3-183.14 Test Function: Control Sequencer ......................................................................... 3-193.15 Changing the Sequencer....................................................................................... 3-20

    4 Working with S7-Graph......................................................................................... 4-14.1 Starting S7-Graph ................................................................................................... 4-14.2 The S7-Graph User Interface .................................................................................. 4-24.3 Settings for the Work Area ...................................................................................... 4-54.4 Customizing Display Level, Colors and Fonts.......................................................... 4-84.5 Tools for Editing the Sequencer ............................................................................ 4-124.5.1 Display and Position of the Toolbars ..................................................................... 4-124.5.2 Editing the Sequencer with the Toolbars ............................................................... 4-134.5.3 Navigating in the Sequencer ................................................................................. 4-13

  • Contents

    S7-GRAPH for S7 300/400 Programming Sequential Control Systemsviii C79000-G7076-C526-01

    5 Creating a Project ................................................................................................. 5-15.1 Creating the Project in the SIMATIC Manager ......................................................... 5-15.2 S7-Graph FB or S7-Graph Source File?.................................................................. 5-25.3 S7-Graph FB .......................................................................................................... 5-25.4 S7-Graph Source File ............................................................................................. 5-35.5 Opening an S7-Graph FB or an S7-Graph Source File ............................................ 5-4

    6 Programming the Structure of the Sequencer..................................................... 6-16.1 Sequencer - Principle.............................................................................................. 6-26.2 Structures of a Sequencer....................................................................................... 6-36.3 Rules for the Structure of a Sequencer.................................................................... 6-46.4 Elements of a Sequencer........................................................................................ 6-46.5 Step-Transition Pair and Initial Step ........................................................................ 6-56.6 Jump ...................................................................................................................... 6-66.7 Alternative Branch .................................................................................................. 6-76.8 Simultaneous Branch.............................................................................................. 6-86.9 Branch Stop............................................................................................................ 6-96.10 New Sequencer ...................................................................................................... 6-96.11 Permanent Instructions ......................................................................................... 6-106.12 Block Comment .................................................................................................... 6-11

    7 Programming Actions and Conditions ................................................................ 7-17.1 Actions ................................................................................................................... 7-27.2 Standard Actions .................................................................................................... 7-37.3 Event-Dependent Actions ....................................................................................... 7-47.4 Counters, Timers and Arithmetic in Actions ............................................................. 7-77.5 Conditions............................................................................................................. 7-147.6 Ladder Logic Elements for Programming Conditions ............................................. 7-177.7 Logic Operations with Ladder Logic Elements ....................................................... 7-207.8 FBD Elements for Programming Conditions .......................................................... 7-217.9 S7-Graph Addresses in Conditions ....................................................................... 7-247.10 Supervision Errors and Acknowledgment .............................................................. 7-257.11 Comment, Extended Name, Number, Name ......................................................... 7-277.12 Programming with Symbolic Addresses ................................................................ 7-287.13 Editing Variables................................................................................................... 7-29

    8 Saving and Compiling .......................................................................................... 8-18.1 Saving and Compiling ............................................................................................. 8-18.2 Rules for Saving an S7-Graph FB ........................................................................... 8-28.3 Rules for Saving an S7-Graph Source File .............................................................. 8-28.4 Settings for Saving and Compiling........................................................................... 8-38.4.1 Settings in the General" Tab Page ......................................................................... 8-38.4.2 Settings in the "Compile/Save" Tab Page................................................................ 8-58.4.3 Settings in the "Messages" Tab Page...................................................................... 8-78.5 Saving .................................................................................................................... 8-98.6 Compiling.............................................................................................................. 8-10

  • Contents

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 ix

    9 Assigning Parameters to and Calling the S7-Graph FB...................................... 9-19.1 Calling the S7-Graph FB in the S7 Program ............................................................ 9-19.2 Calling the S7-Graph FB ......................................................................................... 9-19.3 Selecting an FB Parameter Set ............................................................................... 9-29.4 Parameter Sets of the FB........................................................................................ 9-39.5 Input Parameters of the S7-Graph FB ..................................................................... 9-59.6 Output Parameters of the S7-Graph FB................................................................... 9-89.7 The Modes of the Sequential Control System........................................................ 9-109.7.1 Automatic Mode (SW_AUTO) ............................................................................... 9-119.7.2 Manual mode (SW_MAN) ..................................................................................... 9-129.7.3 Inching mode (SW_TAP)....................................................................................... 9-139.7.4 Automatic or Switch to next Mode (SW_TOP) ....................................................... 9-1410 Downloading the S7-Graph FB and Instance DB............................................... 10-110.1 Downloading blocks from the Programming Device to the CPU............................. 10-110.2 Uploading Blocks from the CPU to the Programming Device ................................. 10-2

    11 Monitoring and Testing the Sequential Control System ................................... 11-111.1 Monitoring and Test Functions in S7-Graph........................................................... 11-211.1.1 Monitoring the Status Information.......................................................................... 11-211.1.2 Control Sequencer ................................................................................................ 11-311.1.3 Synchronization .................................................................................................... 11-411.2 Test Functions of STEP 7 ..................................................................................... 11-5

    12 Printing the Sequencer....................................................................................... 12-1

    13 Overview of All Actions ...................................................................................... 13-113.1 Standard Actions with and without Interlock........................................................... 13-113.2 Event-Dependent Actions - with and without Interlock............................................ 13-313.3 Counters in Actions............................................................................................. 13-1313.4 Timers in Actions ................................................................................................ 13-1813.5 Arithmetic in Actions............................................................................................ 13-23

    14 Notes on Configuration ...................................................................................... 14-114.1 General Level Structure and Program Structure .................................................... 14-114.2 Points to Note about Programming Sequencers .................................................... 14-814.3 Linking to Operator Control and Monitoring Systems ........................................... 14-12

  • Contents

    S7-GRAPH for S7 300/400 Programming Sequential Control Systemsx C79000-G7076-C526-01

    15 Instance DB......................................................................................................... 15-115.1 Settings for the Instance DB.................................................................................. 15-115.2 Assignment of Instance DB and S7-Graph FB....................................................... 15-215.3 Automatic Creation of the Instance DB on Saving ................................................. 15-215.4 Creating the Instance DB Later ............................................................................. 15-315.5 Displaying and Printing the Content of the Instance DB......................................... 15-315.6 Accessing the Instance DB ................................................................................... 15-315.7 Structure of an Instance DB .................................................................................. 15-415.8 Outline of the Structure of the Instance DB............................................................ 15-415.9 FB parameters...................................................................................................... 15-415.10 The Transition Structure........................................................................................ 15-915.11 The Step Structure.............................................................................................. 15-1115.12 Sequencer Status ............................................................................................... 15-1315.13 Internal Data Area............................................................................................... 15-19

    Glossary.................................................................................................................. Glossary-1

    Index ........................................................................................................................ Index-1

  • S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 1-1

    1 Product Overview

    S7-Graph Programming LanguageThe S7-Graph programming language extends the range of functions of STEP 7 byallowing you to program sequential control systems graphically.With S7-Graph, you can configure and write programs to control sequentialprocesses with a SIMATIC programmable logic controller (PLC). The process isdivided into single steps with a clearly defined range of functions. The processsequence is represented graphically and can be documented both as graphics andtext.In the steps, you specify the actions to be executed. The progression from one stepto the next is controlled by transitions (step enabling conditions). The definitions,interlocks and monitoring of the transitions are programmed using a subset of theLadder Logic (LAD) or FBD (Function Block Diagram) programming languages.S7-Graph for the S7-300/400 complies with the sequential control language"Sequential Function Chart" specified in the DIN EN 61131-3 (IEC 1131-3)standard.

  • Product Overview

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems1-2 C79000-G7076-C526-01

    The Blocks of a Sequential Control SystemA sequential control system controls the process in a fixed order dependent oncertain conditions.The complexity of the sequential control system depends on the automation task.However, even the simplest system requires at least the three following blocks: A STEP 7 block (1) in which the S7-Graph FB (function block) is called. This

    block can be an organization block (OB), a function (FC), or another FB. An S7-Graph FB (2) that describes the individual subtasks and

    interdependencies of the sequential control system. These subtasks (steps) andinterdependencies (transitions) can be organized in one or more sequencers.

    An instance DB (3) that contains data and parameters of the sequential controlsystem. The instance DB is assigned to the S7-Graph FB and can be createdautomatically by the system.

    OB/FB/FC

    FC70/71/72

    T2

    T1

    S2

    S1

    Comments for...

    FB i(1)

    CALL FBi,DBiINIT_SQ:=

    (2) (3)

    DB i

  • Product Overview

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 1-3

    Section of a Sequencer with Steps and TransitionsYou program sequencers in the S7-Graph FB. A sequencer consists of a sequenceof steps that are activated in a fixed order depending on transitions (step-enablingconditions).

    Motor Limit switch

    S1Step1

    T1

    Step1Action

    S2Step2

    Step2Action

    T2

    Input1 Input2

    Conditions

    Action

    Transition1

    Transition2

    Conditions

  • Product Overview

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems1-4 C79000-G7076-C526-01

    Procedure for Creating a Sequential Control SystemBy working through the tasks listed in the table below step by step, you will get toknow how to program a complete sequential control system.

    Step Task

    1 Practical introduction based on the example of a "drill"

    2 Creating a project3 Programming the structure of a sequencer

    4 Programming actions and conditions

    5 Saving and compiling

    6 Parameter assignment and calling the S7-Graph FB

    7 Downloading the S7-Graph FB and the instance DB

    8 Monitoring and testing the sequential control system

  • S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 2-1

    2 Installation and Authorization

    2.1 Authorization

    A product authorization is required to use the S7-Graph software package.Software protected by this mechanism can only be used when the authorizationrequired by the program or software package is detected on the hard disk of theprogramming device.Different authorizations are necessary, for example for STEP 7 and for the optionalpackages.

    Authorization DisketteTo authorize the product, you require the copy-protected authorization disketteshipped with the package. This contains the actual authorization. The "AuthorsW"program required to display, install, and uninstall the authorization is on the sameCD-ROM as S7-Graph V5.0.

    Number of AuthorizationsThe number of possible authorizations is determined by an authorization counteron the authorization diskette. When you install an authorization, the counter isdecremented by 1. Once the counter reaches the value 0, there are no moreauthorizations on the diskette.

    NoteYou receive a yellow authorization diskette for the STEP 7 standard software with acorresponding authorization. You do not need an authorization for STEP 7 Mini.With each optional software package, you receive a red authorization diskettecontaining one authorization.

    NoteNote the information in the README.WRI file and the rules below in "Rules forHandling Authorizations". If you do not keep to the instructions in this file, you maydestroy the authorization.

  • Installation and Authorization

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems2-2 C79000-G7076-C526-01

    Loss of the Authorization...You can lose an authorization, for example, due to a defect on the hard disk thatprevents you from uninstalling the authorization from the defective hard disk.If you lose the authorization, you can use the emergency authorization. This is alsoon the authorization diskette. The emergency authorization allows you to continueto use the software for a restricted time. In this case, when you start S7-Graph, thetime until the authorization expires is displayed. Before this time expires, youshould obtain a replacement for the lost authorization from your Siemens distributoror sales office.

    NoteThe restricted period of the emergency authorization begins from the moment youinstall it even if you do not start S7-Graph. You cannot extend this period even bytransferring the authorization back to the diskette.

    Installing AuthorsWThe "AuthorsW" program required to display, install, and uninstall the authorizationis on the same CD-ROM as S7-Graph V5.0. You can install this program on yourhard disk and start it there when you want to install and uninstall authorizations.

    NoteThe default location for the AuthorsW program is the AuthorsW folder and you canstart it from the taskbar (START > SIMATIC > AuthorsW > AuthorsW).

    2.2 Installing the Authorization

    Handling the Authorization During InstallationYou should transfer the authorization when prompted by Setup when you installS7-Graph for the first time. Follow the steps below:1. Insert the authorization diskette when Setup asks you for it.2. Then confirm the next prompt.3. The authorization is transferred to a physical drive.

  • Installation and Authorization

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 2-3

    Installing the Authorization LaterIf you start the S7-Graph software and there is no authorization on your system, amessage to this effect is displayed. To install the authorization at a later point intime:1. insert the authorization diskette in your floppy disk drive, for example, drive A.2. Start the "Authorsw.exe" program on the hard disk drive.3. Select drive A:\. The authorizations on the authorization diskette are displayed.4. Select the full authorization for S7-Graph (validity: unlimited).5. Holding down the left mouse button, drag the selected authorization to the

    destination drive. The authorization is transferred to the destination drive.

    NoteThe authorization is effective in Windows NT only when full access to both harddisk "C:" and the source floppy drive is possible.

    Recovering the AuthorizationIf you have a problem with your authorization (defective etc.), please contact thehotline. If a problem occurs, it may be possible to avoid loss of the authorizationusing the menu command Authorization > Recover.

    2.3 Upgrading the Authorization

    Use the "Upgrade" menu command to upgrade authorizations. To use this function,you require: The authorization diskette of the authorization you want to upgrade The "AuthorsW authorization program, version 2.0" on hard disk The new S7-Graph upgrade on diskette The old authorization on diskette or hard diskWhen you upgrade, the old authorizations are deleted and replaced by new ones.For this reason, the authorization diskette must never be made read-only.1. Insert the new authorization diskette.2. Start the "Authorsw.exe" program on the hard disk drive.3. Select the menu command Authorization > Upgrade. A dialog box is opened

    in which you can select the upgrade program. You will then be asked to insertthe authorization diskette of the old authorization.

  • Installation and Authorization

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems2-4 C79000-G7076-C526-01

    4. Insert the required authorization diskette. You will then be asked whether youreally want to upgrade. This is the last opportunity to cancel the upgrade. Afteryou confirm this prompt, do not interrupt the upgrade procedure under anycircumstances otherwise you will lose the authorization.

    5. Click the OK button. You will then be asked to insert the authorization disketteof the new authorization.

    All the necessary requirements are checked. If these requirements are met, theupgrade is completed by activating the new authorization.

    2.4 Uninstalling the Authorization

    If, for example, you want to reformat the hard disk containing the authorization, youmust first transfer the authorizations back to the authorization diskette (uninstall).For this, you require the original yellow authorization diskette of the STEP 7standard software. You can also transfer the authorizations of your optionalpackages back to this authorization diskette.To transfer the authorization back to the authorization diskette:1. insert the yellow original authorization diskette in your floppy disk drive, for

    example, drive A.2. Start the "Authorsw.exe" program on the hard disk drive.3. Select the drive on which your authorization is located. All the authorizations

    found on this drive are displayed.4. Select the relevant authorization.5. Holding down the left mouse button, drag the selected authorization to drive A:\.

    The authorization is transferred to the authorization diskette.6. Close the dialog box if you do not want to remove any further authorizations.

    You can use this diskette again to install the authorization.

    2.5 Rules for Handling Authorizations

    NoteRead the instructions in this section and in the README.TXT. If you do not keep tothe instructions in this file, you may destroy the authorization.

    When is it necessary to uninstall authorizations?Before you format, compress, or restore your hard disk drive, or before you install anew operating system, you must first uninstall existing authorizations.

  • Installation and Authorization

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 2-5

    BackupIf a backup of your hard disk contains copies of your authorizations, there is a riskthat the valid, installed authorizations will be overwritten and destroyed when youwrite the backup data to the hard disk.To avoid loss of the authorization by overwriting an authorized system with abackup: Either remove all authorizations before you make your backup Or exclude the authorizations from the backup.

    Hard Disk OptimizationIf you use an optimization program that allows fixed blocks to be moved on thehard disk, you should only use this function after first transferring all authorizationsfrom the hard disk back to the authorization diskette.

    Defective SectorsAfter installing an authorization, a special cluster is created on the hard disk that issometimes indicated as "defective". Do not attempt to repair this or you willprobably destroy the authorization.

    Read-Only and Copy ProtectionThe authorization diskette must not be made read-only.Files on the authorization diskette can be copied to a different drive (for examplehard disk) and used there. It is, however, not possible to install an authorizationwith the copied data; this is only possible with the original authorization diskette.

    Permitted DrivesThe authorization can only be installed on a hard disk drive. If you have acompressed drive (for example DBLSPACE), you can install on its host drive.The authorization tool prevents installation on unsuitable drives.

    LocationWhen you install an authorization, the files are transferred to the protected folder"AX NF ZZ" with the attributes "system" and "hidden". Do not change these attributes. The files must not be modified or deleted.

  • Installation and Authorization

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems2-6 C79000-G7076-C526-01

    The folder must not be moved. Files copied from the folder (authorizations) aredetected as invalid authorizations and cannot be used.

    If you do not keep to these rules, the authorization will be irretrievably lost.The protected folder "AX NF ZZ" is created only once per drive. It contains all theauthorizations installed on the drive. It is created when you first install anauthorization and is deleted when you remove the last authorization from it.For each authorization, two files with the same name but with different extensionsare created. These files are given the authorization name as the file name.

    Number of AuthorizationsYou can install any number of authorizations on one drive providing there isenough space; however, only one of each version (for example only oneS7-Graph V4.x and only one S7-Graph V5.x). These authorizations do not affecteach other.

    Defective AuthorizationDefective authorizations on a hard disk can no longer be removed with theAuthorsW authorization tool. They can even block the installation of new, validauthorizations. In this case, contact your Siemens distributor or sales office.

    Authorization ToolUse version V2.0 of the AuthorsW authorization tool and where possible avoidusing older versions.

    NoteSince V2.0 does not recognize all older authorizations, you may nevertheless needto use an older AUTHORS version (DOS version) < V3.x.

    2.6 Installing S7-Graph

    S7-Graph contains a Setup program that installs the package automatically.Prompts on the screen guide you step by step through the entire installation. TheSetup program is started as usual when installing software in Windows 95/98 orWindows NT.The essential phases of installation are as follows: Copying the data to your programming device/PC Installing the authorization (if required)

  • Installation and Authorization

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 2-7

    Requirements for Installation Microsoft Windows 95/98 or Windows NT as operating system SIMATIC STEP 7 standard package PC or programming device equipped as explained in the readme fileA programming device (PG) is a personal computer designed specifically for use inan industrial environment. It is fully equipped for programming SIMATICprogrammable controllers. Disk space:

    For the space required on your hard disk, refer to the "Readme". MPI interface (optional):

    You only require the MPI interface between the programming device or PC) andPLC if you want to communicate with the PLC via MPI. For this connection yourequire either:- A PC/MPI cable connected to the communication port of your device, or- An MPI module installed in your device.An MPI port is integrated in some programming devices.

    External Prommer (optional):An external prommer is only required when you want to blow EPROMs usingyour PC.

    Preparations for InstallationBefore you start the installation, Windows 95/98/NT must first be started.To install from CD-ROM, insert the CD-ROM in the CD-ROM drive of your PC.

    Starting the Installation ProgramTo install the software:1. Under Windows 95/98/NT, open the dialog for installing programs by double-

    clicking the Add/Remove Programs" icon in the Control Panel".2. Click Install".3. Insert the CD ROM and click Next". Windows 95/98/NT now automatically

    searches for the setup.exe installation program.4. Follow the instructions on the screen step by step as they are displayed by the

    installation program.The program guides you step by step through the installation. You can move on tothe next step or back to the previous step.During installation, you will be prompted to answer questions and to select options.Please read the following notes so that you have the information you require forthese dialog boxes.

  • Installation and Authorization

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems2-8 C79000-G7076-C526-01

    If you already have a version of S7-Graph installed ...If the installation program detects an S7-Graph installation on your programmingdevice/PC, a message is displayed and you then have the following options: Cancel the installation (you can then uninstall the old S7-Graph version under

    Windows 95/98/NT and then start the new installation again) or Continue the installation and overwrite the old version with the new version.In the interests of "clean" data management, you should uninstall an olderinstallation before installing the new version. Simply overwriting an older versionalso has the disadvantage that when you later uninstall the program, existing partsof the older installation will not be removed.

    Notes on AuthorizationDuring the installation, the program checks whether an authorization already existson the hard disk. If no authorization is found, a message appears informing youthat the software can only be used with an authorization. You can either install theauthorization immediately or continue the installation and install the authorizationlater. If you decide to install immediately, insert the authorization diskette whenprompted to.

    Errors During InstallationThe following errors lead to the installation being canceled: If an initialization error occurs immediately after starting Setup, the most

    probable reason is that Setup was not started under Windows. Not enough space on the disk: You must have enough space on your hard disk

    for the type of installation you have selected (see readme). Defective diskette: If you discover that a diskette is defective, please contact

    your Siemens distributor or sales office. If you make a mistake: Start the installation again and follow the instructions

    carefully.

    Completion of the installation ...Successful installation is indicated by a message on the screen.If changes were made to DOS files during installation, you will be prompted torestart Windows. Following the restart, you can also start S7-Graph.If DOS files were not changed, you can start S7-Graph in the last installationdialog.

  • Installation and Authorization

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 2-9

    2.7 Uninstalling S7-Graph

    To uninstall the software, use the usual method under Windows:1. Under Windows, open the dialog for installing/uninstalling programs by double-

    clicking the Add/Remove Programs" icon in the Control Panel".2. Select the STEP 7 entry in the list of installed programs. Click the

    "Add/Remove" button to uninstall the program.If the "Remove Released File" dialogs appear, click the "No" button if you areunsure whether you want to remove the file or not.

    NoteThis method does not uninstall the authorization. If you also want to uninstall theauthorization, follow the instructions in section on Authorization.

  • Installation and Authorization

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems2-10 C79000-G7076-C526-01

  • S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 3-1

    3 Designing a Sequential Control Systembased on the Example of a Drill

    Welcome to the S7-Graph Beginners ExampleIf you take an hour to work through the beginners example, you will learn how tocreate a sequential control system for automating the drill as described below.

    You first learn how to configure a sequential control system efficiently and will thenbe guided step by step through the tasks you need to perform in the SIMATICManager and in S7-Graph so that you can create the sequential control system, download it to the CPU and test it.The correctly programmed sample is supplied with S7-Graph as a project called"ZEn02_01_S7Graph_Drill".

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems3-2 C79000-G7076-C526-01

    RequirementsTo allow you to program and test the "drill" example, you require the followinghardware and software: Programming device/PC with

    - STEP 7 standard package and the S7-Graph optional package- MPI connection to the programmable logic controller

    A programmable logic controller (in our example an S7-300) consisting of thefollowing: standard rail, 24V power supply, CPU 314 and a digital input/outputmodule (8DI + 8DO)

    As an alternative to the PLC: The "PLC Simulation" S7 optional package

    Procedure for Creating a Sequential Control SystemThe flow diagram illustrates the procedure for creating the sequential controlsystem for the drill example:

    Create symbol table

    Specify structure of sequencerand define signals for system

    Create drill project in theSIMATIC Manager

    Create sequencer: create and open S7 Graph FB1 in

    the SIMATIC Manager Program sequencer

    Program OB1 with FB1 call andcorresponding instance DB (DB1)

    Download sample program (DB1, FB1,OB1) to the CPU in the SIMATICManager and test the sequencer

    Symbolicprogramming

    yes

    no

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 3-3

    3.1 Technological Task and Functional Diagram

    TaskYou want to program a sequential control system to automate a drill. The setup ofthe drill is shown by a technological drawing and the process sequence in the formof a function diagram.

    Technological Drawing - Set Up of the DrillThe drill consists of the following elements: Drill motor with feedback signals for drill running/stopped Start button and coolant switch Cooling pump with feedback signal for coolant pressure reached Clamping device with feedback signal for selected clamp pressure reached Carriage raise/lower drill with limit switches for drill up/down

    Raise drillDrill motor onFeedback signal:- Drill running- Drill stopped

    Cooling pump onFeedback signalCoolant pressure reached

    Start button

    Feedback signal:Selected clamping pressurereached

    Limit switch:Drill up

    Limit switch:Drill down

    Coolant switch

    Drill motor

    Carriage

    Clamp deviceCooling pump

    Lower drill

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems3-4 C79000-G7076-C526-01

    Initial StateThe initial state of the drill is defined as follows: The drill motor and cooling pump are stopped The carriage/drill is in the upper position There is no work piece in the clamping device

    Functional Diagram - Drilling SequenceThe entire drilling sequence can be divided into the following sections: Insert work piece (manual) If required, set switch for coolant (depending on the material) Start the machine with the start button (drill motor starts up) Clamp the work piece with the selected clamp pressure Start the cooling pump (if coolant selected) Lower drill and carriage to the bottom target position (drill) Wait 0.5 seconds at lower target position (drill) Raise drill with carriage to upper target position Remove work piece, turn off drill motor and cooling pump Remove work piece (manual)

    Motorrunning

    stopped

    Carriageup

    down

    Element State

    Clampingdevice

    On

    Off

    Start

    3.2 Selecting the Structure of the Sequencer

    Before you write the program for the sequencer, you should include a conceptphase in which you break down the drilling operation into single steps. The basis ofthe concept design is the technological drawing and the flowchart.

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 3-5

    Dividing the Drilling Process into Individual Steps - Structure of the SequencerThe drilling process is described by S7-Graph in the form of a sequencer. Asequencer represents a sequence of single steps and conditions that control howthe process moves on to the next single step. To specify the structure of thesequencer, follow the steps outlined below:1. Break down the drilling process into steps and specify the order of the steps (for

    example step S2 follows S1" or step S3 follows either step S4 or S7").2. For each step, specify the actions that must be performed in the step (for

    example in S1 the action Drill ready" or in S3 the action Turn on drill motor").3. Then decide for every step which conditions must be met so that the process

    can move on to the next step (for example for T1 the condition Drill started -start button pressed" or for T5 the condition Drill in upper position").

    T2

    S2

    T8

    T3

    T7

    S3

    S1

    T4

    T1

    T6

    S7

    S4

    Drill ready (initial step)

    Clamp work piece

    Turn on drill motor

    Turn on cooling pump

    Lower drill (start drilling)

    Drill program started (start buttonpressed)

    Work piece clamped with selectedpressure

    Drill motor running at selected speed(without coolant)

    Coolant pressure reached

    Drill in lower position

    Drill motor running at selected speed(with coolant)

    S5

    S6

    T5

    T6

    S1

    Raise drill

    Release work piece, turn off drill motorand cooling pump

    Drill in upper position

    Work piece is released, coolingpump stopped, drill motor stoppedWaiting time 500 ms

    S = stepT = transition

    Monitor clamping

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems3-6 C79000-G7076-C526-01

    3.3 Defining the System Signals

    Once you have broken down the drilling operation into individual steps, you shouldthen define the input and output parameters for each step. The basis of theconcept design is the technological drawing and the flowchart.

    Defining Inputs and OutputsList the inputs and outputs for the drill in the form of a table.If you want to program symbolically, enter the required symbolic names (forexample input I 0.4 "Cl_press_ok") for the absolute inputs and outputs and anycomments that will make the program easier to understand (for example"Workpiece clamping pressure reached").In the drill example, it is assumed that the switches and contactors of the drill arecontrolled via the inputs and outputs of the digital input/output module of theS7-300 programmable controller. The input/output module has 8 inputs and 8outputs. The default values of the input and output addresses of the moduleinserted in slot 4 are as follows: I 0 to I 0.7 and Q =0.0 to Q 0.7.

    AbsoluteAddresses

    Symbolicaddresses

    Explanation

    Inputs in the program (I)I 0.0 Dr_mot_running Feedback signal for drill running at selected speed

    I 0.1 Dr_mot_stopped Feedback signal for drill stopped

    I 0.2 Drill_down Limit switch for drill in lower position

    I 0.3 Drill_up Limit switch for drill in upper position

    I 0.4 Cl_press_ok Feedback signal for work piece clamping pressurereached

    I 0.5 Coolant_sel Selector for coolant (dependent on work piece)I 0.6 Cool_press_ok Feedback signal for coolant pressure reached

    I 0.7 Start_button Start button of the drill

    Outputs in the program (Q)Q 0.0 Dr_mot_on Turn on drill motorQ 0.1 Cool_pump_on Turn on cooling pump (dependent on work piece)Q 0.2 Lower_drill Lower drill and carriage to bottom limit positionQ 0.3 Raise_drill Raise drill and carriage to the upper limit positionQ 0.4 Clamp_workp Clamp work piece at required pressure

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 3-7

    3.4 Creating the Drill Project in the SIMATIC Manager

    Creating a ProjectProjects for sequential control systems do not differ from other projects in STEP 7.To create a new project in the SIMATIC Manager, follow the steps outlined below:1. Select the menu command File > New.2. Name the project Drill".

    Inserting an S7 ProgramIn this example, hardware configuration is unnecessary since the defaultaddressing of the input/output module in slot 4 is used. You can thereforeimmediately insert an S7 program in the project folder in the SIMATIC Manager.The S7 program serves as a folder for the blocks of the user program, the sourcefiles and the symbols. Follow the steps below:1. Select the Drill" project.2. Select the menu command Insert > Program > S7 Program.3. Name the S7 program Drill Program".The folders for source files, blocks and symbols are created automatically whenyou insert an S7 program. An empty OB1 is also created in the Blocks folder.

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems3-8 C79000-G7076-C526-01

    3.5 Creating a Symbol Table

    When you program in STEP 7, you work with addresses such as I/O signals,memory bits, counters, timers, data blocks, and function blocks. You can accessthese addresses in your program in absolute format (for example I1.1, M2.0,FB21).You will find the program much clearer and easier to read if you use symbols (forexample Motor_A_on) instead of the absolute addresses. To allow the use ofsymbols, you can enter a name, the absolute address, the data type and acomment for every address used.Once you have defined a symbol, it can be used throughout the entire userprogram of a programmable module.

    Creating a Symbol TableIf you want to write your program using symbolic addresses, it is advisable tocreate the symbol table at this point.1. Open the symbol table in the Drill Program" folder by double-clicking

    Symbols".2. Edit the table as shown below.3. Save the symbol table using the menu command Table > Save.

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 3-9

    3.6 Creating an S7-Graph FB and Programming a Sequencer

    Create an S7-Graph FBThe S7-Graph FB will contain the sequencer. To create an S7-Graph FB, follow thesteps outlined below:1. Open the Blocks" folder in Drill Program" in the SIMATIC Manager.2. Select the menu command Insert > S7 Block > Function Block.3. Set S7-Graph" as the language in the Properties" dialog box.

    Result: The empty FB with the default number 1 is created in the "Blocks"folder.

    Programming a SequencerAfter you have started the S7-Graph editor by double-clicking FB1 the systeminserts the first step (initial step) and the first transition. You can create thestructure both at the "Overview" level and at the "Single Page" level.Using the mouse and the "Sequencer" toolbar at the left-hand edge of the screen,you can then position all the remaining steps and transitions, the alternativebranch and the jump from the end of the sequencer to the start of the sequencer.There are two ways of doing this and both are illustrated here.

    Method 1: "Direct" Mode1. Select transition 1 and click the

    Insert Step + Transition button with the mouseyou arrive at step-transition 6.

    2. Select step 3 and click the

    Open Alternative Branch button.This opens the alternative branch for supplying coolant. The branch begins withtransition 7.

    3. Select the

    Insert Step + Transition button with the mouseand add step (S7) and transition (T8).

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems3-10 C79000-G7076-C526-01

    4. Select the button

    Close alternative branch buttonand then select transition 3.

    5. Now complete the sequencer structure by first selecting transition 6 and thenclicking the

    Insert jump buttonand then selecting step 1.

    Method 2: "Drag & Drop"1. Return to the SIMATIC Manager and create the function block FB2 in the

    "Blocks" folder as described above. As the language, specify "GRAPH" again.2. Start the S7-Graph editor by double-clicking FB2 in the "Blocks" folder.3. Select the menu command Insert > Drag & Drop.4. Select the

    Insert Step + Transition button with the mouseand position it repeatedly on the last transition of the individual elements byclicking with the mouse until you arrive at step-transition 6.

    5. Select the button

    Open alternative branchand open the alternative branch for supplying coolant by clicking step 3. Thebranch begins with transition 7.

    6. Select the

    Insert Step + Transition button with the mouseand add step (S7) and transition (T8).

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 3-11

    7. Select the

    Close alternative branch buttonand select first transition 8 and then transition 3.

    8. Close the sequencer structure with the following button

    Insert jump buttonby selecting first transition 6 and then step 1.

    NoteBefore you start to program step actions, close function block FB2. You onlycreated this FB to try out the second method of creating a sequencer structure.When you close the FB, answer all prompts with "No". For the rest of the exercise,you will be working in FB1.

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems3-12 C79000-G7076-C526-01

    3.7 Programming Step Actions

    There are also two methods available for programming step actions andtransitions: Direct and Drag & Drop. The procedure described below assumes youhave selected the menu command Insert > Drag & Drop:1. Select the menu command Insert > Action.

    Result: The mouse pointer then appears as shown below:

    2. Insert an empty action line by clicking the action box.3. Enter the actions.An action consists of an instruction and an address. For the drill program, fourdifferent instructions are necessary in the steps: S Set output R Reset output N Non holding: As long as the step is active, the signal state of the

    address is 1. D Delay: The address is set to 1 after the defined time has elapsed

    following activation of the step and is reset when the step isdeactivated.

    3.8 Programming Transitions

    The bit logic instructions "normally open contact", "normally closed contact" and"comparator" are used for the step enabling conditions in the transitions. Toprogram transitions:1. Set the "LAD" view and select the relevant buttons in the "LAD/FBD" toolbar

    Insert normally open contact

    Insert normally closed contact

    Insert comparator2. Position the symbols at the appropriate points by clicking the transition lines.

    You can exit the insert mode at any time with the ESC key.3. Enter the addresses. Click the placeholder "??.?" of the required text field. Then

    enter an absolute or symbolic address (for example I 0.7, "Start_switch").

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 3-13

    4. If you wish, you can also enter a comment for the sequencer. In all views, thecomment field is at the top left and can be opened by clicking it with the mouse.

    The following figure shows the completed sequencer.

    GRAPH: Programming s7 Sequential Control Systems - Drill\...File Edit Insert PLC Debug View Options Window Help

    Drill

    T1Trans1

    T4Trans4

    "Drill_down"

    S2Cla...

    T2Trans2

    S3Mo...

    T3Trans3

    T7Trans7

    T8

    Trans8

    Drill_ready

    Clamp_onS "Clamp_workp"

    Motor_onS "Dr_mot_on"

    Coolant_onS "Cool_pump_on"

    Lower_drillN "Lower_drill""

    S4Low...

    S7Coo...

    T6

    "Start_button"

    Clamp_pres_ok"

    "Drill_motor_running"

    "Coolant_sel"

    "Cool_press_ok"

    S1Dr...

    "Drill_motor_running"

    "Coolant_sel"

    S5Rai...

    T5Trans5

    "Drill_up"

    "Cl_press_ok" T6

    Trans6

    "Cool_press_ok"

    S6Cla...

    S1

    CMPTerm_M_pump_off.T

    T#500MS

    Raise_drillD "Raise_drill""

    T#500MS

    Term_M_pump_offR ""Clamp_workp"R "Dr_mot_on"R "Cool_pump_on"

    "Drill_motr_stopped"

    >=

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems3-14 C79000-G7076-C526-01

    When programming comparators, you can use the system information for steps asthe addresses. The addresses have the following significance: Step_name.T: current or last activation time of the step Step_name.U: current or last activation time of the step without the time of a

    disturbance

    3.9 Programming Monitoring Functions

    To program monitoring functions:1. Double-click step 2 to change from the single page" display to the single step"

    display.2. Select the following button in the "LAD/FBD" toolbar

    Insert comparator3. Position the comparator at the appropriate point on the supervision line and

    enter the required monitoring time.

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 3-15

    3.10 Specifying the Standard Function Block

    If you work with default system compilation option "Standard FC required", anexecutable S7-Graph program requires the standard function block FC70/72, thatcontains the run-time system of an S7-Graph sequencer. This is used automaticallyby the S7-Graph optional package.The block is copied automatically to the user project if you select FC70 or FC72 asthe block number and there is not already an FC70 or FC72 in the destinationproject. If you want to use a different number for the standard block, you must copyand renumber yourself.Some older CPUs have neither SFC17 nor SFC18 (Alarm_SQ or Alarm_S). Tocheck whether or not your CPU contains these SFCs:1. Select the menu command PLC > Display Accessible Nodes in the SIMATIC

    Manager or click the corresponding button in the toolbar.2. Open the Blocks" folder in the S7 program.If this container contains neither SFC17 nor SFC18 you must use FC71. Follow thesteps outlined below:3. Start the S7-Graph editor by double-clicking FB1 in the "Blocks" folder in the

    drill program.4. Select the menu command Options > Block Settings.5. Enter 71 in the "FC number" box and close the dialog.As default, you work with FC72. Remember that your CPU must be capable ofprocessing blocks with more than 8 Kbytes. If you CPU does not permit this, youmust do without user-defined parameters and use FC70/71.

    3.11 Saving and Closing the SequencerWhen you save the sequencer, it is automatically compiled.1. Select the menu command File > Save.

    Result: The "Select Instance DB" dialog box is opened with the default instanceDB (DB1).

    2. Accept the settings by clicking OK".Result: The instance data block is automatically created in the "Blocks" folder.

    NoteThe warning S1 without content" in the compiler log simply means that no action isprogrammed in step 1.

    3. To close the sequencer, select the menu command File > Close.

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems3-16 C79000-G7076-C526-01

    3.12 Including the Sequencer in the STEP 7 Program

    Programming OB1The sequential control program for the drill is called and started in organizationblock OB1. You can create OB1 in LAD, FBD, STL or SCL (here it was created inLAD). Program OB1 as shown in the following diagram. Follow the steps below:1. Open the Blocks" folder in the Drill Program" S7 program in the SIMATIC

    Manager.2. Start the LAD/STL/FBD editor by double-clicking OB1.3. Select with the menu command View the programming language LAD.4. Select segment 1 and insert the sequencer call using the program element

    catalog by double-clicking FB1 (Seq_drill).5. Type in the name of the corresponding instance data block (IDB_Seq_drill)

    above the LAD box.6. Select the input parameter INIT_SQ, insert a normally open element using the

    LAD" toolbar and label it M0.0 (INIT_SQ"). Using this parameter, you can setthe sequencer to the initial step (in the example step 1) in the online mode.

    7. Select the menu command File > Save and close the organization block withthe menu command File > Close.

    Note

    All other block parameters can be ignored for the example.

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 3-17

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems3-18 C79000-G7076-C526-01

    3.13 Downloading the Program to the CPU and Testing theSequencer

    Downloading the User ProgramTo allow you to download the program to the CPU, you must download all theblocks (DB1, FB1, OB1, FC72 or FC70/71) to the CPU of the programmablecontroller in the SIMATIC Manager. Follow the steps outlined below:1. Open the Drill Program" S7 program in the SIMATIC Manager and select the

    Blocks" folder.2. Select the menu command PLC > Download.

    NoteIt is best to download the S7-Graph block in the STOP mode since followingdownloading of the instance DB, the sequencer is automatically set to the initialstate.

    You should only download S7-Graph blocks in the RUN-P mode when thesequencer is in the initial state or in the OFF state. If you download the blocks thesequencer in a different state, for example when overwriting an old block, problemsmay occur in the synchronization of the sequencer with the process.

    Testing the User ProgramTo test the user program, you require an online connection to a CPU.1. Open the project window in the SIMATIC Manager.2. Open the sequencer by double-clicking FB1.3. Select the menu command Debug > Monitor.

    Result: The program status is displayed (the initial step is active). Active stepsare displayed in color.

    NoteA monitoring time is programmed in step 2. If the step activation time exceeds theconfigured monitoring time (500 ms) in the supervision condition, the systemrecognizes a supervision error and the disturbed step is displayed in red. If a faultoccurs, you must first meet the condition for switching to the next transition. Usingthe PG function Debug > Control Sequencer you can then acknowledge (seealso Section "Control Sequencer").

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 3-19

    3.14 Test Function: Control Sequencer

    Control Sequencer is a test function with which you can test the sequencer inS7-Graph in all modes. All the settings and entries for the dialog box have thesame effect as the corresponding FB parameters.The entries in the "Control Sequencer" dialog box can be different from the settingsyou used to compile the sequencers. The dialog box settings have priority.

    "Control Sequencer" Dialog boxThe "Control Sequencer" dialog box is used both as an output field that displaysthe current settings and as an input field in which you can change the currentstatus.

    If you acknowledge an error, initialize the sequencer or want to change the step tothe manual mode, call the dialog box with the menu command Debug > ControlSequencer.

    AcknowledgeIf the "Acknowledge errors" option is clickd, you acknowledge a pending errormessage with the "Acknowledge" button. In this way, you can acknowledge adisturbance caused, for example, by the configured monitoring time in Step 2 beingexceeded.Note, however, that before you acknowledge the error you must make sure that thesupervision or interlock conditions that led to the error are no longer satisfied.After an error has occurred, you can enable the next step in the sequencer bysatisfying the step enable condition since the last step enable condition in the cyclein which you acknowledge has priority over the supervision. You must neverthelessacknowledge the error.If the error was caused because the undisturbed activation time Step name.U hasexceeded the configured monitoring time, you can move on the sequencer byclicking the "Acknowledge" button.This is possible because the Step name.U variable is set to "0" when youacknowledge.

    InitializeWith the "Initialize" button, you can restart the sequencer completely with thedefined initial step.

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems3-20 C79000-G7076-C526-01

    Setting the Mode

    If you click one of the round option buttons, you switch the sequencer to theselected mode.You can, for example, run your sequencer in the manual mode instead of theautomatic mode. In the manual mode, you can activate or deactivate any step.Follow the steps outlined below:1. Enter the step number of the step you want to process in the "Step number" box

    or simply click the required step.2. Select the action to be executed with the step:

    - Activate The selected step is activated even if the preceding transition is notsatisfied.

    - Deactivate The selected step is deactivated.Note that before you activate a step you must first deactivate the currently activestep since only one step can be active at any one time in a linear sequencer. Inother words, you can only activate the required step when you have deactivatedthe currently active step.If you have set a new mode, the original mode is indicated in bold face.After you have controlled your sequencer in the manual mode, you can return tothe automatic mode and close the "Control Sequencer" dialog box.

    3.15 Changing the Sequencer

    Often, a program does not run as required at the first attempt. This means thatchanges and modifications are required. This is also the case in our sampleprogram. The configured monitoring time in Step 2 is too short and the programhangs at this step. The following section explains how to make the requiredchanges. You must first change to the "offline" mode.

    Modifying the Monitoring TimeThe monitoring time configured in Step 2 is 500 ms. To give you more time forsetting the "Cl_press_ok" variable, change the monitoring time to 5 s as explainedbelow:1. Double-click step 2 to change from the single page" display to the single step"

    display.2. Close the status by selecting the menu command Debug > Monitor or clicking

    the following button: .3. Enter the value 5 s for the monitoring time.4. Save the sequencer with the menu command File > Save, since the sequencer

    must be recompiled.

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 3-21

    Downloading the Modified SequencerOnce you have compiled the sequencer, you must download it to the CPU. Youcan download the sequencer in the SIMATIC Manager or in the S7-Graph editor. Inthe S7-Graph editor, follow the steps outlined below:1. With the FB open, select the menu command PLC > Download or click the

    Download button. This opens the "Download" dialog.2. Accept the defaults by clicking OK".3. Confirm the prompt to overwrite the existing blocks.

    Include Instance DBIf you have not cleared the system default "Include Instance DB", S7-Graph checkswhether the instance DB has changed since it was last downloaded and whether itmust be updated. The option "Download with Instance DB" is clicked in the"Download" dialog box.Otherwise, S7-Graph does not check the instance DB and leaves you to decidewhether or not to download the instance DB again. The option "Download withInstance DB" is not clicked in the "Download" dialog box.

    Restarting the StatusTo be able to monitor or control the sequencer again, restart Status by selecting

    the menu command Debug > Monitor or by selecting the Monitor button.

  • Designing a Sequential Control System based on the Example of a Drill

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems3-22 C79000-G7076-C526-01

  • S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 4-1

    4 Working with S7-Graph

    AimsThis chapter explains how to get started with S7-Graph. The chapter alsodescribes the user interface and shows you how to customize its appearance.

    Prior ExperienceIn terms of handling, S7-Graph is a typical Windows (95/98/NT) program. It isassumed that you have experience in working with Windows programs. Thisincludes, for example, working with a mouse (right mouse key - context-sensitivemenus) and keyboard, using toolbars and ALT key combinations to click menucommands.

    4.1 Starting S7-Graph

    Requirements for Starting S7-Graph The STEP 7 standard package is installed on your PC/programming device. S7-Graph is installed on your PC/programming device. You have installed the authorization for S7-Graph.

    Starting S7-GraphThere are two ways of starting S7-Graph: Starting under Windows 95/98/NT

    Start S7-Graph by clicking the "Start" button on the taskbar in Windows 95/98 orWindows NT.The S7-Graph entry is under Simatic > STEP 7 > S7-Graph - ProgrammingSequential Control Systems.

    Starting in the SIMATIC managerIn the SIMATIC manager, double-click an S7-Graph FB or an S7-Graph sourcefile.S7-Graph is started and displays the selected block in the selected view.

  • Working with S7-Graph

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems4-2 C79000-G7076-C526-01

    4.2 The S7-Graph User Interface

    Elements of the S7-Graph User Interface

    This section describes the elements of the user interface numbered in the figure. Title bar of the S7-Graph editor (1) Menu bar (2) Toolbars (3), (4), (6), (7) Variable declaration window (5) Work area (8) Status bar (9)

  • Working with S7-Graph

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 4-3

    Message window

    Title Bars

    Title bars are always located at the upper edge of a window in this case thewindow of S7-Graph (1). Apart from the standard Windows buttons, the title barscontain the following information: Title of the software Name and number of the open FB and DB Selected display level Name of the source with complete path

    Work AreaThe work area is a window within S7-Graph in which the sequencers of anS7-Graph FB or an S7-Graph source file are displayed and can be edited.Within the main window of S7-Graph, you can open up to 10 windows at the sametime. You can cascade or tile these windows.

    Menu BarJust like other Windows applications, S7-Graph has a menu bar below the title barof the main window. The display of the menu commands is context-sensitive. Themenu commands are either active (black) or inactive (gray) depending on whetheror not the command can be applied to the currently selected object.

    ToolbarsThe toolbars contain buttons with which you can start frequently required andcurrently available menu commands.The names of the toolbars in S7-Graph are visible when the toolbars are positionedwithin the main window.

    Name Content

    Standard Contains functions for handling files (opening, saving etc.) and for editing(copying, pasting etc.).

    View Contains symbols for selecting various views (for example how S7-GraphFBs are displayed, display of symbolic names etc.).

    Sequencer Contains buttons for editing the sequencer (for example inserting a step-transition pair).

    LAD/FBD Contains buttons for inserting Ladder Logic/FBD elements (for examplecomparator).

  • Working with S7-Graph

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems4-4 C79000-G7076-C526-01

    Status BarThe status bar is at the bottom edge of the main window of S7-Graph. By selectingthe menu command View > Status Bar, you can display or hide the status bar.The status bar contains the following information: Brief information about the selected menu command Symbolic/Absolute: Display of the addresses Online/Offline/Status/Status?

    - Online/Offline: Indicates the location of the open block (online: on theprogrammable controller; offline: on the programming device)

    - Status/Status?: Indicates that you are working in the Monitor" mode. In the"Create" mode this field is empty.The ? appears if you have requested more information than can bedisplayed.

    FB/Source File: Type of object open Modified/Interface Modified

    - Modified: The block has been modified.- Interface Modified: The corresponding instance DB must be created again.

    Variable Declaration WindowThe variable declaration window is displayed to the left of the work area and isused to declare variables. In the left half of the variable declaration window, you willsee the declaration sections and on the right-hand side the detailed information ofthe component selected on the left.In the variable declaration window, you can modify existing parameter sets, systemparameters can be deleted but cannot be edited. It is also possible to extend yourown parameters.If you want to use a parameter in the sequencer, you can drag it from the variabledeclaration window to the sequencer using the mouse and position it at therequired location.Changes you have made to the parameters in the variable declaration window areautomatically updated in the sequencer so that no inconsistencies can result.With the F1 key, detailed help is available on declaring variables in the variabledeclaration window.

  • Working with S7-Graph

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 4-5

    Message Window

    The message window is used to display errors and warnings that occur forexample after compiling the sequencer. This is not a separate window but isanchored to the work area. You can toggle the display of the message window onor off as required. You can also change the size of the message window.

    4.3 Settings for the Work Area

    To allow you to customize the work area and appearance of the user interface,S7-Graph has various display modes and settings. Some of the settings are savedalong with the block you are editing.

    Display Levels for the Work AreaS7-Graph supports you with four different display levels that you can select with themenu View: Overview display Single page display Single step display Permanent Instructions

    Overview Display

    At the overview level, the entire system structure with all the sequencers containedin the FB is displayed. Several sequencers are displayed side by side. This displaylevel is ideal for configuring the sequencers. At this level, you can specify thestructure of the sequencers and select the numbers, names and comments forsteps and transitions.The following elements are displayed: All the sequencers contained in the FB The arrangement of the steps, transitions and branches - however not their

    contents Depending on the zoom factor, steps and transition names are displayed The block comment

  • Working with S7-Graph

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems4-6 C79000-G7076-C526-01

    NoteTo program the contents of the steps and transitions, select the single page orsingle step level.

    Single Page Display

    At the single page level, the entire system structure with all the sequencerscontained in the FB and the contents of the steps and transitions is displayed.Several sequencers are displayed one above the other . This display level issuitable for configuring and programming sequencers. At this display level, you canconfigure the structure of the sequencers and specify numbers, names andcomments for steps and transitions and program their contents.The following elements are displayed: All the sequencers contained in the FB The arrangement of the steps, transitions, and branches Actions: Contents of the steps (except for interlock and supervision) Conditions: Contents of the transitions Depending on the zoom factor, steps and transition names are displayed The block comment The extended name.

    NoteTo program interlocks and supervisions, select the single step level.You can program permanent instructions at the permanent instructions" level.

  • Working with S7-Graph

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 4-7

    Single Step Display

    At the single step level, only one step-transition pair is displayed. All the detailedinformation can be programmed at this display level, as follows: Action: Actions executed within the step Supervision: Conditions for monitoring the displayed step Interlock: Conditions for interlocking the displayed step Transition: Conditions for enabling the step following the currently displayed

    step Step comments Numbers and names of the displayed step-transition pair The extended name. List of the symbolic addresses

    NoteTo display a different step without changing the display level, you can use themenu command Edit > Go To.To change to the next or previous step, use the cursor keys.

    Permanent Instructions

    At the permanent instructions display level, you can program the following: Permanent instructions before the sequencer Permanent instructions after the sequencer

  • Working with S7-Graph

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems4-8 C79000-G7076-C526-01

    Setting a Display LevelTo set a display level:1. Open the View menu.2. Select the display level suitable for the current task:

    - Overview for structuring the sequencers or- Single page to display the structure with actions and conditions or- Single step to program individual steps and transitions.- Permanent instructions for programming permanent conditions and

    permanent block calls.

    Default Setting of a Display LevelAn S7-Graph FB is always opened at the default display level. You select thedefault with the menu command Options > Application Settings in the "General"tab page.Under "New Window View" select the display level at which the S7-Graph FB willbe opened.

    4.4 Customizing Display Level, Colors and Fonts

    Customizing a Display LevelYou can adapt the selected display level to suit your purposes. S7-Graph providesthe following options: Zoom in and zoom out Zoom factor for the current display Lasso functions for zooming Splitting the work area into two windows Buttons for handling windows Displaying and hiding selected areas Setting a default display for certain areas

    Zoom In and Zoom OutSelect the menu commands View > Zoom In or Zoom Out to change the size ofthe display.

  • Working with S7-Graph

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 4-9

    Specifying a Zoom Factor for the Current DisplayYou can adapt the size of the current display to suit its contents by selecting themenu command View > Zoom Factor.If you select a zoom factor that would make text too small to be legible, the stepand transition names are no longer displayed and only the numbers of steps andtransitions are visible. You can, nevertheless, display step and transition names bypositioning the mouse pointer on the step or transition.If you want to avoid this, you can specify minimum zoom factors for the variousviews so that the display size never becomes illegible.You can also revert to the previous zoom factor at any time.

    Lasso Functions for ZoomingIf you want to increase the size of a specific area, you can also use the lassofunction. Drag a rectangle round the area you want to zoom using the mouse.Select the menu command View > Selected Area. Now only the selected area isdisplayed in the S7-Graph work area.

    Splitting the Work Area into Two WindowsWith the menu command Window > Split, you can split the work area verticallyinto two sections and display the sequencer at two different display levels at thesame time.The left half of a split window is always displayed at the overview level. In the righthalf of the split window, you can set any other display level.Steps selected in the left-hand pane can be edited in the right-hand pane.

    Navigating in the Split WindowWith the menu command Window > Next Pane, you can switch backwards andforwards between the two panes.

    Buttons for Handling WindowsS7-Graph provides you with a button for toggling the message window on or offand a button for changing between the split window and the simple window. Thisallows you to set up the work area to suit your requirements.

  • Working with S7-Graph

    S7-GRAPH for S7 300/400 Programming Sequential Control Systems4-10 C79000-G7076-C526-01

    Displaying and HidingApart from displaying individual steps and transitions, S7-Graph provides furtheroptions in the work area. Select the required menu commands from the Viewmenu:

    To display a comment field: View > Display with > Comments To display the address list: View > Display with > Address List To display addresses in symbolic representation: View > Display with >

    Symbols To display with following/preceding references: View > Display with >

    References

    Defaults for the Display of Additional ElementsAdditional elements can also be displayed as part of the default setting when ablock is opened. You select the default with the menu command Options >Application Settings in the "General" tab page. Select the displayed options tomake the default setting: To display a block comment or a step comment: "Display Comments" To display the address list at the single step level: "Display Address List" To display addresses in symbolic representation: "Display Symbols"

    Customizing Colors and FontsS7-Graph also allows you to customize the appearance of individual elements.These include the settings for color, font, lines and Ladder Logic/FBD addresses.

    Modifying the SettingsYou can make all the required settings in the "Editor" tab page. You can displaythis tab page with the menu command Options > Application Settings. When youclose the editor (when you quit the customize functions) any modifications youhave made are saved.

  • Working with S7-Graph

    S7-GRAPH for S7-300/400 Programming Sequential Control SystemsC79000-G7076-C526-01 4-11

    ColorYou can change the color of the following elements:

    Element Create Mode Monitor Mode

    Selected element Selected element

    Step active/transition valid Elements

    Step not active Inactive step

    Error Operator input error Disturbed step

    LAD/FBD satisfied Satisfied conditions in transitions,supervision conditions and interlocks

    LAD/FBD not satisfied Non-satisfied conditions in transitions,supervision conditions and interlocks

    LAD/FBD not processed Non-executed transitions, supervisionconditions or interlocks

    Synchronization point Synchronization points

    FontYou can change the font for the following elements

    Area

    Step-transition number Numbers of the steps/transitions

    Step-transition name Name of the steps/transitions

    LAD/FBD LAD/FBD addresses

    Extended names Titles of the action tables

    Actions Contents of the action tables

    Comments Contents of the comment fields

    LinesYou can change the line style (thickness) for the following types of line:

    Line Style Normal line The entry applie