Page 1
Preface, Contents Requirements for Working with the Primer Defining and Structuring the Control Task Installing and Wiring Your SIMATIC S7-300 Working with the STEP 7 Programming Software S7-300 Programmable Configuring and Assigning Controller Parameters to Your S7-300 Quick Start Programming Logic Blocks with STEP 7 Downloading and Testing Your Primer...
Page 2
Trademarks SIMATIC and SINEC are registered trademarks of SIEMENS AG. Third parties using for their own purposes any other names in this document which refer to trademarks might infringe upon the rights of the trademark owners. Copyright...
Preface to the Primer Hold on there. You weren’t going to continue without reading the Preface, were you? The Preface gives you an overview of the information contained in the Primer. Primer: S7-300 Programmable Controller, Quick Start C79000-G7076-C500-01...
Page 4
Preface to the Primer What Does This Primer Describe? Aims of the Primer With this Primer, we aim to show you how easily you can install the S7-300 programmable logic controller and program it with the relevant STEP 7 programming software. The Primer supports you with: Simple step-by-step instructions and An easily understandable sample program that leads you through the...
Page 5
Preface to the Primer What Does Each The individual chapters of the Primer provide you with the following Chapter Contain? information and procedures: Chapter 1: Requirements for Working with the Primer Chap. 1 This chapter lists the hardware and software requirements for working with the Primer.
Page 6
Preface to the Primer Primer: S7-300 Programmable Controller, Quick Start C79000-G7076-C500-01...
Requirements for Working with the Primer You mean to say, this is all you need for working with the Primer? We have made every effort to keep the hardware and software requirements for working with the Primer to a minimum. Primer: S7-300 Programmable Controller, Quick Start C79000-G7076-C500-01...
Requirements for Working with the Primer Hardware Requirements What Hardware Do For working with the Primer and executing the TLIGHT sample program, You Need? you require the following hardware components: Component Function Illustration Rail ... functions as a mounting rack for an S7-300.
Requirements for Working with the Primer Software Requirements What Software Do For working with the Primer and executing the TLIGHT sample program, You Need? you require: WINDOWS 95 and The STEP 7 software package, version 3. STEP 7 Software STEP 7 contains a SETUP program that carries out the installation Package automatically.
Requirements for Working with the Primer Other References for This Chapter Where Can You If you still have questions and you need additional information regarding Find Other hardware and software requirements, our manuals may be of assistance. References? Anything you can’t find in our manuals, you will find in the online help for STEP 7! You Will Find Information on...
Defining and Structuring the Control Task Your control task in the Primer is to design a TLIGHT control system. We will show you exactly how to implement a simple control system using the TLIGHT sample program. Primer: S7-300 Programmable Controller, Quick Start C79000-G7076-C500-01...
Defining and Structuring the Control Task How Do You Design a Control Task? Basic Procedure Using the TLIGHT sample program, we intend to show you step-by-step how to proceed in designing a control task. You can then transfer this procedure to your own applications.
Defining and Structuring the Control Task How to Define and Structure Your Control Task What is to be The TLIGHT sample program to be created will control vehicle and Controlled? pedestrian traffic at a pedestrian crossing, as shown in Figure 2-2. What Subtasks are The TLIGHT program is to control both to be Performed?
Page 16
Defining and Structuring the Control Task What Safety You must take into account the following safety requirements in order to Requirements prevent any hazard to pedestrians or drivers: Apply? The default setting should be green for the traffic light and red for the pedestrian light, in order to define a safe starting point.
Page 17
Defining and Structuring the Control Task Which Addresses In order for the TLIGHT sample program to simulate a traffic light control Do You Need? system on the simulator module of your S7-300, you must define the following addresses to which you can also assign a symbolic name: 2 inputs (I) for requesting green for the pedestrians on both sides of the street.
Page 18
Defining and Structuring the Control Task Sample Program If input I 0.0 or I 0.1 is set by the pedestrian green request, the following Sequence occurs: The traffic light switches from Q 0.7 (green) via Q 0.6 (yellow) to Q 0.5 (red) and The pedestrian light switches from Q 0.0 (red) to Q 0.1 (green) The outputs are set alternately by the timers defined in the program.
Defining and Structuring the Control Task Other References for This Chapter Where Can You If you still have questions and you need additional information with regard to Find Other defining and structuring your own control task, our manuals may be of References? assistance.
Page 20
Defining and Structuring the Control Task Primer: S7-300 Programmable Controller, Quick Start C79000-G7076-C500-01...
Installing and Wiring Your S7-300 You want to install and wire your S7-300? No problem! You can do it in no time! This chapter shows you step-by-step how to proceed. Primer: S7-300 Programmable Controller, Quick Start C79000-G7076-C500-01...
Installing and Wiring Your S7-300 What Do You Need to Know Before You Start? Are There Any Slot There are a few simple slot rules that you need to observe when installing Rules? your S7-300 (see Figure 3-1): The power supply module (PS) must always be plugged in as the first module on the left of the DIN rail.
Installing and Wiring Your S7-300 How Do You Install Your S7-300? Basic Procedure You can install your S7-300 with just a few adjustments as shown below: Step Procedure Illustration Install the DIN rail and ground the connection. Plug the bus connector into the module to be installed (the illustration shows the CPU).
Page 24
Installing and Wiring Your S7-300 Step Procedure Illustration Hang each module (the illustration shows the CPU) onto the DIN rail and swing it down. Screw the module tight. 0.8 to 1.1 Nm Insert the key into the CPU. STOP Now that you have installed your S7-300, you can wire it.
Installing and Wiring Your S7-300 How Do You Wire Your S7-300? Overview The table below shows you the basic procedure for wiring your S7-300. You should observe the assembly guidelines which are described in the manuals listed at the end of this chapter. Warning Only wire the S7-300 when the power is switched off! You can wire the PS 307 power supply module to the CPU 313/314/315 via...
Installing and Wiring Your S7-300 How Do You Connect Your Programming Device/PC? Connecting a Connect your programming device/PC to your S7-300 via an MPI cable. The Programming MPI cable is included with your programming device. Device/PC to an Figure 3-2 shows how the multipoint interfaces on the programming device S7-300 and on your S7-300 are connected by an MPI cable: S7-300...
Installing and Wiring Your S7-300 Other References for This Chapter Where Can You You will find additional information regarding the installation of complex Find Other systems in our manuals. References? If you are installing a larger system, the manuals listed below will help you! You Will Find Information on...
Page 28
Installing and Wiring Your S7-300 Primer: S7-300 Programmable Controller, Quick Start C79000-G7076-C500-01...
Working with the STEP 7 Programming Software Now we can really get going. Go ahead and switch on your programming device or PC! On the following pages, you will be introduced to the STEP 7 programming software. Primer: S7-300 Programmable Controller, Quick Start C79000-G7076-C500-01...
Working with the STEP 7 Programming Software What is STEP 7? Introduction STEP 7 is the programming software for SIMATIC S7/M7 and therefore for your S7-300. STEP 7 provides you with the entire functionality required for configuring, programming, and assigning parameters to your S7-300. Our programming software gives you effective support when solving your automation task.
Working with the STEP 7 Programming Software How Do You Work with STEP 7? Starting Up the You can start up the software quite simply by double-clicking on the icon for Software the SIMATIC Manager. Result: The project window for the SIMATIC Manager opens. SIMATIC Manager File View...
Working with the STEP 7 Programming Software Which STEP 7 Objects Should You Know? Introduction The table below shows you the STEP 7 objects that you should know for the TLIGHT programming example. You can see from the table which symbols are assigned to the individual objects and what they mean: Symbol Object...
Page 33
Working with the STEP 7 Programming Software Actions with You have access to all the processing functions via STEP 7 objects: Objects You can create and open objects! You can rename and delete objects! You can edit and save objects! And you can print and archive objects! You can cut, copy, and...
Working with the STEP 7 Programming Software This is How You Create a Project Structure! Introduction For the TLIGHT sample program, you need a project structure in which you can store the relevant data for this control task. You have already learned on the previous page what a project structure looks like.
Working with the STEP 7 Programming Software Other References for This Chapter Where Can You If you still have questions and you need additional information on creating Find Other projects, stations, and programs, our manuals may be of assistance. References? You will find a detailed example in the manual below! You Will Find Information on...
Page 36
Working with the STEP 7 Programming Software Primer: S7-300 Programmable Controller, Quick Start C79000-G7076-C500-01...
Configuring and Assigning Parameters to Your S7-300 Believe me, you don’t even need to get out of your chair! You can make all the necessary settings via the STEP 7 software. Primer: S7-300 Programmable Controller, Quick Start C79000-G7076-C500-01...
Configuring and Assigning Parameters to Your S7-300 What is Configuring and Assigning Parameters? What Does ‘Configuring’ is arranging modules in a configuration table. Configuring Just as in your actual system, you arrange the modules on a mounting rack Mean? using STEP 7. You can select the modules from an electronic catalog and enter them in the relevant slot in the configuration table.
Configuring and Assigning Parameters to Your S7-300 How to Configure and Assign Parameters Prerequisites Before you can enter a new configuration and assign parameters to the CPU of your S7-300, you must have created a project and selected the object that you want to configure (here, your SIMATIC 300 station).
Configuring and Assigning Parameters to Your S7-300 First Perform a Memory Reset of Your CPU! Introduction Before downloading your configuration data to the CPU of your S7-300, perform a memory reset of the CPU to make sure that it does not contain any ‘old’...
Configuring and Assigning Parameters to Your S7-300 How Do You Configure and Assign Parameters to Your S7-300? How Do You The table below shows you step-by-step how to configure and assign Proceed? parameters to your S7-300: Step Procedure Result Select the SIMATIC 300 station (1) in your The configuration table appears on the screen project and call up the configuration table with with the working window and the “Hardware...
Configuring and Assigning Parameters to Your S7-300 What Does a Configuration Table Look Like? Configuration You must fill in a configuration table according to the hardware configuration Table Example of your S7-300. The relevant position in the configuration table is assigned to the actual slot in your mounting rack.
Page 43
Configuring and Assigning Parameters to Your S7-300 Other References for This Chapter Where Can You If you still have questions and you need additional information on Find Other configuring and assigning parameters to your S7-300, our manuals may be of References? assistance.
Page 44
Configuring and Assigning Parameters to Your S7-300 Primer: S7-300 Programmable Controller, Quick Start C79000-G7076-C500-01...
Programming Logic Blocks with STEP 7 You want to program your S7-300? No problem! It’s easy too! Programming your blocks is easy and user-friendly with STEP 7. Primer: S7-300 Programmable Controller, Quick Start C79000-G7076-C500-01...
Programming Logic Blocks with STEP 7 Procedure for Programming Blocks Introduction You can program your programmable controller quite easily by creating a user program that you download to the CPU of your S7-300. The user program you have to create consists of different blocks which enable you to structure your program.
Programming Logic Blocks with STEP 7 How Do You Create the Required Blocks? Program an organization block (OB1) and a function (FC1) for the TLIGHT sample program. How Do You The table below shows you how to create the required function: Proceed? Step Procedure...
Programming Logic Blocks with STEP 7 What are STL, LAD, and FBD? STL = Statement STL stands for Statement List and is a textual programming language in List STEP 7. The syntax of the statements is close to machine code: Instructions or operations are followed by addresses.
Page 49
Programming Logic Blocks with STEP 7 Starting STL, LAD, If you double-click on the FC1 which has already been programmed, the and FBD language editor you have assigned (STL, LAD, or FBD) will be started and a split window appears with: The variable declaration table of the block in the upper half and The code section of the block in the lower half of the window.
Page 50
Programming Logic Blocks with STEP 7 Variable Declaration Table You do not need to fill in the variable declaration table since the FC1 used in the TLIGHT sample program does not contain any local variables! Code Section In the code section, you enter the program for your block as STL statements or as LAD and FBD elements in networks.
Programming Logic Blocks with STEP 7 How Do You Program Blocks in STL? Prerequisite You must have created FC1 and OB1 as blocks and assigned the incremental STL editor as the language editor. You will find the rules for entering STL statements in the STEP 7 online help.
Page 52
Programming Logic Blocks with STEP 7 STL Statements Enter the STL statements listed below for the TLIGHT sample program for FC1 network by network in your FC1. Proceed as described in the table. You have already defined the required addresses in Chapter 2 of the Primer. Network 1: Detecting green request for pedestrians I 0.0...
Page 53
Programming Logic Blocks with STEP 7 Network 8: Timer start for yellow phase delay for vehicles M 0.0 S5T#6S Network 9: Red phase for pedestrians M 0.0 M 0.0 Q 0.0 Network 10: Timer start for red/yellow phase for vehicles M 0.0 S5T#3S Network 11:...
Programming Logic Blocks with STEP 7 How Do You Program Blocks in LAD? Prerequisite You have created OB1 and FC1 as blocks and you have assigned the incremental LAD editor as the language editor. Starting the LAD If you double-click on the FC1 which has already been programmed in the Language Editor SIMATIC Manager, the assigned LAD editor is started and you can program the block.
Page 55
Programming Logic Blocks with STEP 7 Methods of There are the following methods for inserting LAD elements: Entering LAD You can enter NO contacts, NC contacts, or coils via function keys Elements or you can select the icons for NO contacts, NC contacts, or coils from the toolbar.
Page 56
Programming Logic Blocks with STEP 7 LAD Elements for Enter the LAD elements listed below for the TLIGHT sample program network by network in your FC1. Proceed as described in the table. You have already defined the required addresses in Chapter 2 of the Primer. Network 1: Detecting green request for pedestrians I0.0...
Page 57
Programming Logic Blocks with STEP 7 Network 8: Timer start for yellow phase delay for vehicles S_ODT M0.0 S5T#6S ??.? ??.? Network 9: Red phase for pedestrians M0.0 Q0.0 M0.0 Network 10: Timer start for red/yellow phase for vehicles S_ODT M0.0 S5T#3S ??.?
Programming Logic Blocks with STEP 7 How Do You Program Blocks in FBD? Prerequisite You have created OB1 and FC1 as blocks and you have assigned the incremental FBD editor as the language editor. Starting the FBD If you double-click on the FC1 which has already been programmed in the Language Editor SIMATIC Manager, the assigned FBD editor is started and you can program the block.
Page 59
Programming Logic Blocks with STEP 7 Methods of The following methods are available for inserting FBD elements: Entering FBD You can insert AND boxes, OR boxes, OUTPUT boxes, and insert and Elements negate inputs using the function keys . Alternatively, F3, F7, F8, you can select the required elements from the toolbar.
Page 60
Programming Logic Blocks with STEP 7 FBD Elements for Enter the FBD elements listed below for the TLIGHT sample program network by network in your FC1. Proceed as described in the table. You have already defined the required addresses in Chapter 2 of the Primer. Network 1: Detecting green request for pedestrians >=1...
Page 61
Programming Logic Blocks with STEP 7 Network 8: Timer start for yellow phase delay for vehicles & M0.0 S_ODT S5T#6S ??.? Network 9: Red phase for pedestrians & >=1 M0.0 >=1 Q0.0 M0.0 Network 10: Timer start for red/yellow phase for vehicles &...
Programming Logic Blocks with STEP 7 Other References for This Chapter Where Can You If you still have questions and you need additional information regarding Find Other programming your blocks in STL, LAD, and FBD, our manuals may be of References? assistance.
Downloading and Testing Your User Program If you have done everything correctly, you can already look forward to success! When your program has been downloaded and tested, it can be executed. Primer: S7-300 Programmable Controller, Quick Start C79000-G7076-C500-01...
Downloading and Testing Your User Program Basic Procedure for Downloading and Testing Introduction You cannot test your program until you have downloaded it to the CPU of your S7-300. You can download either individual blocks or the complete user program to the CPU of your programmable controller.
Page 65
Downloading and Testing Your User Program How Do You Download the User Program to Your S7-300? Prerequisites The following prerequisites must be fulfilled before you can download the user program to your S7-300: There must be an online connection between your programming device and your S7-300.
Page 66
Downloading and Testing Your User Program What Do You Have to Know about Testing? Introduction Regardless of whether you want to test a block created in STL, LAD, or FBD, you can always: Define the trigger condition, Select the test environment and Define the settings for the test display.
Page 67
Downloading and Testing Your User Program Meaning of the You can choose between the two online test situations ‘Process’ and Test Environment ‘Laboratory’ in which you can test your program; With the ‘Process’ test environment, the status of statements during a loop run is only detected on the first loop run.
Page 68
Downloading and Testing Your User Program How Do You Test Your STL Program? Introduction You test your STL program by displaying the program status for each STL statement in the status fields you have selected. Program status display is updated cyclically and only displayed for the area visible to the STL editor. Prerequisites In order to be able to display the program status, the following prerequisites must be fulfilled:...
Page 69
Downloading and Testing Your User Program Displaying the The program status is only displayed for the area visible to the editor. Program Status in Netzwerk 1: Network 1: Detecting green request for pedestrians RLO STA STANDARD I 0.0 I 0.1 M 0.0 M 0.0 Network 2 : Green phase for vehicles...
Page 70
Downloading and Testing Your User Program How Do You Test Your LAD Program? Introduction You can test your LAD program by defining how you want to display the signal flow within the networks of a block. Prerequisites To display the signal flow, the following prerequisites must be fulfilled: You must have saved the block without errors and downloaded it to the CPU.
Page 71
Downloading and Testing Your User Program Displaying the The program status is only displayed for the area visible to the editor. Program Status in Network 1: Detecting green request for pedestrians I 0.0 M 0.0 I 0.1 M 0.0 Network 2 : Green phase for vehicles M 0.0 Q 0.7 Figure 7-4 Example of Displaying the Program Status in LAD...
Page 72
Downloading and Testing Your User Program How Do You Test Your FBD Program? Introduction You can test your FBD program by defining how you want to display the signal flow within the networks of a block. Prerequisites To display the signal flow, the following prerequisites must be fulfilled: You must have saved the block without errors and downloaded it to the CPU.
Page 73
Downloading and Testing Your User Program Displaying the The program status is only displayed for the area visible to the editor. Program Status in Network 1: Detecting green request for pedestrians >=1 I0.0 & >=1 I0.1 & M0.0 M0.0 Network 2 : Green phase for vehicles Q0.7 &...
Page 74
Downloading and Testing Your User Program Other References for This Chapter Where Can You If you still have questions and you need additional information on Find Other downloading and testing your user program, our manuals may be of References? assistance. Just refer to the manual below if you need additional information!
Page 75
Glossary Address An address is part of a STEP 7 statement and specifies what the processor should execute the instruction on. Addresses can be absolute or symbolic. Automation An automation system is a programmable logic controller (PLC) in the case System of SIMATIC S7, a SIMATIC C7 control system (PLC with integrated operator panel), or a SIMATIC M7 automation computer.
Page 76
Glossary Central Processing The CPU is the central module in the programmable controller consisting of Unit (CPU) a control unit, arithmetic unit, memory, operating system, and interfaces to the signal modules and function modules. Complete Restart When a CPU starts up (for example, when the mode selector is moved from STOP to RUN or when power is turned on), before cyclic program processing starts (OB1), either the organization block OB101 (restart;...
Page 77
Glossary Memory Reset The memory reset function deletes the following memories in the CPU: (MRES) Work memory Read/write area of the load memory System memory with the exception of the MPI parameters and the diagnostic buffer Multipoint The multipoint interface is the programming device interface in SIMATIC Interface (MPI) S7.
Page 78
Glossary S7 Program An S7 program is a container for blocks, source files, and charts for S7 programmable modules. Startup The CPU goes through the STARTUP mode during the transition from the STOP mode to the RUN mode. It can be set using the mode selector, or following power-on, or by an operation on the programming device.
Page 79
Index Actions with objects, 4-5 Hardware components, 1-2 Assigning parameters, 5-2 Hardware requirements, 1-2 Assigning parameters to the S7-300, 5-5 Installing the S7-300, 3-3, 3-4 Blocks slot rules, 3-2 creating, 6-3 downloading, 7-3 programming, 6-2 testing, 7-4 LAD programs testing, 7-8 Ladder Logic (LAD), definition, 6-4 Code section of blocks, definition, 6-6 Configuration table, example, 5-6...
Page 80
Index spare parts for the S7-300, 3-7 subtasks, 2-3 the S7-300 modules, 3-7 symbolic names of addresses, 2-5 wiring the S7-300, 3-7 timers defined, 2-6 Setting the test display for LAD, 7-5 Setting the test display for STL, 7-5 SIMATIC Manager, 4-3 Slot rules, 3-2 Procedure Software requirements, 1-3...
Page 81
Siemens AG AUT E 146 Östliche Rheinbrückenstr. 50 D–76181 Karlsruhe Federal Republic of Germany From: Your Name: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _...
Page 82
Your comments and recommendations will help us to improve the quality and usefulness of our publications. Please take the first available opportunity to fill out this questionnaire and return it to Siemens. Please give each of the following questions your own personal mark within the range from 1 (very good) to 5 (poor).