You are on page 1of 55

A Project Report on

STUDY OF PROGRAMMABLE LOGIC CONTROLLER (SIMATIC S7-200 IN PAPER MILL)


Submitted in partial fulfillment of the requirements For the award of the degree of

Bachelor of Technology In ELECTRONICS AND COMMUNICATION ENGINEERING Submitted by Under the esteemed guidance of Ms. M. NEELIMA
Head of the Department (E.C.E.)

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING KAKINADA INSTITUTE OF ENGINEERING AND TECHNOLOGY FOR WOMEN (Affiliated to JNTUK) KORANGI 533461 2011 2012

ACKNOWLEDGMENT
It is a great pleasure to express our sincere thanks to the management of ANDHRA PRADESH PAPER MILLS Pvt Ltd. for providing the required infrastructure and other facilities which contributed a lot in carrying this project. We would like to express our sincere thanks to the Principal Mr. Dr. A. Rajagopalarao for giving excellent support for successful completion of project. We express our deep sense of guidance and heartfelt thanks to our Head of the department, ECE Ms.M.Neelima for her constant encouragement, cheerful motivation and impartial suggestions at each stage of endeavor. We would like to express our unbounded gratefulness to our project guide, Mr. K. Chakravarthi of APPM for his valuable guidance throughout the project. We also express our gratitude to all the Training Members, and other Staff of ANDHRA PRADESH PAPER MILLS Pvt Ltd. for their support in making this project a successful one.

ABSTRACT
Visualization of a topic practically makes an ease of interest for fetching knowledge about and to feel that one we made a chance to study about SIMATIC S7-200 PLC at Andhra Pradesh Paper Mills, Rajahmundry which is very valued for its non-fluctuating and efficient control of operations of start, stop, speed increasing, speed decreasing of motors and paper tensioning. The functions such as load distribution and speed chain are achieved automatically by software so as to fully meet requirements of process and electrical control.

In order to produce high quality products, the paper machine needs a variety of requirements for the electrical drive system. They include Working speed of the paper machine should have high stability and its speed must be increased and decreased stably, speed difference must be controllable and the speed ratio shall be adjustable. Increased awareness for an optimally tuned control system has become very important for controlling these complex operations. SIEMENS Company manufactures a range of PLCs having applications in many areas including paper production. SIMATIC S7-200 is used in Paper mills. It offers innovative methods to quickly calibrate the machine control system, and provide analysis to make commissioning fast and performance predictable. The SIMATIC S7-200 Micro PLC is in a class by itself exceptionally compact yet remarkably capable especially with respect to its real-time performance it is fast, features great communication options, and comes with easy to operate hardware and software. This study project addresses the features of SIMATIC S7-200 PLC which offers its services to the paper machine electrical drive control system.

CONTENTS
List of figures About the Paper mill 1. Introduction 2. Programmable Logic controller 2.1 Characteristic functions of PLC 2.2 Basic PLC components 2.3 Basic operation of a PLC 2.4 PLC input and output devices 2.5 PLC Communications 2.6 Industrial Network communications 3. Description of SIMATIC S7-200 3.1 Open Communication 3.2 Powerful performance 3.3 Optimal modularity 3.4 Communication 3.5 Programming 3.6 High speed I/O 3.7 Display panels 3.8 Area of application 4. Operation of S7-200 4.1 Execution of tasks in a Scan cycle
6

01 02 04 05 06 08 09 10 11 12 13 14 14 15 16 17 18 19 20 20

4.2 Reading the Inputs 4.3 Executing the Program 4.4 Processing Any Communications Requests 4.5 Executing the CPU Self-test Diagnostics 4.6 Writing to the Digital Outputs 4.7 Accessing the Data of the S7-200 4.8 Accessing data in the Memory areas 4.9 Format of Real numbers 4.10 Format for Strings 4.11 Specifying a Constant value for S7-200 Instructions 4.12 Addressing the Local and Expansion I/O 4.13 Using Pointers for Indirect Addressing of the S7-200 Memory Areas 4.14 Understanding How the S7-200 Saves and Restores Data 4.15 Downloading and Uploading the Elements of Project 4.16 Saving the Retentive M Memory area on Power loss 4.17 Restoring Data after Power on 4.18 Storing Program on a Memory Cartridge 4.19 Copying Program to the Memory Cartridge 4.20 Restoring the Program from a Memory Cartridge 4.21 Selecting the Operating Mode for the S7-200 CPU 5. Features& Applications of SIMATIC S7-200 5.1 Features of SIMATIC S7-200
7

21 22 22 22 22 22 23 28 29 29 29 29 30 30 32 33 33 33 34 35 36 36

5.2 Highlights 5.3 Internal Features 5.4 Instruction Set 5.5 Typical application of S7-200 6. Conclusions 7. References

38 40 41 42 45 46

LIST OF FIGURES
2.1 2.2 Internal block diagram of PLC Operation of PLC system 8 8

3.1 3.2 3.3 4.1 4.2 4.3 4.4 4.6 4.5 4.7 4.8 4.9 4.10 4.11 4.12 4.13 4.14 4.15 4.16 4.17 4.18 5.1 5.2 5.3

SIMATIC S7-200 Parts of S7-200 CPU Text Display TD200 and 200c Control of Inputs and outputs S7-200 Scan Cycle Byte-bit addressing Comparing Byte, Word, and Double-Word Access to the Same Address Accessing the Counter Bit or the Current Value of a Counter Accessing the Timer Bit or the Current Value of a Timer Accessing Accumulator Format of a Real number Format for strings Creating and using a pointer Modifying a pointer Storage areas of the S7 200 CPU Downloading a project to S7-200 CPU Uploading a project from S7-200 Saving M memory on power loss Restoring Data after power on Copying to a Memory cartridge Restoring from Memory cartridge Structure Sketch System Principle Diagram System Block Diagram

12 12 18 20 21 23 23 25 25 26 28 29 30 30 31 31 32 32 33 34 34 42 43 43

LIST OF TABLES

4-1 4-2

Different sizes of Data Representation of constant values

22 29

10

ABOUT THE PAPER MILL


Andhra Pradesh Paper Mills Ltd. one of the leading producers of paper is located in Rajahmundry of East Godavari District. The Company was incorporated on 29th June 1964. The Certificate of Commencement of business was obtained on 10th July 1964. The Andhra Pradesh Paper Mills Ltd. was formed with infusion of funds and high caliber management of the well-known industrial house of Bangurs of Calcutta, who have interests in textile manufacturing, tea plantation, wind energy generation and trading and investment business other than paper. In 2001, Coastal Papers Ltd was taken over by the company. The production capacity of both the units put together is 1,74,000 TPA. There are eight paper machines installed at the two locations which produce papers of different M.F & M.G varieties in the range of 21 to 250 GSM as well as newsprint. With the commissioning of largest continuous digester in the country, the total bleached pulp production at APPM (Unit Rajahmundry) is 1,81,500 TPA.

11

