SIMATIC Programming with STEP 7 Manual This manual is part of the documentation package with the order number: 6ES7810-4CA10-8BW0 05/2010 A5E02789666-01 Introducing the Product and Installing the Software 1 Installation 2 Working Out the Automation Concept 3 Basics of Designing a Program Structure 4 Startup and Operation 5 Setting Up and Editing the Project 6 Editing Projects with Different Versions of STEP 7 7 Defining Symbols 8 Creating Blocks and Libraries 9 Basics of Creating Logi
Siemens AG Industry Sector Postfach 48 48 90026 NÜRNBERG GERMANY A5E02789666-01 Ⓟ 05/2010 Copyright © Siemens AG 2010.
Continued SIMATIC Programming with STEP 7 Manual Setting Up and Editing the Project 16 Controlling and Monitoring Variables 17 Establishing an Online Connection and Making CPU Settings 18 Downloading and Uploading 19 Testing with the Variable Table 20 Testing Using Program Status 21 Testing using the Simulation Program (Optional Package) 22 Diagnostics 23 Printing and Archiving 24 Working with M7 Programmable Control Systems This manual is part of the documentation package with the ord
Legal information Warning notice system This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are graded according to the degree of danger.
Preface Purpose This manual provides a complete overview of programming with STEP 7. It is designed to support you when installing and commissioning the software. It explains how to proceed when creating programs and describes the components of user programs. The manual is intended for people who are involved in carrying out control tasks using STEP 7 and SIMATIC S7 automation systems. We recommend that you familiarize yourself with the examples in the manual "Working with STEP 7 V5.5, Getting Started.
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-4CA10-8BW0 personnel describing the methods of implementing control tasks with STEP 7 and the S7-300/400 programmable controllers.
Preface Online Help The manual is complemented by an online help which is integrated in the software. This online help is intended to provide you with detailed support when using the software. The help system is integrated in the software via a number of interfaces: • There are several menu commands which you can select in the Help menu: The Contents command opens the index for the Help on STEP 7. • Using Help provides detailed instructions on using the online help.
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 at: http://www.siemens.com/simatic-tech-doku-portal The online catalog and order system is found under: http://mall.automation.siemens.
Preface Technical Support You can reach the Technical Support for all Industry Automation and Drive Technology products • Via the Web formula for the Support Request http://www.siemens.com/automation/support-request Additional information about our Technical Support can be found on the Internet pages http://www.siemens.com/automation/service Service & Support on the Internet In addition to our documentation, we offer our Know-how online on the internet at: http://www.siemens.
Preface 10 Programming with STEP 7 Manual, 05/2010, A5E02789666-01
Contents 1 Introducing the Product and Installing the Software.............................................................................23 1.1 1.2 1.3 1.4 1.4.1 1.4.2 1.4.3 2 Installation..................................................................................................................................................43 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.2.2 2.3 2.4 2.4.1 2.4.2 3 Automation License Manager .................................................................................
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.............................................................................................................................113 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 5.6.6 6 Starting STEP 7 ...............................................................................................................
Contents 6.7.2.3 6.7.2.4 6.7.2.5 6.7.2.6 6.7.2.7 6.7.3 6.7.3.1 6.7.3.2 6.7.3.3 6.7.3.4 7 Editing Projects with Different Versions of STEP 7.............................................................................185 7.1 7.2 7.3 7.4 7.5 8 Editing Version 2 Projects and Libraries...............................................................................185 Expanding DP Slaves That Were Created with Previous Versions of STEP 7 ....................
Contents 9.4 9.4.1 9.4.2 10 Basics of Creating Logic Blocks ...........................................................................................................239 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 14 Working with Libraries..........................................................................................
Contents 11 Creating Data Blocks ..............................................................................................................................267 11.1 11.2 11.3 11.4 11.4.1 11.4.2 11.4.3 11.4.4 11.4.5 11.4.6 11.4.7 12 Parameter Assignment for Data Blocks................................................................................................277 12.1 13 Basic Information on Creating Data Blocks ..........................................................................
Contents 13.7.2 13.7.3 13.7.4 13.7.5 13.7.6 14 Displaying Reference Data .....................................................................................................................309 14.1 14.1.1 14.1.2 14.1.3 14.1.4 14.1.5 14.1.6 14.2 14.2.1 14.2.2 14.2.3 14.2.4 14.2.5 15 Checking Block Consistency.................................................................................................325 Time Stamps as a Block Property and Time Stamp Conflicts ........................................
Contents 16.3 16.3.1 16.3.2 16.3.2.1 16.3.2.2 16.3.2.3 16.3.3 16.3.3.1 16.3.4 16.4 16.4.1 16.4.2 16.4.3 16.5 16.5.1 16.6 16.6.1 16.6.2 16.6.3 16.6.4 16.6.5 16.7 16.7.1 16.8 16.8.1 16.8.2 16.9 16.9.1 16.9.2 16.9.3 16.9.4 16.9.5 16.9.6 16.9.7 16.9.8 16.9.9 17 CPU-Oriented Message Configuration .................................................................................354 How to Assign CPU-Oriented Message Numbers................................................................
Contents 18 Establishing an Online Connection and Making CPU Settings ..........................................................401 18.1 18.1.1 18.1.2 18.1.3 18.1.4 18.1.5 18.2 18.3 18.3.1 18.4 18.4.1 19 Downloading and Uploading ..................................................................................................................415 19.1 19.1.1 19.1.2 19.1.3 19.1.4 19.1.5 19.1.6 19.1.6.1 19.1.6.2 19.1.6.3 19.1.6.4 19.1.6.5 19.2 19.2.1 19.2.2 19.3 19.3.1 19.3.2 19.3.3 19.3.3.1 19.3.3.2 19.
Contents 20.4.3 20.4.4 20.4.5 20.4.6 20.4.7 20.4.7.1 20.4.7.2 20.4.7.3 20.5 20.6 20.6.1 20.6.2 20.7 20.7.1 20.7.2 20.8 20.8.1 20.8.2 20.8.3 21 Testing Using Program Status...............................................................................................................467 21.1 21.2 21.3 21.4 21.4.1 22 Program Status Display ........................................................................................................
Contents 23.9.1 23.9.2 23.9.3 23.9.4 23.9.5 23.9.6 23.9.7 23.9.8 23.9.9 23.9.10 23.9.11 23.9.12 23.9.13 23.9.14 23.9.15 23.10 23.10.1 23.10.2 23.10.2.1 23.10.2.2 23.10.2.3 23.10.2.4 23.10.2.5 23.10.2.6 Evaluating the Output Parameter RET_VAL ........................................................................502 Error OBs as a Reaction to Detected Errors.........................................................................503 Inserting Substitute Values for Error Detection..........................
Contents 26 Tips and Tricks ........................................................................................................................................551 26.1 26.2 26.3 26.4 26.5 26.6 26.7 27 Exchanging Modules in the Configuration Table ..................................................................551 Projects with a Large Number of Networked Stations ..........................................................551 Rearranging .............................................................
Contents 27.3.4 27.3.4.1 27.3.4.2 27.3.4.3 27.3.4.4 27.3.4.5 27.3.4.6 27.3.4.7 27.3.4.8 27.3.4.9 27.4 27.4.1 27.4.2 27.4.3 27.5 27.5.1 27.6 27.6.1 27.6.2 27.6.2.1 27.6.2.2 27.6.2.3 27.6.2.4 27.6.2.5 27.6.3 27.6.3.1 27.6.3.2 27.6.3.3 27.6.3.4 27.6.4 27.6.4.1 27.6.4.2 27.6.4.3 27.6.4.4 27.6.4.5 27.6.4.6 27.7 27.7.1 27.7.2 27.8 27.8.1 27.8.2 27.8.3 27.8.4 Parameter Types ..................................................................................................................
1 Introducing the Product and Installing the Software 1.1 Overview of STEP 7 What is STEP 7? STEP 7 is the standard software package used for configuring and programming SIMATIC programmable logic controllers. It is part of the SIMATIC industry software. There are the following versions of the STEP 7 Standard package: • STEP 7 Micro/DOS and STEP 7 Micro/Win for simpler stand-alone applications on the SIMATIC S7-200.
Introducing the Product and Installing the Software 1.
Introducing the Product and Installing the Software 1.1 Overview of STEP 7 Alternative Procedures As shown in the figure above, you have two alternative procedures: • You can configure the hardware first and then program the blocks. • You can, however, program the blocks first without configuring the hardware. This is recommended for service and maintenance work, for example, to integrate programmed blocks into in an existing project.
Introducing the Product and Installing the Software 1.1 Overview of STEP 7 Procedure for Creating Logic Blocks and Basic Information on Programming in STL Source Files). 26 • S7 only: generate and evaluate reference data You can make use of these reference data to make debugging and modifying your user program easier (see also Overview of the Available Reference Data). • Configure messages You create block-related messages, for example, with their texts and attributes.
Introducing the Product and Installing the Software 1.
Introducing the Product and Installing the Software 1.2 The STEP 7 Standard Package 1.2 The STEP 7 Standard Package Standards Used The SIMATIC programming languages integrated in STEP 7 are compliant with EN 61131-3. The standard package matches the graphic and object oriented operating philosophy of Windows and runs under the operating systems MS Windows XP Professional (simply Windows XP below), MS Windows Server 2003 and MS Windows 7 Business, Ultimate and Enterprise.
Introducing the Product and Installing the Software 1.2 The STEP 7 Standard Package Applications in STEP 7 The STEP 7 Standard package provides a series of applications (tools) within the software: You do not need to open the tools separately; they are started automatically when you select the corresponding function or open an object.
Introducing the Product and Installing the Software 1.2 The STEP 7 Standard Package SIMATIC Manager The SIMATIC Manager manages all the data that belong to an automation project − regardless of which programmable control system (S7/M7/C7) they are designed for. The tools needed to edit the selected data are started automatically by the SIMATIC Manager. Symbol Editor With the Symbol Editor you manage all the shared symbols.
Introducing the Product and Installing the Software 1.2 The STEP 7 Standard Package Diagnosing Hardware These functions provide you with an overview of the status of the programmable controller. An overview can display symbols to show whether every module has a fault or not. A double-click on the faulty module displays detailed information about the fault.
Introducing the Product and Installing the Software 1.2 The STEP 7 Standard Package Hardware Configuration You use this tool to configure and assign parameters to the hardware of an automation project. The following functions are available: • To configure the programmable controller you select racks from an electronic catalog and arrange the selected modules in the required slots in the racks. • Configuring the distributed I/O is identical to the configuration of the central I/O.
Introducing the Product and Installing the Software 1.3 What's New in STEP 7, Version 5.5? 1.3 What's New in STEP 7, Version 5.5? The following subject areas have been updated: • Operating Systems • Configuring and Diagnosing Hardware • Configuration Changes during Ongoing Operation (CiR) • Standard Libraries • Report System Error • Diagnostics • Setting the PG/PC Interface Operating systems As of STEP 7 V5.
Introducing the Product and Installing the Software 1.3 What's New in STEP 7, Version 5.5? Standard Libraries • As of STEP 7 V5.5, the system functions have been expanded by the addition of SFB104 "IP_CONF" for program-controlled configuration of the integrated PROFINET interface of your CPU. • As of STEP 7 V5.5, the system functions have been expanded by the addition of SFC99 "WWW" for enabling or synchronizing user Web pages. • As of STEP 7 V5.
Introducing the Product and Installing the Software 1.4 Extended Uses of the STEP 7 Standard Package 1.4 Extended Uses of the STEP 7 Standard Package The standard package can be extended by optional software packages that are grouped into the following three software classes: • Engineering Tools; these are higher-level programming languages and technology-oriented software. • Run-Time Software; these contain off-the-shelf run-time software for the production process.
Introducing the Product and Installing the Software 1.
Introducing the Product and Installing the Software 1.4 Extended Uses of the STEP 7 Standard Package 1.4.1 Engineering Tools Engineering Tools are task-oriented tools that can be used to extend the standard package. Engineering Tools include: • High-level languages for programmers • Graphic languages for technical staff • Supplementary software for diagnostics, simulation, remote maintenance, plant documentation etc.
Introducing the Product and Installing the Software 1.4 Extended Uses of the STEP 7 Standard Package Graphic Language CFC for S7 and M7 is a programming language for interconnecting functions graphically. These functions cover a wide range of simple logic operations through to complex controls and control circuits. A large number of such function blocks are available in the form of blocks in a library. You program by copying the blocks into a chart and interconnecting the blocks with connecting lines.
Introducing the Product and Installing the Software 1.4 Extended Uses of the STEP 7 Standard Package 1.4.2 Run-Time Software Runtime software provides ready-to-use solutions you can call in user program and is directly implemented in the automation solution.
Introducing the Product and Installing the Software 1.4 Extended Uses of the STEP 7 Standard Package Tools for Linking with Windows • PRODAVE MPI is a toolbox for process data traffic between SIMATIC S7, SIMATIC M7, and SIMATIC C7. It automatically controls the data flow across the MPI interface. • An M7 DDE server (Dynamic Data Exchange) can be used to link Windows applications to process variables in SIMATIC M7, without additional programming effort.
Introducing the Product and Installing the Software 1.4 Extended Uses of the STEP 7 Standard Package 1.4.3 Human Machine Interface Human Machine Interface (HMI) is a software especially designed for operator control and monitoring in SIMATIC. • The open process visualization systems SIMATIC WinCC and SIMATIC WinCC flexible are basic systems that are not restricted to specific industrial sectors or technology and provide all the important operator control and monitoring functions.
Introducing the Product and Installing the Software 1.
2 Installation 2.1 Automation License Manager 2.1.1 User Rights Through The Automation License Manager Automation License Manager To use STEP 7 programming software, you require a product-specific license key (user rights). Starting with STEP 7 V5.3, this key is installed with the Automation License Manager. The Automation License Manager is a software product from Siemens AG. It is used to manage the license keys (license modules) for all systems.
Installation 2.1 Automation License Manager License Keys The license key is the technical representation (an electronic "license stamp") of a license to use software. SIEMENS AG issues a license key for all of its software that is protected by a license. When the computer has been started, such software can only be used in accordance with the applicable license and terms of use after the presence of a valid license key has been verified.
Installation 2.1 Automation License Manager Types of Licenses The following different types of application-oriented user licenses are available for software products from Siemens AG. The actual behavior of the software is determined by which type license key is installed for it. The type of use can be found on the accompanying Certificate of License. License Type Description Single License The software can be used on any single computer desired for an unlimited amount of time.
Installation 2.1 Automation License Manager 2.1.2 Installing the Automation License Manager The Automation License Manager is installed by means of an MSI setup process. The installation software for the Automation License Manager is included on the STEP 7 product CD. You can install the Automation License Manager at the same time you install STEP 7 or at a later time. .
Installation 2.1 Automation License Manager 2.1.3 ! Guidelines for Handling License Keys Caution Please note the information on handling license keys that is available in the online help on the Automation License Manager and also in the STEP 7 Readme file on the installation CD-ROM. If you do not follow these guidelines, the license keys may be irretrievably lost.
Installation 2.2 Installing STEP 7 2.2 Installing STEP 7 The STEP 7 Setup program performs an automatic installation. The complete installation procedure is menu controlled. Execute Setup using the standard Windows XP/7/Server 2003 software installation procedure.
Installation 2.2 Installing STEP 7 PGs are supplied with an MPI interface. • External prommer (optional) An external prommer is only required if you want to program EPROMs with a PC. Note Refer to the information on STEP 7 installation in the Readme file and the "List of SIMATIC Software Packages compatible to the versions of the standard STEP 7 software package." You can find the Readme file in the start menu under Start > Simatic > Product Notes.
Installation 2.2 Installing STEP 7 2.2.1 Installation Procedure Preparing for Installation The operating system (Windows XP, Server 2003 or Windows 7) must be started before you can start your software installation. • You do not require an external storage medium if the installable STEP 7 software is already stored on the hard disk of the PG. • To install from CD-ROM, insert the CD-ROM in the CD-ROM drive of your PC. Starting the Installation Program To install the software, proceed as follows: 1.
Installation 2.2 Installing STEP 7 ID Number You will be prompted during setup to enter an ID number (found on the Software Product Certificate or on your license key storage medium). Installing License Keys During setup, the program checks to see whether a corresponding license key is installed on the hard disk. If no valid license key is found, a message stating that the software can be used only with a license key is displayed.
Installation 2.2 Installing STEP 7 If Errors Occur during the Installation Setup may be cancelled due to the following errors: • If an initialization error occurs immediately after the start of Setup, more than likely setup was not started under Windows. • Insufficient hard disk space: For the basic software, you require approximately 650 MB to 900 MB of free space on your hard disk depending on the scope of your installation.
Installation 2.2 Installing STEP 7 2.2.2 Setting the PG/PC Interface Here you configure the communication between the PG/PC and the PLC. During installation, you are displayed a dialog for assigning parameters to the PG/PC interface. You can also open this dialog box after installation, by calling the program "Setting PG/PC Interface" in the STEP 7 program group. This enables you to modify the interface parameters at a later time, independently of the installation.
Installation 2.2 Installing STEP 7 Changes will also be necessary if conflicts with other settings arise (for example, interrupt or address assignments). In this case, make the appropriate changes with the hardware recognition and Control Panel in Windows (see below). ! Caution Do not remove any "TCP/IP" parameters from your interface configuration. This could cause malfunctioning of other applications.
Installation 2.3 Uninstalling STEP 7 2.3 Uninstalling STEP 7 Use the standard Windows method to uninstall STEP 7: 1. Double-click on the "Add/Remove Programs" icon in the "Control Panel." to start the Windows software installation dialog box. 2. Select the STEP 7 entry in the displayed list of installed software. Click the button to "Add/Remove" the software. 3. If the "Remove Shared File" dialog box appears, click the "No" button if you are uncertain. 2.4 User Rights 2.4.
Installation 2.4 User Rights 2.4.2 User Rights in MS Windows 7 Specifying Access Rights in the Operating System When you install STEP 7 in MS Windows 7, the user group "Siemens TIA Engineer" is created automatically. This allows the users entered there to configure the PG/PC interface and to install selected Hardware Support Packages.
Installation 2.4 User Rights Creating the global domain user group "Siemens TIA Engineer" When working in a domain, you have the alternative of creating a global domain user group that is then mapped to the local user groups "Siemens TIA Engineer" and "Network Configuration Operators". The following requirements must be met first: • The domain administrator has created a global domain user group.
Installation 2.
3 Working Out the Automation Concept 3.1 Basic Procedure for Planning an Automation Project This chapter outlines the basic tasks involved in planning an automation project for a programmable controller (PLC). Based on an example of automating an industrial blending process, you are guided step by step through the procedure. There are many ways of planning an automation project. The basic procedure that you can use for any project is illustrated in the following figure.
Working Out the Automation Concept 3.2 Dividing the Process into Tasks and Areas 3.2 Dividing the Process into Tasks and Areas An automation process consists of a number of individual tasks. By identifying groups of related tasks within a process and then breaking these groups down into smaller tasks, even the most complex process can be defined.
Working Out the Automation Concept 3.2 Dividing the Process into Tasks and Areas Determining the Areas of a Process After defining the process to be controlled, divide the project into related groups or areas: As each group is divided into smaller tasks, the tasks required for controlling that part of the process become less complicated. In our example of an industrial blending process you can identify four distinct areas (see table below).
Working Out the Automation Concept 3.3 Describing the Individual Functional Areas 3.3 Describing the Individual Functional Areas As you describe each area and task within your process, you define not only the operation of each area, but also the various elements that control the area. These include: • Electrical, mechanical, and logical inputs and outputs for each task • Interlocks and dependencies between the individual tasks The sample industrial blending process uses pumps, motors, and valves.
Working Out the Automation Concept 3.3 Describing the Individual Functional Areas Agitator Motor The agitator motor mixes ingredient A with ingredient B in the mixing tank. • Rating: 100 kW (134 hp) at 1200 rpm The agitator motor is controlled (start/stop) from an operator station located near the mixing tank. The number of starts is counted for maintenance purposes. Both the counters and the display can be reset with one button.
Working Out the Automation Concept 3.4 Listing Inputs, Outputs, and In/Outs 3.4 Listing Inputs, Outputs, and In/Outs After writing a physical description of each device to be controlled, draw diagrams of the inputs and outputs for each device or task area. These diagrams correspond to the logic blocks to be programmed.
Working Out the Automation Concept 3.5 Creating an I/O Diagram for the Motors 3.5 Creating an I/O Diagram for the Motors Two feed pumps and one agitator are used in our example of an industrial blending process. Each motor is controlled by its own "motor block" that is the same for all three devices.
Working Out the Automation Concept 3.6 Creating an I/O Diagram for the Valves 3.6 Creating an I/O Diagram for the Valves Each valve is controlled by its own "valve block" that is the same for all valves used. The logic block has two inputs: one to open the valve and one to close the valve. It also has two outputs: one to indicate that the valve is open and the other to indicate that it is closed. The block has an in/out to activate the valve.
Working Out the Automation Concept 3.7 Establishing the Safety Requirements 3.7 Establishing the Safety Requirements Decide which additional elements are needed to ensure the safety of the process - based on legal requirements and corporate health and safety policy. In your description, you should also include any influences that the safety elements have on your process areas. Defining Safety Requirements Find out which devices require hardwired circuits to meet safety requirements.
Working Out the Automation Concept 3.8 Describing the Required Operator Displays and Controls 3.8 Describing the Required Operator Displays and Controls Every process requires an operator interface that allows human intervention in the process. Part of the design specification includes the design of the operator console. Defining an Operator Console In the industrial blending process described in our example, each device can be started or stopped by a pushbutton located on the operator console.
Working Out the Automation Concept 3.9 Creating a Configuration Diagram 3.9 Creating a Configuration Diagram After you have documented the design requirements, you must then decide on the type of control equipment required for the project. By deciding which modules you want to use, you also specify the structure of the programmable controller.
Working Out the Automation Concept 3.
4 Basics of Designing a Program Structure 4.1 Programs in a CPU A CPU will principally run two different programs: • The operating system and • The user program. Operating System Every CPU comes with an integrated operating system that organizes all CPU functions and sequences not associated with a specific control task.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2 Blocks in the User Program The STEP 7 programming software allows you to structure your user program, in other words to break down the program into individual, self-contained program sections. This has the following advantages: • Extensive programs are easier to understand. • Individual program sections can be standardized. • Program organization is simplified. • It is easier to make modifications to the program.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2.1 Organization Blocks and Program Structure Organization blocks (OBs) represent the interface between the operating system and the user program. Called by the operating system, they control cyclic and interrupt-driven program execution, startup behavior of the PLC and error handling. You can program the organization blocks to determine CPU behavior.
Basics of Designing a Program Structure 4.
Basics of Designing a Program Structure 4.2 Blocks in the User Program Type of Interrupt Organization Block Priority Class (Default) See also Synchronous errors Priority of the OB that caused the error Error Handling Organization Blocks (OB70 to OB87 / OB121 to OB122) 1) OB121 Programming Error OB122 Access Error The priority class 29 corresponds to priority 0.29. The background cycle has a lower priority than the free cycle.
Basics of Designing a Program Structure 4.2 Blocks in the User Program Changing the Priority Interrupts can be assigned parameters with STEP 7. With the parameter assignment you can for example, deselect interrupt OBs or priority classes in the parameter blocks: time-of-day interrupts, time-delay interrupts, cyclic interrupts, and hardware interrupts. The priority of organization blocks on S7-300 CPUs is fixed.
Basics of Designing a Program Structure 4.2 Blocks in the User Program Deselected Interrupt OBs If you assign priority class 0 or assign less than 20 bytes of local data to a priority class, the corresponding interrupt OB is deselected. The handling of deselected interrupt OBs is restricted as follows: • In RUN mode, they cannot be copied or linked into your user program.
Basics of Designing a Program Structure 4.2 Blocks in the User Program Event-Driven Program Processing Cyclic program processing can be interrupted by certain events (interrupts). If such an event occurs, the block currently being executed is interrupted at a command boundary and a different organization block that is assigned to the particular event is called. Once the organization block has been executed, the cyclic program is resumed at the point at which it was interrupted.
Basics of Designing a Program Structure 4.2 Blocks in the User Program Linear Versus Structured Programming You can write your entire user program in OB1 (linear programming). This is only advisable with simple programs written for the S7-300 CPU and requiring little memory. Complex automation tasks can be controlled more easily by dividing them into smaller tasks reflecting the technological functions of the process or that can be used more than once.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2.2 Call Hierarchy in the User Program For the user program to function, the blocks that make up the user program must be called. This is done using special STEP 7 instructions, the block calls, that can only be programmed and started in logic blocks. Order and Nesting Depth The order and nesting of the block calls is known as the call hierarchy.
Basics of Designing a Program Structure 4.2 Blocks in the User Program Block Calls The following figure shows the sequence of a block call within a user program. The program calls the second block whose instructions are then executed completely. Once the second or called block has been executed, execution of the interrupted block that made the call is resumed at the instruction following the block call.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2.3 Block Types 4.2.3.1 Organization Block for Cyclic Program Processing (OB1) Cyclic program processing is the "normal" type of program execution on programmable logic controllers. The operating system calls OB1 cyclically and with this call it starts cyclic execution of the user program.
Basics of Designing a Program Structure 4.
Basics of Designing a Program Structure 4.2 Blocks in the User Program Cycle Monitoring Time With STEP 7, you can modify the default maximum cycle monitoring time. If this time expires, the CPU either changes to STOP mode or OB80 is called in which you can specify how the CPU should react to this error. Minimum Cycle Time With STEP 7, you can set a minimum cycle time for S7-400 CPUs and the CPU 318.
Basics of Designing a Program Structure 4.2 Blocks in the User Program Updating the Process Image During cyclic program processing by the CPU, the process image is updated automatically. With the S7-400 CPUs and the CPU 318 you can deselect the update of the process image if you want to: • Access the I/O directly instead or • Update one or more process image input or output sections at a different point in the program using system functions SFC26 UPDAT_PI and SFC27 UPDAT_PO.
Basics of Designing a Program Structure 4.2 Blocks in the User Program How the Parameter works The operating system of the CPU constantly provides the communication with the configured percent of the entire CPU processing capacity (time slice technique). If this processing capacity is not needed for the communication, it is available to the rest of the processing.
Basics of Designing a Program Structure 4.2 Blocks in the User Program Recommendations • Where possible, apply the default value. • Increase this value only if you are using the CPU primarily for communication purposes and your user program is not time critical. • In all other cases, only reduce the value. • Set the process mode (S7-300 only), and limit the time needed there for test functions.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2.3.2 Functions (FC) Functions (FCs) belong to the blocks that you program yourself. A function is a logic block "without memory." Temporary variables belonging to the FC are saved in the local data stack. This data is then lost when the FC has been executed. To save data permanently, functions can also use shared data blocks. Since an FC does not have any memory of its own, you must always specify actual parameters for it.
Basics of Designing a Program Structure 4.2 Blocks in the User Program Thus, observe the following points: • If possible, initialize the OUTPUT parameters. • Set and reset instructions depend on RLO. When these instructions are used to determine the value at an OUTPUT parameter, no value is generated if the result of a previous logic operation (RLO) = 0. • Always ensure that data are written to the OUTPUT parameters - irrespective of any program paths in the block.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2.3.3 Function Blocks (FB) Function blocks (FBs) belong to the blocks that you program yourself. A function block is a block "with memory." It is assigned a data block as its memory (instance data block). The parameters that are transferred to the FB and the static variables are saved in the instance DB. Temporary variables are saved in the local data stack.
Basics of Designing a Program Structure 4.2 Blocks in the User Program Variables of the Data Type FB If your user program is structured so that an FB contains calls for further already existing function blocks, you can include the FBs to be called as static variables of the data type FB in the variable declaration table of the calling FB. This technique allows you to nest variables and concentrate the instance data in one instance data block (multiple instance).
Basics of Designing a Program Structure 4.2 Blocks in the User Program Assigning Initial Values to Formal Parameters You can assign initial values to the formal parameters in the declaration section of the FB. These values are written into the instance DB associated with the FB. If you do not assign actual parameters to the formal parameters in the call statement, STEP 7 uses the values saved in the instance DB.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2.3.4 Instance Data Blocks An instance data block is assigned to every function block call that transfers parameters. The actual parameters and the static data of the FB are saved in the instance DB. The variables declared in the FB determine the structure of the instance data block. Instance means a function block call.
Basics of Designing a Program Structure 4.2 Blocks in the User Program One Instance DB for Several Instances of an FB (Multiple Instances) You can also transfer the instance data for several motors at the same time in one instance DB. To do this, you must program the calls for the motor controllers in a further FB and declare static variables with the data type FB for the individual instances in the declaration section of the calling FB.
Basics of Designing a Program Structure 4.2 Blocks in the User Program One Instance DB for Several Instances of Different FBs (Multiple Instances) In a function block you can call the instances of other existing FBs. You can assign the instance data required for this to the instance data block of the calling FB, meaning you do not need any additional data blocks for the called FBs in this case.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2.3.5 Shared Data Blocks (DB) In contrast to logic blocks, data blocks do not contain STEP 7 instructions. They are used to store user data, in other words, data blocks contain variable data with which the user program works. Shared data blocks are used to store user data that can be accessed by all other blocks. The size of DBs can vary. Refer to the description of your CPU for the maximum possible size.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2.3.6 System Function Blocks (SFB) and System Functions (SFC) Preprogrammed Blocks You do not need to program every function yourself. S7 CPUs provide you with preprogrammed blocks that you can call in your user program. Further information can be found in the reference help on system blocks and system functions (Jumps to Language Descriptions and Help on Blocks and System Attributes).
Basics of Designing a Program Structure 4.2 Blocks in the User Program Additional Information For more detailed information about SFBs and SFCs, refer to the "System Software for S7-300 and S7-400, System and Standard Functions" Reference Manual. The "S7-300 Programmable Controller, Hardware and Installation Manual" and "S7-400, M7-400 Programmable Controllers Module Specifications Reference Manual" explain which SFBs and SFCs are available.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2.4 Organization Blocks for Interrupt-Driven Program Processing By providing interrupt OBs, the S7 CPUs allow the following: • Program sections can be executed at certain times or intervals (time-driven) • Your program can react to external signals from the process. The cyclic user program does not need to query whether or not interrupt events have occurred.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2.4.1 Time-of-Day Interrupt Organization Blocks (OB10 to OB17) The S7 CPUs provide the Time-Of-Day interrupt OBs that can be executed at a specified date or at certain intervals.
Basics of Designing a Program Structure 4.2 Blocks in the User Program Deactivating the Time-of-Day Interrupt You can deactivate Time-Of-Day interrupts that have not yet been executed with SFC29 CAN_TINT. Deactivated Time-Of-Day interrupts can be set again using SFC28 SET_TINT and activated with SFC30 ACT_TINT. Priority of the Time-of-Day Interrupt OBs All eight Time-Of-Day interrupt OBs have the same priority class (2) as default and are therefore processed in the order in which their start event occurs.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2.4.2 Time-Delay Interrupt Organization Blocks (OB20 to OB23) The S7 CPUs provide time delay OBs with which you can program the delayed execution of parts of your user program. Rules for Time-Delay Interrupts Time delay interrupts can only be executed when the corresponding organization block exists in the CPU program.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2.4.3 Cyclic Interrupt Organization Blocks (OB30 to OB38) The S7 CPUs provide cyclic interrupt OBs that interrupt cyclic program processing at certain intervals. Cyclic interrupts are triggered at intervals. The time at which the interval starts is the mode transition from STOP to RUN.
Basics of Designing a Program Structure 4.2 Blocks in the User Program Priority of the Cyclic Interrupt OBs The following table shows the default intervals and priority classes of the cyclic interrupt OBs. You can assign parameters to change the interval and the priority class.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2.4.4 Hardware Interrupt Organization Blocks (OB40 to OB47) The S7 CPUs provide hardware interrupt OBs that react to signals from the modules (for example, signal modules (SMs), communications processors (CPs), function modules (FMs)). With STEP 7, you can decide which signal from a configurable digital or analog module starts the OB. With CPs and FMs, use the appropriate parameter assignment dialogs.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2.4.5 Startup Organization Blocks (OB100 / OB101 / OB102) Startup Types There are three distinct types of startup: • Hot restart (not in S7-300 and S7-400H) • Restart (warm restart) • Cold restart The following table shows which OB the operating system calls in each startup type.
Basics of Designing a Program Structure 4.2 Blocks in the User Program Startup Type After Automatic Restart On S7-300 CPUs, only a restart (warm restart) is possible following power up. On S7-400 CPUs, you can specify whether an automatic startup following power up leads to a restart (warm restart) or a hot restart. Clearing the Process Image When an S7-400 CPU is restarted, the remaining cycle is executed, and as default, the process image output table is cleared.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2.4.6 Background Organization Block (OB90) If you have specified a minimum scan cycle time with STEP 7 and this is longer than the actual scan cycle time, the CPU still has processing time available at the end of the cyclic program. This time is used to execute the background OB. If OB90 does not exist on your CPU, the CPU waits until the specified minimum scan cycle time has elapsed.
Basics of Designing a Program Structure 4.2 Blocks in the User Program Programming OB90 The run time of OB90 is not monitored by the CPU operating system so that you can program loops of any length in OB90. Ensure that the data you use in the background program are consistent by observing the following when programming: • The reset events of OB90 (see the "System Software for S7-300 and S7-400, System and Standard Functions" Reference Manual) • The process image update asynchronous to OB90.
Basics of Designing a Program Structure 4.2 Blocks in the User Program 4.2.4.7 Error Handling Organization Blocks (OB70 to OB87 / OB121 to OB122) Types of Errors The errors that can be detected by the S7 CPUs and to which you can react with the help of organization blocks can be divided into two basic categories: • Synchronous errors: these errors can be assigned to a specific part of the user program. The error occurs during the execution of a particular instruction.
Basics of Designing a Program Structure 4.2 Blocks in the User Program Using OBs for Synchronous Errors Synchronous errors occur during the execution of a particular instruction. When these errors occur, the operating system makes an entry in the I stack and starts the OB for synchronous errors. The error OBs called as a result of synchronous errors are executed as part of the program in the same priority class as the block that was being executed when the error was detected.
Basics of Designing a Program Structure 4.
5 Startup and Operation 5.1 Starting STEP 7 When you start Windows, you will find an icon for the SIMATIC Manager, the starting point for the STEP 7 software on the Windows interface. The quickest method to start STEP 7 is to position the cursor on the icon and double-click. The window containing the SIMATIC Manager is then opened. From here you can access all the functions you have installed for the standard package and any optional packages.
Startup and Operation 5.2 Starting STEP 7 with Default Start Parameters 5.2 Starting STEP 7 with Default Start Parameters From STEP 7 V5.0 onwards, you can create several symbols in the SIMATIC Manager and specify start parameters in the call line. By doing this, you can cause the SIMATIC Manager to position on the object described by these parameters. This allows you to jump to the corresponding locations in a project immediately just by double-clicking. On calling s7tgtopx.
Startup and Operation 5.
Startup and Operation 5.2 Starting STEP 7 with Default Start Parameters Note on the Structure of the Project Path The project path is the physical path in the file system. The complete logical path has the following structure: [View ID,online ID]:project name\{object name\}*\ object name Example: /o 1.8:MyConfig\SIMATIC 400(1)\CPU416-1\S7-Program(1)\Blocks\FB1 The path of network drives must be specified in UNC notation (= Universal Naming Convention, in other words \\\\...).
Startup and Operation 5.3 Calling the Help Functions 5.3 Calling the Help Functions Online Help The online help system provides you with information at the point where you can use it most efficiently. You can use the online help to access information quickly and directly without having to search through manuals.
Startup and Operation 5.4 Objects and Object Hierarchy 5.4 Objects and Object Hierarchy In the same way that the Windows Explorer shows the directory structure of folders and files, the object hierarchy for projects and libraries in STEP 7 is shown in the SIMATIC Manager. The following figure shows an example of an object hierarchy.
Startup and Operation 5.4 Objects and Object Hierarchy 5.4.1 Project Object The project represents the entirety of all the data and programs in an automation solution, and is located at the top of an object hierarchy.
Startup and Operation 5.4 Objects and Object Hierarchy Symbol Objects in the Project Level Selection of Important Objects Station: • Inserting Stations • Stations are both objects (project level) and object folder (station level). Other functions can be found under Station Object • S7/M7 Program without a Station or CPU • S7/M7 programs are both objects (project level) and object folders (program level).
Startup and Operation 5.4 Objects and Object Hierarchy 5.4.2 Library Object A library can contain S7/M7 programs and is used to store blocks. A library is located at the top of an object hierarchy.
Startup and Operation 5.4 Objects and Object Hierarchy 5.4.3 Station Object A SIMATIC 300/400 station represents a S7 hardware configuration with one or more programmable modules.
Startup and Operation 5.
Startup and Operation 5.4 Objects and Object Hierarchy 5.4.4 Programmable Module Object A programmable module represents the parameter assignment data of a programmable module (CPUxxx, FMxxx, CPxxx). The system data of modules with no retentive memory (for example, CP441) are loaded via the CPU of the station. For this reason, no "system data" object is assigned to such modules and they are not displayed in the project hierarchy.
Startup and Operation 5.4 Objects and Object Hierarchy Symbol Objects in the "Programmable Modules" level Selection of Important Functions Programs: • Inserting an S7/M7 Program • S7/M7 programs are both objects (project level) and object folders (program level).
Startup and Operation 5.4 Objects and Object Hierarchy 5.4.5 S7/M7 Program Object A (S7/M7) program folder contains software for S7/M7 CPU modules or software for non-CPU modules (for example, programmable CP or FM modules).
Startup and Operation 5.
Startup and Operation 5.4 Objects and Object Hierarchy 5.4.6 Block Folder Object A block folder of an offline view can contain: logic blocks (OB, FB, FC, SFB, SFC), data blocks (DB), user-defined data types (UDT) and variable tables. The system data object represents system data blocks. The block folder of an online view contains the executable program parts that have been downloaded to the programmable controller.
Startup and Operation 5.
Startup and Operation 5.
Startup and Operation 5.4 Objects and Object Hierarchy 5.4.7 Source File Folder Object A source file folder contains source programs in text format.
Startup and Operation 5.4 Objects and Object Hierarchy 5.4.8 S7/M7 Program without a Station or CPU You can create programs without having configured a SIMATIC station beforehand. This means that you can initially work independently of the module and module settings you intend to program. Creating an S7/M7 Program 1. Open the relevant project using the menu command File > Open or activate the project window. 2. Select the project in the project window of the offline view. 3.
Startup and Operation 5.5 User Interface and Operation 5.5 User Interface and Operation 5.5.1 Operating Philosophy The aim: Easy Operation It is the aim of the graphic user interface to provide maximum and intuitive operating comfort. You will therefore find objects you already know from your daily work, e.g. stations, modules, programs, blocks. Actions you perform under STEP 7 include the creation, selection and manipulation of such objects.
Startup and Operation 5.5 User Interface and Operation 5.5.2 Window Arrangement The standard components of a window are shown in the following figure: Title Bar and Menu Bar The title bar and menu bar are always found at the top of a window. The title bar contains the title of the window and icons for controlling the window. The menu bar contains all menus available in the window.
Startup and Operation 5.5 User Interface and Operation 5.5.3 Elements in Dialog Boxes Making Entries in Dialog Boxes In dialog boxes you can enter information which is required for executing a particular task. The components which appear most frequently in dialog boxes are explained using the example in the following figure. List Boxes and Combination Boxes Text boxes sometimes have an arrow pointing downwards beside them.
Startup and Operation 5.5 User Interface and Operation 5.5.4 Creating and Managing Objects Some basic processing steps are the same for all objects and do not depend on the object type. These standard handling sequences are summarized here. This knowledge of standard procedures is required to move on to other sections in the manual. The usual sequence of steps when handling objects is: • Create an object • Select an object • Perform actions with the object (for example, copy, delete).
Startup and Operation 5.5 User Interface and Operation Opening Objects There are a number of ways to open an object in the detailed view: • Double-click on the object icon • Select the object and then the menu command Edit > Open Object. This only works for objects that are not folders. Once you have opened an object, you can create or change its contents.
Startup and Operation 5.5 User Interface and Operation Note • Properties of the "System Data" folder and the "Hardware" object cannot be displayed or changed. • You cannot write in the dialog boxes for object properties of a read-only project. In this case, the input boxes are grayed out. • If you display the properties of programmable modules, you cannot edit the displayed parameters for reasons of consistency. To edit the parameters you must open the "Configuring Hardware" application.
Startup and Operation 5.5 User Interface and Operation Renaming Objects The SIMATIC Manager assigns standard names to some new objects. These names are generally formed from the type of object (if a number of objects of this type can be created in the same folder) and a number. For example, the first S7 program will be named "S7 Program(1)", the second "S7 Program(2)" etc. The symbol table is simply called "Symbols" as it can only exist once in each folder.
Startup and Operation 5.5 User Interface and Operation Moving Objects With the SIMATIC Manager you can move objects from one folder to another even if the destination is in another project. When you move a folder its contents are all moved as well. Note You cannot move the following objects: • Connections • System data blocks (SIB) in the online view • System functions (SFC) and system function blocks (SFB) in the online view You will find a step-by-step guide to moving under Moving Objects.
Startup and Operation 5.5 User Interface and Operation Deleting Objects You can delete folders and objects. If you delete a folder, all the objects contained in it are also deleted. You cannot undo the delete procedure. If you are not sure whether you really no longer need an object, it is better to archive the whole project first.
Startup and Operation 5.5 User Interface and Operation 5.5.5 Selecting Objects in a Dialog Box Selecting objects in a dialog box (browser) is an action which you will need regularly for a large number of different edit steps. Calling the Browser You call the browser dialog in the hardware configuration application, for example, using menu commands such as Station > New/Open (one exception is the basic application window "SIMATIC Manager").
Startup and Operation 5.5 User Interface and Operation 5.5.6 Session Memory The SIMATIC Manager can save the contents of windows (that is, the projects and libraries open), and the layout of the windows. • Using the menu command Options > Customize, you define whether the window contents and layout are to be saved at the end of a session. At the start of the next session, these window contents and layout are restored. In the open projects, the cursor is positioned on the last folder selected.
Startup and Operation 5.5 User Interface and Operation 5.5.8 Saving and Restoring the Window Arrangement The STEP 7 applications have a feature which enables you to save the current window arrangement and restore it at a later stage. You can make the setting using the menu command Options > Customize in the "General" tab.
Startup and Operation 5.6 Keyboard Operation 5.6 Keyboard Operation 5.6.1 Keyboard Control 5.6.2 International Key Names German Key Names HOME POS1 END ENDE PAGE UP BILD AUF PAGE DOWN BILD AB CTRL STRG ENTER Eingabetaste DEL ENTF INSERT EINFG Key Combinations for Menu Commands Every menu command can be selected by typing a key combination with the ALT key.
Startup and Operation 5.
Startup and Operation 5.6 Keyboard Operation 5.6.
Startup and Operation 5.
Startup and Operation 5.6 Keyboard Operation 5.6.4 5.6.
Startup and Operation 5.6 Keyboard Operation 5.6.6 Key Combinations for Toggling between Windows To Press toggle between the panes in a window F6 return to the previous pane, if there is no dockable window Shift+F6 toggle between the document window and a dockable window in the document (for example, variable declaration window). Shift+F6 If there are no dockable windows, you can use this key combination to return to the previous pane.
6 Setting Up and Editing the Project 6.1 Project Structure Projects are used to store the data and programs which are created when you put together an automation solution. The data collected together in a project include: • Configuration data on the hardware structure and parameters for modules, • Configuration data for communication in networks, and • Programs for programmable modules. The main task when you create a project is preparing these data for programming.
Setting Up and Editing the Project 6.1 Project Structure Project Window The project window is split into two halves. The left half shows the tree structure of the project. The right half shows the objects that are contained in the object open in the left half in the selected view (large symbols, small symbols, list, or details). Click in the left half of the window on the box containing a plus sign to display the full tree structure of the project.
Setting Up and Editing the Project 6.2 What You Should Know About Access Protection 6.2 What You Should Know About Access Protection As of STEP 7 V5.4, you have the option of restricting access to projects and libraries by assigning a project password. This functionality is available only if SIMATIC Logon is installed. You can also enable, disable and display a change log. If SIMATIC Logon is installed on your computer, the following dynamic menu commands are available in the SIMATIC Manager.
Setting Up and Editing the Project 6.2 What You Should Know About Access Protection Opening and Closing Access-protected Projects The following situations can be distinguished: 156 PC with STEP 7 and SIMATIC PC with STEP 7 and Logon SIMATIC Logon PC with STEP 7 (no SIMATIC Logon present) 1. The user logs on using SIMATIC Logon with a user name and password. The user opens the access-protected project by entering the project password. 2. The project with access protection is opened. 3.
Setting Up and Editing the Project 6.2 What You Should Know About Access Protection Note • To disable access protection, you must be authorized in SIMATIC Logon as project administrator. • The first time you enable access protection, the project format is changed. You will receive a message indicating that the modified project can no longer be edited with older STEP 7 versions.
Setting Up and Editing the Project 6.3 What You Should Know About The Change Log 6.3 What You Should Know About The Change Log As of STEP 7 V5.4, after setting up access protection for projects and libraries, you have the option of keeping a change log that records online actions.
Setting Up and Editing the Project 6.4 Using Foreign-Language Character Sets 6.4 Using Foreign-Language Character Sets As of STEP 7 V5.3 SP2, you can enter texts in foreign languages in projects and libraries even if these languages do not match the language that has been set for STEP 7. To do this, the corresponding Windows language must be set in the Control Panel of the operating system.
Setting Up and Editing the Project 6.4 Using Foreign-Language Character Sets Rules If you will be editing your projects or libraries on computers that have different language settings, be sure to observe the following "rules and regulations" to prevent incompatibilities or data corruption from occurring when using a foreign-language character set: 160 • Install STEP 7 only in folders with names that contain the characters of the English character set (ASCII characters 0x2a - 0x7f).
Setting Up and Editing the Project 6.4 Using Foreign-Language Character Sets Notes • If you change or copy projects or libraries that were created on a computer that is identified as being language-neutral with respect to the Windows language setting but is not compatible with the setting on the computer currently being used, data corruption may occur if characters that are not contained in the English character set (ASCII characters 0x2a - 0x7f) were used in the project or library.
Setting Up and Editing the Project 6.5 Setting the MS Windows Language 6.5 Setting the MS Windows Language To set the Windows language, proceed as follows: Setting the Language in Windows XP and Windows Server 2003: 1. To set the desired display language for programs that do not support Unicode, select the following menu command sequence: Control Panel > Regional and Language Options > Advanced > Language for non-Unicode programs. 2.
Setting Up and Editing the Project 6.6 Setting Up a Project 6.6 Setting Up a Project 6.6.1 Creating a Project To construct a solution to your automation task using the framework of a project management, you will need to create a new project. The new project is created in the directory you set for projects in the "General" tab when you selected the menu command Options > Customize. Note The SIMATIC Manager allows names that are longer than eight characters.
Setting Up and Editing the Project 6.6 Setting Up a Project Creating a Project Manually You can also create a new project using the menu command File > New in the SIMATIC Manager. It already contains the "MPI Subnet" object. Alternative Procedures When editing a project, you are flexible as to the order in which you perform most of the tasks.
Setting Up and Editing the Project 6.6 Setting Up a Project 6.6.2 Inserting Stations In a project, the station represents the hardware structure of a programmable controller and contains the data for configuring and assigning parameters to individual modules. New projects created with the "New Project" wizard already contain a station. Otherwise you can create the station using the menu command Insert > Station.
Setting Up and Editing the Project 6.6 Setting Up a Project 6.6.3 Inserting an S7/M7 Program The software for programmable modules is stored in object folders. For SIMATIC S7 modules this object folder is called "S7 Program," for SIMATIC M7 modules it is called "M7 Program." The following figure shows an example of an S7 program in a programmable module in a SIMATIC 300 station.
Setting Up and Editing the Project 6.6 Setting Up a Project Using Blocks from Standard Libraries You can also use blocks from the standard libraries supplied with the software to create user programs. You access the libraries using the menu command File > Open. You will find further information on using standard libraries and on creating your own libraries in Working with Libraries and in the online help.
Setting Up and Editing the Project 6.7 Editing a Project 6.7 Editing a Project Opening a Project To open an existing project, enter the menu command File > Open. Then select a project in the dialog boxes that follow. The project window is then opened. Note If the project you require is not displayed in the project list, click on the "Browse" button. In the browser you can then search for other projects and include any projects you find in the project list.
Setting Up and Editing the Project 6.7 Editing a Project 6.7.1 Checking Projects for Software Packages Used If a project that you are editing contains objects that were created with another software package, this software package is required to edit this project. No matter what programming device you are using to work with multiprojects, projects or libraries, STEP 7 assists you by showing you what software packages and versions are required to do so.
Setting Up and Editing the Project 6.7 Editing a Project Export Exporting is done for all blocks and symbol tables located under the selected object. An export file is created for each text type. This file contains a column for the source language and a column for the target language. Text in the source language must not be changed. Import During import, the contents of the target-language columns (right-hand column) are integrated into the project to which the selected object belongs.
Setting Up and Editing the Project 6.
Setting Up and Editing the Project 6.7 Editing a Project 6.7.2.1 Types of Multilingual Texts For export, a separate file will be created for each type of text. This file will have the text type as its name and the export format as its extension (texttype.format: for example, SymbolComment.CSV or SymbolComment.XLS). Files that do not satisfy the naming convention cannot be used as source or target.
Setting Up and Editing the Project 6.7 Editing a Project 6.7.2.2 Structure of the Export File The export file is structured as follows: Example: Fundamentally, the following applies: 1. The following may not be changed, overwritten, or deleted: - Fields beginning with "$_" (these are keywords) - The numbers for the language (in the example above: 9(1) for the source language English (USA) and 7(1) for the target language German). 2. Each file holds the text for just a single test type.
Setting Up and Editing the Project 6.7 Editing a Project Export File Format You specify the format in which export files are to be saved. If you have decided to use CSV format, you must keep in mind when editing in Excel that a CSV file can be only opened properly in Excel if the Open dialog is used. Opening a CSV file by double-clicking in Explorer often results in an unusable file. You will find it easier to work with CSV files in Excel if you use the following procedure: 1.
Setting Up and Editing the Project 6.7 Editing a Project 6.7.2.3 Information on the Log File Error messages and warnings that appear when working with text managed in many languages are output in a log file (TXT format). This file is stored in the same folder as the export files. In general, the messages are self-explanatory. Any further explanations are listed below: Warning: The Text 'xyz' in the 'xyz' file already exists. Further occurrences of the text were ignored.
Setting Up and Editing the Project 6.7 Editing a Project 6.7.2.4 Managing User Texts Whose Language Font is Not Installed You can export user texts whose language font is not installed in your operating system, have them translated and then import them back in and save them for use in your project. However, such texts can only be displayed on a computer that has the appropriate language font installed on it.
Setting Up and Editing the Project 6.7 Editing a Project 6.7.2.5 Optimizing the Source for Translation You can prepare the source material for translation by combining different terms and expressions.
Setting Up and Editing the Project 6.7 Editing a Project 6.7.2.6 Optimizing the Translation Process If you have projects where the structure and text are similar to a previous project, you can optimize the translation process. In particular, the following procedure is recommended for projects that were created by copying and then modifying. Prerequisite There must be an existing translated export target. Procedure 1. Copy the export files into the project folder for the new project to be translated. 2.
Setting Up and Editing the Project 6.7 Editing a Project 6.7.2.7 Hiding Texts in Selected Languages Texts you do not want displayed in the target language can be hidden with the "$_hide" keyword. This does not apply to comments on variables (InterfaceComment) and symbols (SymbolComment).
Setting Up and Editing the Project 6.7 Editing a Project 6.7.3 Micro Memory Card (MMC) as a Data Carrier 6.7.3.1 What You Should Know About Micro Memory Cards (MMC) Micro Memory Cards (MMC) are plug-in memory cards, for example, for a CPU 31xC or an IM 151/CPU (ET 200S). Their most distinguishing feature is the highly compact design. A new memory concept has been introduced for MMCs. It is briefly described below.
Setting Up and Editing the Project 6.7 Editing a Project Accessing Data Blocks on the MMC On the MMC, you can use data blocks and data block contents to handle larger quantities of data or data rather scarcely required in the user program. New system operations are available for that purpose: • SFC 82: creating data blocks in the load memory • SFC 83: reading from the data block in the load memory • SFC 84: writing to a data block in the load memory MMC and Password Protection If a CPU (i.e.
Setting Up and Editing the Project 6.7 Editing a Project 6.7.3.2 Using a Micro Memory Card as a Data Carrier A SIMATIC Micro Memory Card (MMC) can be used with STEP 7 in the same manner as any other type of external data storage medium. After you have determined that the MMC has enough capacity to accommodate all the data to be stored, you can transfer any data visible in the operating system's file explorer to the MMC.
Setting Up and Editing the Project 6.7 Editing a Project 6.7.3.4 Storing Project Data on a Micro Memory Card (MMC) With STEP 7 you can store the data for your STEP 7 project as well as any other kind of data (such as WORD or Excel files) on a SIMATIC Micro Memory Card (MMC) in a suitable CPU or a programming device (PG)/PC. This allows you to access project data with programming devices that do not have the project saved on them.
Setting Up and Editing the Project 6.
7 Editing Projects with Different Versions of STEP 7 7.1 Editing Version 2 Projects and Libraries Version V5.2 of STEP 7 no longer supports Changes in V2 Projects. When you edit V2 projects or libraries, inconsistencies can occur such that V2 projects or libraries can no longer be edited with older versions of STEP 7. In order to continue to edit V2 projects or libraries, a STEP 7 version older that V5.1 must be used. 7.
Editing Projects with Different Versions of STEP 7 7.2 Expanding DP Slaves That Were Created with Previous Versions of STEP 7 Constellation after Replacement of Type Files by GSD Files in STEP 7 V5.1 Service Pack 4 As of STEP 7 V5.1, Service Pack 4, the type files have been either updated or largely replaced by GSD files. This replacement only affects the catalog profiles supplied with STEP 7, not any catalog profiles that you may have created yourself.
Editing Projects with Different Versions of STEP 7 7.3 Editing Current Configurations with Previous Versions of STEP 7 7.3 Editing Current Configurations with Previous Versions of STEP 7 Configuring Direct Data Exchange (Lateral Communication) Configuring direct data exchange with a DP master without a DP master system: • Not possible with STEP 7 V5.0, Service Pack 2 (or older version) • Possible with STEP 7 V5.0, as of Service Pack 3 and as of STEP 7 V5.
Editing Projects with Different Versions of STEP 7 7.4 Appending SIMATIC PC Configurations of Previous Versions 7.4 Appending SIMATIC PC Configurations of Previous Versions PC Configurations of STEP 7 V5.1 Projects (up to SP 1) As of STEP 7 V5.1, Service Pack 2 you can download communications to the PC station in the same way as to an S7-300 or S7-400 station (without having to take the roundabout via configuration file).
Editing Projects with Different Versions of STEP 7 7.4 Appending SIMATIC PC Configurations of Previous Versions PC Configurations of STEP 7 V5.0 Projects You must convert the station if you want to edit a SIMATIC PC station configuration with STEP 7 as of V5.0, Service Pack 3 to configure new components that are only supported by Service Pack 3 or higher: • In the SIMATIC Manager, highlight the SIMATIC PC station and select the menu command Edit > Object properties.
Editing Projects with Different Versions of STEP 7 7.5 Displaying Modules Configured with Later STEP 7 Versions or Optional Packages 7.5 Displaying Modules Configured with Later STEP 7 Versions or Optional Packages As of STEP 7 V5.1 Service Pack 3, all modules are displayed, even those that were configured with a later STEP 7 version and are thus unknown to the "older" STEP 7.
Editing Projects with Different Versions of STEP 7 7.5 Displaying Modules Configured with Later STEP 7 Versions or Optional Packages Working with a Dummy Module in the SIMATIC Manager The dummy module is visible below the station level. All subordinate objects at this level such as user programs, system data and connection tables are visible and can be downloaded from the SIMATIC Manager. You also open, edit, compile and load the user program (such as its blocks).
Editing Projects with Different Versions of STEP 7 7.
8 Defining Symbols 8.1 Absolute and Symbolic Addressing In a STEP 7 program you work with addresses such as I/O signals, bit memory, counters, timers, data blocks, and function blocks. You can access these addresses in your program absolutely, but your programs will be much easier to read if you use symbols for the addresses (for example, Motor_A_On, or other identifiers according to the code system used within your company or industry).
Defining Symbols 8.1 Absolute and Symbolic Addressing Support with Programming In the programming languages Ladder Logic, Function Block Diagram, and Statement List you can enter addresses, parameters, and block names as absolute addresses or as symbols. Using the menu command View > Display > Symbolic Representation you can toggle between the absolute and symbolic representation of addresses.
Defining Symbols 8.2 Shared and Local Symbols 8.2 Shared and Local Symbols A symbol allows you to work with meaningful symbolic names instead of absolute addresses. The combination of short symbols and longer comments can be used effectively to make programming easier and program documentation better. You should distinguish between local (block-specific) and shared symbols.
Defining Symbols 8.3 Displaying Shared or Local Symbols 8.3 Displaying Shared or Local Symbols You can distinguish between shared and local symbols in the code section of a program as follows: • Symbols from the symbol table (shared) are shown in quotation marks "..". • Symbols from the variable declaration table of the block (local) are preceded by the character "#". You do not have to enter the quotation marks or the "#".
Defining Symbols 8.4 Setting the Address Priority (Symbolic/Absolute) 8.4 Setting the Address Priority (Symbolic/Absolute) The address priority helps you to adapt the program code as you see fit when making changes in the symbol table, changing parameter names of data blocks or function blocks or when changing UDTs referring to component names or changing multiple instances When making changes in the following situations, be sure to set the address priority carefully and with a definite purpose in mind.
Defining Symbols 8.4 Setting the Address Priority (Symbolic/Absolute) Setting the Address Priority: Tracking Changes: In the SIMATIC Manager, select the block folder and then select the menu command Edit > Check Block Consistency. The "Check block consistency' function make the changes necessary in the individual blocks. Switching Names or Assignments Examples: 198 • The names of existing assignments in the symbol table are switched.
Defining Symbols 8.4 Setting the Address Priority (Symbolic/Absolute) Setting the Address Priority: Tracking Changes: In the SIMATIC Manager, select the block folder and then select the menu command Edit > Check Block Consistency. The "Check block consistency" function makes the changes necessary in the individual blocks. New Symbols, Variables, Parameters or Components Examples: • You are creating new symbols for addresses used in the program.
Defining Symbols 8.5 Symbol Table for Shared Symbols Tracking Changes: In the SIMATIC Manager, select the block folder and then select the menu command Edit > Check Block Consistency. The "Check block consistency' function make the changes necessary in the individual blocks. 8.5 Symbol Table for Shared Symbols Shared symbols are defined in the symbol table. An (empty) symbol table ("Symbols" object) is created automatically when you create an S7 or M7 program.
Defining Symbols 8.5 Symbol Table for Shared Symbols Row If the columns for "Special Object Properties" were hidden (the menu command View > Columns O, M, C, R, CC was deselected), this symbol appears in the row if the row concerned has at least one "Special Object Property" set for it. "Status" Column The symbol name or address is identical to another entry in the symbol table. The symbol is still incomplete (the symbol name or the address is missing).
Defining Symbols 8.5 Symbol Table for Shared Symbols R/O/M/C/CC Columns The columns R/O/M/CC show whether a symbol was assigned special object properties (attributes): • R (monitoring) means that error definitions for process diagnostics were created for the symbol with the optional package S7-PDIAG (V5). • O means that the symbol can be operated and monitored with WinCC. • M means that a symbol-related message (SCAN) was assigned to the symbol.
Defining Symbols 8.5 Symbol Table for Shared Symbols Converting to C Variables You can select symbols in the symbol table for an M7 program and convert them to corresponding C variables in conjunction with the ProC/C++ software option. 8.5.2 Addresses and Data Types Permitted in the Symbol Table Only one set of mnemonics can be used throughout a symbol table.
Defining Symbols 8.5 Symbol Table for Shared Symbols 8.5.3 Incomplete and Non-Unique Symbols in the Symbol Table Incomplete Symbols It is also possible to store incomplete symbols. You can, for example, enter only the symbol name first and then add the corresponding address at a later date. This means you can interrupt your work on the symbol table at any time, save the interim result, and complete your work another time. symbol.
Defining Symbols 8.6 Entering Shared Symbols 8.6 Entering Shared Symbols There are three methods of entering symbols that can be used for programming at a later stage: 8.6.1 • Via Dialog Box You can open a dialog box in the window where you are entering a program and define a new symbol or redefine an existing symbol. This procedure is recommended for defining individual symbols, for example, if you realize that a symbol is missing or you want to correct one while you are writing the program.
Defining Symbols 8.6 Entering Shared Symbols 8.6.2 Entering Single Shared Symbols in a Dialog Box The procedure described below shows you how you can change symbols or define new symbols in a dialog box while programming blocks without having to display the symbol table. This procedure is useful if you only want to edit a single symbol. If you want to edit a number of symbols, you should open the symbol table and work in it directly.
Defining Symbols 8.6 Entering Shared Symbols 8.6.3 Entering Multiple Shared Symbols in the Symbol Table Opening the Symbol Table There are a number of ways of opening a symbol table: • Double-click the symbol table in the project window. • Select the symbol table in the project window and select the menu command Edit > Open Object. The symbol table for the active program is displayed in its own window. You can now create symbols or edit them.
Defining Symbols 8.6 Entering Shared Symbols 8.6.4 Using Upper and Lower Case for Symbols No Distinction between Upper and Lower Case Characters Previously it was possible to define symbols in STEP 7 which differed from one another only in the case used for individual characters. This was changed in STEP 7, V4.02. It is now no longer possible to distinguish between symbols on the basis of the case used.
Defining Symbols 8.6 Entering Shared Symbols Parameters which Differ from One Another Only in their Use of Upper and Lower Case Characters Conflict: Source files containing such interfaces can no longer be compiled without errors. Blocks with such interfaces can be opened, but access to the second of these parameters is no longer possible. When you try to access the second parameter, the program automatically returns to the first parameter when the block is saved.
Defining Symbols 8.6 Entering Shared Symbols 8.6.5 Exporting and Importing Symbol Tables You can export the current symbol table to a text file in order to be able to edit it with any text editor. You can also import tables created using another application into your symbol table and continue to edit them there. The import function can be used, for example, to include in the symbol table assignment lists created with STEP5/ST following conversion. The file formats *.SDF, *.ASC, *.DIF, and *.
Defining Symbols 8.6 Entering Shared Symbols 8.6.6 File Formats for Importing/Exporting a Symbol Table The following file formats can be imported into or exported out from the symbol table: • ASCII file format (ASC) • Data Interchange Format (DIF) You can open, edit, and save DIF files in Microsoft Excel. • System Data Format (SDF) You can open, edit, and save SDF files in Microsoft Access. • - To import and export data to and from the Microsoft Access application, use the SDF file format.
Defining Symbols 8.6 Entering Shared Symbols Data Interchange Format (DIF) File Type *.DIF Structure: A DIF file consists of the file header and the data: Header TABLE Start of a DIF File 0,1 "
" Comment string VECTORS Number of records in the file 0, "" TUPLES Number of data fields in a record 0,Defining Symbols 8.6 Entering Shared Symbols System Data Format (SDF) File Type *.SDF Structure: Strings in quotation marks, parts separated by commas Example: "green_phase_ped.", "T 2", TIMER","Duration of green phase for pedestrians" "red_ped.", "Q 0.0", "BOOL","Red for pedestrians" To open an SDF file in Microsoft Access you should select the file format 'Text (with delimiter)'. Use the double quotation mark (") as the text delimiter and the comma (,) as the field delimiter.
Defining Symbols 8.6 Entering Shared Symbols 8.6.7 Editing Areas in Symbol Tables As of STEP 7 V5.3, you can now select and edit contiguous areas within a symbol table. This means that you can copy and/or cut parts of one symbol table and insert them into another symbol table or delete them as required. This makes it easier to update symbol tables by quickly transferring data from one symbol table to another.
9 Creating Blocks and Libraries 9.1 Selecting an Editing Method Depending on the programming language you use to create a program, you can enter your program either in incremental input mode and/or free-edit (text) mode. Incremental Editors for the Programming Languages Ladder Logic (LAD), Function Block Diagram (FBD), Statement List (STL), or S7-GRAPH In the incremental input mode editors for Ladder, FBD, STL, and S7-GRAPH, you create blocks that are stored in the user program.
Creating Blocks and Libraries 9.2 Selecting the Programming Language 9.2 Selecting the Programming Language Setting the Programming Language for the Editor Before you you generate a particular block or a source file, select the programming language and editor via the object properties. This selection determines which editor is started when the block or source file is opened.
Creating Blocks and Libraries 9.
Creating Blocks and Libraries 9.2 Selecting the Programming Language 9.2.1 Ladder Logic Programming Language (LAD) The graphic programming language Ladder Logic (LAD) is based on the representation of circuit diagrams. The elements of a circuit diagram, e.g. normally open contacts and normally closed contacts, are combined to form networks. The code section of a logic block represents one or more networks.
Creating Blocks and Libraries 9.2 Selecting the Programming Language 9.2.2 Function Block Diagram Programming Language (FBD) The programming language Function Block Diagram (FBD) is based on graphic logic symbols also known in Boolean algebra. Complex functions such as math functions can also be displayed directly in combination with the logic boxes. The programming language FBD is supplied with the standard STEP 7 software package.
Creating Blocks and Libraries 9.2 Selecting the Programming Language 9.2.3 Statement List Programming Language (STL) The programming language STL is a text-based programming language with a structure similar to machine code. Each statement represents a program processing operation of the CPU. Multiple statements can be linked to form networks. Example of Networks in Statement List The programming language STL is supplied with the standard STEP 7 software package.
Creating Blocks and Libraries 9.2 Selecting the Programming Language 9.2.4 S7 SCL Programming Language The programming language SCL (Structured Control Language) is available as an optional package. This is a high-level text-based language whose global language definition conforms to IEC 1131-3. The language closely resembles PASCAL and, other than in STL, simplifies the programming of loops and conditional branches due to its high-level language commands, for example.
Creating Blocks and Libraries 9.2 Selecting the Programming Language 9.2.5 S7-GRAPH Programming Language (Sequential Control) The graphic programming language S7-GRAPH is available as optional package. It allows you to program sequential controls. This includes the creation of sequencers and the specification of corresponding step contents and transitions. You program the contents of the steps in a special programming language (similar to STL).
Creating Blocks and Libraries 9.2 Selecting the Programming Language 9.2.6 S7 HiGraph Programming Language (State Graph) The graphic programming language S7 HiGraph is available as an optional package. It allows you to program a number of the blocks in your program as status graphs. Here you split your system into dedicated functional units which can acquire different states and you define the transition conditions between states.
Creating Blocks and Libraries 9.2 Selecting the Programming Language A graph group is stored in a HiGraph source file in the "Source" folder of the S7 program. This source file is then compiled to generate S7 blocks for the user program. Syntax and formal parameters are checked after the last entry was made in a graph (when the working window is closed). Addresses and symbols are not checked until the source file is being compiled. 9.2.
Creating Blocks and Libraries 9.3 Creating Blocks 9.3 9.3.1 Creating Blocks Blocks Folder You can create the program for an S7 CPU in the form of: • Blocks • Source files The folder "Blocks" is available under the S7 program for storing blocks. This block folder contains the blocks you need to download to the S7 CPU for your automation task. These loadable blocks include logic blocks (OBs, FBs, FCs) and data blocks (DB).
Creating Blocks and Libraries 9.3 Creating Blocks 9.3.2 User-Defined Data Types (UDT) User-defined data types are special data structures you create yourself that you can use in the whole S7 program once they have been defined. • User-defined data types can be used like elementary data types or complex data types in the variable declaration of logic blocks (FC, FB, OB) or as a data type for variables in a data block (DB).
Creating Blocks and Libraries 9.3 Creating Blocks 9.3.3 Block Properties You can more easily identify the blocks you created if you use block properties and you can also protect these blocks from unauthorized changes. You should edit the block properties when the block is open. In addition to the properties you can edit, the properties dialog box also displays data for your information only: you cannot edit this information.
Creating Blocks and Libraries 9.3 Creating Blocks Keyword / Property Meaning Example [UNLINKED] for DBs only! Data blocks with the UNLINKED property are only stored in the load memory. They take up no space in the working memory and are not linked to the program. They cannot be accessed with MC7 commands. Depending on the specific CPU, the contents of such a DB can be transferred to the working memory only with SFC 20 BLKMOV or SFC 83 READ_DBL.
Creating Blocks and Libraries 9.
Creating Blocks and Libraries 9.3 Creating Blocks 9.3.4 Displaying Block Lengths Block lengths are displayed in "bytes.
Creating Blocks and Libraries 9.3 Creating Blocks 9.3.5 Comparing Blocks Introduction To compare blocks that are in different locations, you can start the block comparison process in either of the following ways: • Go to the SIMATIC Manager and select the Options > Compare Blocks menu command. In the "Compare Blocks - Results" dialog box that is displayed, click the "Go to" button.
Creating Blocks and Libraries 9.3 Creating Blocks In contrast to an offline-online comparison, in an offline-offline comparison, STEP 7also detects the presence of different variable names. This additional step is not possible for an offline-offline comparison since only replacement symbols are available online. Comments for block networks and lines as well as other block attributes (such as S7-PDIAG information and messages) are excluded from comparisons.
Creating Blocks and Libraries 9.3 Creating Blocks How Block Comparison Works: Comparison in the SIMATIC Manager 1. In the SIMATIC Manager, select the block folder or the blocks to be compared. 2. Select the Options > Compare Blocks menu command. 3. In the "Compare Blocks" dialog box that is displayed, select the type of comparison (ONLINE/offline or Path1/Path2). 4. For a Path1/Path2 comparison: In the SIMATIC Manager, select the block folder or the blocks to be compared.
Creating Blocks and Libraries 9.3 Creating Blocks 9.3.6 Rewiring The following blocks and addresses can be rewired: • Inputs, outputs • Memory bits, timers, counters • Functions, function blocks To rewire: 1. Select the "Blocks" folder that contains the individual blocks you want to rewire in the SIMATIC Manager. 2. Select the menu command Options > Rewire. 3. Enter the required replacements (old address/new address) in the table in the "Rewire" dialog box. 4.
Creating Blocks and Libraries 9.4 Working with Libraries 9.4 Working with Libraries Libraries serve to store reusable program components for SIMATIC S7/M7. The program components can be copied to the library from existing projects or created directly in the library independently of other projects. You can save yourself a lot of programming time and effort if you store blocks which you want to use many times in a library in an S7 program.
Creating Blocks and Libraries 9.4 Working with Libraries Copying Libraries You copy a library by saving it under another name using the menu command File > Save As. You copy parts of a library such as programs, blocks, source files etc. using the menu command Edit > Copy. Deleting a Library You delete a library using the menu command File > Delete. You delete parts of a library such as programs, blocks, source files etc. using the menu command Edit > Delete.
Creating Blocks and Libraries 9.4 Working with Libraries 9.4.1 Hierarchical Structure of Libraries Libraries are structured in a hierarchical manner, just like projects: • Libraries can contain S7/M7 programs. • An S7 program can contain one "Blocks" folder (user program), one "Source Files" folder, one "Charts" folder, and one "Symbols" object (symbol table).
Creating Blocks and Libraries 9.
10 Basics of Creating Logic Blocks 10.1 Basics of Creating Logic Blocks 10.1.1 Structure of the Program Editor Window The window of the program editor is split into the following areas: Tables The "Program Elements" tab displays a table of the program elements you can insert into your LAD, FBD or STL program. The "Call Structure" tab shows the call hierarchy of the blocks in the current S7 program.
Basics of Creating Logic Blocks 9.4 Working with Libraries Details The various tabs in the "Details" window provide functions, for example, for displaying error messages, editing symbols, providing address information, controlling addresses, comparing blocks and for editing error definitions for hardware diagnostics.
Basics of Creating Logic Blocks 9.4 Working with Libraries 10.1.2 Basic Procedure for Creating Logic Blocks Logic blocks (OBs, FBs, FCs) consist of a variable declaration section, a code section as well as their properties. When programming, you must edit the following three parts: • Variable declaration: In the variable declaration you specify the parameters, system attributes for parameters, and local block-specific variables.
Basics of Creating Logic Blocks 9.4 Working with Libraries 10.1.3 Default Settings for the LAD/STL/FBD Program Editor Before you start programming, you should make yourself familiar with the settings in the editor in order to make it easier and more comfortable for you when programming. Using the menu command Options > Customize you open a tabbed dialog box. In the various tabs you can make the following default settings for programming blocks, e.g.
Basics of Creating Logic Blocks 9.4 Working with Libraries 10.1.5 Instructions from the Program Elements Table The "Program elements" tab in the overview window provides LAD and FBD elements as well as already declared multiple instances, pre-configured blocks and blocks from libraries. You can access the tab via menu command View > Tables. You can also insert program elements in the code section using the menu command Insert > Program Elements.
Basics of Creating Logic Blocks 10.2 Editing the Variable Declaration 10.2 Editing the Variable Declaration 10.2.1 Using the Variable Declaration in Logic Blocks After you open a logic block, a window opens that contains in the upper section the variable table and the variable detail view for the block as well as the instruction list in the lower section in which you edit the actual block code.
Basics of Creating Logic Blocks 10.2 Editing the Variable Declaration In the variable detail view, you specify the local variables and the formal parameters for the block as well as the system attributes for parameters. This has the following effects: 10.2.2 • During declaration, sufficient memory space is reserved for temporary variables in the local data stack, and in the case of function blocks, for static variables in the instance DB to be associated later.
Basics of Creating Logic Blocks 10.2 Editing the Variable Declaration 10.2.3 Structure of the Variable Declaration Window The variable declaration window consists of the overview of variables and of the variable detail view. After you have generated and opened a new code block, a default variable table is displayed. It lists only the declaration types (in, out, in_out, stat, temp) permitted for the selected block, namely in the prescribed order.
Basics of Creating Logic Blocks 10.3 Multiple Instances in the Variable Declaration 10.3 10.3.1 Multiple Instances in the Variable Declaration Using Multiple Instances It is possible that you may want to or have to use a restricted number of data blocks for instance data owing to the performance (for example, memory capacity) of the S7 CPUs you are using.
Basics of Creating Logic Blocks 10.3 Multiple Instances in the Variable Declaration 10.3.2 Rules for Declaring Multiple Instances The following rules apply to the declaration of multiple instances: • Declaring multiple instances is only possible in function blocks that were created with STEP 7 from Version 2 onwards (see Block Attribute in the properties of the function block).
Basics of Creating Logic Blocks 10.4 General Notes on Entering Statements and Comments 10.4 General Notes on Entering Statements and Comments 10.4.1 Structure of the Code Section In the code section you program the sequence for your logic block by entering the appropriate statements in networks, depending on the programming language chosen. After a statement is entered, the editor runs an immediate syntax check and displays any errors in red and italics.
Basics of Creating Logic Blocks 10.4 General Notes on Entering Statements and Comments 10.4.2 Procedure for Entering Statements You can edit the parts of the code section in any order. We recommend you proceed as follows when you program a block for the first time: You can make changes in either overwrite mode or insert mode. You switch between modes using the INSERT key.
Basics of Creating Logic Blocks 10.4 General Notes on Entering Statements and Comments 10.4.3 Entering Shared Symbols in a Program Using the menu command Insert > Symbol you can insert symbols in the code section of your program. If the cursor is positioned at the beginning, the end, or within a string, the symbol is already selected that starts with this string - if such a symbol exists. If you change the string, the selection is updated in the list.
Basics of Creating Logic Blocks 10.4 General Notes on Entering Statements and Comments Block Title or Network Title To enter a block or network title, position the cursor on the word "Title" to the right of the block name or network name (for example, Network 1: Title:). A text box is opened in which you can enter the title. This can be up to 64 characters long. Block comments pertain to the whole logic block. There they can comment the function of the block.
Basics of Creating Logic Blocks 10.4 General Notes on Entering Statements and Comments 10.4.5 Entering Block Comments and Network Comments 1. Activate the comments with the menu command View > Display with > Comments (a check mark is visible in front of the menu command). 2. Position the cursor in the gray field below the block name or below the network name by clicking with the mouse. The gray comment field appears white and has a border. 3. Enter your comment in the open text box.
Basics of Creating Logic Blocks 10.4 General Notes on Entering Statements and Comments Inserting a Network Template in a Program 1. Open the block in which you want to insert the new network. 2. In the opened block, click in the network after which you want to insert a new network based on the network template. 3. Open the "Program Elements" tab (menu command Insert > Program Elements). 4. Open the "S7 Program" folder of the relevant library in the catalog. 5. Double-click the network template. 6.
Basics of Creating Logic Blocks 10.5 Editing LAD Elements in the Code Section 10.5 10.5.1 Editing LAD Elements in the Code Section Settings for Ladder Logic Programming Setting the Ladder Logic Layout You can set the layout for creating programs in the Ladder Logic representation type. The format you select (A4 portrait/landscape/maximum size) affects the number of Ladder elements that can be displayed in one rung. 1. Select the menu command Options > Customize. 2.
Basics of Creating Logic Blocks 10.5 Editing LAD Elements in the Code Section 10.5.2 Rules for Entering Ladder Logic Elements You will find a description of the Ladder Logic programming language representation in the "Ladder Logic for S7-300/400 - Programming Blocks" manual or in the Ladder Logic online help. A Ladder network can consist of a number of elements in several branches. All elements and branches must be connected; the left power rail does not count as a connection (IEC 1131-3).
Basics of Creating Logic Blocks 10.5 Editing LAD Elements in the Code Section • Coils which do not permit Boolean logic: - Master Control Relay Activate _/(MCRA) - Master Control Relay Deactivate _/(MCRD) - Open Data Block _/(OPN) - Master Control Relay Off _/(MCR>) All other coils can either have Boolean logic operations or not.
Basics of Creating Logic Blocks 10.5 Editing LAD Elements in the Code Section 10.5.3 Illegal Logic Operations in Ladder Power Flow from Right to Left No branches may be created which may cause power to flow in the reverse direction. The following figure shows an example: With signal state "0" at I 1.4 a power flow from right to left would result at I 6.8. This is not permitted. Short Circuit No branches may be created which cause a short circuit.
Basics of Creating Logic Blocks 10.6 Editing FBD Elements in the Code Section 10.6 10.6.1 Editing FBD Elements in the Code Section Settings for Function Block Diagram Programming Setting the Function Block Diagram Layout You can set the layout for creating programs in the Function Block Diagram representation type. The format you select (A4 portrait/landscape/maximum size) affects the number of FBD elements that can be displayed in one rung. 1. Select the menu command Options > Customize. 2.
Basics of Creating Logic Blocks 10.6 Editing FBD Elements in the Code Section 10.6.2 Rules for Entering FBD Elements You will find a description of the programming language "FBD" in the "Function Block Diagram for S7-300/400 - Programming Blocks" manual or in the FBD online help. An FBD network can consist of a number of elements. All elements must be interconnected (IEC 1131-3). When programming in FBD, you must observe a number of rules. Error messages will inform you of any errors you make.
Basics of Creating Logic Blocks 10.6 Editing FBD Elements in the Code Section Some boxes require a Boolean logic operation and some boxes must not have a Boolean logic operation.
Basics of Creating Logic Blocks 10.7 Editing STL Statements in the Code Section 10.7 10.7.1 Editing STL Statements in the Code Section Settings for Statement List Programming Setting the Mnemonics You can choose between two sets of mnemonics: • German • English. You set the mnemonics in the SIMATIC Manager with the menu command Options > Customize in the "Language" tab before opening a block. While editing a block you cannot change the mnemonics. You edit the block properties in their own dialog box.
Basics of Creating Logic Blocks 10.8 Updating Block Calls 10.8 Updating Block Calls You can use the menu command Edit > Block Call > Update in "LAD/STL/FBD - Programming S7 Blocks" to automatically update block calls which have become invalid.
Basics of Creating Logic Blocks 10.8 Updating Block Calls 10.8.1 Changing Interfaces You can also use the incremental Editor to modify the interfaces of offline blocks that have been edited with STEP 7, version 5: 1. Make sure that all the blocks have been compiled with STEP 7, version 5. To do this, generate a source file for all the blocks and compile it. 2. Modify the interface of the relevant block. 3. Now open all the calling blocks one after another - the corresponding calls are displayed in red. 4.
Basics of Creating Logic Blocks 10.9 Saving Logic Blocks 10.9 Saving Logic Blocks To enter newly created blocks or changes in the code section of logic blocks or in declaration tables in the programming device database, you must save the respective block. The data are then written to the hard disk of the programming device. To save blocks on the hard disk of the programming device: 1. Activate the working window of the block you want to save. 2.
Basics of Creating Logic Blocks 10.
11 Creating Data Blocks 11.1 Basic Information on Creating Data Blocks The data block (DB) is a block in which you can, for example, store values for your machine or plant to access. In contrast to a logic block that is programmed with one of the programming languages Ladder Logic, Statement List, or Function Block Diagram, a data block contains only the variable declaration section. This means the code section is irrelevant here and so is programming networks.
Creating Data Blocks 11.2 Declaration View of Data Blocks 11.2 Declaration View of Data Blocks With data blocks that are not globally shared, the declaration view cannot be changed. Column Explanation Address Displays the address that STEP 7 automatically assigns for the variable when you finish entering a declaration. Declaration This column is only displayed for instance data blocks.
Creating Data Blocks 11.3 Data View of Data Blocks 11.3 Data View of Data Blocks The data view shows you the current values of all variables in the data block. You can only change these values in the data view. The table representation in this view is the same for all shared data blocks. For instance data blocks an additional "Declaration" column is displayed.
Creating Data Blocks 11.4 Editing and Saving Data Blocks 11.4 Editing and Saving Data Blocks 11.4.1 Entering the Data Structure of Shared Data Blocks If you open a data block which is not assigned to a user-defined data type or function block, you can define its structure in the declaration view of the data block. With data blocks which are not shared, the declaration view cannot be changed. 1. Open a shared data block, meaning a block which is not associated with a UDT or FB. 2.
Creating Data Blocks 11.4 Editing and Saving Data Blocks 11.4.2 Entering and Displaying the Data Structure of Data Blocks Referencing an FB (Instance DBs) Input When you associate a data block with a function block (instance DB), the variable declaration of the function block defines the structure of the data block. Any changes can only be made in the associated function block. 1. Open the associated function block (FB). 2. Edit the variable declaration of the function block. 3.
Creating Data Blocks 11.4 Editing and Saving Data Blocks Note For data blocks that are assigned to a function block, you can only edit the actual values for the variables. To enter actual values for the variables, you must be in the data view of data blocks.
Creating Data Blocks 11.4 Editing and Saving Data Blocks 11.4.3 Entering the Data Structure of User-Defined Data Types (UDT) 1. Open the user-defined data type (UDT). 2. Display the declaration view if this view is not set already. 3. Define the structure of the UDT by determining the sequence of variables, their data type, and an initial value if required using the information in the table below. 4. You complete the entry of a variable by exiting the row with the TAB key or RETURN.
Creating Data Blocks 11.4 Editing and Saving Data Blocks 11.4.4 Entering and Displaying the Structure of Data Blocks Referencing a UDT Input When you assign a data block to a user-defined data type, the data structure of the user-defined data type defines the structure of the data block. Any changes can only be made in the associated user-defined data type. 1. Open the user-defined data type (UDT). 2. Edit the structure of the user-defined data type. 3. Create the data block again.
Creating Data Blocks 11.4 Editing and Saving Data Blocks 11.4.5 Editing Data Values in the Data View Editing actual values is only possible in the data view of data blocks. 1. If necessary, toggle to the table display in the data view using the menu command View > Data View. 2. Enter the required actual values for the data elements in the fields of the column "Actual Value." The actual values must be compatible with the data type of the data elements.
Creating Data Blocks 11.4 Editing and Saving Data Blocks 11.4.7 Saving Data Blocks To enter newly created blocks or changed data values in data blocks in the programming device database, you must save the respective block. The data are then written to the hard disk of the programming device. To save blocks on the hard disk of the programming device: 1. Activate the working window of the block you want to save. 2.
12 Parameter Assignment for Data Blocks The function "Parameter Assignment for Data Blocks" allows you to do the following outside the LAD/STL/FBD program editor: • Edit and download the actual values of instance data blocks to the PLC, without having to load the entire data block. • Monitor instance data blocks online. • Use the "S7_techparam" system attribute (Technological Functions) to easily assign parameters to instance data blocks and multiple instances and monitor them online. Procedure: 1.
Parameter Assignment for Data Blocks 12.1 Assigning Parameters to Technological Functions 12.1 Assigning Parameters to Technological Functions With the function "Parameter Assignment for Data Blocks" you can easily assign parameters to the temperature controller blocks FB 58 "TCONT_CP" and FB 59 "TCONT_S" that are supplied in the standard library and monitor them online. To do so, proceed as follows: 1.
13 Creating STL Source Files 13.1 Basic Information on Programming in STL Source Files You can enter your program or parts of it as an STL source file and then compile it into blocks in one step. The source file can contain the code for a number of blocks, which are then compiled as blocks in one compilation run.
Creating STL Source Files 13.2 Rules for Programming in STL Source Files 13.2 13.2.1 Rules for Programming in STL Source Files Rules for Entering Statements in STL Source Files An STL source file consists mainly of continuous text. To enable the file to be compiled into blocks, you must observe certain structures and syntax rules.
Creating STL Source Files 13.2 Rules for Programming in STL Source Files 13.2.2 Rules for Declaring Variables in STL Source Files For every block in the source file you must declare the required variables. The variable declaration section comes before the code section of the block. The variables must - if they are being used - be declared in the correct sequence for declaration types. This means all variables of one declaration type are together.
Creating STL Source Files 13.2 Rules for Programming in STL Source Files 13.2.3 Rules for Block Order in STL Source Files Called blocks precede the calling blocks. This means: 13.2.4 • The OB1 used in most cases, which calls other blocks, comes last. Blocks that are called from OB1 must precede it. • User-defined data types (UDT) precede the blocks in which they are used. • Data blocks with an associated user-defined data type (UDT) follow the user-defined data type.
Creating STL Source Files 13.2 Rules for Programming in STL Source Files 13.2.5 Rules for Setting Block Properties in STL Source Files You can more easily identify the blocks you created if you use block properties and you can also protect these blocks from unauthorized changes. The block properties can be checked or changed in incremental input mode using the menu command File > Properties under the "General - Part 1" and "General - Part 2" tabs.
Creating STL Source Files 13.2 Rules for Programming in STL Source Files Block Properties and Block Order When entering block properties, you should observe the input sequence shown in the following table: Order Keyword / Property Meaning Example 1. [KNOW_HOW_PROTECT] Block protection; a block compiled with this option does not allow its code section to be viewed. The interface for the block can be viewed, but it cannot be changed. KNOW_HOW_PROTECT 2.
Creating STL Source Files 13.2 Rules for Programming in STL Source Files 13.2.
Creating STL Source Files 13.3 Structure of Blocks in STL Source Files 13.3 Structure of Blocks in STL Source Files The blocks in STL source files are structured using keywords. Depending on the type of block, there are differences in the structure of: 13.3.
Creating STL Source Files 13.3 Structure of Blocks in STL Source Files 13.3.
Creating STL Source Files 13.4 Syntax and Formats for Blocks in STL Source Files 13.4 Syntax and Formats for Blocks in STL Source Files The format tables show the syntax and formats that you should observe when programming STL source files. The syntax is represented as follows: 13.4.1 • Each element is described in the right column. • Any elements that must be entered are shown in quotation marks. • The square brackets [...] mean that the contents of these brackets are optional.
Creating STL Source Files 13.4 Syntax and Formats for Blocks in STL Source Files 13.4.
Creating STL Source Files 13.4 Syntax and Formats for Blocks in STL Source Files 13.4.3 Format Table of Functions The following table shows a brief list of the format for functions in an STL source file: Structure "FUNCTION" Description fc_no : fc_type or fc_name : fc_type fc_no is the block number, for example FC5; fc_name is the symbolic name of the block as defined in the symbol table; fc_type is the data type of the return value (RET_VAL) of the function.
Creating STL Source Files 13.4 Syntax and Formats for Blocks in STL Source Files 13.4.
Creating STL Source Files 13.5 Creating STL Source Files 13.5 Creating STL Source Files 13.5.1 Creating STL Source Files The source file must be created in the source file folder beneath the S7 program. You can create source files in the SIMATIC Manager or the editor window. Creating Source Files in the SIMATIC Manager 1. Open the appropriate "Source Files" folder by double-clicking on it. 2. To insert an STL source file select the menu command Insert > S7 Software > STL Source File.
Creating STL Source Files 13.5 Creating STL Source Files 13.5.3 Setting The Layout of Source Code Text To improve readability of text in source files, select menu command Options > Settings and the "Source Code" tab. Specify the font, font style and color for the various elements of the source code. For example, you can specify to display line numbers and to display keywords in upper case letters. 13.5.
Creating STL Source Files 13.5 Creating STL Source Files 13.5.6 Inserting Source Code from Existing Blocks in STL Source Files You can insert the source code from other blocks into your STL source file which were created in Ladder, Function Block Diagram, or Statement List. This is possible for organization blocks (OB), function blocks (FB), functions (FC), data blocks (DB), and user-defined data types (UDT). Proceed as follows: 1.
Creating STL Source Files 13.5 Creating STL Source Files 13.5.8 Generating STL Source Files from Blocks You can generate an STL source file which you can edit with any text editor from existing blocks. The source file is generated in the source file folder of the S7 program. To generate a source file from a block, proceed as follows: 1. In the program editor, select the menu command File > Generate Source File. 2.
Creating STL Source Files 13.6 Saving and Compiling STL Source Files and Executing a Consistency Check 13.6 Saving and Compiling STL Source Files and Executing a Consistency Check 13.6.1 Saving STL Source Files You can save an STL source file at any time in its current state. The program is not compiled and no syntax check is run, meaning any errors are saved as well. Syntax errors are detected and reported only when the source file is compiled or following a consistency check.
Creating STL Source Files 13.6 Saving and Compiling STL Source Files and Executing a Consistency Check To find the location of an error in a source file, position the cursor on the "Error" tab of the message window. The faulty element is automatically highlighted in the code section and an error message is output at the status bar. 13.6.
Creating STL Source Files 13.7 Examples of STL Source Files 13.7 13.7.1 Examples of STL Source Files Examples of Declaring Variables in STL Source Files Variables of Elementary Data Type // Comments are separated from the declaration section by a double slash.
Creating STL Source Files 13.7 Examples of STL Source Files 13.7.
Creating STL Source Files 13.7 Examples of STL Source Files ORGANIZATION_BLOCK OB1 TITLE = Example for OB1 with different block calls //The 3 networks show block calls //with and without parameters {S7_pdiag := 'true'} AUTHOR FAMILY NAME VERSION VAR_TEMP Interim value : INT; END_VAR //System attribute for blocks Siemens Example Test_OB 1.1 // Buffer BEGIN NETWORK TITLE = Function call transferring parameters // Parameter transfer in one line CALL FC1 (param1 :=I0.0,param2 :=I0.
Creating STL Source Files 13.7 Examples of STL Source Files 13.7.
Creating STL Source Files 13.7 Examples of STL Source Files FUNCTION FC1: VOID // Only due to call VAR_INPUT param1 : bool; param2 : bool; END_VAR begin end_function FUNCTION FC2 : INT TITLE = Increment number of items // As long as the value transferred is < 1000, this function // increases the transferred value. If the number of items // exceeds 1000, "-1" is returned via the return value // for the function (RET_VAL).
Creating STL Source Files 13.7 Examples of STL Source Files AUTHOR FAMILY NAME VERSION : : : : Siemens Throughput check INCR_ITEM_NOS 1.0 VAR_IN_OUT ITEM_NOS {S7_visible := 'true'}: INT; // No.
Creating STL Source Files 13.7 Examples of STL Source Files 13.7.
Creating STL Source Files 13.7 Examples of STL Source Files FUNCTION_BLOCK FB6 TITLE = Simple traffic light switching // Traffic light control of pedestrian crosswalk // on main street {S7_m_c := 'true'} //System attribute for blocks AUTHOR : Siemens FAMILY : Traffic light NAME : Traffic light01 VERSION : 1.
Creating STL Source Files 13.
Creating STL Source Files 13.7 Examples of STL Source Files 13.7.
Creating STL Source Files 13.7 Examples of STL Source Files Data Block with Associated Function Block: DATA_BLOCK DB 30 TITLE = DB (FB) Example FB 30 // Specifies associated FB BEGIN start := TRUE; // Assignment of actual values setp := 10; END_DATA_BLOCK Note The associated function block must come before the data block in the source file. 13.7.6 Example of User-Defined Data Types in STL Source Files TYPE UDT20 STRUCT start : BOOL; // Variable of type BOOL setp.
14 Displaying Reference Data 14.1 Overview of the Available Reference Data You can create and evaluate reference data to make it easier to debug and modify your user program.
Displaying Reference Data 14.1 Overview of the Available Reference Data Displaying a Number of Views Simultaneously Displaying other lists in additional windows allows you, for example, to: 310 • Compare the same lists for different S7 user programs. • Display various views of a list, for example, a cross-reference list, displayed differently and placed side by side on the screen.
Displaying Reference Data 14.1 Overview of the Available Reference Data 14.1.1 Cross-Reference List The cross-reference list provides an overview of the use of addresses within the S7 user program.
Displaying Reference Data 14.1 Overview of the Available Reference Data 14.1.2 Program Structure The program structure describes the call hierarchy of the blocks within an S7 user program. You are also given an overview of the blocks used, their dependencies, and their local data requirements. Using the menu command View > Filter in the "Generating Reference Data" window you open a tabbed dialog box. In the "Program Structure" tab you can set how you want the program structure displayed.
Displaying Reference Data 14.1 Overview of the Available Reference Data Call Structure The complete call hierarchy is displayed. If the program structure is to be created for all organization blocks (OB) and OB1 is not in the S7 user program, or if a starting block was specified which is not present in the program, you are automatically prompted to specify another block for the program structure root.
Displaying Reference Data 14.1 Overview of the Available Reference Data 14.1.3 Assignment List The Assignment lists show you which addresses are already assigned in the user program. This display is an important basis for troubleshooting or making changes in the user program. The I/Q/M assignment list display gives you an overview of which bit in which byte of the memory areas input (I), output (Q), bit memory (M), times (T) and counter (Z) is used.
Displaying Reference Data 14.1 Overview of the Available Reference Data Example The following example shows the typical layout of an assignment list for inputs, outputs, and bit memory (I/Q/M). The first row shows the assignment of input byte IB 0. Inputs for address IB 0 are accessed directly (bit access). The columns "0", "1", "2", "3", "5", and "6" are identified with "X" for bit access. There is also word access to memory bytes 1 and 2, 2 and 3 or 4 and 5.
Displaying Reference Data 14.1 Overview of the Available Reference Data 14.1.4 Unused Symbols You are shown an overview of all the symbols with the following characteristics: • The symbols defined in the symbol table. • The symbols not used in the parts of the user program for which reference data exist. They are displayed in an active window. The working window's title bar shows the name of the user program to which the list belongs. Every line shown in the window corresponds to a list entry.
Displaying Reference Data 14.1 Overview of the Available Reference Data 14.1.5 Addresses Without Symbols When you display the list of addresses without symbols, you obtain a list of the elements which are used in the S7 user program, but which are not defined in the symbol table. They are displayed in an active window. The working window's title bar shows the name of the user program to which the list belongs.
Displaying Reference Data 14.2 Working with Reference Data Displaying Block Information for the Optional Programming Languages The online help topics on block information can be accessed if the corresponding optional package is installed. 14.2 Working with Reference Data 14.2.1 Ways of Displaying Reference Data The following possibilities are available for displaying reference data: Displaying from the SIMATIC Manager 1. In the project window in the component view offline, select the "Blocks" folder.
Displaying Reference Data 14.2 Working with Reference Data 14.2.3 Reference Data View Menu Command to Display this Reference Data View Program Structure View > Program Structure Cross-Reference List View > Cross References Generating and Displaying Reference Data Generating Reference Data: 1. In the SIMATIC Manager, select the block folder for which you want to generate reference data. 2. Select the menu command Options > Reference Data > Generate in the SIMATIC Manager.
Displaying Reference Data 14.2 Working with Reference Data 14.2.4 Finding Address Locations in the Program Quickly You can use reference data to position the cursor at different locations of an address in the program when programming. To do this, you must have up-to-date reference data. However, you do not have to start the application for displaying reference data. Basic Procedure 1.
Displaying Reference Data 14.2 Working with Reference Data 14.2.5 Example of Working with Address Locations You want to determine at which locations output Q1.0 (direct/indirect) is set. The following STL code in OB1 is used as an example: Network 1: ........... A Q 1.0 // irrelevant = Q 1.1 // in this example Network 2: A M1.0 A M2.0 = Q 1.0 // assignment Network 3: //comment line only SET = M1.0 // assignment Network 4: A I 1.0 A I 2.0 = M2.
Displaying Reference Data 14.2 Working with Reference Data Then proceed as follows: 1. Position the cursor on Q1.0 (NW 1, Inst 1) in OB1 in the LAD/STL/FBD Editor. 2. Select the menu command Edit > Go To > Location or use the right mouse button to select "Go to Location." The dialog box now displays all the assignments for Q1.0: OB1 Cycle Execution NW 2 Inst 3 /= W STL OB1 Cycle Execution NW 1 Inst 1 /A R STL 3.
Displaying Reference Data 14.2 Working with Reference Data 12. Jump to "NW 4 Inst 3" in the LAD/STL/FBD Editor using the "Go To" button: Network 4: A I 1.0 A I 2.0 = M2.0 13. Now you have to check the assignments to I1.0 and I2.0. This process is not described in this example, because you proceed in the same way as before (point 4 onwards). By switching between the LAD/STL/FBD Editor and the address locations dialog box, you can find and check the relevant locations in your program.
Displaying Reference Data 14.
15 Checking Block Consistency and Time Stamps as a Block Property 15.1 Checking Block Consistency Introduction If the interfaces or the code of individual objects have to be adapted or extended, this can lead to time stamp conflicts. Time stamp conflicts can in turn cause block inconsistencies between calling objects and called objects or reference blocks and thus to a high amount correction work. The "Check block consistency" function eliminates a lot of this correction work.
Checking Block Consistency and Time Stamps as a Block Property 15.1 Checking Block Consistency 3. If it was not possible to eliminate all the block inconsistencies automatically during the compilation run, the corresponding objects are marked in the output windows as error messages. Position the mouse on the corresponding error entry and use the right-hand mouse to call the error display in the pop-up menu. The relevant error is opened and the program jumps to the positions to be changed.
Checking Block Consistency and Time Stamps as a Block Property 15.2 Time Stamps as a Block Property and Time Stamp Conflicts 15.2 Time Stamps as a Block Property and Time Stamp Conflicts Blocks contain a code time stamp and an interface time stamp. These time stamps are displayed in the dialog box for the block properties. You can monitor the consistency of STEP 7 programs using time stamps. STEP 7 displays a time stamp conflict if it detects a violation of the rules when comparing time stamps.
Checking Block Consistency and Time Stamps as a Block Property 15.3 Time Stamps in Logic Blocks 15.3 Time Stamps in Logic Blocks Code Time stamp The time and date the block was created is entered here.
Checking Block Consistency and Time Stamps as a Block Property 15.4 Time Stamps in Shared Data Blocks 15.4 Time Stamps in Shared Data Blocks Code Time stamp The time stamp is updated: • When an ASCII source file is created for the first time • When an ASCII source file is compiled • When changes are made in the declaration view or in the data view of the block Interface Time stamp The time stamp is updated: • 15.
Checking Block Consistency and Time Stamps as a Block Property 15.6 Time Stamps in UDTs and Data Blocks Derived from UDTs 15.6 Time Stamps in UDTs and Data Blocks Derived from UDTs User-defined data types (UDTs) can, for example, be used to create a number of data blocks with the same structure. Code Time stamp The code time stamp is updated on every change.
Checking Block Consistency and Time Stamps as a Block Property 15.8 Avoiding Errors when Calling Blocks 15.8 Avoiding Errors when Calling Blocks STEP 7 Overwrites Data in the DB Register STEP 7 modifies the registers of the S7-300/S7-400 CPU when various instructions are executed. The contents of the DB and DI registers are, for example, swapped when you call an FB. This allows the instance DB of the called FB to be opened without losing the address of the previous instance DB.
Checking Block Consistency and Time Stamps as a Block Property 15.8 Avoiding Errors when Calling Blocks Situations in which Registers are Modified The manipulation of the address registers for indirect addressing is relevant only in STL. The other languages do not support indirect access to the address registers. The adaptation of the DB register by the compiler must be taken into account in all programming languages to ensure correct parameter transfer when blocks are called.
16 Configuring Messages 16.1 The Message Concept Messages allow you to detect, localize, and remedy errors during processing on the programmable controllers quickly, thus reducing downtimes on a plant considerably. Before messages can be output, they must first be configured. With STEP 7, you can create and edit messages linked to events with assigned message texts and message attributes. You can also compile the messages and display them on display devices. 16.1.
Configuring Messages 16.1 The Message Concept Message Numbering Message numbering requires the programmer to perform only one step: • Create the user program on the programming device, set the required bit, and assign the required message text to the bit directly while programming. There is no cyclic query of the programmable controller.
Configuring Messages 16.1 The Message Concept 16.1.
Configuring Messages 16.
Configuring Messages 16.1 The Message Concept 16.1.3 SIMATIC Components Overview The following figure shows an overview of which SIMATIC components are involved in configuring and displaying messages.
Configuring Messages 16.1 The Message Concept 16.1.4 Parts of a Message How a message is displayed depends on the messaging method, the message block used, and the display device.
Configuring Messages 16.1 The Message Concept 16.1.
Configuring Messages 16.
Configuring Messages 16.1 The Message Concept 16.1.6 Formal Parameters, System Attributes, and Message Blocks Formal Parameters as Message Number Inputs For each message or group of messages you need a formal parameter in your program that you specify as the IN parameter in the variable overview of your program. This formal parameter is then used as a message number input and forms the basis of a message.
Configuring Messages 16.1 The Message Concept The system attributes are assigned automatically if the message blocks that you use in your program are SFBs or FBs with corresponding system attributes and are called as multiple instances. 16.1.7 Message Type and Messages Message configuration allows you to use different procedures to create a message type or a message. This depends on the message-type block via which you gain access to message configuration.
Configuring Messages 16.1 The Message Concept Modifying Data Of Message Types Whether or not the modification of data at message types has an influence on the instances depends on whether you have assigned message numbers globally to the project (project-oriented message numbers) or to the CPU (CPU-oriented message numbers) when you generated your project.
Configuring Messages 16.1 The Message Concept 16.1.8 How to Generate an STL Source File from Message-Type Blocks When you generate an STL source file from message-type blocks, the configuration information is also written to the source file. This information is written to a pseudo-comment that begins with "*$ALARM_SERVER" and ends with "*". Caution When you set a symbolic reference for a block, note that the symbol table may not be modified prior to the compilation of the source file.
Configuring Messages 16.1 The Message Concept 16.1.10 Differences Between Project-Oriented and CPU-Oriented Assignment of Message Numbers The table below lists the differences between project-oriented and CPU-oriented assignment of message numbers: Project oriented CPU oriented Some of the message attributes and texts depend on the used HMI unit and must be configured display specific.
Configuring Messages 16.1 The Message Concept 16.1.11 Options for Modifying the Message Number Assignment of a Project In the "Message number" tab of the SIMATIC manager you can preset the way message numbers will be assigned (Menu command Options > Customize) to future projects and libraries. In this tab you determine whether the message numbers are to be assigned only to the CPU (CPU-oriented) or only to the project (project-oriented).
Configuring Messages 16.2 Project-Oriented Message Configuration 16.2 16.2.1 Project-Oriented Message Configuration How to Assign Project-Oriented Message Numbers Messages are identified by a number which is unique throughout a project. To achieve this, the individual STEP 7 programs are each allocated a number range within the total available range (1 to 2097151).
Configuring Messages 16.2 Project-Oriented Message Configuration 16.2.2.1 How to Create Block-Related Messages (Project-Oriented) Basic Procedure Programming Message-Type Blocks (FB) 1. In the SIMATIC Manager select the function block (FB) for which you want to generate a block-related message and open this block with a double-click. Result: The selected block is opened and displayed in the "LAD/STL/FBD" window. 2. Fill out the variable declaration table.
Configuring Messages 16.2 Project-Oriented Message Configuration 3. In the code section of the function block, insert the call for the selected message block, here "CALL alarm", and finish your entry with RETURN. Result: The input variables for the called message block (here SFB33) are displayed in the code section of the function block. 4. Assign the symbolic name you assigned in step 2 for the message block input, here "Mess01," to the variable "EV_ID".
Configuring Messages 16.2 Project-Oriented Message Configuration Creating Instance Data Blocks 1. When you have created a message type, you can associate instance data blocks to it and edit the instance-specific messages for these data blocks. To do this, in the SIMATIC Manager open the block that is to call your previously configured function block, for example, "OB1", by double-clicking it.
Configuring Messages 16.2 Project-Oriented Message Configuration message variations for it. 16.2.2.3 How to Configure PCS 7 Messages (Project-Oriented) For editing message types and messages to be output on WinCC display devices, the PCS7 message configuration function in STEP 7 provides a user-friendly method of: • Simplifying the configuration of display devices (created automatically) • Simplifying the entry of attributes and texts for messages • Ensuring that messages are standardized.
Configuring Messages 16.2 Project-Oriented Message Configuration 16.2.3 Assigning and Editing Symbol-Related Messages 16.2.3.1 How to Assign and Edit Symbol-Related Messages (Project-Oriented) Symbol-related messages (SCAN) are assigned directly to a signal in the symbol table. Permitted signals are all Boolean addresses: inputs (I), outputs (Q), and bit memory (M). You can assign these signals different attributes, messages texts, and up to 10 associated values with the message configuration function.
Configuring Messages 16.2 Project-Oriented Message Configuration 16.2.4 Creating and Editing User-Defined Diagnostic Messages Using this function you can write a user entry in the diagnostic buffer and send a corresponding message that you create in the message configuration application. User-defined diagnostic messages are created by means of the system function SFC52 (WR_USMSG; Error Class A or B) that is used as a message block.
Configuring Messages 16.3 CPU-Oriented Message Configuration 16.3 16.3.1 CPU-Oriented Message Configuration How to Assign CPU-Oriented Message Numbers Messages of the CPU are identified by a unique number. This is done by assigning each CPU a number area. Other than for assigning project-oriented message numbers, there is no need to assign a new number area to the new program. A new compilation of the program is therefore not required.
Configuring Messages 16.3 CPU-Oriented Message Configuration 16.3.2 Assigning and Editing Block-Related Messages 16.3.2.
Configuring Messages 16.3 CPU-Oriented Message Configuration Programming Message-Type Blocks (FB) 1. In SIMATIC Manager, select the function block (FB) for which you want to generate a block-related message and double-click to open it. Result: The selected block is opened and displayed in the "LAD/STL/FBD" window. 2. Fill out the variable declaration table. You must declare the corresponding variables in the calling function block for every message block that is called in the function block.
Configuring Messages 16.3 CPU-Oriented Message Configuration Editing a Message Type • Select the desired message block. • Enter the required text in the appropriate columns or select the required attributes.
Configuring Messages 16.3 CPU-Oriented Message Configuration Transferring Configuration Data • 16.3.2.2 Transfer the configured data to the WinCC database (via the AS-OS connection configuration) or the ProTool database. How to Edit Block-Related Messages (CPU-Oriented) 1. Select a message block, and then select the menu command Edit > Special Object Properties > Message to call message configuration. 2. Enter your required text in the "Default Texts" and "Additional Texts" columns.
Configuring Messages 16.3 CPU-Oriented Message Configuration Editing Message Types 1. In SIMATIC Manager, select the FB whose message texts you want to edit, and open the PCS7 message configuration dialog box. 2. Click on "More" to open the "Message text block". Fill out the text boxes for the message components "Origin," "OS area," and "Batch ID." 3. Enter the message class and the event text for all events of the message blocks used and specify whether every event must be acknowledged individually. 4.
Configuring Messages 16.3 CPU-Oriented Message Configuration 16.3.3 Assigning and Editing Symbol-Related Messages 16.3.3.1 How to Assign and Edit Symbol-Related Messages (CPU-Oriented) Symbol related messages (SCAN) are assigned directly to a signal in the symbol table. Permitted signals are all Boolean addresses: inputs (I), outputs (Q), and bit memory (M). You can assign these signals different attributes, messages texts, and up to 10 associated values with the message configuration function.
Configuring Messages 16.3 CPU-Oriented Message Configuration 16.3.4 Creating and Editing User-Defined Diagnostic Messages Using this function you can write a user entry in the diagnostic buffer and send a corresponding message that you create in the message configuration application. User-defined diagnostic messages are created by means of the system function SFC52 (WR_USMSG; Error Class A or B) that is used as a message block.
Configuring Messages 16.4 Tips for Editing Messages 16.4 16.4.1 Tips for Editing Messages Adding Associated Values to Messages To add current information (such as from a process) to block-related and symbol-related messages, you can insert associated values at any point in a message text. To add values, proceed as follows: 1. Create a block with the following structure: @@. 2.
Configuring Messages 16.4 Tips for Editing Messages Format Code These codes specify the output format for the associated value on the display device. A format instruction is introduced by a "%" sign. For message texts, there are the following fixed message codes: Format Code Description %[i]X Hex value with i index %[i]u Unsigned decimal value with i index %[i]d Signed decimal value with i index %[i]b Binary value with i index %[i][.y]f Integer (fixed-point no.
Configuring Messages 16.4 Tips for Editing Messages Examples of Associated Values @1I%6d@: The value from associated value 1 is displayed as a decimal number having a maximum of 6 places. @2R%6f@: The value "5.4," for example, from associated value 2 is displayed as an integer "5.4" (three leading blanks). @2R%2f@: The value "5.4," for example, from associated value 2 is displayed as an integer "5.4" (for a number of places that is too small, truncation does not occur).
Configuring Messages 16.4 Tips for Editing Messages 16.4.2 Integrating Texts from Text Libraries into Messages You can integrate as many texts as you want from a maximum of four different text libraries into one message. The texts can be placed freely, so their use in foreign language messages is also guaranteed. Proceed as follows: 1.
Configuring Messages 16.5 Translating and Editing Operator Related Texts The block begins with an @ sign, followed by a location designator identifying the associated value as well as a format code; it ends with another @ sign. 2. Delete this information from the message text. 16.5 Translating and Editing Operator Related Texts Texts that are output on display devices during process editing were usually input in the same language used to program the automation solution.
Configuring Messages 16.5 Translating and Editing Operator Related Texts Basic Procedure Ensure that you have set your target languages for the text translation in SIMATIC manager, under menu command Options > Language for Display Devices. Note You can print user text only under the application used for the translation.
Configuring Messages 16.6 Translating and Editing Text Libraries 16.6 16.6.1 Translating and Editing Text Libraries User Text Libraries A user text library lets you view text or text segments dynamically, depending on the associated value. Here, the associated value provides the text library index for the current text. A placeholder is entered at the position were the dynamic text is to be displayed. You can create user libraries for a program in which you can enter text and select your own index.
Configuring Messages 16.6 Translating and Editing Text Libraries 16.6.3 How to Edit User Text Libraries To edit existing user text libraries, proceed as follows: 1. In SIMATIC Manager, select the program or the subordinate object within the program whose text library you want to edit and then select the menu command Options > Text Libraries > User Text Library. 2. Select the text library you want to open from the "Available Text Libraries" dialog box. 3. Edit the displayed texts.
Configuring Messages 16.6 Translating and Editing Text Libraries 16.6.5 Translating Text Libraries System text libraries and user text libraries provide a list of texts that can be integrated into messages, updated dynamically at run time, and shown on a programming device or other display device. The texts in system text libraries are provided by STEP 7 or STEP 7 optional packages. There can be several text libraries assigned to one CPU. You can translate these texts into the required languages.
Configuring Messages 16.6 Translating and Editing Text Libraries Basic Procedure In the SIMATIC Manager, with the menu command Options > Language for Display Devices…, make sure that you have set the languages into which you want to translate a text library.
Configuring Messages 16.7 Transferring Message Configuration Data to the Programmable Controller 16.7 Transferring Message Configuration Data to the Programmable Controller 16.7.1 Transferring Configuration Data to the Programmable Controller Overview Use the transfer program AS-OS Engineering to transfer the message configuration data generated to the WinCC database.
Configuring Messages 16.8 Displaying CPU Messages and UserDefined Diagnostic Messages 16.
Configuring Messages 16.8 Displaying CPU Messages and UserDefined Diagnostic Messages Acknowledgeable messages (ALARM_SQ and ALARM_DQ) are displayed in bold letters. You can acknowledge these messages under the menu command Edit > Acknowledge CPU Message.
Configuring Messages 16.8 Displaying CPU Messages and UserDefined Diagnostic Messages "Interrupt" Tab The status of queued messages from ALARM_S blocks that have not yet been received or acknowledged is also displayed in the "Interrupt" tab. You can select the menu command View > Multiline Messages to display messages on one or more lines. In addition, you can sort the columns as necessary.
Configuring Messages 16.8 Displaying CPU Messages and UserDefined Diagnostic Messages 16.8.1 Configuring CPU Messages To configure CPU messages for selected modules, proceed as follows: 1. In the SIMATIC Manager, start the CPU Messages application via an online project. To do this, select an S7 program online and call the CPU Messages application for the selected CPU using the menu command PLC > CPU Messages. Result: The "CPU Messages" application window appears which lists the registered CPU. 2.
Configuring Messages 16.9 Configuring the 'Reporting of System Errors' 16.9 16.9.1 Configuring the 'Reporting of System Errors' Overview of 'Report System Error' With STEP 7, when system errors occur you can output messages with a description of the error that has occurred and the location of the error to one or more display devices (for example, WinCC, OP). 16.9.
Configuring Messages 16.9 Configuring the 'Reporting of System Errors' Basic Procedure The messages are sent by means of the standard message path ALARM_S/SQ to CPU Messages on the programming device or to the connected HMI devices. The sending of message to an HMI device can be deselected. Note Blocks generated with 'report system error' may only be downloaded to the CPU when this is in STOP mode.
Configuring Messages 16.9 Configuring the 'Reporting of System Errors' 16.9.3 Supported Components and Functional Scope The components of S7 300 stations, S7 400 stations, PROFINET IO devices, DP slaves, and WinAC are supported by Report System Error, as long as they support functions such as diagnostic interrupt insert/remove module interrupt, and channel-specific diagnostics.
Configuring Messages 16.
Configuring Messages 16.9 Configuring the 'Reporting of System Errors' Note • The station errors (failure/return) are displayed in plain text for all PROFIBUS DP slaves. • The manufacturer-specific diagnostics is supported for all PROFIBUS DP slaves with the following restrictions: - Only V1 slaves are supported. These are slaves with a GSD file containing the entry "DPV1_Slave=1". - The DP interrupt mode must be set to "DPV0" for this slave.
Configuring Messages 16.9 Configuring the 'Reporting of System Errors' PROFINET IO Below, you will find the diagnostic information from the various PROFINET devices supported by "Report System Error". Errors that occur during operation (CPU in RUN): • Device errors (failure, return) are supported • Module error and submodule error (module/submodule removed, wrong module/submodule, compatible module/submodule) are supported.
Configuring Messages 16.9 Configuring the 'Reporting of System Errors' Shared Devices SFM evaluates the information as to whether a (sub)module was configured as a shared device. Since SFM always views a CPU, only the (sub)modules with full access set for the CPU are taken into account in the diagnostics. Those configured as "not assigned" (sub)modules are ignored. 16.9.
Configuring Messages 16.9 Configuring the 'Reporting of System Errors' You can find more detailed information in the Help on the open dialog.
Configuring Messages 16.9 Configuring the 'Reporting of System Errors' 16.9.5 Generating Blocks for Reporting System Errors After you have completed your settings for reporting system errors, you can generate the required blocks (FB with assigned instance DB and one or more global DB(s) and an FC, depending on the setting even OBs that do not yet exist). To do this, click on the "Generate" button in the "Report System Errors" dialog box.
Configuring Messages 16.9 Configuring the 'Reporting of System Errors' 16.9.6 Generated Error OBs Depending on the CPU, you can generate the following Error OBs with "Report System Error": • OB 70 (I/O redundancy error) with a call for the generated diagnostic FB. This OB only exists with H-CPUs. • OB 72 (CPU redundancy error) with a call for the generated diagnostic FB. This OB only exists with H-CPUs. • OB 73 (communication redundancy error) with a call for the generated diagnostic FB.
Configuring Messages 16.9 Configuring the 'Reporting of System Errors' ATTENTION Please note the following: • The CPU no longer goes into STOP mode when Report System Error generates OB85 upon the error event Error While Updating Process Image.
Configuring Messages 16.9 Configuring the 'Reporting of System Errors' 16.9.7 Generated Blocks The diagnostic block set by 'Report System Error' (FB with associated instance DB and one or more shared DB(s) and an FC evaluates the local data of the error OB and reads any additional diagnostic information from the hardware component that caused the error.
Configuring Messages 16.
Configuring Messages 16.9 Configuring the 'Reporting of System Errors' 16.9.
Configuring Messages 16.9 Configuring the 'Reporting of System Errors' Hardware Error Error class Module Plug/pull of the module or wrong module type Module error Submodule Data record 0 Module error Channel error (channel 0...7FFF) Channel error Channel error for the entire module (Subslot = 0) Module error Maintenance (channel 0...7FFF) -* Maintenance (entire module) -* Plug/pull of the module or wrong module type Submodule error Data record 0 Module error Channel error (channel 0...
Configuring Messages 16.9 Configuring the 'Reporting of System Errors' 16.9.9 Generating Foreign-Language Message Texts in 'Report System Error' You can display the messages configured in 'Report System Error' in the languages that you installed when you installed STEP 7. To do so, proceed as follows: 1. In the SIMATIC Manager, select the Options > Language for Display Devices... menu command. In the dialog box that is then displayed, add the desired language to your project. 2.
Configuring Messages 16.9 Configuring the 'Reporting of System Errors' Translating messages and error texts into a language not supplied with STEP 7 Text in a language other than those supplied with STEP 7 will be displayed in the language set as default. You can export these texts, translate them into the desired language and then import them back into STEP 7. Add the desired language (Options > Language for Display Devices) and set this as the default language.
Configuring Messages 16.
17 Controlling and Monitoring Variables 17.1 Configuring Variables for Operator Control and Monitoring Overview STEP 7 provides a user-friendly method of controlling and monitoring variables in your process or programmable controller using WinCC. The advantage of this method over previous methods is that you no longer need to configure data separately for each operator station (OS), you simply configure once using STEP 7.
Controlling and Monitoring Variables 17.1 Configuring Variables for Operator Control and Monitoring Naming Conventions For the configuration data for WinCC to be saved and transferred, they are stored under a unique name automatically assigned by STEP 7.
Controlling and Monitoring Variables 17.2 Configuring Operator Control and Monitoring Attributes with Statement List, Ladder Logic, and Function Block Diagram 17.
Controlling and Monitoring Variables 17.3 Configuring Operator Control and Monitoring Attributes via the Symbol Table 17.3 Configuring Operator Control and Monitoring Attributes via the Symbol Table Overview Independent of the programming language used, you can configure the following variables using the procedure described below: • Bit memory • I/O signals Requirement Before you start, the following requirements must be fulfilled: • You have created a project in the SIMATIC Manager.
Controlling and Monitoring Variables 17.4 Changing Operator Control and Monitoring Attributes with CFC 17.4 Changing Operator Control and Monitoring Attributes with CFC Overview With CFC, you create your user program by selecting blocks that already have operator control and monitoring capabilities from a library, and placing and linking them in a chart. Requirement You have inserted an S7 program in a STEP 7 project, created a CFC chart, and placed blocks in it.
Controlling and Monitoring Variables 17.5 Transferring Configuration Data to the Operator Interface Programmable Controller 17.5 Transferring Configuration Data to the Operator Interface Programmable Controller Introduction Using the transfer program AS-OS Engineering you transfer the configuration data for operator control and monitoring generated to the WinCC database.
18 18.
Establishing an Online Connection and Making CPU Settings 18.1 Establishing Online Connections Finding directly connected nodes The additional information "direct" is not supported for PROFINET nodes. To still be able to find directly connected nodes, select the PLC > Diagnostics/Settings > Node Flashing Test menu command. In the dialog box that is displayed, you can set the flashing duration and then start the flashing test. The directly connected node will be identified by a flashing FORCE LED.
Establishing an Online Connection and Making CPU Settings 18.1 Establishing Online Connections 18.1.3 Online Access to PLCs in a Multiproject Cross-project access with an assigned PG/PC The "Assign PG/PC" function for the objects "PG/PC" and "SIMATIC PC Station" are also available for the multiproject. You can specify the target module for online access in any project of the multiproject. This procedure is the same as if you were working with one project only.
Establishing an Online Connection and Making CPU Settings 18.1 Establishing Online Connections Possible problems when working with distributed projects The PG/PC assignment is not visible if the allocation of projects is changed and a project is opened on a PG/PC on which it was not created. Nonetheless, the configured PG/PC object still maintains the "assigned" status - but with the "wrong" PG/PC. In this case you must clear the existing assignment and then reassign the PG/PC object.
Establishing an Online Connection and Making CPU Settings 18.1 Establishing Online Connections 18.1.4 Password Protection for Access to Programmable Controllers Using password protection you can: • Protect the user program in the CPU and its data from unauthorized changes (write protection) • Protect the programming know-how in your user program (read protection) • Prevent online functions that would interfere with the process You can only protect a module or the content of a MMC (e.g.
Establishing an Online Connection and Making CPU Settings 18.1 Establishing Online Connections Using the menu command PLC > Access Rights > Setup, you can call the "Enter Password" dialog box directly. By doing this, for example at the beginning of a session, you can enter the password once and will no longer be queried during later online accesses. The password remains effective until either the SIMATIC Manager is closed or the password is cancelled with the menu command PLC > Access Rights > Cancel.
Establishing an Online Connection and Making CPU Settings 18.1 Establishing Online Connections 18.1.5 Updating the Window Contents You should note the following: • Changes in the online window of a project as a result of user actions (for example, downloading or deleting blocks) are not automatically updated in any open "Accessible Nodes" windows. • Any such changes in the "Accessible Nodes" window are not automatically changed in any open online windows of a project.
Establishing an Online Connection and Making CPU Settings 18.2 Displaying and Changing the Operating Mode 18.2 Displaying and Changing the Operating Mode With this function you can, for example, switch the CPU to RUN again after correcting an error. Displaying the Operating Mode 1. Open your project and select an S7/M7 program, or open the "Accessible Nodes" window using the menu command PLC > Display Accessible Nodes and select a node ("MPI=..."). 2.
Establishing an Online Connection and Making CPU Settings 18.3 Displaying and Setting the Time and Date 18.3 18.3.
Establishing an Online Connection and Making CPU Settings 18.3 Displaying and Setting the Time and Date TOD Interrupts OB 80 is called if TOD interrupts were not triggered due to the "Time jump" when standard time is switched to daylight saving. For daylight saving/standard time conversion the periodicity is maintained for TOD interrupts with minute and hourly periodicity.
Establishing an Online Connection and Making CPU Settings 18.4 Updating the Firmware 18.4 Updating the Firmware 18.4.1 Updating Firmware in Modules and Submodules Online As of STEP 7 V5.1 Service Pack 3, you can update modules or submodules on a station in a standardized way online. To do so, proceed as described below: Concept To update the firmware on a module (CPU, IM, etc.) or a submodule (DI, DO, etc.), you can download the files (*.UPD) containing the latest firmware on the Internet ("http://www.
Establishing an Online Connection and Making CPU Settings 18.4 Updating the Firmware The files containing the latest firmware versions must be available in the file system on your PG/PC. Only files for one firmware version must be in one folder.
Establishing an Online Connection and Making CPU Settings 18.4 Updating the Firmware Procedure in HW Config 1. Open the station containing the module to be updated. 2. Select the module For PROFIBUS DP interface modules such as an IM 151, select the icon for the DP slave. In this case, it is the one that stands for ET 200S. 3. Follow the same procedure for PROFINET IO devices.
Establishing an Online Connection and Making CPU Settings 18.4 Updating the Firmware Principle Consequences of updating the firmware during operation You can decide to activate the new firmware immediately after updating via an option in the update dialog. If you select this option, the station performs a restart like after POWER OFF/POWER ON. As result, it may happen that a CPU remains in STOP mode or the processing of the user program is adversely affected.
19 Downloading and Uploading 19.1 Downloading from the PG/PC to the Programmable Controller 19.1.1 Requirements for Downloading Requirements for Downloading to the Programmable Controller • There must be a connection between your programming device and the CPU in the programmable controller (for example, via the multipoint interface). • Access to the programmable controller must be possible.
Downloading and Uploading 19.1 Downloading from the PG/PC to the Programmable Controller Restart (Warm Restart (Transition to RUN Mode) If you execute a restart (warm restart) in the "STOP" mode, the program is restarted and first processes the startup program (in the block OB100) in STARTUP mode. If the startup is successful, the CPU changes to RUN mode.
Downloading and Uploading 19.1 Downloading from the PG/PC to the Programmable Controller 19.1.2 Differences Between Saving and Downloading Blocks You should always distinguish between saving and downloading blocks. Menu commands Saving Downloading File > Save PLC > Download File > Save As Function The current status of the block in the editor is saved on the hard disk of the programming device. The current status of the block in the editor is only downloaded to the CPU.
Downloading and Uploading 19.1 Downloading from the PG/PC to the Programmable Controller 19.1.3 Load Memory and Work Memory in the CPU After completing the configuration, parameter assignment, and program creation and establishing the online connection, you can download complete user programs or individual blocks to a programmable controller.
Downloading and Uploading 19.1 Downloading from the PG/PC to the Programmable Controller CPU Work Memory The work memory (integrated RAM) is used to store the parts of the user program required for program processing. Possible Downloading/Uploading Procedures • You use the download function to download the user program or loadable objects (for example, blocks) to the programmable controller.
Downloading and Uploading 19.1 Downloading from the PG/PC to the Programmable Controller 19.1.4 Download Methods Dependent on the Load Memory The division of the load memory of a CPU into RAM and EEPROM areas determines the methods available for downloading your user program or the blocks in your user program.
Downloading and Uploading 19.1 Downloading from the PG/PC to the Programmable Controller 19.1.5 Updating Firmware in Modules and Submodules Online As of STEP 7 V5.1 Service Pack 3, you can update modules or submodules on a station in a standardized way online. To do so, proceed as described below: Concept To update the firmware on a module (CPU, IM, etc.) or a submodule (DI, DO, etc.), you can download the files (*.UPD) containing the latest firmware on the Internet ("http://www.siemens.
Downloading and Uploading 19.1 Downloading from the PG/PC to the Programmable Controller (3) CPU with MPI interface and DP interface or PN interface (with S7 routing) Procedure in HW Config 1. Open the station containing the module to be updated. 2. Select the module For PROFIBUS DP interface modules such as an IM 151, select the icon for the DP slave. In this case, it is the one that stands for ET 200S. 3. Follow the same procedure for PROFINET IO devices.
Downloading and Uploading 19.1 Downloading from the PG/PC to the Programmable Controller Principle Consequences of updating the firmware during operation You can decide to activate the new firmware immediately after updating via an option in the update dialog. If you select this option, the station performs a restart like after POWER OFF/POWER ON. As result, it may happen that a CPU remains in STOP mode or the processing of the user program is adversely affected.
Downloading and Uploading 19.1 Downloading from the PG/PC to the Programmable Controller 19.1.6 Downloading a Program to the S7 CPU 19.1.6.1 Downloading with Project Management 1. In the project window, select the user program or the blocks you want to download. 2. Download the selected objects to the programmable logic controller by selecting the menu command PLC > Download. Alternative Procedure (Drag & Drop) 1. Open an offline window and an online window of your project. 2.
Downloading and Uploading 19.1 Downloading from the PG/PC to the Programmable Controller 19.1.6.4 Saving Downloaded Blocks on Integrated EPROM For CPUs that have an integrated EPROM (such as CPU 312), you can save blocks from the RAM to the integrated EPROM so as not to lose the data following power off or memory reset. 1.
Downloading and Uploading 19.1 Downloading from the PG/PC to the Programmable Controller 19.1.6.5 Downloading via EPROM Memory Cards Requirements For access to EPROM memory cards in the programming device which are intended for an S7 programmable logic controller, you will require the appropriate EPROM drivers. For access to EPROM memory cards which are intended for an M7 programmable control system, the Flash File System must be installed (only possible on the PG 720, PG 740, and PG 760).
Downloading and Uploading 19.2 Compiling and Downloading Several Objects from the PG 19.2 19.2.1 Compiling and Downloading Several Objects from the PG Requirements for and Notes on Downloading Downloading Block Folders For block folders, only logic blocks can be downloaded. Other objects in the block folder, such as system data (SDBs), etc. cannot be downloaded here. SDBs are downloaded through the "Hardware" object.
Downloading and Uploading 19.2 Compiling and Downloading Several Objects from the PG Requirements for Downloading the Hardware Configuration • CPUs must be in STOP mode. • It must be possible to establish online connections to the CPUs. In the case of the selected CPU or the selected block folder, password-projected CPUs require an authorized connection or entry of a password ("Edit" button) before the "Compile and Download Objects" function can be run.
Downloading and Uploading 19.2 Compiling and Downloading Several Objects from the PG 19.2.2 Compiling and Downloading Objects In the "Compile and download objects" dialog you prepare the objects that can be selected in your project or multiproject for transfer to the PLC and their subsequent download (if desired). This dialog can be used for objects in a station, a project or a multiproject. Depending on the object selected, certain information may not be displayed.
Downloading and Uploading 19.2 Compiling and Downloading Several Objects from the PG Special considerations when compiling and downloading connections If, in a module, you select the "Connections" object as the one to be compiled, then STEP 7 automatically selects the corresponding "Connections" object in the connection partner. By doing this, STEP 7 always creates consistent configuration data (system data blocks). The automatically selected objects cannot be directly deselected manually.
Downloading and Uploading 19.3 Uploading from the Programmable Controller to the PG/PC 19.3 Uploading from the Programmable Controller to the PG/PC This function supports you when carrying out the following actions: • Saving information from the programmable controller (for example, for servicing purposes) • Fast configuring and editing of a station, if the hardware components are available before you start configuring.
Downloading and Uploading 19.
Downloading and Uploading 19.3 Uploading from the Programmable Controller to the PG/PC 19.3.1 Uploading a Station Using the menu command PLC > Upload Station you can upload the current configuration and all blocks from the programmable controller of your choice to the programming device. To do this, STEP 7 creates a new station in the current project under which the configuration will be saved. You can change the preset name of the new station (for example, "SIMATIC 300-Station(1)").
Downloading and Uploading 19.3 Uploading from the Programmable Controller to the PG/PC 19.3.2 Uploading Blocks from an S7 CPU You can upload S7 blocks from the CPU to the hard disk of the programming device using the SIMATIC Manager. Uploading blocks to the programming device is useful in the following situations: 19.3.3 • Making a backup copy of the current user program loaded in the CPU.
Downloading and Uploading 19.3 Uploading from the Programmable Controller to the PG/PC Two Distinct Cases When uploading blocks from the CPU to the programming device, remember that there are two distinct situations: 1. The user program to which the blocks belong is located on the programming device. 2. The user program to which the blocks belong is not on the programming device. This means that the program sections listed below, that cannot be downloaded to the CPU, are not available.
Downloading and Uploading 19.4 Deleting on the Programmable Controller 19.4 Deleting on the Programmable Controller 19.4.1 Erasing the Load/Work Memory and Resetting the CPU Before downloading your user program to the S7 programmable controller, you should perform a memory reset on the CPU to ensure that no "old" blocks are still on the CPU.
Downloading and Uploading 19.4 Deleting on the Programmable Controller 19.4.2 Deleting S7 Blocks on the Programmable Controller Deleting individual blocks on the CPU may be necessary during the test phase of the CPU program. Blocks are stored in the user memory of the CPU either in the EPROM or RAM (depending on the CPU and the load procedure). • Blocks in the RAM can be deleted directly. The occupied space in the load or work memory becomes free and can be used again.
Downloading and Uploading 19.5 Compressing the User Memory (RAM) 19.5 19.5.1 Compressing the User Memory (RAM) Gaps in the User Memory (RAM) After deleting and reloading blocks, gaps can occur in the user memory (load and work memory) and reduce the usable memory area. With the compress function, the existing blocks are rearranged in the user memory without gaps, and a continuous free memory is created.
Downloading and Uploading 19.5 Compressing the User Memory (RAM) 19.5.2 Compressing the Memory Contents of an S7 CPU Ways of Compressing the Memory There are two methods of compressing the user memory, as follows: • If there is insufficient memory available when you are downloading to the programmable controller, a dialog box appears informing you of the error. You can compress the memory by clicking the corresponding button in the dialog box.
Downloading and Uploading 19.
20 Testing with the Variable Table 20.1 Introduction to Testing with Variable Tables Variable tables offer the advantage of being able to store various test environments. Thus, tests and monitoring can be effortlessly reproduced during operation or for the purpose of service and maintenance. There is no limit to the number of variable tables that can be stored.
Testing with the Variable Table 20.2 Basic Procedure when Monitoring and Modifying with the Variable Table 20.2 Basic Procedure when Monitoring and Modifying with the Variable Table To use the Monitor and Modify functions, proceed as follows: 1. Create a new variable table or open an existing variable table. 2. Edit or check the contents of the variable table. 3. Establish an online connection between the current variable table and the required CPU using the menu command PLC > Connect To. 4.
Testing with the Variable Table 20.3 Editing and Saving Variable Tables 20.3 20.3.1 Editing and Saving Variable Tables Creating and Opening a Variable Table Before you can monitor or modify variables, you must create a variable table (VAT) and enter the required variables. To create a variable table, you can choose from one of the following methods: In the SIMATIC Manager: • Select the "Blocks" folder and the menu command Insert > S7 Block > Variable Table.
Testing with the Variable Table 20.3 Editing and Saving Variable Tables 20.3.1.1 How to Create and Open a Variable Table Alternative 1 in the SIMATIC Manager 1. Select the offline project view. 2. Open the block folder in which you want to save the variable table. 3. Select the menu command Insert > S7 Block > Variable Table. 4. In the dialog box, specify the name of the variable table. 5. You can open the variable table by double-clicking the object.
Testing with the Variable Table 20.3 Editing and Saving Variable Tables 20.3.2 Copying/Moving Variable Tables You can copy or move variable tables in block folders of an S7/M7 program. Note the following when copying or moving variable tables: • Existing symbols in the symbol table of the target program will be updated. • When you move a variable table, the corresponding symbols from the symbol table of the source program will also be moved to the symbol table of the target program.
Testing with the Variable Table 20.4 Entering Variables in Variable Table 20.4 Entering Variables in Variable Table 20.4.1 Inserting Addresses or Symbols in a Variable Table Select the variables whose values you want to modify or monitor and enter them in the variable table. Start from the "outside" and work "inwards"; this means you should first select the inputs and then the variables that are influenced by the inputs and which influence the outputs, and finally the outputs.
Testing with the Variable Table 20.4 Entering Variables in Variable Table Notes on Inserting Symbols • You enter the variable you want to modify with your address or as a symbol. You can enter symbols and addresses either in the "Symbol" column or in the "Address" column. The entry is then written automatically in the correct column. If the corresponding symbol is defined in the symbol table, the symbol column or the address column is filled out automatically.
Testing with the Variable Table 20.4 Entering Variables in Variable Table If you position the cursor in a row marked in red, brief information is displayed telling you the cause of the error. Notes on correcting the error can be obtained by pressing F1. Note If you prefer to edit the variable table with the keyboard (without the mouse), you should keep the "Brief Information When Using the Keyboard" feature enabled.
Testing with the Variable Table 20.4 Entering Variables in Variable Table 20.4.2 Inserting a Contiguous Address Range in a Variable Table 1. Open a variable table. 2. Position the cursor in the row after which you want the range of contiguous addresses to be inserted. 3. Select the menu command Insert > Range of Variables. The "Insert Range of Variables" dialog box appears. 4. Enter an address as the start address in the "From Address" field. 5.
Testing with the Variable Table 20.4 Entering Variables in Variable Table 20.4.
Testing with the Variable Table 20.4 Entering Variables in Variable Table 20.4.
Testing with the Variable Table 20.4 Entering Variables in Variable Table 20.4.7 Examples 20.4.7.1 Example of Entering Addresses in Variable Tables Permitted Address: Data Type: Example (English Mnemonics): Input | Output | Bit memory BOOL Input | Output | Bit memory BYTE IB 1 | QB 10 | MB 100 I 1.0 | Q 1.7 | M 10.
Testing with the Variable Table 20.4 Entering Variables in Variable Table 20.4.7.2 Example of Entering a Contiguous Address Range Open a variable table and call up the "Insert Range of Variables" dialog box with the menu command Insert > Range of Variables. For the dialog box entries the following lines for bit memory are inserted in the variable table: • From address: M 3.0 • Number: 10 • Display format: BIN Address Display Format M 3.0 BIN M 3.1 BIN M 3.2 BIN M 3.3 BIN M 3.4 BIN M 3.
Testing with the Variable Table 20.4 Entering Variables in Variable Table 20.4.7.3 Examples of Entering Modify and Force Values Bit Addresses Possible bit addresses Permitted modify/force values I1.0 true M1.7 false Q10.7 0 DB1.DBX1.1 1 I1.1 2#0 M1.6 2#1 Byte Addresses Possible byte addresses IB 1 MB 12 MB 14 QB 10 DB1.
Testing with the Variable Table 20.4 Entering Variables in Variable Table Double Word Addresses Possible double word addresses Permitted modify/force values ID 1 2#00110011001100110011001100110011 MD 0 23e4 MD 4 2 QD 10 dw#16#abcdef10 QD 12 ABCDEF10 DB1.DBD 1 b#(12,34,56,78) PQD 2 'abcd' MD 8 l# -12 MD 12 l#12 MD 16 -123456789 MD 20 123456789 MD 24 t#12s345ms MD 28 tod#1:2:34.567 MD 32 p#e0.
Testing with the Variable Table 20.5 Establishing a Connection to the CPU 20.5 Establishing a Connection to the CPU In order to be able to monitor or modify the variables you entered in your current variable table (VAT), you must establish a connection to the appropriate CPU. It is possible to link each variable table with a different CPU. Displaying an Online Connection If an online connection exists, the term "ONLINE" in the title bar of the variable table window indicates this fact.
Testing with the Variable Table 20.6 Monitoring Variables 20.6 20.6.1 Monitoring Variables Introduction to Monitoring Variables The following methods are available to you for monitoring variables: • Activate the Monitor function with the menu command Variable > Monitor. The values of the selected variables are displayed in the variable table in accordance with the trigger point and trigger frequency set.
Testing with the Variable Table 20.6 Monitoring Variables Trigger Point The following figure shows the position of the trigger points. To display the modified value in the "Status Value" column, you should set the trigger point for monitoring to "Start of cycle" and the trigger point for modifying to "End of cycle". Trigger Immediately You can update the values of selected variables using the menu command Variable > Update Monitor Values.
Testing with the Variable Table 20.7 Modifying Variables 20.7 20.7.1 Modifying Variables Introduction to Modifying Variables The following methods are available to you for modifying variables: • Activate the Modify function with the menu command Variable > Modify. The user program applies the modify values for the selected variables from the variable table in accordance with the trigger point and trigger frequency set.
Testing with the Variable Table 20.7 Modifying Variables 20.7.2 Defining the Trigger for Modifying Variables You can assign fixed values to individual variables of a user program (once or every cycle) at a specific point during program processing (trigger point). When you select a trigger point you determine the point in time at which the modify values are assigned to the variables. You can set the trigger point and a trigger frequency using the menu command Variable > Trigger.
Testing with the Variable Table 20.7 Modifying Variables The following applies to trigger points when modifying variables: • If you set "Once" as the trigger frequency, a message appears if the selected variables cannot be modified. • With the trigger frequency "Every cycle," no message appears. Trigger Immediately You can modify the values of selected variables using the menu command Variable > Activate Modify Values.
Testing with the Variable Table 20.8 Forcing Variables 20.8 20.8.1 Forcing Variables Safety Measures When Forcing Variables Beware of Injury to Personnel and Damage to Property Note that when using the "Force" function, any incorrect action could: ! • Endanger the life or health of personnel or • Cause damage to machines or the whole plant. Caution Before you start the Force function you should check that nobody is executing this function on the same CPU at the same time.
Testing with the Variable Table 20.8 Forcing Variables 20.8.2 Introduction to Forcing Variables You can assign fixed values to individual variables of a user program so that they cannot be changed or overwritten even by the user program executing in the CPU. The requirement for this is that the CPU supports this function (for example, the S7-400 CPUs). By assigning fixed values to variables you can set specific situations for your user program and use this to test the programmed functions.
Testing with the Variable Table 20.8 Forcing Variables Using Forcible Addresses from the Variable Table If you want to enter a variable from a variable table in the force value window, select the table and the required variable. Next, call menu command Variable > Force values to open the force value window. The variables a module can force will be entered in the force value window.
Testing with the Variable Table 20.8 Forcing Variables 20.8.3 Differences Between Forcing and Modifying Variables The following table summarizes the differences between forcing and modifying: Feature / Function Forcing with S7-400 (incl.
21 Testing Using Program Status You can test your program by displaying the program status (RLO, status bit) or the contents of the corresponding registers for every instruction. You can define the scope of the information displayed in the "LAD/FBD" tab in the "Customize" dialog box. You open this dialog box using the menu command Options > Customize in the "LAD/STL/FBD: Programming Blocks" window.
Testing Using Program Status 21.1 Program Status Display 21.1 Program Status Display The display of the program status is updated cyclically. It begins with the selected network. Preset Color Codes in LAD and FBD • Status fulfilled: green continuous lines • Status not fulfilled: blue dotted lines • Status unknown: black continuous lines The preset for line type and color can be changed under the menu command Options > Customize, "LAD/FBD" tab.
Testing Using Program Status 21.1 Program Status Display Status of Parameters • The values of parameters in bold type are current. • The values of parameters in thin type result from a previous cycle; the program section was not processed in the current scan cycle.
Testing Using Program Status 21.2 What You Should Know About Testing in Single-Step Mode/Breakpoints 21.2 What You Should Know About Testing in Single-Step Mode/Breakpoints When testing in single-step mode you can do the following: • Execute programs statement by statement (in single steps) • Set breakpoints The function "testing in single-step mode" is not possible for all programmable controllers (refer to the documentation for the relevant programmable controller).
Testing Using Program Status 21.2 What You Should Know About Testing in Single-Step Mode/Breakpoints Permitted Test Functions • Monitor/modify variables • Module information • Operating mode Danger Risk of dangerous plant status in HOLD mode.
Testing Using Program Status 21.3 What You Should Know About the HOLD Mode 21.3 What You Should Know About the HOLD Mode If the program encounters a breakpoint, the programmable controller goes into the HOLD operating mode. LED Display in HOLD Mode • LED RUN • LED STOP is lit flashes Program Processing in HOLD Mode • In HOLD mode, no S7 code is processed, meaning no priority classes are processed any further.
Testing Using Program Status 21.4 Program Status of Data Blocks 21.4 Program Status of Data Blocks From STEP 7 version 5 onwards, it is possible to observe a data block online in the data view. The display can be activated either by an online data block or by an offline data block. In both cases, the contents of the online data block in the programmable controller are displayed. The data block must not be modified before the program status is started.
Testing Using Program Status 21.4 Program Status of Data Blocks 21.4.1 Setting the Display for Program Status You can set the display of the program status in a Statement List, Function Block Diagram, or Ladder Logic block yourself. To set the display, proceed as follows: 1. Select the menu command Options > Customize. 2. In the "Customize" dialog box, select the "STL" tab or the "LAD/FBD" tab. 3. Select the required options for testing the program. You can display the following status fields. Activate...
22 Testing using the Simulation Program (Optional Package) 22.1 Testing using the Simulation Program S7 PLCSIM (Optional Package) With the optional software package PLC Simulation you can run and test your program on a simulated programmable controller that exists on your computer or programming device (for example, Power PG). As the simulation is realized completely by the STEP 7 software, you do not require any S7 hardware (CPU or signal modules).
Testing using the Simulation Program (Optional Package) 22.
23 Diagnostics 23.1 Hardware Diagnostics and Troubleshooting You can see whether diagnostic information is available for a module by the presence of diagnostics symbols. Diagnostics symbols show the status of the corresponding module and, for CPUs, the operating mode as well. Diagnostics symbols are displayed in the project window in the online view as well as in the quick view (default setting) or the diagnostic view when you call the function "Hardware Diagnostics.
Diagnostics 23.1 Hardware Diagnostics and Troubleshooting Displaying Maintenance Information As of STEP 7 V5.4 Service Pack 1, certain PROFINET components can display information indicating whether or not preventive maintenance is necessary and, if it is, how urgent it is. The following maintenance information is available: • Maintenance required (indicated by a green wrench): The relevant component must be replaced within a foreseeable period.
Diagnostics 23.2 Diagnostics Symbols in the Online View 23.2 Diagnostics Symbols in the Online View Diagnostics symbols are displayed in the online project window and in the hardware configuration window with the online view of configuration tables. Diagnostics symbols make it easier for you to detect a fault. You can see by a glance at a module symbol whether diagnostic information is available.
Diagnostics 23.2 Diagnostics Symbols in the Online View Diagnostics Symbol for Forcing Symbol Mode Variables are being forced on this module, meaning variables in the user program for the module are assigned fixed values that cannot be changed by the program. The symbol for forcing can also appear in combination with other symbols (here with the symbol for RUN mode).
Diagnostics 23.3 Diagnosing Hardware: Quick View 23.3 Diagnosing Hardware: Quick View 23.3.1 Calling the Quick View The quick view offers you a quick way of using "Diagnosing Hardware" with less information than the more detailed displays in the diagnostic view of HW Config. The quick view is displayed as default when the "Diagnose Hardware" function is called.
Diagnostics 23.4 Diagnosing Hardware: Diagnostic View 23.4 Diagnosing Hardware: Diagnostic View 23.4.1 Calling the Diagnostic View Using this method you can open the "Module Information" dialog box for all modules in the rack. The diagnostic view (configuration table) shows the actual structure of a station at the level of the racks and DP stations with their modules.
Diagnostics 23.4 Diagnosing Hardware: Diagnostic View Calling from the ONLINE view of a project in the SIMATIC Manager 1. Establish an online connection to the programmable controller using the menu command View > Online in the project view in the SIMATIC Manager. 2. Select a station and double-click to open it. 3. Then open the "Hardware" object in it. The diagnostic view is opened.
Diagnostics 23.4 Diagnosing Hardware: Diagnostic View 23.4.2 Information Functions in the Diagnostic View In contrast to the quick view, the diagnostic view displays the entire station configuration available online. This consists of: • Rack configurations • Diagnostics symbols for all configured modules From these, you can read the status of each module and, with CPU modules, the operating mode. • Module type, order number and address details, comments on the configuration.
Diagnostics 23.5 Module Information 23.5 23.5.1 Module Information Options for Displaying the Module Information You can display the "Module Information" dialog box from different starting points. The following procedures are examples of frequently used methods of calling module information: • In the SIMATIC Manager from a window with the project view "online" or "offline.
Diagnostics 23.5 Module Information 23.5.2 Module Information Functions The module information functions can each be found in the various tabs within the "Module Information" dialog box. When displayed in an active situation, only those tabs relevant to the selected module are displayed.
Diagnostics 23.5 Module Information Function/Tab Information Use Stacks Stacks tab: Can only be called up in To determine the cause of a transition to STOP mode or HOLD mode. STOP and to correct a block The B stack for the selected module is displayed. You can then also display the I stack, the L stack, and the nesting stack and jump to the error location in the interrupted block.
Diagnostics 23.5 Module Information 23.5.3 Scope of the Module Type-Dependent Information The scope of information that can be evaluated and displayed is dependent on: • The module selected, and • From which view you call the module information A full scope of information is available when called from the online view of the configuration tables or from the project window. A limited scope of information is available when called from the "Accessible Nodes" window.
Diagnostics 23.5 Module Information Tabs Displayed The table shows which property tabs can be present in the "Module Information" dialog box for each module type.
Diagnostics 23.5 Module Information 23.5.4 Displaying the Module Status of PA Field Devices and DP Slaves After a Y-Link As of STEP 7 V5.1 Service Pack 3, you can evaluate the module status of DP slaves and PA field devices "after" a DP/PA link (IM 157).
Diagnostics 23.
Diagnostics 23.6 Diagnosing in STOP Mode 23.6 23.6.1 Diagnosing in STOP Mode Basic Procedure for Determining the Cause of a STOP To determine why the CPU has gone into "STOP" mode, proceed as follows: 1. Select the CPU that has gone into STOP. 2. Select the menu command PLC > Diagnostics/Settings > Module Information. 3. Select the "Diagnostic Buffer" tab. 4. You can determine the cause of the STOP from the last entries in the diagnostic buffer. If a programming error occurs: 1.
Diagnostics 23.6 Diagnosing in STOP Mode 23.6.2 Stack Contents in STOP Mode By evaluating the diagnostic buffer and the stack contents you can determine the cause of the fault in the processing of the user program. If, for example, the CPU has gone into STOP as a result of a programming error or the STOP command, the "Stacks" tab in the module information displays the block stack. You can display the contents of the other stacks using the "I Stack", "L Stack", and "Nesting Stack" buttons.
Diagnostics 23.7 Checking Scan Cycle Times to Avoid Time Errors 23.7 Checking Scan Cycle Times to Avoid Time Errors 23.7.1 Checking Scan Cycle Times to Avoid Time Errors The "Scan Cycle Time" tab in the module information gives information about the scan cycle times of the user program. If the duration of the longest cycle time is close to the configured maximum scan cycle time, there is a danger that fluctuations in the cycle time might cause a time error.
Diagnostics 23.8 Flow of Diagnostic Information 23.8 Flow of Diagnostic Information The following figure shows the flow of diagnostic information in SIMATIC S7. Displaying Diagnostic Information You can read out the diagnostic entries using SFC51 RDSYSST in the user program or display the diagnostic messages in plain language with STEP 7.
Diagnostics 23.8 Flow of Diagnostic Information 23.8.1 System Status List SSL The system status list (SSL) describes the current status of the programmable logic controller. It provides an overview of the configuration, the current parameter assignment, the current statuses and sequences on the CPU, and the modules belonging to it. You can only read the data in the system status list but not modify them. It is a virtual list that is only created on request.
Diagnostics 23.8 Flow of Diagnostic Information System Data of the System Status List System data are intrinsic or assigned characteristic data of a CPU. The following table shows the topics about which information can be displayed (partial system status lists): Topic Information Module identification Order number, type ID, and version of the module CPU characteristics Time system, system behavior (for example,.
Diagnostics 23.8 Flow of Diagnostic Information Diagnostic Data on Modules In addition to the CPU, there are also other modules with diagnostic capabilities (SMs, CPs, FMs) whose data are entered in the system status list.
Diagnostics 23.8 Flow of Diagnostic Information 23.8.2 Sending Your Own Diagnostic Messages You can also extend the standard system diagnostics of SIMATIC S7 by using the system function SFC 52 WRUSMSG to: • Enter your own diagnostic information in the diagnostic buffer (for example, information about the execution of the user program). • Send user defined diagnostic messages to logged on stations (monitoring devices such as a PG, OP or TD).
Diagnostics 23.8 Flow of Diagnostic Information 23.8.3 Diagnostic Functions System diagnostics detect, evaluate, and report errors that occur within a programmable controller. For this purpose, every CPU and every module with system diagnostics capability (for example, FM 354) has a diagnostic buffer in which detailed information on all diagnostic events is entered in the order they occurred.
Diagnostics 23.9 Program Measures for Handling Errors 23.
Diagnostics 23.9 Program Measures for Handling Errors You can find detailed information on OBs, SFBs, and SFCs in the corresponding Help on Blocks. 23.9.1 Evaluating the Output Parameter RET_VAL Using the RET_VAL output parameter (return value), a system function indicates whether or not the CPU was able to execute the SFC function correctly Error Information in the Return Value The return value is of the integer data type (INT).
Diagnostics 23.9 Program Measures for Handling Errors 23.9.2 Error OBs as a Reaction to Detected Errors Detectable Errors The system program can detect the following errors: • CPU functioning incorrectly • Error in the system program execution • Errors in the user program • Error in the I/Os Depending on the type of error, the CPU is set to STOP mode or an error OB is called.
Diagnostics 23.9 Program Measures for Handling Errors Error OBs A distinction is made between synchronous and asynchronous errors as follows: • Synchronous errors can be assigned to an MC7 instruction (for example, load instruction for a signal module which has been removed). • Asynchronous errors can be assigned to a priority class or to the entire programmable logic controller (for example, cycle time exceeded). The following table shows what types of errors can occur.
Diagnostics 23.9 Program Measures for Handling Errors Example of Using Error OB81 Using the local data (start information) of the error OB, you can evaluate the type of error that has occurred. If, for example, the CPU detects a battery error, the operating system calls OB81 (see figure). You can write a program that evaluates the event code triggered by the OB81 call. You can also write a program that brings about a reaction, such as activating an output connected to a lamp on the operator station.
Diagnostics 23.9 Program Measures for Handling Errors Local Data of Error OB81 The following table shows the temporary variables that must be declared, in this case, in the variable declaration table of OB81. The symbol Battery error (BOOL) must be identified as an output (for example, Q 4.0) so that other parts of the program can access these data. Decl.
Diagnostics 23.9 Program Measures for Handling Errors Sample Program for the Error OB81 The sample STL program shows how you can read the error code in OB81. The program is structured as follows: • The error code in OB81 (OB81FLTID) is read and compared with the value of the event "battery exhausted" (B#16#3921). • If the error code corresponds to the code for "battery exhausted," the program jumps to the label Berr and activates the output batteryerror.
Diagnostics 23.9 Program Measures for Handling Errors 23.9.3 Inserting Substitute Values for Error Detection With certain types of error (for example, a wire break affecting an input signal), you can supply substitute values for values that are not available due to the error. There are two ways in which you can supply substitute values: • You can assign substitute values for configurable output modules using STEP 7. Output modules that cannot have parameters assigned have the default substitute value 0.
Diagnostics 23.9 Program Measures for Handling Errors The following sample program could be written in OB122. The following table shows the temporary variables that must be declared, in this case, in the variable declaration table of OB122. Decl.
Diagnostics 23.9 Program Measures for Handling Errors 23.9.4 I/O Redundancy Error (OB70) Description The operating system of a H CPU calls OB70 if a loss of redundancy occurs on the PROFIBUS DP (for example, if there is a bus failure on the active DP master or an error in the DP slave interface module) or if the active DP master changes from DP slaves with switched I/Os. Programming OB70 You must create OB70 as an object in your S7 program using STEP 7.
Diagnostics 23.9 Program Measures for Handling Errors 23.9.5 CPU Redundancy Error (OB72) Description The operating system of the H CPU calls OB72 if one of the following events occurs: • Loss of redundancy on the CPUs • Comparison error (for example, RAM, PIQ) • Standby-master switchover • Synchronization error • Error in a SYNC submodule • Update process aborted • OB72 is executed by all CPUs which are in RUN mode or STARTUP mode after an accompanying start event.
Diagnostics 23.9 Program Measures for Handling Errors 23.9.6 Time Error (OB80) Description The operating system of the CPU calls OB80 when a time error occurs. Time errors include the following, for example: • Maximum cycle time exceeded • Time-of-day interrupts skipped by moving the time forward • Delay too great when processing a priority class Programming OB80 You must create OB80 as an object in your S7 program using STEP 7.
Diagnostics 23.9 Program Measures for Handling Errors 23.9.7 Power Supply Error (OB81) Description The operating system of the CPU calls OB81 if one of the following fails in a CPU or an expansion unit • The 24-V voltage supply • A battery • The complete backup This OB is also called when the problem has been eliminated (the OB is called when an event comes and goes). Programming OB81 You must create OB81 as an object in your S7 program using STEP 7.
Diagnostics 23.9 Program Measures for Handling Errors 23.9.8 Diagnostic Interrupt (OB82) Description The operating system of the CPU calls OB82 when a module with diagnostics capability on which you have enabled the diagnostic interrupt detects an error and when the error is eliminated (the OB is called when the event comes and goes). Programming OB82 You must create OB82 as an object in your S7 program using STEP 7.
Diagnostics 23.9 Program Measures for Handling Errors 23.9.9 Insert/Remove Module Interrupt (OB83) Description S7-400 CPUs monitor the presence of modules in the central rack and expansion racks at intervals of approximately 1 second. After the power supply is turned on, the CPU checks whether all the modules listed in the configuration table created with STEP 7 are actually inserted.
Diagnostics 23.9 Program Measures for Handling Errors 23.9.10 CPU Hardware Fault (OB84) Description The operating system of the CPU calls OB84 when an error is detected on the interface to the MPI network, to the communication bus, or to the network card for the distributed I/Os; for example, if an incorrect signal level is detected on the line. The OB is also called when the error is eliminated (the OB is called when the event comes and goes).
Diagnostics 23.9 Program Measures for Handling Errors You can find detailed information on OBs, SFBs, and SFCs in the corresponding Help on Blocks. 23.9.
Diagnostics 23.9 Program Measures for Handling Errors • To create a data block if the data block for the status information of global data communication is missing. The CPU does not change to "STOP" mode when a communication error is detected and OB87 is not programmed. You can find detailed information on OBs, SFBs, and SFCs in the corresponding Help on Blocks. 23.9.
Diagnostics 23.10 System Diagnostics with 'Report System Error' You can use OB122, for example, for the following purposes: • To evaluate the start information of OB122 • To call the system function SFC 44 and supply a substitute value for an input module so that program execution can continue with a meaningful, process-dependent value. If you do not program OB122, the CPU changes to STOP mode when an I/O access error is detected.
Diagnostics 23.10 System Diagnostics with 'Report System Error' For information on the supported interfaces, refer to the Readme file. Note The master system of an IE/PB link cannot be diagnoses. The diagnostics is performed via the PROFINET IO DB.
Diagnostics 23.10 System Diagnostics with 'Report System Error' "MANUAL" mode In this mode all errors in the selected station are shown in sequence. "AUTOMATIC" mode In this mode all the errors in all configured stations are shown in sequence. Static variable area Address Name Data type Description 0 DP_MASTERSYSTEM INT Number of the DP master system 2.0 EXTERNAL_DP_INTERFACE BOOL External DP interface (CP/IM) 2.1 MANUAL_MODE BOOL Operating mode 2.
Diagnostics 23.10 System Diagnostics with 'Report System Error' Address Name Data type Description 16 CHANNEL_ERROR_INFO_1 DWORD Channel error, code 1 20 CHANNEL_ERROR_INFO_2 DWORD Channel error, code 2 24 DIAG_COUNTER BYTE Total of a diagnostic for the displayed stations. 25.0 DIAG_OVERFLOW BOOL Diagnostic overflow 25.1 BUSY BOOL Evaluation in progress 932 - 1176 DIAG_DAT_NORM BYTE [1..244] Slave diagnostic data 1176 - 1191 CONFIG_SLAVES DWORD [1..
Diagnostics 23.10 System Diagnostics with 'Report System Error' 23.10.2.3 Example of a DB 125 with a DP Slave The following table shows an example of the assignment of DB125 in "Manual" mode. DP_MASTERSYSTEM INT 0 (last value used) EXTERNAL_DP_INTERFACE BOOL 2.0 Unused (last value used) MANUAL_MODE BOOL 2.1 TRUE SINGLE_STEP_SLAVE BOOL 2.2 Unused SINGLE_STEP_ERROR BOOL 2.3 Positive edge changes to next error RESET BOOL 2.4 Unused (except for positive edge) SINGLE_DIAG BOOL 2.
Diagnostics 23.
Diagnostics 23.10 System Diagnostics with 'Report System Error' 23.10.2.5 PROFINET Diagnostic Status Interface for the PROFINET IO DB The generated data block depicts the current status of all configured devices. If desired, it can describe the status of a device more exactly in response to a query from an HMI device. The data block is dynamically created and depends on the HW configuration. The DB uses the RSE diagnostics FB (by default, FB49) to access the diagnostics data.
Diagnostics 23.10 System Diagnostics with 'Report System Error' Address Name Data Type Description 32 Error_No DWORD Error number (index in lexicon) 36 Map_ErrorNo WORD No. of the error text in the export table 38 Map_HelpNo WORD No. of the help text in the export table 40 Number_IO_Sys WORD No.
Diagnostics 23.10 System Diagnostics with 'Report System Error' Byte N IO_Sys_[1]: Device number 12 N+1 11 10 9 16 15 14 13 ... Status of a device in the overview IO_Sys_Status_: Status All devices in the group are OK or not configured. At least one device in the group is faulty or has failed. Coding 0 1 Byte N Bit 7 N+1 ... 0 7 ... 0 IO_Sys_Status 113-128 _[0]: Device number 17-112 1 - 16 241 - 256 145 - 240 129 - 144 Group 2-7 1 16 10 - 15 9 8 ...
Diagnostics 23.10 System Diagnostics with 'Report System Error' 23.10.2.6 Example of a DB126 with an IO System 100 and Devices with Device Numbers 2, 3 and 4 Number_IO_Sys W#16#1 Number of configured IO systems Detail_IO_Sys [0] .System_No W#16#64 System number Detail_IO_Sys [0] .Max_Num_Dev W#16#4 Maximum ID for the configured device Detail_IO_Sys [0] .Offset W#16#2E Offset at the beginning of the IO_Sys_Status field in bytes relative to Detail_IO_Sys Detail_IO_Sys [0] .
Diagnostics 23.10 System Diagnostics with 'Report System Error' 23.10.2.7 Example of a Request for the PROFINET IO DB You would like to call up the errors of device 50 on IO system 100 on the OP with HMI_ID 1. If the HMI_ID is "0", the DB is not being used by anyone and a request can be set up. Request HMI_ID 1 System_No 100 Device_No 50 Enable TRUE Next_Error * Because the module works asynchronously, you have to wait until Busy becomes "FALSE".
Diagnostics 23.10 System Diagnostics with 'Report System Error' 23.10.2.8 Diagnostic Status DB Interface for the Diagnostic Status DB The generated data block (DB127) allows the system status of a configured components and any of its subcomponents to be queried. This data block is required to support system diagnostics via the CPU Web server. As default, it is disabled; if, however, one CPU is configured on which the functionality is enabled, DB127 is enabled automatically by 'Report system error'.
Diagnostics 23.10 System Diagnostics with 'Report System Error' Address Name Data Type Description 8.6 Q_Reserved6 BOOL Reserved 8.7 Q_Reserved7 BOOL Reserved 9.0 Q_Start BOOL Start query 10.0 Q_Error BYTE Internal error in query 11.
Diagnostics 23.10 System Diagnostics with 'Report System Error' Address Name Data Type Description 18.0 S_ChannelVector ARRAY [0..
Diagnostics 23.10 System Diagnostics with 'Report System Error' 23.10.2.9 Example of a Diagnostic Status DB Query You want to see the errors of the central module with I/O address QB 50 on the OP. This module has two channels, channel 1 has signaled wire break. You have selected the value "5" as the client ID. Query 1. As long as Q_ClientID_Intern is not equal to DW#16#00000005, Q_ClientID_User := DW#16#00000005 2.
Diagnostics 23.10 System Diagnostics with 'Report System Error' A_AssociatedValue[1] W#16#8C06 A_AssociatedValue[2] W#16#1 A_AssociatedValue[3] W#16#0 A_AssociatedValue[4] W#16#0 A_AssociatedValue[5] W#16#0 A_AssociatedValue[6] W#16#8002 U_SubComponentCount W#16#0 U_SubComponentFault[] {FALSE} 6. Check the validity: If Q_ClientID_Intern is not equal to DW#16#00000005, return to step 1 7. The data can be evaluated. The DB is reinitialized automatically.
Diagnostics 23.10 System Diagnostics with 'Report System Error' S_Maintenance2 FALSE S_SubFault TRUE S_SubMainenance1 FALSE S_SubMaintenance2 FALSE S_TIAMS DW#16#0 S_TIAMSChannelExist DW#16#0 S_TIAMSChannelOK DW#16#0 S_ChannelCount W#16#0 U_SubComponentCount W#16#3 U_SubComponentFault[1] TRUE U_SubComponentFault[2] FALSE U_SubComponentFault[3] TRUE 6. Check the validity: If Q_ClientID_Intern is not equal to DW#16#00000005, return to step 1 7. The data can be evaluated.
Diagnostics 23.10 System Diagnostics with 'Report System Error' 23.10.2.10 Importing Error and Help Texts In order to be able to display error and help texts on HMI devices, these texts have to be imported into the device. For this reason, several export files are created in the specified export directory when generating 'Report System Error'. You can set the export directory in the ‘HMI Export Data’ field on the Diagnostics Support tab.
Diagnostics 23.
24 Printing and Archiving 24.1 Printing Project Documentation Once you have finished creating the program for your automation task, you can print out all the important data for project documentation purposes using the print functions integrated in STEP 7. Parts of the Project You Can Print You can print the contents of objects both directly from the SIMATIC Manager and by opening the respective object and starting the print procedure.
Printing and Archiving 24.1 Printing Project Documentation 24.1.1 Basic Procedure when Printing To print, proceed as follows: 1. Open the appropriate object to display the information you want to print on the screen. 2. Open the "Print" dialog box using the menu command File > Print in the application window. Depending on which application you are in, the first entry in the menu bar may not be "File", but the object processed by the application, such as "Symbol Table." 3.
Printing and Archiving 24.1 Printing Project Documentation Print Preview You can use the "Print Preview" function to display the page layout of the document to be printed. Note The print format of the finished document is not displayed in the print preview. Setting the Page Format and the Headers and Footers You can set the paper size (such as A4, A5, Letter) and the page format and the orientation (portrait or landscape) for all documents that you want to print with the File > Page Setup menu command.
Printing and Archiving 24.2 Archiving Projects and Libraries 24.2 Archiving Projects and Libraries You can store individual projects or libraries in compressed form in an archive file. This compressed storage procedure is possible on a hard disk or on a portable data medium (such as a floppy disk). Archive Programs In STEP 7, you can use the archive program you prefer to archive projects. The archiving programs ARJ and PKZip ship with STEP 7 and are installed automatically.
Printing and Archiving 24.2 Archiving Projects and Libraries 24.2.1 Uses for Saving/Archiving Save As With this function you create a copy of the project under another name. You can use this function: • To create backup copies • To duplicate an existing project in order to adapt it for other purposes. To use the fastest method of creating a copy, select the "Save As" option without rearranging in the dialog box.
Printing and Archiving 24.2 Archiving Projects and Libraries 24.2.2 Requirements for Archiving To archive a project or library, the following requirements must be fulfilled: 24.2.3 • You must have installed the archive program in your system. The link to STEP 7 is explained in the online help topic "Procedure for Archiving/Retrieving." • All the data for the project without exception must be in the project directory or a subdirectory of the project.
25 Working with M7 Programmable Control Systems 25.1 Procedure for M7 Systems The standard PC architecture of the M7-300/M7-400 automation computer forms a freely programmable extension to the SIMATIC automation platform. You can programs the user programs for SIMATIC M7 in a high-level language such as C or graphically using CFC (Continuous Function Chart).
Working with M7 Programmable Control Systems 25.
Working with M7 Programmable Control Systems 25.2 Optional Software for M7 Programming 25.2 Optional Software for M7 Programming M7 Optional Software STEP 7 provides you with the basic functions you require to do the following: • Create and manage projects • Configure and assign parameters to the hardware • Configure networks and connections • Manage symbol data These functions are provided regardless of whether you are using a SIMATIC S7 or SIMATIC M7 programmable controller.
Working with M7 Programmable Control Systems 25.2 Optional Software for M7 Programming Summary To create... You will require the M7 software option... C/C++ programs • M7-SYS RT • M7-ProC/C++ • Borland C++ CFC programs • M7-SYS RT • CFC for S7 and M7 • Borland C++ Which Software Offers Which Type of Support? The specific tools required to create M7 applications are partly integrated in STEP 7 and partly in the M7 software options.
Working with M7 Programmable Control Systems 25.
Working with M7 Programmable Control Systems 25.
26 Tips and Tricks 26.1 Exchanging Modules in the Configuration Table If you using HW Config to revise a station configuration and you want to exchange a module for one with a new order number for example, proceed as follows: 1. Use a drag-and-drop operation to drag the module from the Hardware Catalog window over the old module that is already placed. 2. Drop the new module. To the extent possible, the new module assumes the parameters of the one that was already inserted.
Tips and Tricks 26.3 Rearranging 26.3 Rearranging If unexplained problems occur when working with STEP 7, it often helps to rearrange the database of the project or library. Select the menu command File > Rearrange to do this. This removes any gaps which occur when contents are deleted, meaning that the amount of memory required for the project/library data is reduced.
Tips and Tricks 26.5 Testing with the Variable Table 26.5 Testing with the Variable Table For monitoring and modifying variables in the variable table, note the following editing tips: • You can enter symbols and addresses in both the "Symbol" column as well as the "Address" column. The entry is written into the appropriate column automatically.
Tips and Tricks 26.6 Modifying Variables With the Program Editor 26.6 Modifying Variables With the Program Editor In the program editor, you can program buttons for binary inputs and memory bits that offer you a quick and easy way to modify these addresses with mouse click.
Tips and Tricks 26.7 Virtual Work Memory 26.7 Virtual Work Memory Another reason for problems occurring in STEP 7 may be insufficient virtual work memory. To work with STEP 7 you should adjust the setting for the virtual memory. Proceed as follows: 1. Open the Control Panel, for example, via the Start menu Start > Settings > Control Panel and double-click on the icon "System". 2. In the dialog box that opens, select the "Advanced" tab and click the "Settings" button in the "System Performance" area. 3.
Tips and Tricks 26.
27 Appendix 27.1 Operating Modes 27.1.1 Operating Modes and Mode Transitions Operating Modes Operating modes describe the behavior of the CPU at a particular point in time. Knowing the operating modes of CPUs is useful when programming the startup, testing the controller, and for troubleshooting.
Appendix 27.1 Operating Modes Other Operating Modes If the CPU is not ready for operation, it is in one of the following modes: • Off, in other words, the power supply is turned off. • Defective, in other words, a fault has occurred. To check whether the CPU is really defective, switch the CPU to STOP and turn the power switch off and then on again. If the CPU starts up, display the diagnostic buffer to analyze the problem. If the CPU does not start up it must be replaced.
Appendix 27.1 Operating Modes Transition 8. Description The CPU changes back to STOP mode when: • An error is detected in RUN mode and the corresponding OB is not loaded. • The CPU is changed to STOP by the key switch or on the programming device. • A stop command is edited in the user program. • The STOP communication function is executed. 9. The CPU changes to RUN mode when a breakpoint was set and the "EXIT HOLD" command is executed. 10.
Appendix 27.1 Operating Modes 27.1.2 STOP Mode The user program is not executed in STOP mode. All the outputs are set to substitute values so that the controlled process is in a safe state.
Appendix 27.1 Operating Modes 27.1.3 STARTUP Mode Before the CPU can start processing the user program, a startup program must first be executed. By programming startup OBs in your startup program, you can specify certain settings for your cyclic program. There are three types of startup: warm restart, cold restart, and hot restart. A hot restart is only possible on S7-400 CPUs. This must be set explicitly in the parameter set for the CPU using STEP 7.
Appendix 27.1 Operating Modes Automatic Warm Restart An automatic warm restart can be triggered following power up in the following situations: • The CPU was not in STOP mode when the power outage occurred. • The mode selector is set to RUN or RUN-P. • No automatic hot restart is programmed following power up. • The CPU was interrupted by a power outage during a warm restart (regardless of the programmed type of restart). The CRST/WRST switch has no effect on an automatic warm restart.
Appendix 27.1 Operating Modes Automatic Hot Restart An automatic hot restart can be triggered following power up in the following situations: • The CPU was not in STOP or HOLD mode when the power outage occurred. • The mode selector is set to RUN or RUN-P. • Automatic hot restart following power up is set in the parameter set of the CPU. The CRST/WRST switch has no effect on an automatic hot restart.
Appendix 27.
Appendix 27.
Appendix 27.1 Operating Modes • If errors occur when evaluating the module parameters. A hot restart is not executed or it is aborted in the following situations: 566 • The CPU memory was reset (only a warm restart is possible after memory reset). • The interruption time limit has been exceeded (this is the time between exiting RUN mode until the startup OB including the remaining cycle has been executed). • The module configuration has been changed (for example module replaced).
Appendix 27.
Appendix 27.1 Operating Modes Key to the figure "Activities of the CPU during STARTUP and RUN" 1. All peripheral outputs are switched to a safe state (default value = 0) on the hardware side by the I/O modules. This switch takes place regardless of whether the user program employs the outputs inside the process-image area or outside of it. If you are using signal modules that have substitute value capability, you can assign parameters to the behavior of the outputs, such as Keep Last Value. 2.
Appendix 27.1 Operating Modes 27.1.4 RUN Mode In RUN mode, the CPU executes the cyclic, time-driven, and interrupt-driven program, as follows: • The process image of the inputs is read in. • The user program is executed. • The process-image output table is output. The active exchange of data between CPUs using global data communication (global data table) and using communication SFBs for configured connections and using communication SFCs for non-configured connections is only possible in RUN mode.
Appendix 27.1 Operating Modes 27.1.5 HOLD Mode The HOLD mode is a special mode. This is only used for test purposes during startup or in RUN mode. The HOLD mode means the following: 570 • All timers are frozen: timers and runtime meters are not processed, monitoring times are stopped, the basic clock pulses of the time-driven levels are stopped. • The real-time clock runs. • Outputs are not enabled but can be enabled explicitly for test purposes. • Inputs and outputs can be set and reset.
Appendix 27.2 Memory Areas of S7 CPUs 27.2 27.2.1 Memory Areas of S7 CPUs Distribution of the Memory Areas The memory of an S7 CPU can be divided into three areas (see figure below): • The load memory is used for user programs without symbolic address assignments or comments (these remain in the memory of the programming device). The load memory can be either RAM or EPROM. • Blocks that are not marked as required for startup will be stored only in the load memory.
Appendix 27.2 Memory Areas of S7 CPUs 27.2.2 Load Memory and Work Memory When you download the user program from the programming device to the CPU, only the logic and data blocks are loaded in the load and work memory of the CPU. The symbolic address assignment (symbol table) and the block comments remain on the programming device.
Appendix 27.2 Memory Areas of S7 CPUs Identifying Data Blocks as "Not Relevant for Execution" Data blocks that were programmed in a source file as part of an STL program can be identified as "Not Relevant for Execution" (keyword UNLINKED). This means that when they are downloaded to the CPU, the DBs are stored only in the load memory. The content of such blocks can, if necessary, be copied to the work memory using SFC20 BLKMOV. This technique saves space in the work memory.
Appendix 27.2 Memory Areas of S7 CPUs 27.2.3 System Memory 27.2.3.1 Using the System Memory Areas The system memory of the S7 CPUs is divided into address areas (see table below). Using instructions in your program, you address the data directly in the corresponding address area.
Appendix 27.2 Memory Areas of S7 CPUs Address Area Access via Units of Following Size S7 Notation (IEC) Description Data block Data block, opened with "OPN DB": DB Data blocks contain information for the program. They can be defined for general use by all logic blocks (shared DBs) or they are assigned to a specific FB or SFB (instance DB).
Appendix 27.2 Memory Areas of S7 CPUs 27.2.3.2 Process-Image Input/Output Tables If the input (I) and output (Q) address areas are accessed in the user program, the program does not scan the signal states on the digital signal modules but accesses a memory area in the system memory of the CPU and distributed I/Os. This memory area is known as the process image. Updating the Process Image The following figure shows the processing steps within a scan cycle.
Appendix 27.2 Memory Areas of S7 CPUs in it. Writing the process image output table to the outputs for the modules and reading in the process image input table is all independently controlled by the operating system. Advantages of the Process Image Compared with direct access to the input/output modules, the main advantage of accessing the process image is that the CPU has a consistent image of the process signals for the duration of one program cycle.
Appendix 27.2 Memory Areas of S7 CPUs Updating Part Process Images (Process-Image Partitions) with SFCs You can use SFCs to update the entire process image or a process-image partition from your user program. • Requirement: The process image in question is not updated by the system. • SFC26 UPDAT_PI: Update process-image input table • SFC27 UPDAT_PO: Update process-image output table.
Appendix 27.2 Memory Areas of S7 CPUs I/O Access Error (PZF) during Update of the Process Image The default reaction of the CPU families (S7-300 and S7-400) to an error during the update of the process image varies: • S7-300: No entry is made in the diagnostic buffer, no OB is called, the corresponding input bytes are reset to "0" and will remain at "0" until the fault is gone again.
Appendix 27.2 Memory Areas of S7 CPUs 27.2.3.3 Local Data Stack The L stack saves the following: • The temporary variables of the local data of blocks • The start information of the organization blocks • Information about transferring parameters • Interim results of the logic in Ladder Logic programs When you are programming organization blocks, you can declare temporary variables (TEMP) that are only available when the block is executed and are then overwritten again.
Appendix 27.2 Memory Areas of S7 CPUs ! Caution When using temporary variables, remember that they are only valid within the relevant block or are only available as previous local data for other blocks called in this block. In particular, there is no guarantee that if you close and then re-open the block, the temporary variables will have the same values they had when the previous block call was completed.
Appendix 27.2 Memory Areas of S7 CPUs 27.2.3.5 Block Stack If processing of a block is interrupted by the call of another block or by a higher priority class (interrupt/error servicing), the B stack stores the following data: • Number, type (OB, FB, FC, SFB, SFC), and return address of the block that was interrupted. • Numbers of the data blocks (from the DB and DI register) that were open when the block was interrupted. Using this data, the user program can then be resumed after the interrupt.
Appendix 27.2 Memory Areas of S7 CPUs 27.2.3.6 Diagnostic Buffer The diagnostic buffer displays the diagnostic messages in the order in which they occur. The first entry contains the newest event. The number of entries in the diagnostic buffer is dependent on the module and its current operating mode. Diagnostic events include the following: 27.2.3.
Appendix 27.2 Memory Areas of S7 CPUs Diagnostic Buffer Content The upper list box contains a list of all the diagnostic events that occurred with the following information: • Serial number of the entry (the newest entry has the number 1) • Time and date of the diagnostic event: The time and date of the module are displayed if the module has an integrated clock. For the time data in the buffer to be valid, it is important that you set the time and date on the module and check it regularly.
Appendix 27.2 Memory Areas of S7 CPUs 27.2.3.8 Retentive Memory Areas on S7-300 CPUs If a power outage occurs or the CPU memory is reset (MRES), the memory of the S7-300 CPU (dynamic load memory (RAM), work memory, and system memory) is reset and all the data previously contained in these areas is lost. With S7-300 CPUs, you can protect your program and its data in the following ways: • You can protect all the data in the load memory, work memory, and in parts of the system memory with battery backup.
Appendix 27.2 Memory Areas of S7 CPUs Using Battery Backup to Protect Data By using a backup battery, the load memory and work memory are retentive during a power outage. If you configure your CPU so that timers, counters, and bit memory are saved in the NVRAM, this information is also retained regardless of whether you use a backup battery or not. Configuring the Data of the NVRAM When you configure your CPU with STEP 7, you can decide which memory areas will be retentive.
Appendix 27.2 Memory Areas of S7 CPUs 27.2.3.10 Configurable Memory Objects in the Work Memory With some CPUs, the size of objects such as local or the diagnostic buffer can be set in HW Config. If, for example, you reduce the default values, a larger section of the work memory is made available elsewhere. The settings for these CPUs can be displayed in the "Memory" tab of the Module Information ("Details" button).
Appendix 27.3 Data Types and Parameter Types 27.3 27.3.1 Data Types and Parameter Types Introduction to Data Types and Parameter Types All the data in a user program must be identified by a data type.
Appendix 27.3 Data Types and Parameter Types 27.3.2 Elementary Data Types Each elementary data type has a defined length. The following table lists the elementary data types.
Appendix 27.3 Data Types and Parameter Types Type and Description Size in Format Options Bits Range and Number Notation (lowest to highest value)_ Example CHAR 8 'A','B' etc. L 'E' ASCII characters (Character) 27.3.2.1 Format of the Data Type INT (16-Bit Integers) An integer has a sign that indicates whether it is a positive or negative integer. The space that an integer (16 bits) occupies in the memory is one word. The following table shows the range of an integer (16 bits).
Appendix 27.3 Data Types and Parameter Types 27.3.2.3 Format of the Data Type REAL (Floating-Point Numbers) Numbers in floating-point format are represented in the general form "number = m * b to the power of E." The base "b" and the exponent "E" are integers; the mantissa "m" is a rational number. This type of number representation has the advantage of being able to represent both very large and very small values within a limited space.
Appendix 27.3 Data Types and Parameter Types Using the three components S, e, and m, the value of a number represented in this form is defined by the formula: Number = 1.m ∗ 2 to the power of (e - bias) Where: • e: 1 ≤ e ≤ 254 • Bias: bias = 127. This means that an additional sign is not required for the exponent. • S: for a positive number, S = 0 and for a negative number, S = 1.
Appendix 27.3 Data Types and Parameter Types Accuracy when Calculating Floating-Point Numbers ! Caution Calculations involving a long series of values including very large and very small numbers can produce inaccurate results. The floating-point numbers in STEP 7 are accurate to 6 decimal places. You can therefore only specify a maximum of 6 decimal places when entering floating-point constants.
Appendix 27.
Appendix 27.3 Data Types and Parameter Types 27.3.2.4 Format of the Data Types WORD and DWORD in Binary Coded Decimal Numbers The binary-coded decimal (BCD) format represents a decimal number by using groups of binary digits (bits). One group of 4 bits represents one digit of a signed decimal number or the sign of the decimal number. The groups of 4 bits are combined to form a word (16 bits) or double word (32 bits).
Appendix 27.3 Data Types and Parameter Types 27.3.2.5 Format of the Data Type S5TIME (Time Duration) When you enter time duration using the S5TIME data type, your entries are stored in binary coded decimal format. The following figure shows the content of the time address with a time value of 127 and a time base of 1 s. When working with S5TIME, you enter a time value in the range of 0 to 999 and you indicate a time base (see the following table).
Appendix 27.3 Data Types and Parameter Types 27.3.3 Complex Data Types 27.3.3.1 Complex Data Types Complex data types define data groups that are larger than 32 bits or data groups consisting of other data types. STEP 7 permits the following complex data types: • DATE_AND_TIME • STRING • ARRAY • STRUCT • UDT (user-defined data types) • FBs and SFBs The following table describes the complex data types.
Appendix 27.3 Data Types and Parameter Types 27.3.3.2 Format of the Data Type DATE_AND_TIME When you enter date and time using the DATE_AND_TIME data type (DT), your entries are stored in binary coded decimal format in 8 bytes. The DATE_AND_TIME data type has the following range: DT#1990-1-1-0:0:0.0 to DT#2089-12-31-23:59:59.999 The following examples show the syntax for the date and time for Thursday, December 25, 1993, at 8:12 and 34,567 seconds in the morning.
Appendix 27.3 Data Types and Parameter Types The permitted range for the data type DATE_AND_TIME is: • min.: DT#1990-1-1-0:0:0.0 • max.: DT#2089-12-31-23:59:59.
Appendix 27.3 Data Types and Parameter Types 27.3.3.3 Using Complex Data Types You can create new data types by combining the elementary and complex data types to create the following complex data types: • Array (data type ARRAY): an array combines a group of one data type to form a single unit. • Structure (data type STRUCT): a structure combines different data types to form a single unit.
Appendix 27.3 Data Types and Parameter Types 27.3.3.4 Using Arrays to Access Data Arrays An array combines a group of one data type (elementary or complex) to form a unit. You can create an array consisting of arrays. When you define an array, you must do the following: • Assign a name to the array. • Declare an array with the keyword ARRAY. • Specify the size of the array using an index. You specify the first and last number of the individual dimensions (maximum 6) in the array.
Appendix 27.3 Data Types and Parameter Types Example 2 An array can also describe a multi-dimensional group of data types. The following figure shows a two-dimensional array of integers. You access the data in a multi-dimensional array using the index. In this example, the first integer is Op_temp[1,1], the third is Op_temp[1,3], the fourth is Op_temp[2,1], and the sixth is Op_temp[2,3]. You can define up to a maximum of 6 dimensions (6 indexes) for an array.
Appendix 27.3 Data Types and Parameter Types Entering Initial Values for an Array You can assign an initial value to every array element when you create arrays. STEP 7 provides two methods for entering initial values: • Entry of individual values: for each element of the array, you specify a value that is valid for the data type of the array. You specify the values in the order of the elements: [1,1]. Remember that the individual elements must be separated from each other by a comma.
Appendix 27.3 Data Types and Parameter Types 27.3.3.5 Using Structures to Access Data Structures A structure combines various data types (elementary and complex data types, including arrays and structures) to form one unit. You can group the data to suit your process control. You can therefore also transfer parameters as a data unit and not as single elements. The following figure illustrates a structure consisting of an integer, a byte, a character, a floating-point number, and a Boolean value.
Appendix 27.3 Data Types and Parameter Types Temperature End = = 120 False Saving and Accessing Data in Structures You access the individual elements of a structure. You can use symbolic addresses (for example, Stack_1.Temperature). You can, however, specify the absolute address at which the element is located (example: if Stack_1 is located in DB20 starting at byte 0, the absolute address for amount is DB20.DBW0 and the address for temperature is DB20.DBD6).
Appendix 27.3 Data Types and Parameter Types 27.3.3.6 Using User-Defined Data Types to Access Data User-Defined Data Types User-defined data types (UDTs) can combine elementary and complex data types. You can assign a name to UDTs and use them more than once. The following figure illustrates the structure of a user-defined data type consisting of an integer, a byte, a character, a floating-point number, and a Boolean value.
Appendix 27.3 Data Types and Parameter Types Assigning Initial Values for a User-Defined Data Type If you want to assign an initial value to every element of a user-defined data type, you specify a value that is valid for the data type and the name of the element. You can, for example, assign the following initial values (to the user-defined data type declared in the above figure): Amount = Original_data Control_code Temperature End 100 = = = = B#16#0) 'C' 1.
Appendix 27.3 Data Types and Parameter Types Advantages of DBs with an Assigned UDT By using UDTs you have created once, you can generate a large number of data blocks with the same data structure. You can then use these data blocks to enter different actual values for specific tasks. If, for example, you structure a UDT for a formula (for example, for blending colors), you can assign this UDT to several DBs each containing different amounts.
Appendix 27.3 Data Types and Parameter Types 27.3.4 Parameter Types In addition to elementary and complex data types, you can also define parameter types for formal parameters that are transferred between blocks. STEP 7 recognizes the following parameter types: • TIMER or COUNTER: this specifies a particular timer or particular counter that will be used when the block is executed.
Appendix 27.3 Data Types and Parameter Types 27.3.4.1 Format of the Parameter Types BLOCK, COUNTER, TIMER STEP 7 stores the parameter types BLOCK, COUNTER, and TIMER as binary numbers in a word (16 bits). The following figure shows the format of these parameter types. The permitted number of blocks, timers, and counters is dependent on the type of your S7 CPU.
Appendix 27.3 Data Types and Parameter Types • Address of the data (in the format Byte.Bit) STEP 7 provides the pointer format: p#memory_area byte.bit_address. (If the formal parameter was declared as the parameter type POINTER, you only need to indicate the memory area and the address. STEP 7 automatically reformats your entry into pointer format.) The following examples show how you enter the parameter type POINTER for the data that start at M50.0: 27.3.4.3 • P#M50.0 • M50.
Appendix 27.3 Data Types and Parameter Types Example for Area-Crossing Addressing In area-crossing addressing the memory area is indicated in the pointer (in the example I and Q). L P# I8.7 Load the value of the pointer and the area identification in accumulator 1. P# Q8.7 Load the value of the pointer and the area identification in accumulator 1. LAR1 L Load memory area I and the address 8.7 into AR1. LAR2 Load memory area Q and the address 8.7 into AR2. A [AR1, P#0.
Appendix 27.3 Data Types and Parameter Types 27.3.4.4 Block for Changing the Pointer Using the sample block FC3 "Routing Pointers" it is possible to change the bit or byte address of a pointer. The pointer to be changed is transferred to the variable "pointer" when the FC is called (area-internal and area-crossing pointers in double word format can be used). With the parameter "Bit-Byte" you can change the bit or byte address of the pointer (0: bit address, 1: byte address).
Appendix 27.3 Data Types and Parameter Types Int_Value : DWORD ; //Auxiliary variable END_VAR BEGIN NETWORK TITLE = //The block intercepts changes that change the area information of the pointer //or that lead to "negative" pointers automatically.
Appendix 27.3 Data Types and Parameter Types pos: SLD 3; //shift the increment 3 digits to the left, -D ; //subtract the value, JU test; //and jump to test SLD 3; //Shift the increment 3 digits to the left L #Pointer1; //Load pointer address information +D ; //Add increment #Int_Value; //Transfer results of calculation to Int_Value A L //If invalid byte address (too large or S #RET_VAL; test: T End: 7.
Appendix 27.3 Data Types and Parameter Types 27.3.4.5 Format of the Parameter Type ANY STEP 7 stores the parameter type ANY in 10 bytes. When constructing a parameter of the type ANY, you must ensure that all 10 bytes are occupied because the called block evaluates the whole contents of the parameter. If, for example, you specify a DB number in byte 4, you must also explicitly specify the memory area in byte 6.
Appendix 27.3 Data Types and Parameter Types The following tables show the coding of the data types or of the memory areas for the parameter type ANY.
Appendix 27.3 Data Types and Parameter Types ANY Format for Parameter Types For parameter types STEP 7 stores the data type and the address of the parameters. The repetition factor is always 1. Bytes 4, 5, and 7 are always 0. Bytes 8 and 9 indicate the number of the timer, counter, or block. The following table shows the coding of the data types for the parameter type ANY for parameter types.
Appendix 27.3 Data Types and Parameter Types 27.3.4.6 Using the Parameter Type ANY You can define formal parameters for a block that are suitable for actual parameters of any data type. This is particularly useful when the data type of the actual parameter that is provided when the block is called is unknown or can vary (and when any data type is permitted). In the variable declaration of the block, you declare the parameter as data type ANY.
Appendix 27.3 Data Types and Parameter Types In this example, FC100 has three parameters (in_par1, in_par2, and in_par3) declared as the ANY data type. • When FB10 calls FC100, FB10 transfers an integer (the static variable speed), a word (MW100), and a double word to DB10 (DB10.DBD40). • When FB11 calls FC100, FB11 transfers an array of real numbers (the temporary variable "Thermo"), a Boolean value (M 1.3), and a timer (T2).
Appendix 27.3 Data Types and Parameter Types Example for Using the Parameter Type ANY The following example shows how you can copy a memory area of 10 bytes using the parameter type ANY and the system function SFC20 BLKMOV. STL FUNCTION FC10: VOID Explanation VAR_TEMP Source : ANY; Target : ANY; END_VAR BEGIN LAR1 P#Source; Load the start address of the ANY pointer in AR1. L T B#16#10; LB[AR1,P#0.0]; Load the syntax ID and transfer it to the ANY pointer. L T B#16#02; LB[AR1,P#1.
Appendix 27.3 Data Types and Parameter Types 27.3.4.7 Assigning Data Types to Local Data of Logic Blocks With STEP 7, the data types (elementary and complex data types and parameter types) that can be assigned to the local data of a block in the variable declaration are restricted. Valid Data Types for the Local Data of an OB The following table illustrates the restrictions (--) for declaring local data for an OB. Since you cannot call an OB, an OB cannot have parameters (input, output, or in/out).
Appendix 27.3 Data Types and Parameter Types Valid Data Types for the Local Data of an FC The following table illustrates the restrictions (-) for declaring local data for an FC. Since an FC does not have an instance DB, it also has no static variables. For input, output, and in/out parameters of an FC, only the parameter types POINTER and ANY are permitted. You can also declare temporary variables of the ANY parameter type. The valid assignments are shown by the z symbol.
Appendix 27.3 Data Types and Parameter Types 27.3.4.8 Permitted Data Types when Transferring Parameters Rules for Transferring Parameters Between Blocks When you assign actual parameters to formal parameters, you can specify either an absolute address, a symbolic name, or a constant. STEP 7 restricts the valid assignments for the various parameters.
Appendix 27.3 Data Types and Parameter Types Valid Data Types for the Call of a Function by a Function You can assign the formal parameters of a calling FC to the formal parameters of a called FC. The following figure illustrates the formal parameters of FC10 that are assigned as actual parameters to the formal parameters of FC12. STEP 7 restricts the assignment of formal parameters of an FC as actual parameters for the formal parameters of a different FC.
Appendix 27.3 Data Types and Parameter Types Valid Data Types for the Call of a Function by a Function Block You can assign the formal parameters of a calling FB to the formal parameters of a called FC. The following figure illustrates the formal parameters of FB10 that are assigned as actual parameters to the formal parameters of FC12. STEP 7 restricts the assignment of the formal parameters of an FB to the formal parameters of an FC.
Appendix 27.3 Data Types and Parameter Types Valid Data Types for the Call of a Function Block by a Function You can assign the formal parameters of a calling FC to the formal parameters of a called FB. The following figure illustrates the formal parameters of FC10 that are assigned as actual parameters to the formal parameters of FB12. STEP 7 restricts the assignment of formal parameters of an FC to the formal parameters an FB.
Appendix 27.3 Data Types and Parameter Types Valid Data Types for the Call of a Function Block by a Function Block You can assign the formal parameters of a calling FB to the formal parameters of a called FB. The following figure illustrates the formal parameters of FB10 that are assigned as actual parameters to the formal parameters of FB12. STEP 7 restricts the assignment of the formal parameters of an FB to the formal parameters of another FB.
Appendix 27.3 Data Types and Parameter Types 27.3.4.9 Transferring to IN_OUT Parameters of a Function Block When complex data types are transferred to IN_OUT parameters of a function block (FB) the address of the variable is transferred (call by reference). When elementary data types are transferred to IN_OUT parameters of a function block the values are copied into the instance data block before the function block is started and copied out of the instance data block after the function block is ended.
Appendix 27.4 Working with Older Projects 27.4 Working with Older Projects 27.4.1 Converting Version 2 Projects In STEP 7 you can also open version 2 projects using the menu command File > Open. Version 2 projects/libraries can be converted (migrated) to your current STEP 7 version using the menu command File > Save As and the option "Rearrange before saving." The project is then saved as a project with the current STEP 7 version.
Appendix 27.4 Working with Older Projects 27.4.2 Editing Version 2 Projects and Libraries Version V5.2 of STEP 7 no longer supports Changes in V2 Projects. When you edit V2 projects or libraries, inconsistencies can occur such that V2 projects or libraries can no longer be edited with older versions of STEP 7. In order to continue to edit V2 projects or libraries, a STEP 7 version older that V5.1 must be used. 27.4.3 Notes on STEP 7 V.2.
Appendix 27.5 Expanding DP Slaves That Were Created with Previous Versions of STEP 7 27.5 Expanding DP Slaves That Were Created with Previous Versions of STEP 7 Constellations That Can Be Formed by Importing New *.GSD Files New DP slaves can be accepted by the HW Config if you install new device database files (*.GSD files) into the Hardware Catalog. After installation, they are available in the Other Field Devices folder.
Appendix 27.5 Expanding DP Slaves That Were Created with Previous Versions of STEP 7 Editing a DP Configuration with an Earlier Version of STEP 7 V5.1, SP4) If you configure an "updated" DP slave with STEP 7 as of V5.1, Service Pack 4 and then edit the project with a previous version of STEP 7 (earlier than STEP 7 V5.1, SP4), you will not be able to edit this DP slave since the GSD file used is unknown to the previous version. Remedy: You can install the required GSD file in the previous version of STEP 7.
Appendix 27.6 Sample Programs 27.6 27.6.1 Sample Programs Sample Projects and Sample Programs The STEP 7 installation medium contains a number of useful sample projects that are listed below. You will find the sample projects in the "open" dialog of the SIMATIC Manager ("Sample Projects" tab). Other sample projects may also be added when optional packages are installed. For information on these sample projects, refer to the documentation for the optional packages.
Appendix 27.6 Sample Programs Deleting and Installing the Supplied Sample Projects The supplied sample projects can be deleted in the SIMATIC Manager and then reinstalled. To install the sample projects, you must start the STEP 7 V5.0 setup program. The sample projects can be installed selectively at a later date. Copies of the supplied sample projects and self-created sample projects made using the menu command "Save As" can only be saved as user projects.
Appendix 27.6 Sample Programs 27.6.2 Sample Program for an Industrial Blending Process The sample program is makes use of information that you have already read in part 1 of the manual about controlling an industrial blending process. Task Two ingredients (ingredient A and ingredient B) are mixed together in a mixing tank by an agitator. The finished product is drained from the tank through a drain valve. The following figure shows a diagram of the sample process.
Appendix 27.6 Sample Programs Describing the Parts of a Process Part 1 of the manual included a description of how you divide up the sample process into functional areas and individual tasks. The individual areas are described below. The area for ingredients A and B: • The pipes for each of the ingredients are equipped with an inlet and a feed valve and feed pump. • The inlet pipes also have flow sensors.
Appendix 27.6 Sample Programs Operator Station To allow an operator to start, stop, and monitor the process, an operator station is also required. The operator station is equipped with the following: 638 • Switches for controlling the most important stages of the process. Using the "reset maintenance display" switch, you can turn off the maintenance display lamps for the motors due for maintenance and reset the corresponding counters for the maintenance interval to 0.
Appendix 27.6 Sample Programs 27.6.2.1 Defining Logic Blocks You structure the program by distributing the user program in various blocks and by establishing a hierarchy for block calls. Hierarchy of the Block Calls The following figure shows the hierarchy of the blocks to be called in the structured program. • OB1: The interface to the operating system of the CPU and contains the main program.
Appendix 27.6 Sample Programs 27.6.2.2 Assigning Symbolic Names Defining Symbolic Names Symbols are used in the sample program and they must be defined in the symbol table using STEP 7. The following tables show the symbolic names and the absolute addresses of the program elements used. Symbolic Addresses for Feed Pump, Agitator Motor, and Inlet Valves 640 Symbolic Name Address Data Type Description Feed_pump_A_start I0.0 BOOL Starts the feed pump for ingredient A Feed_pump_A_stop I0.
Appendix 27.6 Sample Programs Symbolic Addresses for Sensors and Displaying the Level of the Tank Symbolic Name Address Data Type Description Tank_below_max I1.3 BOOL Sensor "mixing tank not full" Tank_above_min I1.4 BOOL Sensor "mixing tank above minimum level" Tank_not_empty I1.5 BOOL Sensor "mixing tank not empty" Tank_max_disp Q9.0 BOOL Lamp for "mixing tank full" Tank_min_disp Q9.1 BOOL Lamp for "mixing tank below minimum level" Tank_empty_disp Q9.
Appendix 27.6 Sample Programs 27.6.2.3 Creating the FB for the Motor What is Required of the FB? The FB for the motor contains the following logical functions: • There is a start and a stop input. • A series of interlocks allow the operation of the devices (pumps and agitator motor). The status of the interlocks is saved in the temporary local data (L stack) of OB1 ("Motor_enable," "Valve_enable") and is logically combined with the start and stop inputs when the FB for the motor is processed.
Appendix 27.6 Sample Programs Defining the Parameters for the FB If you use a multiple instance FB for the motor (for controlling both pumps and the motor) you must define general parameter names for the inputs and outputs. The FB for the motor in the sample process requires the following: • It must have signals from the operator station to stop and start the motor and pumps. • It requires a response signal from the motor and pumps to indicate that the motor is running.
Appendix 27.6 Sample Programs Declaring the Variables of the FB for the Motor You must declare the input, output, and in/out parameters of the FB for the motor. Address Declaration Name Type Initial Value 0.0 IN Start BOOL FALSE 0.1 IN Stop BOOL FALSE 0.2 IN Response BOOL FALSE 0.3 IN Reset_Maint BOOL FALSE 2.0 IN Timer_No TIMER 4.0 IN Response_Time S5TIME S5T#0MS 6.0 OUT Fault BOOL FALSE 6.1 OUT Start_Dsp BOOL FALSE 6.2 OUT Stop_Dsp BOOL FALSE 6.
Appendix 27.
Appendix 27.6 Sample Programs 27.6.2.4 Creating the FC for the Valves What is Required of the FC? The function for the inlet and feed valves and for the drain valve contains the following logical functions: • There is an input for opening and an input for closing the valves. • Interlocks allow the valves to be opened.
Appendix 27.6 Sample Programs Declaring the Variables of the FC for the Valves Just as with the FB for the motor, you must also declare the input, output, and in/out parameters for the FC for the valves (see following variable declaration table). Address Declaration Name Type Initial Value 0.0 IN Open BOOL FALSE 0.1 IN Close BOOL FALSE 2.0 OUT Dsp_Open BOOL FALSE 2.1 OUT Dsp_Closed BOOL FALSE 4.
Appendix 27.6 Sample Programs 27.6.2.5 Creating OB1 OB1 decides the structure of the sample program. OB1 also contains the parameters that are transferred to the various functions, for example: • The STL networks for the feed pumps and the agitator motor supply the FB for the motor with the input parameters for starting ("Start"), stopping ("Stop"), for the response ("Response"), and for resetting the maintenance display ("Reset_Maint"). The FB for the motor is processed in every cycle of the PLC.
Appendix 27.6 Sample Programs Creating the Program for OB1 In STEP 7, every block that is called by a different block must be created before the block containing its call. In the sample program, you must therefore create both the FB for the motor and the FC for the valves before the program in OB1.
Appendix 27.
Appendix 27.
Appendix 27.
Appendix 27.
Appendix 27.6 Sample Programs 27.6.3 Example of Handling Time-of-Day Interrupts Structure of the User Program "Time-of-Day Interrupts" FC12 OB10 OB1 and OB80 27.6.3.1 Structure of the User Program "Time-of-Day Interrupts" Task Output Q 4.0 should be set in the time from Monday, 5.00 am to Friday, 8.00 pm. In the time from Friday, 8.00 pm to Monday, 5.00 am the output Q 4.0 should be reset. Translating into a User Program The following table shows the sub-tasks of the blocks used.
Appendix 27.6 Sample Programs Addresses Used The following table shows the shared addresses used. The temporary local variables are declared in the declaration section of the respective block. Address Meaning I0.0 Input to enable "set time-of-day interrupt" and "activate time-of-day interrupt" I0.1 Input to cancel a time-of-day interrupt Q4.0 Output set/reset by the time-of-day interrupt OB (OB10) Q4.
Appendix 27.6 Sample Programs 27.6.3.
Appendix 27.6 Sample Programs STL (FC12) Network 3: CALL FC 3 IN1 := #IN_DATE IN2 := #IN_TIME RET_VAL := #OUT_TIME_DATE Network 4: A I 0.0 AN M 17.2 A M 17.4 = #OK_MERKER Network 5: A #OK_MERKER JNB m001 CALL SFC 28 OB_NO := 10 SDT := #OUT_TIME_DATE PERIOD := W#16#1201 RET_VAL := MW 200 m001 : A BR = M 202.3 Network 6: A #OK_MERKER JNB m002 CALL SFC 30 OB_NO := 10 RET_VAL := MW 204 m002 : A BR = M 202.4 Network 7: A I 0.1 JNB m003 CALL SFC 29 OB_NO := 10 RET_VAL := MW 210 m003 : A BR = M 202.
Appendix 27.6 Sample Programs 27.6.3.
Appendix 27.6 Sample Programs STL Code Section Enter the following STL user program in the code section of OB10: STL (OB10) Network 1 L L AW T Network 2: L L <>I JC Network 3: L T L T SET = JU mond: L T L T CLR = Explanation #STARTINFO.T_STMP.MSEC_WDAY W#16#F Select day of week #WDAY and store. #WDAY 2 If day of week is not Monday, then specify Monday, 5.00 am as next starting time and reset output Q 4.0. mond D#1995-1-27 #IN_DATE TOD#20:0:0.
Appendix 27.6 Sample Programs 27.6.3.4 OB1 and OB80 As the start event information of OB1 (OB for cyclic program) is not evaluated in this example, only the start event information of OB80 is displayed.
Appendix 27.6 Sample Programs OB80 Code Section Enter the following STL user program in the code section of OB80 that is called by the operating system if a time error occurs: STL (OB80) Network 1 AN S Explanation Q 4.1 Q 4.1 CALL SFC SRCBLK RET_VAL DSTBLK 20 := #STARTINFO := MW 210 := P#M 110.0 Byte 20 Programming with STEP 7 Manual, 05/2010, A5E02789666-01 Set output Q 4.1 if time error occurred. Block transfer: save entire start event information to memory area MB110 to MB129.
Appendix 27.6 Sample Programs 27.6.4 Example of Handling Time-Delay Interrupts Structure of the User Program "Time-Delay Interrupts" OB20 OB1 27.6.4.1 Structure of the User Program "Time-Delay Interrupts" Task When input I 0.0 is set, output Q 4.0 should be set 10 seconds later. Every time input I 0.0 is set, the delay time should be restarted.
Appendix 27.6 Sample Programs Addresses Used The following table shows the shared addresses used. The temporary local variables are declared in the declaration section of the respective block. Address Meaning I0.0 Input to enable "start time-delay interrupt" I0.1 Input to cancel a time-delay interrupt I0.2 Input to reset output Q 4.0 Q4.
Appendix 27.6 Sample Programs 27.6.4.
Appendix 27.6 Sample Programs Code Section Enter the following STL user program in the code section of OB20: STL (OB20) Network 1 Explanation SET = Set output Q 4.0 unconditionally Q 4.0 Network 2: L QW 4 T PQW 4 Activate output word immediately Network 3: L #STARTINFO.T_STMP.SECONDS Read seconds from start event information T MW 140 Read milliseconds and day of week from start event information L #STARTINFO.T_STMP.
Appendix 27.6 Sample Programs 27.6.4.
Appendix 27.6 Sample Programs Code Section Enter the following STL user program in the code section of OB1: STL (OB1) Network 1 L #STARTINFO.T_STMP.SECONDS T MW 10 L #STARTINFO.T_STMP.MSEC_WDAY T MW 12 L MD 10 SRD 4 T MD 10 Network 2: A I 0.0 FP M 1.0 = M 1.1 Network 3: A M 1.1 JNB m001 CALL SFC 32 OB_NO := 20 DTME := T#10S SIGN := MW 12 RET_VAL:= MW 100 m001: NOP 0 Network 4: CALL SFC 34 OB_NO := 20 RET_VAL:= MW 102 STATUS := MW 4 Network 5: A I 0.1 FP M 1.3 = M 1.4 Network 6: A M 1.4 A M 5.
Appendix 27.6 Sample Programs 27.6.4.4 Example of Masking and Unmasking Synchronous Errors The following example of a user program illustrates how to mask and unmask synchronous errors.
Appendix 27.6 Sample Programs STL (Network 4) L T Explanation B#16#0 PQB 16 Write access (with value 0) to PQB 16 STL (Network 5) CALL Explanation SFC 38 PRGFLT_QUERY :=DW#16#0 ACCFLT_QUERY :=DW#16#8 RET_VAL PRGFLT_CLR :=MD 30 ACCFLT_CLR :=MD 34 A BR A NOT = M 37.3 :=MW 104 Invert RLO M 0.0=1 if PQB 16 present M 0.
Appendix 27.6 Sample Programs STL (Network 9) CALL Explanation SFC 38 PRGFLT_QUERY :=DW#16#0 ACCFLT_QUERY :=DW#16#8 RET_VAL PRGFLT_CLR :=MD 30 ACCFLT_CLR :=MD 34 A BR A NOT = M 37.3 :=MW 104 Invert RLO M 0.2=1 if PQB 18 present M 0.2 STL (Network 10) L T Explanation B#16#0 PQB 19 Write access (with value 0) to PQB 19 STL (Network 11) CALL Explanation SFC 38 PRGFLT_QUERY :=DW#16#0 ACCFLT_QUERY :=DW#16#8 RET_VAL PRGFLT_CLR :=MD 30 ACCFLT_CLR :=MD 34 A BR A NOT = M 37.
Appendix 27.6 Sample Programs STL (Network 13) A BEC M 27.3 STL (Network 14) m002: A JNB L T NOP M 0.0 m002 IB 0 PQB 16 0 STL (Network 15) m003: A JNB L T NOP M 0.1 m003 IB 1 PQB 17 0 STL (Network 16) m004: A JNB L T NOP M 0.2 m004 IB 2 PQB 18 0 STL (Network 17) m005: A JNB L T NOP M 0.
Appendix 27.6 Sample Programs 27.6.4.5 Example of Disabling and Enabling Interrupts and Asynchronous Errors (SFC39 and SFC40) In this example of a user program, a program section is assumed that cannot be interrupted by interrupts. For this program section, OB35 calls (time-of-day interrupt) are disabled using SFC 39 "DIS_IRT" and later enabled again using SFC 40 "EN_IRT". SFC39 and SFC40 are called in OB1: STL (OB1) A S A S : : Explanation M M M M 0.0 90.1 0.1 90.
Appendix 27.6 Sample Programs 27.6.4.6 Example of the Delayed Processing of Interrupts and Asynchronous Errors (SFC41 and SFC42) In this example of a user program, a program section is assumed that cannot be interrupted by interrupts. For this program section, interrupts are delayed using SFC41 "DIS_AIRT" and later enabled again using SFC42 "EN_AIRT." SFC41 and SFC42 are called in OB1: STL (OB1) A S A S : : Explanation M M M M 0.0 90.1 0.1 90.
Appendix 27.7 Accessing Process and I/O Data Areas 27.7 Accessing Process and I/O Data Areas 27.7.1 Accessing the Process Data Area The CPU can access inputs and outputs of central and distributed digital input/output modules either indirectly using the process image tables or directly via the backplane/P bus. The CPU accesses inputs and outputs of central and distributed analog input/output modules directly via the backplane/P bus.
Appendix 27.7 Accessing Process and I/O Data Areas Module Start Address The module start address is the lowest byte address of a module. It represents the start address of the user data area of the module and is used in many cases to represent the entire module.
Appendix 27.7 Accessing Process and I/O Data Areas 27.7.2 Accessing the Peripheral Data Area The peripheral data area can be divided into the following: • User data and • Diagnostic and parameter data. Both areas have an input area (can only be read) and an output area (can only be written). User Data User data is addressed with the byte address (for digital signal modules) or the word address (for analog signal modules) of the input or output area.
Appendix 27.7 Accessing Process and I/O Data Areas Accessing Data Records You can use the information in the data records of a module to reassign parameters to configurable modules and to read diagnostic information from modules with diagnostic capability. The following table shows which system functions you can use to access data records.
Appendix 27.8 Setting the Operating Behavior 27.8 Setting the Operating Behavior This chapter explains how you can modify certain properties of S7-300 and S7-400 programmable controllers by setting system parameters or using system functions (SFCs).
Appendix 27.8 Setting the Operating Behavior 27.8.1 Changing the Behavior and Properties of Modules Default Settings • When supplied, all the configurable modules of the S7 programmable controller have default settings suitable for standard applications. With these defaults, you can use the modules immediately without making any settings.
Appendix 27.8 Setting the Operating Behavior Which Settings Can Be Made? The module parameters are divided into parameter blocks. Which parameter blocks are available on which CPU is explained in the "S7-300 Programmable Controller, Hardware and Installation" Manual and the "S7-400, M7-400 Programmable Controllers, Module Specifications" Reference Manual.
Appendix 27.8 Setting the Operating Behavior 27.8.2 Updating the Firmware (of the Operating System) in Modules and Submodules Offline The following section describes how to transfer a new firmware version (new operating system version) to a module or a CPU by means of a memory card. The update requires the following two steps: 1. Create an "update memory card" (transfer the update files to a memory card) with the programming device (PG) or PC with an external prommer. 2.
Appendix 27.8 Setting the Operating Behavior 6. Switch the power back on. The CPU executes an automatic memory reset. After that, the CPU is ready for operation. 27.8.3 Using the Clock Functions All S7-300/S7-400 CPUs are equipped with a clock (real-time clock or software clock). The clock can be used in the programmable controller both as clock master or clock slave with external synchronization. The clock is required for Time-Of-Day interrupts and runtime meters.
Appendix 27.8 Setting the Operating Behavior In STOP mode, the runtime meter is stopped. Its count value is retained even after a memory reset. During a restart (warm restart), the runtime meter must be restarted by the user program; during a hot restart, it continues automatically if it had already been started. You can set the runtime meter to an initial value using SFC2 SET_RTM. You can start or stop the runtime meter with SFC3 CTRL_RTM.
Appendix 27.8 Setting the Operating Behavior Note If you use more timers in your user program than the CPU permits, a synchronous error is signaled and OB121 started. On the S7-300 (with the exception of the CPU 318), timers can be started and updated simultaneously only in OB1 and OB100; in all other OBs timers can only be started.
Index " "Accessible Nodes" Window 401 * *.awl file *.k7e file *.k7p file *.
Index BCD 595 Binary Coded Decimal 595 Bit Messaging 333, 334 BLKMOV 573 BLOCK 610 parameter type 609 Block - general Checking consistency 325 Overview 72 Block Calls 80, 81 Block Comment 251 Block Comments Entering 253 Block comparison 231, 232, 233 Block consistency 325 Block folder 128 Block folder object 128 Block Folder Properties 230 Displaying Block Lengths 230 Block for Changing the Pointer 613 Block Lengths 230 Displaying 230 Block properties 227, 229, 241, 327 Block Properties 285 Block Stack 571
Index Compiling 297, 430 Objects 429 STL Source Files 297 Compiling and downloading 427 Complex Data Types 597, 600, 601, 604 Compressing 439 the Memory Contents of an S7 CPU 439 User Memory 438 Compressing the User Memory 438 Configurable Memory Objects in the Work Memory 587 Configurable Modules 679 Configuration data 395, 396 Configuration Data Transferring 372, 400 Configuration Diagram Creating 69 Configuring hardware 551 in the configuration table 551 Configuring in general 376 CPU messages 376 Confi
Index D Data Block Shared 96 Structure 96 Data block (DB) 72 Data Block (DB) 585 Instance Data Blocks 93 Retentive 585 Data Block Register 582 Data blocks 277 Assigning parameters 277 Data view 269 Declaration view 268 Data Blocks 267 Basic Information 267 Editing Data Values in the Data View 275 Resetting Data Values to their Initial Values 275 Saving 276 Data Blocks (DB) Instance Data Blocks 90 Data Carrier 182 Data exchange in different operating modes 569 Data Record Accessing 677, 679 Reading 676, 677
Index DINT 589, 590 DIS_AIRT 111 DIS_IRT 111 Disabling Interrupts and Asynchronous Errors 672 Example 672 Display language 366 Displaying Addresses Without Symbols 318 Block Information for LAD FBD and STL 317 Block Lengths 230 Data Structure of Data Blocks Referencing an (Instance DBs) 271 Deleted Blocks 313 Lists in Additional Working Windows 318 Maximum Local Data Requirement in the Tree Structure 312 Missing Symbols 318 Program Structure 319 Reference Data 318, 319 Shared or Local Symbols 196 Unused Ad
Index Error Handling Organization Blocks (OB70 to OB87 / OB121 to OB122) 110 Error OB OB Types OB121 and OB122 110 OB70 and OB72 110 OB80 to OB87 110 Using Error OBs to React to Events 110 error OBs as reaction to a detected error 503 Error OBs 110, 111, 386, 504 Error Search in Blocks 254 Establish Online Connections 401 Establishing Online Connection via the "Accessible Nodes" Window 401 Online Connection via the Online Window of the Project 402 Establishing a Connection to the CPU 456 Establishing the S
Index Formats 288 Blocks in STL Source Files 288 Forwarding parameters parameter types 609 Function Correcting the Interface 330 Function (FC) 72, 646 Function Block Correcting the Interface 330 Function Block (FB) 642 Function Block Diagram 219 Function Block Diagram Programming Language (FBD) 219 Function Block Diagram(FBD) 216 Function Blocks 289 Format Table 289 Function Blocks (FB) 90 Actual Parameters 90, 91, 92 Application 90 Functional Scope of Report System Errors 379 Functions Format Table 290 Fu
Index Indirect Parameter Assignment 679 Industrial Blending Process 642, 646, 648 Information Functions 488 Information Functions in the Diagnostic View 484 Information Functions in the Quick View 481 Information on the Log File 175 Input Parameters 622 Inputs Assignment List 314 Process Image 576 Insert/Remove Module Interrupt (OB83) 515 Insert/Remove Module Interrupt Organization Block 515 Inserting Addresses or Symbols in a Variable Table 446 Block Templates in STL Source Files 293 Comment Lines 451 Con
Index Local Data Requirements 312 Local Data Stack 571, 580, 581 Local time 409 Logic blocks in the incremental editor 241 Structure 241 Logic Blocks 639 Saving 265 Time Stamps 328 M M7 Programming Optional Software 547 M7-300 / 400 Inserting a program 166 M7-300/M7-400 Operating Systems 545 M7-300/M7-400 Operating Systems 549 Maintenance demand 477 Maintenance Demanded 480 Maintenance information 478 Maintenance required 478 Maintenance Required 480 Make (see checking block consistency) 325 Make (see com
Index Monitoring Times 107 Motors 65 Creating an I/O Diagram 65 Moving Object 136, 137, 138, 139, 141 MPI Card for PG/PC 53 MPI FW Update 411, 421 MPI Interface 48, 49 MPI-ISA Card (Auto) 53 MSK_FLT 111 Multiple Instance 90 entering in the Variable Declaration Window 248 Multiple instances Use 247 Multiple Instances 95 Rules 248 Multiproject Online access to PLCs in 403 Multiprojects with Access Protection 155 N Naming conventions 396 for Configuration data 395 Narrowing down disruptions 477 Nested Calls
Index Operating Modes and Mode Transitions 557 Operating philosophy 133 Operating system 82, 83, 86, 681 Operating System Tasks 71 Operator Console 68 Operator control and monitoring attributes 395 Operator Control and Monitoring Attributes CFC 399 Configuring with STL LAD FBD 397 Configuring with Symbol Table 398 Operator Displays and Controls Example of Industrial Blending Process 68 Optimizing the Source for Translation 177 Optimizing the Translation Process 178 Optional Package 475 Optional Software fo
Index Power down 563 Power Flow 258 Power Supply Error (OB81) 513 Power Supply Error Organization Block 513 Preventing Personal Injury 463 Preventing Property Damage 463 Previous versions of STEP 7 187 compatibility (direct data exchange) 187 compatibility (online connection via PROFIBUS DP interface) 187 direct data exchange 187 distributed I/O 187 downward compatibility 187 editing current configurations with previous versions of STEP 7 187 online connection via DP interface 187 PROFIBUS DP 187 Printer F
Index Projects with a large number of networked stations 551 Projects with Access Protection 155 PZF (I/O Access Error) 576 Q QRY_TINT 100, 654 Querying Time-of-Day Interrupt 100 Quick View of the Diagnostic Information 481 R Rack Failure (OB86) 517 Rack Failure Organization Block 517 RAM 571, 585 RAM Area 572, 586 RDSYSST 495, 496, 584 READ_CLK 682 READ_RTM 682 Reading and Adjusting the TOD and the TOD Status 409 Reading from a Data Block in Load Memory 180 REAL 589, 591 Rearranging projects and librari
Index Safety Measures When Forcing Variables 462 Safety Notes 580 Exceeding the L Stack 580 Overwriting the L Stack 580 Safety Requirements 67 Example of an Industrial Blending Process 67 Sample Program 639, 640, 644, 646, 648, 649, 668, 672, 673 Sample Program for an Industrial Blending Process 636 Sample programs 634 Sample Programs 642 FB for the Industrial Blending Process 642 FC for an Industrial Blending Process 646 Industrial Blending Process 636 Creating a Configuration Diagram 69 Describing the In
Index SFC42 EN_AIRT 110 Example in STL 673 SFC48 SNC_RTCB 682 SFC51 RDSYSST 495, 496, 583 SFC55 WR_PARM 676 SFC56 WR_DPARM 676 SFC57 PARM_MOD 676 SFC82 180 SFC83 180 SFC84 180 Shared and Local Symbols 195 Shared Data Blocks 270 Entering the Data Structure 270 Time Stamps 329 Shared Data Blocks (DB) 96 Short Circuit Ladder Logic Illegal Logic Operations 258 Signal Module 475 Simulating 475 Signal Modules with Hardware Interrupt Capability Assigning Parameters 105 SIMATIC Components 337 SIMATIC Manager 113,
Index STL 220 Displaying Block Information 318 Entering Blocks 250 STL Editor Settings 242 STL Examples of FBs 304 FCs 301 OBs 299 UDTs 308 Variable Declaration 298 STL Examples of DBs 307 STL Files Debugging 296 STL source file Basics of programming 279 STL Source File Creating 292 STL Source Files Checking Consistency 296 Compiling 297 Generating from Blocks 295 Inserting Block Templates 293 Inserting External Source Files External Source Files 294 Inserting Source Code from Existing Blocks 294 Inserting
Index System function block SFB 72 System Function Blocks 97 System Function Blocks (SFB) and System Functions (SFC) 97 System function SFC 72 System Functions 97 System Memory 571, 574 System Parameters 678 System Status List 496, 497, 498 Contents 496 Reading 496 System Text Libraries 369 T Tabs in Dialog Boxes 135 Tasks Example of Industrial Blending Process 60 Tasks and Areas Example of Industrial Blending Process 62 TEMP (Variable Declaration) 622 Temporary Variables 622, 623 Testing 441, 553 Using P
Index U UDT 226, 597, 606, 607, 608 UDT - User-defined Data Types in STL Source Files Example 308 Uninstalling STEP 7 55 Uninstalling the User Authorization 47 Unknown modules 190 Unmasking Start Events 110 Unmasking Synchronous Errors 668 Example 668 Unused Addresses Displaying 318 Unused Symbols 316 UPDAT_PI 85, 576 UPDAT_PO 85, 576 Update (operating system of the CPU) 681 Updating 414, 423, 681 Firmware (operating system) of module and submodules - offline 681 Process image 82, 84, 85 Process Image 576,
Index Monitoring - introduction 457 Operator control and monitoring 395, 396 Version 2 Projects 630 Converting 630 Virtual work memory Setting 555 W Warm restart 561, 562, 563, 564, 565, 566 Automatic 561 unbuffered 561 Canceling 561 Manual 561 Warning 580 Exceeding the L Stack 580 Overwriting the L Stack 580 Watchdog time 82 What Are the Different Messaging Methods? 333 What You Should Know About Access Protection 155 What You Should Know About HOLD Mode 472 What You Should Know About Micro Memory Cards
Index 704 Programming with STEP 7 Manual, 05/2010, A5E02789666-01