Page 1
Preface Quick review Latching SIMATIC S7-200 Pulse Operated Switch S7-200 Getting Started - Advanced Off Delay Timer Sequencer Training Documents Learning More Appendix A 09/2007 A5E01469795B...
Page 2
Trademarks All names identified by ® are registered trademarks of the Siemens AG. The remaining trademarks in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
After working through this manual, you will find it easy to solve typical controller tasks on your own. You can find and load the SIMATIC S7-200 program examples from the STEP 7- Micro/WIN Documentation CD or the Programming Examples CD provided in the back cover of this manual.
Table of contents Preface ..............................3 Quick review ............................7 A Few Words of Review ......................7 Here are the Bits......................... 8 Power flow in a ladder diagram....................9 Finding information about ladder instructions ................10 The PLC scan cycle: Reading the inputs .................. 11 The PLC scan cycle: Writing the outputs ..................
Page 6
Table of contents Sequencer ............................43 Introduction..........................43 Solution Starting Point ......................44 Sequencer control........................45 Transition condition........................46 Structure of the sequencer program ..................47 Control logic for the sequencer ....................48 Working with memory bits......................49 Transition condition for the sequencer ..................50 Advantages of working with sequencers...................
Quick review 1.2 Here are the Bits Here are the Bits The smallest unit to be processed is the bit! The bit can assume two states: ● "1" meaning "bit set" or state is "true" ● "0" meaning "bit not set " or state is "false" In a method familiar to you, the two binary states "1"...
Quick review 1.3 Power flow in a ladder diagram Power flow in a ladder diagram In this example, output Q0.3 would be active or "1", if the contact at I0.1 is closed, or bit value "1" (24 V DC at input I0.1) AND simultaneously, the timer bit T37 is active, or "1".
Quick review 1.4 Finding information about ladder instructions Finding information about ladder instructions Getting Started - Advanced Training Documents, 09/2007, A5E01469795B...
Quick review 1.5 The PLC scan cycle: Reading the inputs The PLC scan cycle: Reading the inputs All SIMATIC programmable controllers use a scan cycle. In this cyclical operation, the switch states are read at the inputs and stored in the process input image (PII). This information is interpreted by your control program.
Quick review 1.6 The PLC scan cycle: Writing the outputs The PLC scan cycle: Writing the outputs The outputs in the process-image output table (PIQ) are overwritten by the control logic in the program. The bit states in the PIQ are transferred to the physical outputs in the final step. The PLC scan cycle continuously repeats this process.
Quick review 1.7 The PLC scan cycle: Program logic The PLC scan cycle: Program logic Getting Started - Advanced Training Documents, 09/2007, A5E01469795B...
Latching Introduction You should now be familiar with the standard latching function and here you will learn how to program it. For example: Output Q0.0 is to be activated as soon as S1 at input I0.0 is operated. With latching, Q0.0 is to remain active until S2 at input I0.1 is operated and thus interrupts the latch.
Latching 2.2 Normally Closed (NC) Contact Normally Closed (NC) Contact To disable the latching function, input I0.1 must break the current path when operated. If a current path is interrupted (i.e. state "0" exists) when a switch is operated, this is referred to as an NC contact.
Latching 2.3 Inserting a normally-closed contact Inserting a normally-closed contact Note: Press the insert key to toggle ON the 1. Click the mouse to mark the LAD Overwrite (OVR) mode. Look at the Status bar on diagram position with the box cursor the bottom-right corner of the STEP 7- Micro/Win that shows where the NC contact will window to make sure the OVR mode is set.
Latching 2.4 Testing your circuit Testing your circuit As in the contactor circuit, your LAD network has an output state contact (Q0.0) connected in parallel with the tripping element (I0.0). If, during a scan cycle, output Q0.0 has been activated by operation of switch S1 at I0.0, contact Q0.0 parallel to I0.0 is closed in the very next cycle...
Latching 2.5 A faster way to create logic state latches A faster way to create logic state latches Instead of feeding back the output, as in the previous example, here the functions "Set" and "Reset" are used instead. Have a look at the ladder diagram below.
Latching 2.6 Making a Set/Reset network Making a Set/Reset network To make sure you are using the least number of keystrokes and mouse clicks to create the LAD networks, do the following: 1. Select the menu command Tools > Options 2.
Latching 2.7 Safety Tip: How to control a machine shutdown when a wire breaks Safety Tip: How to control a machine shutdown when a wire breaks Because the circuit uses a NC switch as the input to the Reset logic, a broken wire on that input forces a reset.
Pulse Operated Switch Introduction You will implement a pulse-operated switch here. Within this context, you will learn about edge detection and bit memories. Principle of Operation A lamp at output Q0.5 is to be switched on as soon as S1 at input I0.0 is momentarily closed.
Pulse Operated Switch 3.2 Solution Overview Solution Overview Before showing you the step-by-step solution of the task, we will show you the finished solution to provide you with an overview. Detect whether a change of If output Q0.5 is "0", bit memory M0.0 is state from "0"...
Pulse Operated Switch 3.3 Edge detection Edge detection The moment of transition of a contact (input, output ...) from "open" to "closed" or from "false" to "true" is referred to as the rising or positive edge. Correspondingly, the transition from "closed" to "open" or from "true"...
Pulse Operated Switch 3.4 Examples of edge detection Examples of edge detection In STEP 7-Micro/WIN, open the exercise project 2h_pr_03.mwp from diskette. This project is also incomplete and will be finished step by step. 1. Use a mouse click to position the box cursor where the --|P|-- contact will be placed. 2.
Pulse Operated Switch 3.5 Bit memory (M addresses) Bit memory (M addresses) You can use bit memories for the pulse-operated switch. A brief example will serve here to show you how to work with them. Instead of being used as an output, the bit memory "M0.0"...
Pulse Operated Switch 3.6 Pulse-operated switch Pulse-operated switch Now that you know the function of Bit Memory (M addresses), you will be able to understand the solution of the pulse-operated switch. Place a coil here for setting bit memory M0.0. The number under the coil indicates how many bits are to be set counting from the specified starting address.
Pulse Operated Switch 3.7 Solution Description and Test Solution Description and Test To summarize, the function of our now complete program is explained again below If I0.0 is operated (P edge detection) Q0.5 is "0" in the current cycle (upper branch is true on scanning with NC contact) then...
Pulse Operated Switch 3.8 Time to Show What You Know Time to Show What You Know You’ve made some real progress! Read and answer the questions below. • What is the scan cycle of a PLC? What are the three main functions of Section 1.6 the scan cycle? •...
Off Delay Timer Introduction If S1 is switched off, the fan continues to run for 3 seconds. Getting Started - Advanced Training Documents, 09/2007, A5E01469795B...
Page 32
Off Delay Timer 4.1 Introduction Procedure In the next pages, we will work through these steps together to implement the off-delay timer safely. 1. First, load the complete latching circuit from our first example from the hard disk. 2. Then, save the example under a new name on the hard disk.
Off Delay Timer 4.2 Save As... Save As... In STEP 7-Micro/WIN, load your project 2h_pr_01.mwp (latching circuit) from the hard disk. You stored it there in the first chapter. You can save the project under a new name. Save the project as described below under the new name 2h_pr_04.mwp.
Off Delay Timer 4.3 Solution Overview Solution Overview I0.0 activates Q0.0 When T37 has elapsed, the latch function is broken via this contact. Q0.0 maintains its state (latches) since it is also switched The motor stops. simultaneously in parallel with If T37 has not elapsed, the latch remains in I0.0.
Off Delay Timer 4.4 Solution - Enter the Program Solution - Enter the Program Enter the following program in Network 2: Getting Started - Advanced Training Documents, 09/2007, A5E01469795B...
Off Delay Timer 4.5 Solution Description Solution Description This is how our program functions. It has two active phases. Getting Started - Advanced Training Documents, 09/2007, A5E01469795B...
Page 37
Off Delay Timer 4.5 Solution Description Getting Started - Advanced Training Documents, 09/2007, A5E01469795B...
Off Delay Timer 4.6 Entering comments Entering comments You can use comments to document your program. You can add a network title by using a mouse click to select the network title field. Then, type in your title text . Use the View >...
Page 39
Off Delay Timer 4.6 Entering comments Use the View > Symbol Information Table If you already assigned symbol names and menu command or toggle ON symbol comments in the Symbol Table and you information tables with the toolbar button successfully compiled your program, then you can display the Symbol Information tables within the LAD editor.
Page 40
Off Delay Timer 4.6 Entering comments Printing comments Getting Started - Advanced Training Documents, 09/2007, A5E01469795B...
Off Delay Timer 4.7 Time to Show What You Know Time to Show What You Know Please read and answer the questions below. ● How can you implement an off-delay timer? Draw the ladder diagram for two possible solutions: Once with the normal coil —( ) and once with (S) and (R). ●...
Sequencer Introduction A drill motor is started in the clockwise direction with S1. After 3s, the feed is activated. When the depth limit at I0.3 is reached, the feed is deactivated. A spring returns the drill to the initial position. In doing so, the drive turns counter-clockwise (Q0.0 and Q0.1 are "1"). When the initial position I0.4 = "1"...
Sequencer 5.3 Sequencer control Sequencer control What is a sequencer control? ● A control method in which a task is broken down into very small, usually sequential, subtasks (such as Motor on, feed on, or feed off). ● The subtasks (functions) are called steps. ●...
Sequencer 5.4 Transition condition Transition condition What is a transition condition? ● Each step is started (activated) by a condition. The condition is usually derived from the states of the machine. These can include actuated limit switches, operator keys, temperatures reached or timers. ●...
Sequencer 5.5 Structure of the sequencer program Structure of the sequencer program The two program sections of a sequencer control 1. The conditions for Start S1 I0.1, activating the 3s delay, individual steps (sub- depth limit I0.3, tasks) are logically combined with the initial position individual step flags.
Sequencer 5.7 Working with memory bits Working with memory bits ● A separate memory bit (step flag) is assigned to each step. This is "1" if the step is active. ● For the sake of clarity, only one step in a sequencer should be active at any time. This means only one step flag should be "1".
Sequencer 5.8 Transition condition for the sequencer Transition condition for the sequencer The transition condition is in practice also made up of several contacts. Our example can be expanded in such a way that, for example, the start can only take place if the drill is in the initial position.
Sequencer 5.9 Advantages of working with sequencers Advantages of working with sequencers Separate sections for the step sequence control and the output control If an output is now to be active in step 7 in addition to step 2 and 3, the program only needs to be modified at one point.
Sequencer 5.10 Important safety considerations 5.10 Important safety considerations When "STOP" is operated or a motor protector is active, the first step flag (M0.0 in our example) need only be set for all drives to come to a stop. At the same time, all other step flags must be reset.
Sequencer 5.11 Making safe transitions 5.11 Making safe transitions Before assigning the first output, the program section for activating the initial position must be in place. This ensures that activation of the initial position has the highest priority. Program section 1 – Making transitions in the sequencer: Getting Started - Advanced Training Documents, 09/2007, A5E01469795B...
Sequencer 5.13 Solution description: Transitions 5.13 Solution description: Transitions Program section 1 - Making transitions in the sequencer Activating step 1 Step flag M0.1 is set when the sequencer is in the initial position (M0.0 = "1") AND I0.1 is operated. At the same time, M0.0, the step flag of the initial position, is reset.
Sequencer 5.14 Solution description: Activating the steps 5.14 Solution description: Activating the steps Activating step 4 Step flag M0.4 is set if the sequencer is at step 3 (M0.3 ="1") AND input I0.4 (initial position) becomes "1". At the same time, M0.3 is reset.
Sequencer 5.15 Solution description: Activating a timer 5.15 Solution description: Activating a timer Activating timer T37 If step 1 is active (M0.1 = "1"), timer T37 is started. Activating timer T38 If step 4 is active (M0.4 = "1"), timer T38 is started.
Sequencer 5.16 Solution description: Activating the outputs 5.16 Solution description: Activating the outputs Program section 2 - Setting the outputs Activate output Q0.0 (drive clockwise) Output Q0.0 is "1" in steps 1, 2, 3, 4, i.e. if M0.1 or M0.2 or M0.3 or M0.4 are "1". Activate output Q0.1(direction reversal) Output Q0.1 is "1"...
Sequencer 5.17 Test 5.17 Test You can enter the program yourself or load the file 2h_pr_05.mwp from the Programming Exercises CD. Please note that the stop switch I0.0 and the motor protection I0.5 are "normally-closed (NC) contacts". This has been implemented in this way for safety reasons. A broken wire between the switches and the PLC stops the machine! I0.5 and I0.0 must be "1"...
Page 60
Sequencer 5.17 Test Getting Started - Advanced Training Documents, 09/2007, A5E01469795B...
Learning More Do you Want to Learn More? Use the Help > S7-200 on the Web menu command to access Siemens S7-200 support on the Internet. You can find more examples in the "Samples" sub-directory in your STEP 7- Micro/WIN directory.
Page 62
Learning More 6.1 Do you Want to Learn More? Getting Started - Advanced Training Documents, 09/2007, A5E01469795B...
Appendix A Bridge Circuit If you are changing over from contactor technology to PLC technology you will probably encounter switch combinations that cannot be converted directly into ladder diagram representation. Included among these is the bridge circuit. Solutions are provided here both for the simple and the more complex bridge circuit.
Appendix A A.2 Diode Circuit Diode Circuit When diodes have been used in "old" circuit diagrams converting them into ladder diagram terms is not an altogether simple matter. Since diodes represent connection lines in principle but only conduct current in one direction, a similar solution is adopted here as with the bridge circuit.
Appendix A A.3 Changeover Switch Changeover Switch Changeover switches should likewise not cause you any problem when you are converting a circuit diagram into a ladder diagram. This transformation is explained below. The current paths are highlighted. Changeover switch b is then divided into a normally closed (NC) contact that is switched in series and contributes to the effect at output C, or a normally open (NO) contact that takes effect in parallel with a and switches D.