1.INTRODUCTION
Paper has a long history, beginning with the ancient Egyptians and continuing to the present day. For thousands of years, hand-made methods dominated and then, during the 19th century, paper production became industrialised. Originally intended purely for writing and printing purposes, a wide variety of paper grades and uses are now available to the consumer. In the course of the rapid expansion of trade in the late Middle Ages, more and more merchants dealt in the commodity called paper that was growing in importance for public and intellectual life. The history of the paper industry in the 19th and 20th centuries can be broken down into five partly overlapping periods, each marked by definite trends. In the first stage (from about 1800 to 1860), all work sequences previously performed by hand were mechanised. This included the rag preparation, the use of fillers, pulp beating, the paper machine with its various parts, and the machines required for finishing the paper (the headbox, wire section, press section, dryer section, units for reeling, smoothing and packing. During the second stage (about 1840 to 1880), efforts were made to obtain rag substitutes on an industrial scale (groundwood pulp and chemical pulp) and appropriate industrial plants (groundwood and chemical pulp mills) were developed. The third stage (1860 to 1950) was marked by the enlargement of the web width, an increase in working speeds, the introduction of electric drive and further improvements to various machine parts. Machines designed specifically for the production of particular paper and board grades (for example the Yankee cylinder and multi-cylinder machines) were also developed. The web working width grew from 85 cm (1830) to 770 cm (1930), while production speeds rose from 5 m/min. (1820) to over 500 m/min. (1930). The fourth stage (1950 to 1980), which was still dependent on the old methods as far as the mechanics were concerned, brought unprecedented changes in papermaking. Alongside further increases in web width and working speeds, there was the use of new materials (thermo-mechanical pulp, deinked recovered paper, new fillers, processed chemicals and dyes), new sheet forming options (e.g. by twin-wire formers), neutral sizing, greater stress on ecology (closed loops) and, most of all, automation. The operational impact of these changes was: specialisation in certain paper types; development of new paper grades (LWC - lightweight coated paper); corporate mergers; company groups with their own raw material supply and trading organisations; closure of unprofitable operations. The fifth stage leads into the future. The evolution of new sheet-forming principles (with fluid boundaries between paper and non-woven fabrics) and chemical pulp processes have been the main process improvements. However, the situation on the global market (increased demand, above all in the Third World, trends in chemical pulp prices, problems of location), are again raising capital intensity and encouraging the formation of big company groups with international operations. At the same time there are definite opportunities for smaller, local firms satisfying specific needs.

12

The new Millennium will be dominated by the tremendous progress that has been made in computer science, thus triggering a complete change in our commercial and private communication and information behavior. APPM has adopted the Sulphate (Kraft) Process for Pulping. Major raw materials are Casuarina and Subabul. These raw materials are chipped in drum type of chippers in a fixed proportion and the chips are screened to get the required size (5mm - 35mm). The dust generated is fed to a Bio-Gas plant to generate producer gas. This producer gas is used in Lime kilns to replace Furnace oil. The fiberline has been supplied by M/s ANDRITZ OY, FINLAND with a continuous digester and an ECF bleaching sequence. Steps involved in paper manufacturing include:

Cooking process Brown Stock washing Oxygen Delignification ECF Bleaching Pulp bleaching Stock Preparation Converting Soda recovery and causticizing

Power generation for APPM APPM has installed a 34 MW Double Extraction Condensing type turbine to meet its power requirements. Initially, the turbine is supplied with steam generated from the Recovery boiler to produce 18-20 MW of power. Once the power the Boiler comes into operation, the TG will generate power to its full capacity.

2. PROGRAMMABLE LOGIC CONTROLLER


13

A programmable logic controller (PLC) or programmable controller is a digital computer used for automation of industrial processes, such as control of machinery on factory assembly lines. Unlike generalpurpose computers, the PLC is designed for multiple inputs and output arrangements, extended temperature ranges, immunity to electrical noise and resistance to vibration and impact. Programs to control machine operation are typically stored in battery-backed or non-volatile memory. A PLC is an example of a real time system since output results must be produced in response to input conditions within a bounded time, otherwise unintended operation will result Many of the earliest PLCs expressed all decision making logic in simple ladder logic which appeared similar to electrical schematic diagrams. The electricians were quite able to trace out circuit problems with schematic diagrams using ladder logic. This program notation was chosen to reduce training demands for the existing technicians. Other early PLCs used a form of instruction list programming, based on a stack-based logic solver. The functionality of the PLC has evolved over the years to include sequential relay control, motion control, process control, distributed control systems and networking. The data handling, storage, processing power and communication capabilities of some modern PLCs are approximately equivalent to desktop computers. PLC-like programming combined with remote I/O hardware, allow a general-purpose desktop computer to overlap some PLCs in certain applications. Disadvantages of Relays: Relay were susceptible to mechanical failure, They require large amount of energy to operate and They generate large amount of electrical noise.

Extreme care had to be taken to design a relay based control system because it was not uncommon for the output to chatter i.e. turn ON & OFF when they changed states rapidly. Logics of circuits were dictated by the wiring of contacts and coil and in order to make changes more time was required to rewrite the logics than had been needed while installing first time. A PLC has many "input" terminals, through which it interprets "high" and "low" logical states from sensors and switches. It also has many output terminals, through which it outputs "high" and "low" signals to power lights, solenoids, contactors, small motors, and other devices lending themselves to on/off control. In an effort to make PLCs easy to program, their programming language was designed to resemble ladder logic diagrams. Thus, an industrial electrician or electrical engineer accustomed to reading ladder logic schematics would feel comfortable programming a PLC to perform the same control functions.

ADVANTAGES OF PLC OVER RELAY BASED 1. Enhanced Reliability.


14

2. Ease in logic modification. 3. Interactive operator interface. 4. Online repair facility. 5. I/O forcing through Software. 6. Online monitoring of user logics. 7. Finalization of control logic and fabrication of PLC can be done simultaneously. 8. Capability of self-diagnostics to find failure in the equipment. 9. Flexibility while setting and changing the logic during commissioning and operation. 10. Reliable components make these likely to operate for years before failure. 11. Trouble shooting aids make programming easier and reduce downtime. 12. Computational abilities allow more sophisticated control.

2.1 CHARACTERISTIC FUNCTIONS OF PLC


A PLC is currently defined as a digital device that uses a programmable memory to store instructions and to implement specific functions such as logic sequences, timing, counting and arithmetic are to control machines processes. The important characteristics of a PLC are:

It is field programmable by the user. This characteristic allows the user to write and change programs in the field without rewiring or sending the unit back to manufacture for this purpose. It contains programmable functions. PLCs contain logics, timing, counting and memory function that the user can access through some type of control oriented programming language. It allows the control engineer to determine precisely how the machine or process will respond to the program. It provides error checking and diagnostics. A PLC will periodically run doing what its memory processor and I/O system to ensure that what it is doing and what it programmed to do. It can be monitored by an external device that can display program execution states. A PLC is designed to withstand temperature, humidity, vibration and noise in the most factory environment. It has general purpose to suitability. Generally a PLC is not designed for a specific application, but it can handle a wide variety of control tasks efficiently.

2.2 Basic PLC components:


Programmable controllers have grown throughout industrial control applications because of the ease they bring to creating a controller, ease of programming, ease of wiring, ease of installation, and ease of changing. PLCs span a wide range of sizes, but all contain six basic components:

15

Processor or central processing unit (C PU) Rack or mounting Input assembly Output assembly Power supply Programming unit, device, or PC/software

2.2.1Power Supply The power supply provides power for the PLC system. The power supply provides internal DC current to operate the processor logic circuitry and input/output assemblies. Common power levels used are 24V DC or 120 VAC. The basic function of power supply is to convert field power into a form more suitable for electronic devices that comprise the PLCs. Power supply is one of the most important and critical components of a PLC for two reasons: It is typically non redundant. Hence failure of PLC power supply can cause the entire control system to fail. It will contain high voltage component, hence isolation can create a potential serious injury or fire. 2.2.2 Processor (CPU) The processor, central processing unit, or CPU is the "brain" of the PLC. The size and type of CPU will determine things like: the programming functions available, size of the application logic available, amount of memory available, and processing speed. Understanding the CPU can be a complex subject and we will tackle that in other articles. In present day PLCs, this unit is a microprocessor-based system. The construction of CPU will determine the flexibility of the PLC i.e., whether or not the PLC can be expanded and modified for the future enhancement as well as the overall speed is expressed in term of how fast the PLC will scan a given among of memory. This measure is called as scan rate, typically expressed in milliseconds per thousand words of memory. 2.2.3 Input/ Output Assembly Inputs carry signals from the process into the controller; they can be input switches, pressure sensors, operator inputs, etc. These are like the senses and sensors of the PLC. Outputs are the devices that the PLC uses to send changes out to the world. These are the actuator the PLC can change to adjust or control the process - motors, lights, relays, pumps, etc. Many types of inputs and outputs can be connected to a PLC, and they can all be divided into two large groups - analog and digital. Digital inputs and outputs are those that operate due to a discrete or binary change - on/off, yes/no. Analog inputs and outputs change continuously over a variable range - pressure, temperature, and potentiometer. 2.2.4 Programming Device The PLC is programmed using a specialty programmer or software on a computer that can load and change the logic inside. Most modern PLCs are programmed using software on a PC or laptop computer.
16

Older systems used a custom programming device which has their own memory. Memory of a PLC can be of two types namely: 1. VOLATILE 2. NON-VOLATILE Volatile memory loses its contents when power supply is turned OFF, whereas non-volatile does not. PLC will use non-volatile memory from a majority of users memory because the program must be retained during the power down cycle. It is imported that all non-volatile memory in a PLC uses some of the error checking to ensure that the memory has not changed. The other memories used in PLCs are: 2.2.4.1 BATTERY BACK UP CMOS RAM This is probably the most widely used type of memory. Although all Random Access Memories (RAMs) are inherently volatile, the Complementary Metal Oxide Semiconductor (CMOS) variety consumes so less power that a small battery can retain the memory during the power losses. 2.2.4.2 EPROM MEMORY An Electrically Programmable Read Only Memory (EPROM) is programmable using electrical pulses. This can be erased by exposing the circuit to ultraviolet. 2.2.4.3 EEPROM MEMORY Stands for Electrically Erasable Programmable Read Only Memory. It is same as EPROM with an exception that its contents can be erased using electric pulses. Hence it introduces the facility that process of erasing can be restricted to the requisite place only and also the time consumed in this process is also to a very large extent.

The internal block diagram of a OLC is as shown in the fig. below

17

Fig 2.1 Internal Block diagram of a PLC The control engineer enters the control program on a program loader. The program loader writes this into the memory of the processor. The logics solver read the states of the sensors through the input modules, then uses this information to solve the logics stored in the user memory (program) and also writes the resulting output states to the output devices through the output module.

2.3 Basic Operation of a PLC system

Figure: 2.2 Operation of A PLC System The operation of the PLC system is simple and straightforward. The Process or CPU completes three processes: (1) Scans, or reads, from the input devices
18

(2) Executes or "solves" the program logic, and (3) Updates, or writes, to the output devices. 2.3.1 PLC Program For the PLC to be useful, it must first have a Program or Logic for the CPU to execute. A system engineer or PLC programmer will first create the program logic in a programming device (these days it is usually software running on a personal computer). This logic can be written in Ladder Logic, Instruction List, Sequential Function Charts, or any of the IEC languages. The programmer will then download the program to the PLC. This is usually done by temporarily connecting the programmer to the PLC. Once the program is installed or downloaded to the CPU - it is usually not necessary for the PC to remain connected. 2.3.2 Basic Scan Once the program is in the CPU - the PLC is then set to "run", and the PLC executes the application program repeatedly. In addition to executing the program, the CPU regularly reads the status of the input devices, and sends data to the output devices. The Input system senses the status of the real world inputs (a switch, a level, etc.), translates them to values that can be used by the CPU, and writes those values to the Input table. The application program is executed, and writes values to the Output table. The Output system then converts the output value to a real world change (motor turns on, valve opens, etc.) The CPU continuously Reads Inputs, Solves Logic, and Writes to the outputs (there are other tasks the CPU does - which will be discussed later). It is important to understand the scan because it may dictate how a programmer structures logic. This process of reading inputs, executing logic, and writing outputs is called the PLC Scan or Sweep. 2.3.3 Memory The control program or application program is stored in memory. As the PLC executes logic, it may also read and store values to memory. The values may also be used and referenced by the application program.

2.4 PLC Input and Output Devices


The term I/O refers to Input/ Output. I/O is information representing the data that is received from sensing devices and the commands that are sent to actuating and indicating devices. The I/O System is the collection of physical elements of the control system that either provide or use I/O data. There are two major types of I/O: Digital - binary devices which must be in one of only two states: on or off. Analog - continues devices - sense and respond to a range of values.

2.4.1 Digital IO
19

Digital input devices may be either on or off; they may not hold any other values. For example, digital position sensors do not sense how close an object is, they only tell if the object is within a range of positions. Common digital field input devices include pushbuttons, limit switches, and photoeyes. Common digital output devices include relays, motor starters, and solenoid valves. 2.4.2 Analog IO Analog input devices sense continuous parameters. The information that they provide is given as a continuous range of values, not just an on or off indicator. Common analog inputs are pressure, temperature, speed, etc. Analog output devices respond to a range of output values from the controller. Common analog output signals include motor speed, valve position, air pressure, etc. I/O modules connect "real world" field devices to the controller. They convert the electrical signals used in the field devices into electronic signals that can be used by the control system, and translate real world values to IO table values. I/O modules communicate with PLC CPU in one of three ways: 1. Backplane - The I/O modules can be located in the same rack or station. Communications then takes place within the rack or across the backplane. 2. Backplane extension - backplane extension modules allow I/O modules to be located in racks or stations which are separated from the controller. 3. Device network - modules can communicate with a controller over a network. Industrial networks are used to interconnect field level devices with controllers. Common IO networks are FieldBus, Profibus, and DeviceNet. 2.4.3 "Point Count" and the Size of the PLC System The number of I/O devices used within a control system is called its point count. Analog device data requires significantly more manipulation and processing than digital device data. Digital and analog point counts are typically considered separately. The total number of digital and analog points is used to give an indication of the size of a control system.

2.5 PLC Communications


To control a machine or process, many times multiple controllers or intelligent devices must work together to accomplish the task. In order to work together, these devices must communicate. In order to program a PLC, communications must take place - because the Programming device (computer) must communicate with the PLC CPU in order to transfer the configuration and control logic before the PLC can even begin to run. For these reasons, it is important for anyone in automation to have a basic understanding of PLC communications. 2.5.1 Types of Communications There are three basic levels/categories of communications that we are usually concerned with in industrial control: serial communications, industrial communications networks, and industrial I/O networks. The
20

most basic form of communication is a direct, one way, connection between two devices where data is transmitted one bit at a time. We call this serial communication.

2.6 Industrial Network Communications


An Industrial Network is a system of electronic devices that are connected in order to share information. The network can consist of PLC Controllers, I/O Devices, Operator Interfaces, HMI/SCADA computers, and many other elements. Each element is uniquely addressable - giving each component (controllers, I/O devices, Operator interfaces, etc) a unique name or label. Industrial networks provide bidirectional, real-time, (sometimes deterministic) communication. Each element has specific electronic components to allow the transfer of data between the elements, on a shared media, and according to a protocol. 2.6.1 Industrial Network Protocols Network protocols establish the rules that must be followed for two or more devices to share data. They describe ho w devices establish and maintain communications. Examples of network communication protocols include Device Net, Profibus-DP, and Ethernet. 2.6.2 Deterministic Network Many industrial networks are deterministic. If a network is deterministic, it means that communication occurs within a predetermined time span. Industrial networks value determinism because many control systems require predictable, real-time response to data. In APPM as for paper, plastic film, composite material production line for packaging materials are more widely used, including materials and accurate transmission is particularly critical, especially in multimotor synchronous operation control of transmission, the drive motor is accelerated or spin-down process required to multi-drive motor synchronized in time. In this paper mill, SIMATIC S7-200 PLC is used for Bag machine synchronization.

3. DESCRIPTION OF SIMATIC S-7200


The S7-200 series is a line of micro-programmable logic controllers (Micro PLCs) that can control a variety of automation applications. Compact design, low cost, and a powerful instruction set make the S7-200 a perfect solution for controlling small applications. The wide variety of S7-200 models and the Windows-based programming tool gives the flexibility needed to solve automation problems. But theres more, the Micro PLC SIMATIC S7-200 has a compact modular design for customized solutions which arent too large, but flexible enough to be expanded anytime in the future. All this makes the SIMATIC S7-200 a great
21

choice for open-loop control in the lower performance range.

Fig. 3.1 SIMATIC S7-200 The S7-200 has been proven worldwide in applications covering all sectors as a result of its wide range of exceptional features: The S7-200 CPU combines a microprocessor, an integrated power supply, input circuits, and output circuits in a compact housing to create a powerful Micro PLC. See Figure

Fig 3.2 Parts of S7-200 CPU Following are the different types of S7-200 CPUs: CPU 221: Compact CPU for simple automation tasks - The best compact device if you want to change to an effective solution that performs simple automation tasks very economically. Also available with an extended temperature range. CPU 222: Expandable compact CPU for more complex tasks - The capable, compact package for more complex machines and small system solutions.

22

CPU 224: CPU for higher communication and computing requirements - The high-performance CPU for complex tasks that require speed and special communication capabilities. CPU 224XP: CPU for simple drive tasks - The CPU 224 version for convenient implementation of simple drive tasks with two interfaces, two analog inputs and one analog output, as well as two 100-kHz pulse outputs and two high-speed 200-kHz counters. CPU 226: High-performance CPU for larger technical tasks. The versatile high-performance CPU for complex automation tasks with expanded inputs and outputs as well as two RS485 interfaces.

SIMATIC S7-200 delivers consistently economical solutions. The entire system family features Powerful performance, Optimum modularity and Open communications. In addition, the SIMATIC S7-200 programming tools make job even easier. This Micro PLC is easy to program allowing fast and easy realization of applications and the add-on software libraries accelerate special function configuration even more. This Micro PLC has been in successful use in millions of applications around the world in both stand-alone and networked solutions.

3.1 Open communication


Built-in RS 485 interface with data transmission rates up to 187.5 kbit/s PPI protocol system bus for trouble-free networking Freeport mode programmable for user- specific protocols for any peripheral devices Fast connection to PROFIBUS using the slave module Powerful connection to AS-Interface using the master module Communications anywhere using the modem module (for remote maintenance, teleservice or telecontrol) Connection to Industrial Ethernet via the Ethernet module Internet connectivity, e-mail, HTTP, and FTP server functionality using the Internet module S7-200 PC Access OPC Server for simple connection to the PC environment

3.2 Powerful performance


Small and compact ideal for any applications where space is tight
23

Basic and advanced functionality in all CPU models Large program and data memory Outstanding real-time response being in total command of the entire process at any time means increased quality, efficiency and safety Easy-to-use STEP 7-Micro/WIN engineering software ideal for both beginners and experts

3.3 Optimal modularity


Systems engineering 5 distinct CPUs in the performance range with comprehensive basic functionality and integrated Freeport communications interface A wide range of expansion modules for various functions: Digital/analog expansions, scalable to specific requirements PROFIBUS communication as a slave AS-Interface communication as a master Exact temperature measurement Positioning Remote diagnostics Ethernet/Internet communications SIWAREX MS weighing module HMI functions STEP 7-Micro/WIN software with Micro/WIN add-on instruction library Compelling systems engineering now featuring precise dimensioning and optimum solutions for a wide range of different requirements for the complete automation task

3.4 Communication
The communications possibilities of the Micro PLC SIMATIC S7-200 are unique: The built-in RS 485 interfaces can operate at data transmission rates up to 187.5 kbit/s functioning as follows: As a system bus with a maximum of 126 stations. In this capacity, it is possible to network programming devices, SIMATIC HMI products and SIMATIC CPUs without a problem. The integrated PPI protocol is used

24

for pure S7-200 networks supporting multiple masters from a single port. In a network consisting of other Siemens components (SIMATIC S7-300/400 and SIMATIC HMI, etc.), the S7-200 CPUs are integrated as MPI slaves. In Freeport mode (up to max. 115.2 kbaud) with user-specific protocols (e.g. ASCII protocol). This means the SIMATIC S7-200 is open for any connected device; for example, it enables connection of a modem, bar-code scanner, PC, non-Siemens PLC and much more. By means of the USS protocol for drives, as many as 32 Siemens frequency converters can be controlled without additional hardware. The Modbus RTU Library included in the package also enables connection to a Modbus RTU network as a Master or a Slave. 3.4.1 OPC Driver with PC Access PC Access is the ideal basis for data exchange between S7-200 and a connected PC regardless of the communication link selected (PPI, modem, Ethernet/ITCP). As an OPC Server, PC Access offers you the option of writing or reading S7-200 data with Microsoft Excel, or any other OPC client application. As an OPC Client, it can be used for ProTool Pro, WinCC flexible RT, Win CC, etc. With capability up to 8 connections, the configuration, programming and monitoring can be implemented from a central location, saving both time and money. The Internet Technology module CP 243-1 IT also offers you fast access by permitting a simple universal connection of the PLC to different computers by means of FTP, HTTP, JAVA, and e-mail. The Ethernet module CP 243-1 allows you to access S7-200 process data quickly over Ethernet for archiving or further processing. The configuration support from STEP 7-Micro/WIN ensures simple commissioning and convenient diagnostic options.

3.4.2 Modem communications The S7-200 CPUs can be accessed nearly anywhere in the world by modem via wired network or radio. Teleservice: The modem communication option is useful for avoiding expensive service calls. Two modems are all you need for remote use of the complete range of functions such as program transfer, status or control. The communications tools are integrated as a standard feature. External modems can be used as local modems. Telecontrol: We can call up messages and measured values via modem as well as define new setpoints or commands. In this case, one base station S7-200 can control a nearly unlimited number of remote stations. The protocols for data transmission are freely selectable, e.g. for text messages directly to a cell phone, error messages to a fax machine or Modbus RTU.

25

3.4.3 Speedy PROFIBUS connection All CPUs from 222 upwards can be run via the EM 277 communications module as a norm slave on a PROFIBUS DP network with a transmission rate of up to 12 Mbit/s. This open feature of the S7-200 to higher level PROFIBUS DP control levels ensures you can integrate individual machines into your production line. With the EM 277 expansion module, you can implement PROFIBUS capability of individual machines equipped with S7-200. 3.4.4 Powerful AS-Interface connection The CP 243-2 turns all CPUs from 222 upwards into powerful masters on the AS-Interface network. According to the new AS-Interface specification V 2.1, you can connect up to 62 stations, making even analog sensors easy to integrate. With AS-Interface, you can connect up to 248 DIs + 186 DOs in the maximum configuration. The maximum number of 62 stations can include up to 31 analog modules. The configuration of the slaves and reading/writing of data is supported by the handy AS-Interface Wizard.

3.5 Programming
The STEP 7-Micro/WIN programming software features time-saving and powerful tools and that means great cost savings in your day-to-day work. Operation of the programming software is the same as standard Windows applications. Micro/WIN contains all the necessary tools for programming the entire S7-200 range of controllers. Using the SIMATIC instruction set we can program in accordance with IEC 1131. A host of functions such as Trend Charts and wizards now make programming even easier. And STEP 7-Micro/WIN 4.0 has even more to offer: e.g. segmented data memories, improved handling of the program and command structure or diagnostic functions such as a user-specific LED configuration error history, and runtime edit and online download. Programming in the standard editors LAD, FBD and STL and its easy to change between them. 3.5.1 STEP 7- -Micro/WIN Programming Package The STEP 7--Micro/WIN programming package provides a user-friendly environment to develop, edit, and monitor the logic needed to control the application. STEP 7- -Micro/WIN provides three program editors for convenience and efficiency in developing the control program for our application. 3.5.2 Computer Requirements STEP 7--Micro/WIN runs on either a personal computer or a Siemens programming device, such as a PG 760. Computer or programming device should meet the following minimum requirements: - Operating system: Windows 95, Windows 98, Windows 2000, Windows Me (Millennium Edition), Windows NT 4.0 (or later version), Windows XP Professional - At least 100M bytes of free hard disk space - Mouse (recommended)
26

3.6 High-speed I/O


3.6.1 High-Speed Counters The S7-200 provides integrated high-speed counter functions that count high speed external events without degrading the performance of the S7-200. Each counter has dedicated inputs for clocks, direction control, reset, and start, where these functions are supported. We can select different quadrature modes for varying the counting rate. 3.6.2 High-Speed Pulse Output The S7-200 supports high-speed pulse outputs, with outputs Q0.0 and Q0.1 generating either a high-speed pulse train output (PTO) or pulse width modulation (PWM). The PTO function provides a square wave (50% duty cycle) output for a specified number of pulses (from 1 to 4,294,967,295 pulses) and a specified cycle time (in either microsecond or millisecond increments either from 50 s to 65,535 s or from 2 ms to 65,535 ms). We can program the PTO function to produce either one train of pulses or a pulse profile consisting of multiple trains of pulses. For example, we can use a pulse profile to control a stepper motor through a simple ramp up, run, and ramp down sequence or more complicated sequences. The pulse profile can consist of up to 255 segments with a segment corresponding to the ramp up or run or ramp down operation. The PWM function provides a fixed cycle time with a variable duty cycle output, with the cycle time and the pulse width specified in either microsecond or millisecond increments. The cycle time has a range either from 50 s to 65,535 s or from 2 ms to 65,535 ms. The pulse width time has a range either from 0 s to 65,535 s or from 0 ms to 65,535 ms. When the pulse width is equal to the cycle time, the duty cycle is 100 percent and the output is turned on continuously. When the pulse width is zero, the duty cycle is 0 percent and the output is turned off.

3.7 Display Panels


TD 200 Text Display Unit is a 2-line, 20-character, text display device that can be connected to the S7-200. Using the TD 200 wizard, we can easily program S7-200 to display text messages and other data pertaining to application. The TD 200 provides a low cost interface to application by allowing us to view, monitor, and change the process variables pertaining to application

Fig 3.3Text display TD200 and 200c


27

Backlit high-contrast LCD screen, 2-line Up to 80 text messages with integrated variables Configuration is saved on the S7-200: intervention in the control program is possible via input of set-points Setting of inputs and outputs (password protection of all functions) 5 online languages Simplified Asian and Cyrillic fonts Extras for TD 200 8 user-configurable function keys in fixed arrangement Extras for TD 200C Up to 20 user-configurable keys User-defined display layout Representation, position and size of the keys can be configured as desired

3.8 Area of application


The fields of application of the SIMATIC S7-200 extend from replacement of relays and contactors up to more complex automation tasks in stand-alone mode, in networks, and within distributed configurations. The S7-200 also increasingly provides access to areas in which special electronics was previously developed for economic reasons. In addition to the comprehensive basic functionality of the five different CPUs, the modular system technology of the SIMATIC S7-200 offers a wide range of scalable and specific expansion modules for an extremely high range of functionalities in accordance with requirements.

28

4. OPERATION OF S7-200
The S7-200 continuously cycles through the control logic in program, reading and writing data. The S7-200 Relates Program to the Physical Inputs and Outputs The basic operation of the S7-200 is very simple: - The S7-200 reads the status of the inputs. - The program that is stored in the S7-200 uses these inputs to evaluate the control logic. As the program runs, the S7-200 updates the data. - The S7-200 writes the data to the outputs Figure 4.1 shows a simple diagram of how an electrical relay diagram relates to the S7-200. In this example, the Input state of the switch for starting the motor is combined with Start / Stop Switch the states of other inputs. The calculations of these states then determine the state for the output that goes to the then determine the state for the output that goes to the actuator which starts the motor.

29

Fig 4.1 Control of Inputs and outputs

4.1 Execution of Tasks in a Scan cycle


The S7-200 executes a series of tasks repetitively. This cyclical execution of tasks is called the scan cycle. As shown in Figure 4-2, the S7-200 performs most or all of the following tasks during a scan cycle: - Reading the inputs: The S7-200 copies the state of the physical inputs to the process-image input register - Executing the control logic in the program: The S7-200 executes the instructions of the program and stores the values in the various memory areas. - Processing any communications requests: The S7-200 performs any tasks required for communications. - Executing the CPU self-test diagnostics: The S7-200 ensures that the firmware, the program memory, and any expansion modules are working properly. - Writing to the outputs: The values stored in the process-image output register are written to the process image output register are written to the physical outputs.

30

Figure 4.2 S7-200 Scan Cycle The execution of the scan cycle is dependent upon whether the S7-200 is in STOP mode or in RUN mode. In RUN mode, program is executed; in STOP mode, program is not executed.

4.2 Reading the Inputs


Digital inputs: Each scan cycle begins by reading the current value of the digital inputs and then writing these values to the process-image input register. Analog inputs: The S7-200 does not update analog inputs as part of the normal scan cycle unless filtering of analog inputs is enabled. An analog filter is provided to allow you to have a more stable signal. We can enable the analog filter for each analog input point. When analog input filtering is enabled for an analog input, the S7-200 updates that analog input once per scan cycle, performs the filtering function, and stores the filtered value internally. The filtered value is then supplied each time program accesses the analog input. When analog filtering is not enabled, the S7-200 reads the value of the analog input from the physical module each time program accesses the analog input.

4.3 Executing the Program


During the execution phase of the scan cycle, the S7-200 executes your program, starting with the first instruction and proceeding to the end instruction. The immediate I/O instructions give immediate access to inputs and outputs during the execution of either the program or an interrupt routine. If we use interrupts in our program, the interrupt routines that are associated with the interrupt events are stored as part of the program. The interrupt routines are not executed as part of the normal scan cycle, but are executed when the interrupt event occurs (which could be at any point in the scan cycle).

4.4 Processing Any Communications Requests


31

During the message-processing phase of the scan cycle, the S7-200 processes any messages that were received from the communications port or intelligent I/O modules.

4.5 Executing the CPU Self-test Diagnostics


During this phase of the scan cycle, the S7-200 checks for proper operation of the CPU, for memory areas, and for the status of any expansion modules.

4.6 Writing to the Digital Outputs


At the end of every scan cycle, the S7-200 writes the values stored in the process-image output register to the digital outputs. (Analog outputs are updated immediately, independently from the scan cycle.)

4.7 Accessing the Data of the S7-200


The S7-200 stores information in different memory locations that have unique addresses. We can explicitly identify the memory address that we want to access. This allows our program to have direct access to the information. Table 4-1 shows the range of integer values that can be represented by the different sizes of data.

Table 4-1 Different sizes of Data To access a bit in a memory area, we specify the address, which includes the memory area identifier, the byte address, and the bit number. Figure 4.3 shows an example of accessing a bit (which is also called byte.bit addressing). In this example, the memory area and byte address (I = input, and 3 = byte 3) are followed by a period (.) to separate the bit address (bit 4).

Fig 4.3 Byte-bit addressing We can access data in most memory areas (V, I, Q, M, S, L, and SM) as bytes, words, or double words by using the byte-address format. To access a byte, word, or double word of data in the memory, we must
32

specify the address in a way similar to specifying the address for a bit. This includes an area identifier, data size designation, and the starting byte address of the byte, word, or double-word value, as shown in Figure 4-4. Data in other memory areas (such as T, C, HC, and the accumulators) are accessed by using an address format that includes an area identifier and a device number.

Fig 4.4 Comparing Byte, Word, and Double-Word Access to the Same Address

4.8 Accessing Data in the Memory Areas


4.8.1 Process-Image Input Register: I

The S7-200 samples the physical input points at the beginning of each scan cycle and writes these values to the process-image input register. We can access the process-image input register in bits, bytes, words, or double words: Bit: I[byte address].[bit address] I0.1 IB4

Byte, Word, or Double Word: I[size][starting byte address]

4.8.2 Process-Image Output Register: Q At the end of the scan cycle, the S7-200 copies the values stored in the process-image output register to the physical output points. We can access the process-image output register in bits, bytes, words, or double words: Bit: Q[byte address].[bit address] Q1.1 QB5

Byte, Word, or Double Word: Q[size][starting byte address] 4.8.3 Variable Memory Area: V

We can use V memory to store intermediate results of operations being performed by the control logic in the program. We can also use V memory to store other data pertaining to the process or task. We can access the V memory area in bits, bytes, words, or double words:

33

Bit:

V[byte address].[bit address]

V10.2 VW100

Byte, Word, or Double Word: V[size][starting byte address] 4.8.4 Bit Memory Area: M

We can use the bit memory area (M memory) as control relays to store the intermediate status of an operation or other control information. We can access the bit memory area in bits, bytes, words, or double words. Bit: M[byte address].[bit address] M26.7 MD20

Byte, Word, or Double Word: M[size][starting byte address] 4.8.5 Timer Memory Area: T

The S7-200 provides timers that count increments of time in resolutions (time-base increments) of 1 ms, 10 ms, or 100 ms. Two variables are associated with a timer: - Current value: this 16-bit signed integer stores the amount of time counted by the timer. - Timer bit: this bit is set or cleared as a result of comparing the current and the preset value. The preset value is entered as part of the timer instruction. We access both of these variables by using the timer address (T + timer number). Access to either the timer bit or the current value is dependent on the instruction used: instructions with bit operands access the timer bit, while instructions with word operands access the current value. As shown in Figure 4-5, the Normally Open Contact instruction accesses the timer bit, while the Move Word instruction accesses the current value of the timer. Format: T[timer number] T24

Fig 4.5 Accessing the Timer Bit or the Current Value of a Timer 4.8.6 Counter Memory Area: C The S7-200 provides three types of counters that count each low-to-high transition event on the counter input(s): one type counts up only, one type counts down only, and one type counts both up and down. Two variables are associated with a counter: - Current value: this 16-bit signed integer stores the accumulated count.

34

- Counter bit: this bit is set or cleared as a result of comparing the current and the preset value. The preset value is entered as part of the counter instruction. We access both of these variables by using the counter address (C + counter number). Access to either the counter bit or the current value is dependent on the instruction used: instructions with bit operands access the counter bit, while instructions with word operands access the current value. As shown in Figure 4-6, the Normally Open Contact instruction accesses the counter bit, while the Move Word instruction accesses the current value of the counter. Format: C[counter number] C24

Fig 4.6 Accessing the Counter Bit or the Current Value of a Counter 4.8.7 High-Speed Counters: HC The high-speed counters count high-speed events independent of the CPU scan. High-speed counters have a signed, 32-bit integer counting value (or current value). To access the count value for the highspeed counter, we specify the address of the high-speed counter, using the memory type (HC) and the counter number (such as HC0). The current value of the high-speed counter is a read-only value and can be addressed only as a double word (32 bits). Format: 4.8.8 Accumulators: AC The accumulators are read/write devices that can be used like memory. For example, we can use accumulators to pass parameters to and from subroutines and to store intermediate values used in a calculation. The S7-200 provides four 32-bit accumulators (AC0, AC1, AC2, and AC3). We can access the data in the accumulators as bytes, words, or double words. The size of the data being accessed is determined by the instruction that is used to access the accumulator. As shown in Figure 4-7, we use the least significant 8 or 16 bits of the value that is stored in the accumulator to access the accumulator as bytes or words. To access the accumulator as a double word, we use all 32 bits. Format: AC[accumulator number] AC0 HC[high- -speed counter number] HC1

35

Fig 4.7 Accessing Accumulator 4.8.9 Special Memory: SM The SM bits provide a means for communicating information between the CPU and our program. We can use these bits to select and control some of the special functions of the S7-200 CPU, such as: a bit that turns on for the first scan cycle, a bit that toggles at a fixed rate, or a bit that shows the status of math or operational instructions. We can access the SM bits as bits, bytes, words, or double words: Bit: SM[byte address].[bit address] SM0.1 SMB86

Byte, Word, or Double Word: SM[size][starting byte address]

4.8.10 Local Memory Area: L The S7-200 provides 64 bytes of local memory of which 60 can be used as scratchpad memory or for passing formal parameters to subroutines. Local memory is similar to V memory with one major exception. V memory has a global scope while L memory has a local scope. The term global scope means that the same memory location can be accessed from any program entity (main program, subroutines, or interrupt routines). The term local scope means that the memory allocation is associated with a particular program entity. The S7200 allocates 64 bytes of L memory for the main program, 64 bytes for each subroutine nesting level, and 64 bytes for interrupt routines. The allocation of L memory for the main program cannot be accessed from subroutines or from interrupt routines. A subroutine cannot access the L memory allocation of the main program, an interrupt routine, or another subroutine. Likewise, an interrupt routine cannot access the L memory allocation of the main program or of a subroutine.

36

The allocation of L memory is made by the S7-200 on an as-needed basis. This means that while the main portion of the program is being executed, the L memory allocations for subroutines and interrupt routines do not exist. At the time that an interrupt occurs or a subroutine is called, local memory is allocated as required. The new allocation of L memory might reuse the same L memory locations of a different subroutine or interrupt routine. The L memory is not initialized by the S7-200 at the time of allocation and might contain any value. When we pass formal parameters in a subroutine call, the values of the parameters being passed are placed by the S7-200 in the appropriate L memory locations of the called subroutine. L memory locations, which do not receive a value as a result of the formal parameter passing step, will not be initialized and might contain any value at the time of allocation. Bit: L[byte address].[bit address] L0.0 LB33

Byte, Word, or Double Word: L[size] [starting byte address] 4.8.11 Analog Inputs: AI

The S7-200 converts an analog value (such as temperature or voltage) into a word-length (16-bit) digital value. We access these values by the area identifier (AI), size of the data (W), and the starting byte address. Since analog inputs are words and always start on even-number bytes (such as 0, 2, or 4), we access them with even-number byte addresses (such as AIW0, AIW2, or AIW4). Analog input values are read-only values. Format: AIW[starting byte address] AIW4

4.8.12 Analog Outputs: AQ The S7-200 converts a word-length (16-bit) digital value into a current or voltage, proportional to the digital value (such as for a current or voltage). We write these values by the area identifier (AQ), size of the data (W), and the starting byte address. Since analog outputs are words and always start on even-number bytes (such as 0, 2, or 4), we write them with even-number byte addresses (such as AQW0, AQW2, or AQW4). Analog output values are write-only values. Format: AQW[starting byte address] AQW4

4.8.13 Sequence Control Relay (SCR) Memory Area: S SCRs or S bits are used to organize machine operations or steps into equivalent program segments. SCRs allow logical segmentation of the control program. We can access the S bits as bits, bytes, words, or double words. Bit: S[byte address].[bit address]
37

S3.1

Byte, Word, or Double Word: S[size][starting byte address]

SB4

4.9 Format for Real Numbers


Real (or floating-point) numbers are represented as 32-bit, single-precision numbers, whose format is described in the ANSI/IEEE 754- -1985 standard. See Figure 4-8. Real numbers are accessed in double-word lengths.

Fig 4.8 Format of a real number For the S7-200, floating point numbers are accurate up to 6 decimal places. Therefore, you can specify a maximum of 6 decimal places when entering a floating-point constant. 4.9.1 Accuracy when Calculating Real Numbers Calculations that involve a long series of values including very large and very small numbers can produce inaccurate results. This can occur if the numbers differ by 10 to the power of x, where x >6 . For example: 100 000 000 + 1 = 100 000 000

4.10 Format for Strings


A string is a sequence of characters, with each character being stored as a byte. The first byte of the string defines the length of the string, which is the number of characters. Figure 4-9 shows the format for a string. A string can have a length of 0 to 254 characters, plus the length byte, so the maximum length for a string is 255 bytes.

Fig 4.9 Format for strings

4.11 Specifying a Constant Value for S7-200 Instructions


We can use a constant value in many of the S7-200 instructions. Constants can be bytes, words, or double words. The S7-200 stores all constants as binary numbers, which can then be represented in decimal, hexadecimal, ASCII, or real number (floating point) formats. See Table 4-2.

38

Table 4-2 Representation of constant values

4.12 Addressing the Local and Expansion I/O


The local I/O provided by the CPU provides a fixed set of I/O addresses. We can add I/O points to the S7-200 CPU by connecting expansion I/O modules to the right side of the CPU, forming an I/O chain. The addresses of the points of the module are determined by the type of I/O and the position of the module in the chain, with respect to the preceding input or output module of the same type. For example, an output module does not affect the addresses of the points on an input module, and vice versa. Likewise, analog modules do not affect the addressing of digital modules, and vice versa.

4.13 Using Pointers for Indirect Addressing of the S7-200 Memory Areas
Indirect addressing uses a pointer to access the data in memory. Pointers are double word memory locations that contain the address of another memory location. We can only use V memory locations, L memory locations, or accumulator registers (AC1, AC2, AC3) as pointers. To create a pointer, we must use the Move Double Word instruction to move the address of the indirectly addressed memory location to the pointer location. Pointers can also be passed to a subroutine as a parameter. The S7-200 allows pointers to access the following memory areas: I, Q, V, M, S, T (current value only), and C (current value only). We cannot use indirect addressing to access an individual bit or to access AI, AQ, HC, SM, or L memory areas. To indirectly access the data in a memory address, we create a pointer to that location by entering an ampersand (&) and the memory location to be addressed. The input operand of the instruction must be preceded with an ampersand (&) to signify that the address of a memory location, instead of its contents, is to be moved into the location identified in the output operand of the instruction (the pointer). Entering an asterisk (*) in front of an operand for an instruction specifies that the operand is a pointer. As shown in Figure 4-10, entering *AC1 specifies that AC1 is a pointer to the word-length value being referenced by the Move Word (MOVW) instruction. In this example, the values stored in both VB200 and VB201 are moved to accumulator AC0.

39

Fig 4.10 Creating and using a pointer As shown in Figure 4-11, you can change the value of a pointer. Since pointers are 32-bit values, use double-word instructions to modify pointer values. Simple mathematical operations, such as adding or incrementing, can be used to modify pointer values.

Fig 4.11 Modifying a pointer

4.14 Understanding How the S7-200 Saves and Restores Data


The S7-200 provides a variety of safeguards to ensure that our program, the program data, and the configuration data for your S7-200 are properly retained. The S7-200 provides a super capacitor that maintains the integrity of the RAM after power has been removed. Depending on the model of the S7-200, the super capacitor can maintain the RAM for several days. The S7-200 provides an EEPROM to store permanently all of your program, user-selected data areas, and the configuration data. The S7-200 also supports an optional battery cartridge that extends the amount of time that the RAM can be maintained after power has been removed from the S7-200. The battery cartridge provides power only after the super capacitor has been drained.

Fig 4.12 Storage areas of the S7 200 CPU

4.15 Downloading and Uploading the Elements of Project


40

A project consists of three elements: the program block, the data block (optional), and the system block (optional). Figure 4-13 shows how a project is downloaded to the S7-200. When we download a project, the elements of a downloaded project are stored in the RAM area. The S7-200 also automatically copies the user program, data block, and the system block to the EEPROM for permanent storage.

Fig 4.13 Downloading a project to S7-200 CPU Figure 4-14 shows how a project is uploaded from the S7-200. When we upload a project to computer, the S7-200 uploads the system block from the RAM and uploads the program block and the data block from the EEPROM.

Fig 4.14 Uploading a project from S7-200

4.16 Saving the Retentive M Memory Area on Power Loss


41

If the first 14 bytes of bit memory (MB0 to MB13) are configured to be retentive, these bytes are permanently saved to the EEPROM in the event that the S7-200 loses power. As shown in Figure 4-15, the S7200 moves these retentive areas of M memory to the EEPROM. The default setting for the first 14 bytes of M memory is to be non-retentive. The default disables the save that normally occurs when we power off the S7-200.

Fig 4.15 Saving M memory on power loss

4.17 Restoring Data after Power On


At power on, the S7-200 restores the program block and the system block from the EEPROM memory, as shown in Figure 4-16. Also at power on, the S7-200 checks the RAM to verify that the super capacitor successfully maintained the data stored in RAM memory. If the RAM was successfully maintained, the retentive areas of RAM are left unchanged. The retentive and non-retentive areas of V memory are restored from the corresponding data block in the EEPROM. If the contents of the RAM were not maintained (such as after an extended power failure), the S7-200 clears the RAM (including both the retentive and non-retentive ranges) and sets the Retentive Data Lost memory bit (SM0.2) for the first scan cycle following power on, and then copies the data stored in the EEPROM to the RAM.

Fig 4.16 Restoring Data after power on

42

4.18 Storing Program on a Memory Cartridge


The S7-200 supports an optional memory cartridge that provides a portable EEPROM storage for program. The S7-200 stores the following elements on the memory cartridge: the program block, the data block, the system block, and the forced values. We can copy program to the memory cartridge from the RAM only when the S7-200 is powered on and in STOP mode and the memory cartridge is installed. We can install or remove the memory cartridge while the S7-200 is powered on.

4.19 Copying Program to the Memory Cartridge


After installing the memory cartridge, we have to use the following procedure to copy the program: 1. Put the S7-200 CPU in STOP mode. 2. If the program has not already been downloaded to the S7-200, download the program. 3. Select the PLC > Program Memory Cartridge menu command to copy the program to the memory cartridge. Figure 4-17 shows the elements of the CPU memory that are stored on the memory cartridge. 4. Optional: Remove the memory cartridge and replace the cover on the S7-200.

Fig 4.17 Copying to a Memory cartridge

4.20 Restoring the Program from a Memory Cartridge


To transfer the program from a memory cartridge to the S7-200, you must cycle the power to the S7-200 with the memory cartridge installed. As shown in Figure 4-18, the S7-200 performs the following tasks after you cycle power with the memory cartridge installed: 1. If the contents of the memory cartridge differ from the contents of the EEPROM, the S7-200 clears the RAM.
43

2. The S7-200 copies the contents of the memory cartridge to the RAM. 3. The S7-200 copies the program block, the system block, and the data block to the EEPROM.

Fig 4.18 Restoring from Memory cartridge

4.21 Selecting the Operating Mode for the S7-200 CPU


The S7-200 has two modes of operation: STOP mode and RUN mode. The status LED on the front of the CPU indicates the current mode of operation. In STOP mode, the S7-200 is not executing the program, and you can download a program or the CPU configuration. In RUN mode, the S7-200 is running the program. - The S7-200 provides a mode switch for changing the mode of operation. You can use the mode switch (located under the front access door of the S7-200) to manually select the operating mode: setting the mode switch to STOP mode stops the execution of the program; setting the mode switch to RUN mode starts the execution of the program; and setting the mode switch to TERM (terminal) mode does not change the operating mode. If a power cycle occurs when the mode switch is set to either STOP or TERM, the S7-200 goes automatically to STOP mode when power is restored. If a power cycle occurs when the mode switch is set to RUN, the S7-200 goes to RUN mode when power is restored. - STEP 7- -Micro/WIN allows us to change the operating mode of the online S7-200. To enable the software to change the operating mode, you must manually set the mode switch on the S7-200 to either TERM or RUN. We can use the PLC > STOP or PLC > RUN menu commands or the associated buttons on the toolbar to change the operating mode. - We can insert the STOP instruction in program to change the S7-200 to STOP mode. This allows you to halt the execution of program based on the program logic.

44

5. FEATURES& APPLICATIONS OF SIMATIC S7-200


5.1 Features of SIMATIC S7-200:
Compact design Practical functionality Modular expansion options Built-in RS 485 serial networking port(s) Excellent real-time behavior Extremely fast and precise process and sequence control Seamless control of time-critical processes by means of timed interrupts Simple and user-friendly wiring with removable terminal strips on the CPU and expansion modules permanent wiring Small and compact ideal for any applications where space is tight Basic and advanced functionality in all CPU models Large program and data memory Outstanding real-time response being in total command of the entire process at any time means increased quality, efficiency and safety

45

Easy-to-use STEP 7-Micro/WIN engineering software ideal for both beginners and experts Integrated R-S 485-interface or use as system bus Extremely fast and precise operational sequence and process control Complete control of time-critical processes by time interrupts Real-time response The advanced technology down to the last detail ensures our CPUs deliver excellent real-time response rates: 4 or 6 independent hardware counters, each with 30 kHz, 2 x 200 kHz with a CPU 224 XP, e.g. for precise path monitoring with incremental encoders or for high-speed counting of process events 4 independent alarm inputs, input filter time 0.2 ms to program action for maximum process safety Pulse-capturing function for signals > 0.2 ms for fast events from the application 2 pulse outputs, each 20 kHz, or 2 x 100 kHz with CPU 224 XP with pulse-width modulation and pulse no-pulse setpoint e.g. for controlling stepper motors 2 timed interrupts starting at 1 ms and adjustable in increments of 1 ms for bumpless control of rapidly changing processes Fast analog inputs signal conversion with 25 s, 12-bit resolution Real-time clock Timed interrupts Between 1 and 255 ms, with a resolution of 1 ms For example: it is possible to record and process signals on screw insertion machine at 3000 RPM after just a quarter turn. This enables very precise recording, for instance, of tightening torques to ensure optimum fastening of the screw. Fast counters Operating independently of each other, of other operations and of the program cycle Interrupt triggering when user selectable counted values are reached reactiontime from the detection of an input signal to switching of an output is 300 s 4-edge evaluation when incremental position encoders are used for exact positioning Modular expandability

46

Alarm inputs 4 independent inputs For registering signals in rapid succession Response time of 200 s500 s for signal detection/300 s for signal output Response to positive-going and/or negative- going signal edge Max. 16 interrupts in one queue depending on prioritization

5.2 Highlights
Memory card for data logging, recipe management, saving of STEP 7-Micro/WIN project, and storage of documentation in various formats PID auto-tune function 2 built-in serial ports for extended communication options, e.g. with other manufacturers devices (CPU 224 XP, CPU 226) CPU 224 XP with built-in analog inputs/output Integrated online functions: Runtime edit Online status Context-sensitive online help is possible for all functions Clear and informative symbols and symbol table Standard symbol table User-defined table Structured programming with libraries USS protocol for actuating drives Modbus library User-defined libraries
47

Structured programming with subroutines Parameterizable subroutines Password-protected subroutines


Multiple calls of subroutines in user program

Import/export of subroutines possible Debugging Fast online debugging Fault localization at the click of a mouse The S7-200 instruction set provides instructions that immediately read from or write to the physical I/O. These immediate I/O instructions allow direct access to the actual input or output point, even though the image registers are normally used as either the source or the destination for I/O accesses. The S7-200 Allows Your Program to Interrupt the Scan Cycle. The interrupt routines are not executed as part of the normal scan cycle, but are executed when the interrupt event occurs (which could be at any point in the scan cycle). Interrupts are serviced by the S7-200 on a first-come-first-served basis within their respective priority assignments
The S7-200 Allows us to Allocate Processing Time for Communications Tasks. We can configure a

percentage of the scan cycle to be dedicated for processing the communications requests that are associated with a RUN mode edit compilation or execution status
The output table of the S7-200 allows you to determine whether to set the state of the digital output

points to known values upon a transition to the STOP mode, or to leave the outputs in the state they were in before the transition to the STOP mode. The output table is part of the system block that is downloaded and stored in the S7-200 and applies only to the digital outputs.
The S7-200 Allows us to Define Memory to Be Retained on Loss of Power. We can define up to six

retentive ranges to select the areas of memory you want to retain through power cycles. We can define ranges of addresses in the following memory areas to be retentive: V, M, C, and T. For timers, only the retentive timers (TONR) can be retained. The default setting for the first 14 bytes of M Memory is to be non-retentive. Only the current values for timers and counters can be retained: the timer and counter bits are not retentive.
The S7-200 Allows us to Filter the Digital Inputs. The S7-200 allows we to select an input filter that

defines a delay time (selectable from 0.2 ms to12.8 ms) for some or all of the local digital input points. This delay helps to filter noise on the input wiring that could cause inadvertent changes to the states of the inputs. The input filter is part of the system block that is downloaded and stored in the S7-200. The default filter time is 6.4 ms. As shown in Figure 4-24, each delay specification applies to groups of
48

input points.
The S7-200 Allows us to Filter the Analog Inputs. The S7-200 allows us to select software filtering on

individual analog inputs. The filtered value is the average value of a preselected number of samples of the analog input. The filter specification (number of samples and deadband) is the same for all analog inputs for which filtering is enabled.
The filter has a fast response feature to allow large changes to be quickly reflected in the filter value.

The filter makes a step function change to the latest analog input value when the input exceeds a specified change from the current value. This change, called the deadband, is specified in counts of the digital value of the analog input.
The default configuration is to enable filtering for all analog inputs. The S7-200 Allows us to Catch Pulses of Short Duration The S7-200 provides a pulse catch feature which can be used for some or all of the local

digital input points. The pulse catch feature allows us to capture high-going pulses or lowgoing pulses that are of such a short duration that they would not always be seen when the S7-200 reads the digital inputs at the beginning of the scan cycle. When pulse catch is enabled for an input, a change in state of the input is latched and held until the next input cycle update. This ensures that a pulse which lasts for a short period of time is caught and held until the S7-200 reads the inputs.
We can individually enable the pulse catch operation for each of the local digital inputs.

The S7-200 Provides Password Protection Recovering from a Lost Password


If we forget the password, we must clear the memory of the S7-200 and reload the

program. Clearing the memory puts the S7-200 in STOP mode and resets the S7-200 to the factory-set defaults, except for the network address, baud rate, and the time-of-day clock.

5.3 Internal features


Small and practical Battery module To ensure no user data is lost, you can use the optional battery module for longterm backups to extend backup time from the roughly 5 days of internal backup to, in general, a total of 200 days. Real-time clock The integrated realtime clock on the S7-200 runs to the minute and to the day via the software
49

according to your settings even in leap years (Including automatic daylight saving time switchover.) Analog potentiometers With the integrated analog potentiometers on the S7-200, you can optimize the process sequence almost according to feel without a PC or HMI. They let us fine-tune the contents of data registries, time values, preassigned counter values or other parameters without meddling with the program. This is a practical way, for example, to change a welding time or delay time quickly and directly.

5.4 Instruction Set


For programming the S7-200 PLC a very powerful Instruction set is available. Different types of Instruction sets are available which can be used based on the operations we do. The types of Instructions available are given below: Bit Logic Instructions Clock Instructions Communications Instructions Compare Instructions Conversion Instructions Counter Instructions High-Speed Counter Instructions Pulse Output Instruction Math Instructions Proportional/Integral/Derivative (PID) Loop Instruction
Interrupt Instructions Logical Operations Instructions

Move Instructions Program Control Instructions Shift and Rotate Instructions String Instructions
50

Table Instructions Timer Instructions Subroutine Instructions

5.5 Typical application of S7-200 (Application of Siemens S7-200 PLC in drive system for paper machine)
5.5.1 Introduction In this application, the SLANVERT series inverters and Siemens S7-200 PLC are combined to form a set of control system for cultural paper machines. Through communications between PLC and inverters, control operations such as start, stop, speed increasing, speed decreasing, and paper tensioning. The functions such as load distribution and speed chain are achieved automatically by software so as to fully meet requirements of process and electrical control. 5.5.2 Requirements of Paper Machine for Electrical Drive Control System The structure sketch of the paper machine is shown as Figure 5.1. It is 1760/250m/min longmesh multi-cylinder cultural paper machine, producing 40-65g/m2 senior cultural papers, with stable-state accuracy of 0.01%.

Figure 5.1 Structure Sketch In order to produce high quality products, the paper machine has the following requirements for the electrical drive system: (1) The working speed of the paper machine shall have big regulation range of 1:8. (2) The speed shall have higher stability margin, and the overall speed shall be increased and decreased stably. It is required the accuracy of paper machine at stable speed shall be: 0.050.01%. (3) The speed difference shall be controllable, and the speed ratio shall be adjustable and stable. The change of speed difference within certain range shall not cause sudden change of paper

51

quality, and the error rate shall be controlled within 0.1%. The speed of each individual of the paper machine shall be adjustable at a range of 10-15%. (4) The drive points of all individuals have following functions: slight increasing and decreasing of speed; separate and interlocked action among these individuals; and simultaneous start and stop. (5) The paper machine has property of constant torque loads, so the inverter with constant-torque control property, high resolution ratio, and good communication capability shall be selected. 5.5.3 Composition of Control System The system principle is shown as Figure 5.2. For the drive system of this paper machine, the S7200 small-size PLC is used as the control center of the system. SLANVERT SB80 series inverter is used as drive unit, with resolution ratio of frequency at over 0.01Hz. Special frequency-conversion motor serves as execution unit. Omron PLC serves to provide speed feedback signal to let the drive of the paper machine operate in close-loop of the speed, with accuracy at stable speed: up to 0.01%. The PLC, via MODUBUS protocol and RS485 network, together with inverters, achieves the following functions: speed chain function, speed difference control, load distribution function, increasing and decreasing of overall speed and that of all individuals, as well as paper tensioning and releasing functions etc., which ideally satisfy requirements for normal work of the paper machine.

Fig 5.2 System Principle Diagram

52

Fig. 5-3 System block diagram 5.5.4 Design of Speed Chain and Control of Speed Difference The speed chain is with binary tree data structure to carry out data transmission functions. First, perform mathematical abstract for locations of all drive points to determine a number for each drive point in the speed chain, and the number shall be consistent with the internal address of the inverter. Then, determine the upper and lower as well as left or right numbers for each node point according to the binary tree data structure. That is to say, the location of any drive point in the speed chain is decided by three data. After filling it in the location register and transmitting the speed of drive points to inverters, visit location register to determine the node number of the sub-register. If the node number is not 0, conduct corresponding processing for this node until the whole chain is processed completely. After that, check the node number of brother registers and process another chain.

5.5.5 Design of Load Distribution The drive structure of the paper machine has flexibly connected drive points, drying-cylinder part, and pressing part. Between these parts is required not only speed sync, but balance of load rate, or else over-current of one drive point may be caused by overload, and over-voltage of another drive point may be caused by such driving, which will influence normal papermaking, even may tear coarse cotton cloth and damage inverters and machines. Therefore, it is required to automatically control the load distribution among drive points between two drive parts and this automatic controlling function is served by S7-200 which reduces tearing of paper and damage of inverters and machines.

53

6. CONCLUSION
We are delightful on our success in completion of the study project on Andhra Pradesh Paper Mills Pvt Ltd., in Rajahmundry. This study project made us to explore industrial environment and able to understand the function of Siemens PLC SIMATIC S7-200 in the power plant. In paper mill it is used along with Slanvert inverter in order to control the papermaking process and it prevents the tearing of paper and damage of inverters and machines. Optimal care has been taken in preparation for this project report. Hope this report will find good use in future.

54

7. REFERENCES
1. www.siemens.com/s7-200 2. Siemens S7-200 Manual 3. SIMATIC S7-200 Programmable Controller System Manual

55

You might also like