Pages

Saturday, August 18, 2007

Ladder Logic Programming

for Programmable Logic Controllers

What makes a PLC special? PLC's are used to automate machinery in assembly lines. For our project, we use the computer link feature that allows a PLC to take commands and communicate with a host computer. If something goes wrong with the computer link, the PLC still functions and protecting valuable equipment.

High Resolution Fly's Eye experiment, uses a Toshiba T1 PLC as part of a steerable laser system used for monitoring atmospheric clarity. We use a model TDR116-6S. The PLC was purchased as part of a starter kit. Specifically the PLC is used to open and close a cover that protects the a steering mechanism when the systems is not used. It is programmed to automatically close this cover after one hour unless it has received and instruction from the main PC to keep the cover open. This means that even if the PC or network communication to the site fails, the cover will still close. It is also used to power cycle equipment, including the laser and the radiometer.


This PLC and most others use a language called relay ladder logic programming. However, if you've programmed in high level languages before don't be fooled by that last part. Ladder logic is not necessarily difficult. Once you get the hang of it it isn't hard at all. But.. ladder logic is quite different from more common programming languages such as FORTRAN or c. It's true that ladder logic uses conditional statements, subroutines and FOR NEXT loops but there are some very significant differences.

Unlike FORTRAN or c, with ladder logic, every 'rung' of the code is multithreaded. Normally in a programming language things happen in order. The command or line of code on top is executed before the command on the bottom until you hit the end of a loop. This is not so in ladder logic. Everything happens at the same time.

So what is ladder logic programming really like? Ladder logic programming looks, well, like a ladder. It's more like a flow chart than a program. There are two vertical lines coming down the programming environment, one on the left and one on the right. Then, you have rungs of conditionals on the left that lead to outputs on the right. For example:



x0001 x0002 Y0001
|---| |-----|/|---------( )-----|
| |
| |
| x0001 Y002 |
|---| |--[01000 TON T012]--( )--|
| |
| |
| R001 |
|--[D0140 = 0001]--------( )--|
| |
| R001 Y004 |
|--| |---------------------( )--|
| |
|-{END}-------------------------|

In Ladder logic programming you do not have variables, you have registers. There are four kinds of registers: X's that are inputs, Y's that are outputs, D's that are data that can form interger, hex and real numbers, and finally R's that are internal relays. X's and Y's are pointers to the actual terminal strip connectors (what you use a screw driver on to connect wires) on the PLC. If you energize an input, let's say 5, then X0005 will have an on status; also if you give Y0023 an on status then relay 23 will flick on. R's are just about the same as X's and Y's except that they don't point to any hardware. They just hold an on or off value inside of the PLC's memory. R's can be useful. X's Y's and R's can even hold data besides their on and off states on many PLC's, but personally I don't recommend it. For data like integers and hexadecimal numbers D's are used as their addresses.

example one. The things you will probably use the most writing Ladder Logic are the relay conditionals --| |-- ---|/|--- and the output coils ---( )---. These three things basically make up a kind of IF THEN statement. This --| |-- means closed if energized while --|/|-- means closed if not energized. The output coil --( )-- basically means then energize this. So the first rung of example one means that if input 1 is energized and input 2 is not then energize output 1. You should note that on the T1, the number of a particular input or output is written on the case of the PLC but for T2's and for some other more advanced PLC's this is not necessarily the case. To find out what the addresses of your inputs and outputs are you should refer to the documentation that came with your PLC. Also, in most ladder logic programming environments you have to specify the address of each of your inputs and outputs before it will even let you start programming. [the T series can auto configure]

delay timer. What this means is that after a specified amount of time after x0001 turns on, y0002 will turn on. You should note that because of the nature of ladder logic you can not simply put a timer attached directly to the left hand side without a relay conditional between it. Remember, everything is happening at the same time. PLC's are meant to run on their own for long periods of time, so you can't just tell it that 10 seconds after it's first plugged in it should activate something. You have to tell it to start timing after something in the outside world has occurred, like the energizing or de-energizing of an input.

In the code --[01000 TON T012]-- there is the parameter 01000 that tells the timer to wait 1000*10ms or 10 seconds, and the parameter T012 tells the PLC which internal timer you want to use. Some of the more advanced PLC's have timers with different accuracy. Most measure time in 10ms intervals but others measure time in single milliseconds. You should check the documentation on your PLC to see if any of it's timers measure time in different units than the others. Also you should not use the same timer for more than one thing.

On rung three of the ladder we have a conditional statement. If the number stored in D0140 is equal to 1 then energize R001. If you look at the entire circuit you'll note that there is no where else in it where D0140 is mentioned and you should know that all data registers are set to 0 at default. You may think that D0140 will never actually reach the value of 1 and that R001 will never be activated and that rung three and four are useless garbage code. It's true that during the normal operation of the PLC D0140 will never change from zero and the last two rungs before end would be useless. However, this is where the computer link function comes in. All Toshiba PLC's have a computer link protocol built into them. This allows a host computer, such as any sort of DOS, Linux based PC or even a Unix administrator with an RS232 serial port to send commands to the PLC while it's running and read or write values into its registers. This includes data, inputs, outputs, and relays.

Suppose that Y004 was attached to equipment that you wanted to turn it on or off at your pleasure. Suppose it was an air conditioner or maybe some strange contraption that brought you a coke from the fridge to your seat at a computer. If you can write a program at your own specialized system that can send ASCII characters with 8 data bits 1 start bit 1 stop bit and 9600 baud rate with odd parity, then you can manipulate the registers in the Toshiba PLC's and toggle d0140 between 1 and zero or 1 and any other value. See more about the computer link function with a sample C program written under Linux latter. C example

The final rung on the ladder the -{END}- is basically what it says. It's the end statement. It doesn't really do anything except to say, well, your done programming. However, no program will work without an end statement and the PLC will ignore any code put in after an end statement. This shouldn't be a problem for small programs, just look at the screen and make sure the end is in there and at the bottom. If you happen to be making a very large and a very complicated relay circuit your editor will likely force you to write it in separate blocks. Before attempting to write a very large program you should go to the very last programming block available to you and put the end statement there and no where else. The end statement can be used in debugging by ending the program early and disabling commands that fall after the end statement.



| X001 Y001 Y001 |
|-| |---|/|---[01000 TON T002]-[01000 TOF T003]---------( )--| rung one
| |
| X001 Y002 |
|--| |----+---------------------------------------------( )--| rung two
| | |
| Y002 | |
|--| |----+ |
| X001 R006 |
|--| |--|/|--[01000 TON T004]-----+-------[D150 + 1 -> D150]-| rung three
| | R006 |
| +---[01000 TOF T005]--( )--|
| |
| Y003 |
|-[D150 >200]-------------------------------------------( )--| rung four
| |
| Y003 |
|-| |-----------------------------------------[ 0 MOV D150]--| rung five
| |
|--{END}-----------------------------------------------------| END rung

Example two is a bit more complicated than example one, but once you understand it you'll be on your way to being able to design your own relay ladder logic. Rung one is especially interesting. A TON and a TOF combination that lets output Y001 cycle on and off for 10 seconds at a time. While TON waits a given time before allowing an energized input to affect an output, TOF waits a given time before de-energizing an output after it's input has been cut off.

Let's analyze the rung. The -| |- conditional with X001 is there for good programming, it isn't actually necessary in this rung but if it's not there you have no way to stop the oscillating of Y001 during the PLC's operation. Now notice that we're not allowing current to flow if Y001 is energized yet the output of this rung is to energize Y001. Well, if Y001 is off then current is passed to TON. After TON has gone through it's specified time it will energize Y001. Now that Y001 is energized current to the rung is cut off. Once the current has stopped TOF will keep Y001 powered for a specified amount of time before Y001 feels the affects and de-energizes. With Y001 de-energized TON is energized again and the cycle goes on. (You may want to reread that last sentence a few times) The output Y001 stays on for a second, then off for a second continuously cycling.

Rung two shows how to set up a push button. With a momentary push button, the input is only energized for a short amount of time, but often it is useful to keep the rung on long afterwards. What you should notice about rung two is that the output is connected to the left hand side twice. If either of the two relay conditionals are on, then the output is on. Notice that one of the relay conditionals is the output itself. Thus if the output is powered for just one of the PLC's cycles (a very short time) then the output's own momentary on state will keep itself energized. You want to put in an internal relay conditional between the Y002 input and output or else you'll never be able to get it off! Well you could if you restart the PLC's program or with the computer link protocol.

Rung three is also spread across two rung slots but you could get it on one rung if it would fit ( it really doesn't all fit on one rung in the editor). It's basically like rung one except that between the timers is a data statement that increments D150 by one. There are other ways to increment a data register, but this is what I used. Because it's between the timers, the data function will only get power and operate once during the period of the cycle. Since most of the timers only measure in milliseconds you can use a rung like this to measure time in hours or days if your PLC doesn't have any function that will do it for you.

Rung four simply turns on an output when D150 is greater than a number i.e. a certain amount of time has gone by.

Rung five sets D150 back to 0 when that output has been on momentarily. In a real application of something like this you'd probably want to use a TOF on rung four so that when D150 is no longer greater than 200 Y003 will wait a moment before deactivating, other wise it will deactivate after one cycle of the PLC. The PLC probably goes through around a thousand cycles per second. A cycle is when the PLC updates the on, off, and value states of the relays and registers.

You should notice that I didn't just say D150=0. The = sign is already used in conditionals so instead you have to use a move command. The --[0 MOV D150]-- means move the value of 0 into the register D150. There are many other data functions and ladder logic components that you can use. So far I've only gone over what I think are the most important ones. For example, the T1 also haws its own counters and flip flop's built in to use in your program. Don't be afraid to experiment for your self though. When you buy the starter kit a you get PLC, a ladder logic editor and documentation including a list of all of the programming components, hardware, and exactly how everything works.

http://xtronics.com/toshiba/Ladder_logic.htm

PLC pic :







PLC Rack

Monday, August 6, 2007

Advanced Micro Devices

From Wikipedia, the free encyclopedia


Advanced Micro Devices, Inc. (abbreviated AMD; NYSE: AMD) is an American manufacturer of semiconductors based in Sunnyvale, California. The company was founded in 1969 by a group of former executives from Fairchild Semiconductor, including Jerry Sanders, III, Ed Turney, John Carey, Sven Simonsen, Jack Gifford and three members from Gifford's team, Frank Botte, Jim Giles and Larry Stenger. The current chairman and CEO is Dr. Héctor Ruiz and the current president and chief operating officer is Dirk Meyer.
AMD is the world's second-largest supplier of x86 based processors and the world's second largest supplier of graphics cards and GPUs, after taking control over ATI in 2006. AMD also owns a 37% share of Spansion, a supplier of non-volatile flash memory. In 2006 the company ranked eighth among semiconductor manufacturers.

General history


Early AMD 8080 Processor (AMD AM9080ADC / C8080A), 1977

AMD started as a producer of logic chips in 1969, then entered the RAM chip business in 1975. That same year, it introduced a reverse-engineered clone of the Intel 8080 microprocessor. During this period, AMD also designed and produced a series of bit-slice processor elements (Am2900, Am29116, Am293xx) which were used in various minicomputer designs.
During this time, AMD attempted to embrace the perceived shift towards RISC with their own AMD 29K processor, and they attempted to diversify into graphics and audio devices as well as EPROM memory. It had some success in the mid-80s with the AMD7910 and AMD7911 "World Chip" FSK modem, one of the first multistandard devices that covered both Bell and CCITT tones at up to 1200 baud half duplex or 300/300 full duplex. While the AMD 29K survived as an embedded processor and AMD spinoff Spansion continues to make industry leading flash memory, AMD was not as successful with its other endeavors. AMD decided to switch gears and concentrate solely on Intel-compatible microprocessors and flash memory. This put them in direct competition with Intel for x86 compatible processors and their flash memory secondary markets.

Litigation with Intel

AMD has a long history of litigation with former partner and x86 creator Intel.
• In 1986 Intel broke an agreement it had with AMD to allow them to produce Intel's micro-chips for IBM; AMD filed for arbitration in 1987 and the arbitrator decided in AMD's favor in 1992. Intel disputed this, and the case ended up in the Supreme Court of California. In 1994, that court upheld the arbitrator's decision and awarded damages for breach of contract.
• In 1990, Intel brought a copyright infringement action alleging illegal use of its 287 microcode. The case ended in 1994 with a jury finding for AMD and its right to use Intel's microcode in its microprocessors through the 486 generation.
• In 1997, Intel filed suit against AMD and Cyrix Corp. for misuse of the term MMX. AMD and Intel settled, with AMD acknowledging MMX as a trademark owned by Intel, and with Intel granting AMD rights to market the AMD K6 MMX processor.
• In 2005, following an investigation, the Japan Federal Trade Commission found Intel guilty on a number of violations. On June 27, 2005, AMD won an antitrust suit against Intel in Japan, and on the same day, AMD filed a broad antitrust complaint against Intel in the U.S. Federal District Court in Delaware. The complaint alleges systematic use of secret rebates, special discounts, threats, and other means used by Intel to lock AMD processors out of the global market. Since the start of this action, AMD has issued subpoenas to major computer manufacturers including Dell, Microsoft, IBM, HP, Sony, and Toshiba.

Merger with ATI

AMD announced a merger with ATI Technologies on July 24, 2006. AMD had paid $4.2 billion in cash along with 57 million shares of its stock, for a total of a US$5.4 billion. The merger had completed on October 25, 2006[4] and ATI is now part of AMD.
It has been reported that in December 2006 AMD received a subpoena from the Justice Department regarding possible antitrust violations relating to the merger.

AMD x86 processors

Discontinued

8086, Am286, Am386, Am486, Am5x86



AMD 80286 1982

In February 1982, AMD signed a contract with Intel, becoming a licensed second-source manufacturer of 8086 and 8088 processors. IBM wanted to use the Intel 8088 in its IBM PC, but IBM's policy at the time was to require at least two sources for its chips. AMD later produced the Am286 under the same arrangement, but Intel canceled the agreement in 1986 and refused to convey technical details of the i386 part.
AMD challenged Intel's decision to cancel the agreement and won in arbitration, but Intel disputed this decision. A long legal dispute followed, ending in 1994 when the Supreme Court of California sided with AMD. Subsequent legal disputes centered on whether AMD had legal rights to use derivatives of Intel's microcode. In the face of uncertainty, AMD was forced to develop "clean room" versions of Intel code.
In 1991, AMD released the Am386, its clone of the Intel 386 processor. It took less than a year for the company to sell a million units. Later, the Am486 was used by a number of large OEMs, including Compaq, and proved popular. Another Am486-based product, the Am5x86, continued AMD's success as a low-price alternative. However, as product cycles shortened in the PC industry, the process of reverse engineering Intel's products became an ever less viable strategy for AMD.

K5, K6, Athlon (K7)

AMD's first completely in-house x86 processor was the K5 which was launched in 1996.[6] The "K" was a reference to "Kryptonite", which from comic book lore, was the only substance that could harm Superman, with a clear reference to Intel, which dominated in the market at the time, as "Superman" .[7]
In 1996, AMD purchased NexGen specifically for the rights to their Nx series of x86-compatible processors. AMD gave the NexGen design team their own building, left them alone, and gave them time and money to rework the Nx686. The result was the K6 processor, introduced in 1997.
The K7 was AMD's seventh generation x86 processor, making its debut on June 23, 1999, under the brand name Athlon.

Current and future


Athlon 64 (K8)


The K8 is a major revision of the K7 architecture, with the most notable features being the addition of a 64-bit extension to the x86 instruction set (officially called AMD64), the incorporation of an on-chip memory controller, and the implementation of an extremely high performance point-to-point interconnect called HyperTransport, as part of the Direct Connect Architecture. The technology was initially launched as the Opteron server-oriented processor.[8] Shortly thereafter it was incorporated into a product for desktop PCs, branded Athlon 64.

Dual-core Athlon 64 X2


AMD released the first dual core Opteron, an x86-based server CPU, on April 21, 2005.[10] The first desktop-based dual core processor family — the Athlon 64 X2 came a month later.


Quad-core "Barcelona" die-shot


In early May, AMD had abandoned the string "64" in its dual-core desktop product branding, becoming Athlon X2, while upcoming updates involves some of the improvements to the microarchitecture, and a shift of target market from mainstream desktop systems to value dual-core desktop systems, to avoid conflict of target customers between another dual-core product based on the K10 microarchitecture, the Phenom X2.

K10

The latest microprocessor architecture, also known as "AMD K10" is AMD's new microarchitecture. The "AMD K10" microarchitecture is the immediate successor to the AMD K8 microarchitecture, and is expected due middle of 2007. K10 processors will come in a single, dual, and quad-core versions with all cores on one single die.

Bulldozer and Bobcat

After the K10 architecture, AMD will move to a modular design methodology named "M-SPACE", where two new processor cores, codenamed "Bulldozer" and "Bobcat" will be released in the 2009 timeframe. While very little prelimilary information exists even in AMD's Technology Analyst Day 2007, both cores are to be built from the ground up. The Bulldozer core focused on 10 Watts to 100 Watts products, with optimizations for performance-per-watt ratios and HPC applications, while the Bobcat core will focus on 1 Watt to 10 Watts products, given that the core is a simplified x86 core to reduce power draw. Both of the cores will be able to corporate with full DirectX compatible GPU core(s) under the Fusion label.

AMD Fusion

After the merger between AMD and ATI, an initiative codenamed Fusion was announced that merges a CPU and GPU on one chip, including a minimum 16 lane PCI Express link to accommodate external PCI Express peripherals, thereby eliminating the requirement of a northbridge chip completely from the motherboard. It is expected to be released in 2009, one of the fruits of Fusion is the codenamed Falcon family, implementing the codenamed Bulldozer core, aimed for a 10-100 W products, and further products will incorporate codenamed Bobcat core, focusing on sub-10 W markets, targeting UMPC products and small handheld devices which was widely adopted the ARM processors. Processors from this project, will also be deployed in notebooks, with quad-core processors planned for 2009 reelase.

Other platforms and technologies

AMD Live!


AMD LIVE! is a platform marketing initiative focusing the consumer electronics segment, with a recently announced Active TV initiative for streaming Internet videos from web video services such as YouTube, into AMD Live! PC as well as connected digital TVs, together with a scheme for an ecosystem of certified peripherals for the ease of customers to identify peripherals for AMD Live! systems for digital home experience, called "AMD Live! Ready".

AMD Quad FX platform


The AMD Quad FX platform, being an extreme enthusiast platform, allows two processors connect through HyperTransport, which is a similar setup to dual-processor (2P) servers, excluding the use of buffered memory/registered memory DIMM modules, and a server motherboard, the current setup includes two Athlon 64 FX FX-70 series processors and a special motherboard. AMD pushed the platform for the surging demands for what AMD calls "megatasking" for true enthusiasts[citation needed], the ability to do more tasks on one single system. The platform refreshes with the introduction of Phenom FX processors and the next-generation RD790 chipset, codenamed "FASN8".

Commercial platform

Virtualization

AMD's virtualization extension to the 64-bit x86 architecture is named AMD Virtualization, also known by the abbreviation AMD-V, and is sometimes referred to by the code name "Pacifica". AMD processors using Socket AM2, Socket S1, and Socket F include AMD Virtualization support. AMD Virtualization is also supported by release two (8200, 2200 and 1200 series) of the Opteron processors.
AMD also endorsed the development of I/O virtualization technology, currently the "AMD I/O Virtualization Technology" (also known as IOMMU) specification published using HyperTransport architecture by AMD had updated to version 1.2 [13][14], which the first finalized (version 1.0) specification was published prior to Intel's[citation needed].

Commercial initiatives


• AMD Trinity, provides support for virtualization, security and management. Key features include AMD-V technology, codenamed Presidio trusted computing platform technology, I/O Virtualization and Open Management Partition. [15]
• AMD Raiden, future clients similar to the Jack PC [16] to be connected through network to a blade server for central management, to reduce client form factor sizes with AMD Trinity features.
• Torrenza, co-processors support through interconnects such as HyperTransport as PCI Express (though more focus was at HyperTransport enabled co-processors), also opening processor socket architecture to other manufacturers, Sun and IBM are among the supporting consortium, with rumoured POWER7 processors would be socket-compatible to future Opteron processors. The move made rival Intel responded with the open of Front Side Bus (FSB) architecture as well as Geneseo [17], a collaboration project with IBM for co-processors connected through PCI Express. Note that AMD positioned Torrenza for commercial segment, whilst Intel positioned Geneseo for all segments including consumer desktop segments[citation needed].
• Various certified systems programs and platforms: AMD Commercial Stable Image Platform (CSIP), together with AMD Validated Server program, AMD True Server Solutions, AMD Thermally Tested Barebones Platforms and AMD Validated Server Program, providing certified systems for business from AMD.

Desktop platforms

Starting from 2007, AMD has also following Intel, to use codenames for each desktop platforms. The platforms, unlike Intel's approach, will refresh every year, putting focus on platform specialization. The platform includes components as AMD processors, chipsets, ATI graphics and other features, but continued to the open platform approach, and welcome components from other vendors such as VIA, SiS, and NVIDIA, as well as wireless product vendors.
AMD will also release a system controls utility in the future, providing easy system monitoring, allowing adjustments to voltages and clocks, as well as overall platform management, including CPU, chipset and graphics. The features are expected to be similar to the control panel in NVIDIA ForceWare series drivers.

Embedded systems

Alchemy Processors


In February 2002, AMD acquired Alchemy Semiconductor and continued its line of processor in MIPS architecture processors, targets the handheld and Portable media player markets. On 13 June 2006, AMD officially announced that the Alchemy processor line was transferred to Raza Microelectronics Inc.

Geode processors

In August 2003, AMD also purchased the Geode business which was originally the Cyrix MediaGX from National Semiconductor to augment its existing line of embedded x86 processor products. During the second quarter of 2004, it launched new low-power Geode NX processors based on the K7 Thoroughbred architecture with speeds of fanless processors 667 MHz and 1 GHz, and 1.4 GHz processor with fan, of TDP 25 W.

Flash technology


While less visible to the general public than its CPU business, AMD is also a global leader in flash memory. In 1993, AMD established a 50-50 partnership with Fujitsu called FASL, and merged into a new company called FASL LLC in 2003. The joint venture firm went public under ticker symbol SPSN in December 2005, with AMD shares drop to 37%.
AMD no longer directly participates in the Flash memory devices market now as AMD entered into a non-competition agreement, as of December 21, 2005, with Fujitsu and Spansion, pursuant to which it agreed not to directly or indirectly engage in a business that manufactures or supplies standalone semiconductor devices (including single chip, multiple chip or system devices) containing only Flash memory [19].

Mobile platforms



AMD started a platform in 2003 aimed at mobile computing, but with fewer advertisements and promotional schemes, very little was known about the platform. The platform used mobile Athlon 64 or mobile Sempron processors.
As part of the "Better by design" initiative, the open mobile platform, announced February 2007 with announcement of general availability in May 2007, comes together with 65 nm fabrication process Turion 64 X2, and is consists of three major components, as AMD processor, graphics from either NVIDIA or ATI Technologies which also includes integrated graphics (IGP), and wireless connectivity solutions from Atheros, Broadcom, Marvell, Qualcomm or Realtek.

Upcoming platforms were being discussed with Puma platform and Griffin processor to be released in 2008. AMD planned quad-core processors with 3D graphics capcabilities (Fusion) to be launched in 2009 with the Eagle platform.

Sunday, August 5, 2007

Programmable logic controller

From Wikipedia, the free encyclopedia

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 general-purpose 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.

Features

The main difference from other computers is that PLC are armored for severe condition (dust, moisture, heat, cold, etc) and have the facility for extensive input/output (I/O) arrangements. These connect the PLC to sensors and actuators. PLCs read limit switches, analog process variables (such as temperature and pressure), and the positions of complex positioning systems. Some even use machine vision. On the actuator side, PLCs operate electric motors, pneumatic or hydraulic cylinders, magnetic relays or solenoids, or analog outputs. The input/output arrangements may be built into a simple PLC, or the PLC may have external I/O modules attached to a computer network that plugs into the PLC.
PLCs were invented as replacements for automated systems that would use hundreds or thousands of relays, cam timers, and drum sequencers. Often, a single PLC can be programmed to replace thousands of relays. Programmable controllers were initially adopted by the automotive manufacturing industry, where software revision replaced the re-wiring of hard-wired control panels when production models changed.
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.
Under the IEC 61131-3 standard, PLCs can be programmed using standards-based programming languages. A graphical programming notation called Sequential Function Charts is available on certain programmable controllers.

PLC compared with other control systems


PLCs are well-adapted to a certain range of automation tasks. These are typically industrial processes in manufacturing where the cost of developing and maintaining the automation system is high relative to the total cost of the automation, and where changes to the system would be expected during its operational life. PLCs contain input and output devices compatible with industrial pilot devices and controls; little electrical design is required, and the design problem centers on expressing the desired sequence of operations in ladder logic (or function chart) notation. PLC applications are typically highly customized systems so the cost of a packaged PLC is low compared to the cost of a specific custom-built controller design. On the other hand, in the case of mass-produced goods, customized control systems are economic due to the lower cost of the components, which can be optimally chosen instead of a "generic" solution, and where the non-recurring engineering charges are spread over thousands of sales.
For high volume or very simple fixed automation tasks, different techniques are used. For example, a consumer dishwasher would be controlled by an electromechanical cam timer costing only a few dollars in production quantities.
A microcontroller-based design would be appropriate where hundreds or thousands of units will be produced and so the development cost (design of power supplies and input/output hardware) can be spread over many sales, and where the end-user would not need to alter the control. Automotive applications are an example; millions of units are built each year, and very few end-users alter the programming of these controllers. However, some specialty vehicles such as transit busses economically use PLCs instead of custom-designed controls, because the volumes are low and the development cost would be uneconomic.
Very complex process control, such as used in the chemical industry, may require algorithms and performance beyond the capability of even high-performance PLCs. Very high-speed or precision controls may also require customized solutions; for example, aircraft flight controls.
PLCs may include logic for single-variable feedback analog control loop, a "proportional, integral, derivative" or "PID controller." A PID loop could be used to control the temperature of a manufacturing process, for example. Historically PLCs were usually configured with only a few analog control loops; where processes required hundreds or thousands of loops, a distributed control system (DCS) would instead be used. However, as PLCs have become more powerful, the boundary between DCS and PLC applications has become less clear-cut.

Digital and analog signals

Digital or discrete signals behave as binary switches, yielding simply an On or Off signal (1 or 0, True or False, respectively). Pushbuttons, limit switches, and photoelectric sensors are examples of devices providing a discrete signal. Discrete signals are sent using either voltage or current, where a specific range is designated as On and another as Off. A PLC might use 24 V DC I/O, with values above 22 V DC representing On and values below 2VDC representing Off. Initially, PLCs had only discrete I/O.
Analog signals are like volume controls, with a range of values between zero and full-scale. These are typically interpreted as integer values (counts) by the PLC, with various ranges of accuracy depending on the device and the number of bits available to store the data. As PLCs typically use 16-bit signed binary processors, the integer values are limited between -32,768 and +32,767. Pressure, temperature, flow, and weight are often represented by analog signals. Analog signals can use voltage or current with a magnitude proportional to the value of the process signal. For example, an analog 4-20 mA or 0 - 10 V input would be converted into an integer value of 0 - 32767.
Current inputs are less sensitive to electrical noise (i.e. from welders or electric motor starts) than voltage inputs.

Example

As an example, say the facility needs to store water in a tank. The water is drawn from the tank by another system, as needed and our example system must manage the water level in the tank.
Using only digital signals, the PLC has two digital inputs from float switches (tank empty and tank full). The PLC uses a digital output to open and close the inlet valve into the tank.
If both float switches are off (down) or only the 'tank empty' switch is on, the PLC will open the valve to let more water in. If only the 'tank full' switch is on, the valve turns off. Both switches being on would signal that something is wrong with one of the switches, as the tank cannot be both full and empty at the same time. Two float switches are used to prevent a 'flutter' condition where any water usage activates the pump for a very short time causing the system to wear out faster.
An analog system might use a load cell (scale) that weighs the tank, and an adjustable (throttling) valve. The PLC could use a PID feedback loop to control the valve opening. The load cell is connected to an analog input and the valve is connected to an analog output. This system fills the tank faster when there is less water in the tank. If the water level drops rapidly, the valve can be opened wide. If water is only dripping out of the tank, the valve adjusts to slowly drip water back into the tank.
In this system, to avoid 'flutter' adjustments that can wear out the valve, many PLCs incorporate "hysteresis" which essentially creates a "deadband" of activity. A technician adjusts this deadband so the valve moves only for a significant change in rate. This will in turn minimize the motion of the valve, and reduce its wear.
A real system might combine both approaches, using float switches and simple valves to prevent spills, and a rate sensor and rate valve to optimize refill rates. Backup and maintenance methods can make a real system very complicated.

System scale


A small PLC will have a fixed number of connections built in for inputs and outputs. Typically, expansions are available if the base model does not have enough I/O.
Modular PLCs have a chassis (also called a rack) into which is placed modules with different functions. The processor and selection of I/O modules is customised for the particular application. Several racks can be administered by a single processor, and may have thousands of inputs and outputs. A special high speed serial I/O link is used so that racks can be distributed away from the processor, reducing the wiring costs for large plants.
PLCs used in larger I/O systems may have peer-to-peer (P2P) communication between processors. This allows separate parts of a complex process to have individual control while allowing the subsystems to co-ordinate over the communication link. These communication links are also often used for HMI (Human-Machine Interface) devices such as keypads or PC-type workstations. Some of today's PLCs can communicate over a wide range of media including RS-485, Coaxial, and even Ethernet for I/O control at network speeds up to 100 Mbit/s.

Programming


Early PLCs, up to the mid-1980s, were programmed using proprietary programming panels or special-purpose programming terminals, which often had dedicated function keys representing the various logical elements of PLC programs. Programs were stored on cassette tape cartridges. Facilities for printing and documentation were very minimal due to lack of memory capacity. More recently, PLC programs are typically written in a special application on a personal computer, then downloaded by a direct-connection cable or over a network to the PLC. The very oldest PLCs used non-volatile magnetic core memory but now the program is stored in the PLC either in battery-backed-up RAM or some other non-volatile flash memory.
Early PLCs were designed to be used by electricians who would learn PLC programming on the job. These PLCs were programmed in "ladder logic", which strongly resembles a schematic diagram of relay logic. Modern PLCs can be programmed in a variety of ways, from ladder logic to more traditional programming languages such as BASIC and C. Another method is State Logic, a Very High Level Programming Language designed to program PLCs based on State Transition Diagrams.
Recently, the International standard IEC 61131-3 has become popular. IEC 61131-3 currently defines five programming languages for programmable control systems: FBD (Function block diagram), LD (Ladder diagram), ST (Structured text, similar to the Pascal programming language), IL (Instruction list, similar to assembly language) and SFC (Sequential function chart). These techniques emphasize logical organization of operations.
While the fundamental concepts of PLC programming are common to all manufacturers, differences in I/O addressing, memory organization and instruction sets mean that PLC programs are never perfectly interchangeable between different makers. Even within the same product line of a single manufacturer, different models may not be directly compatible.

User interface

PLCs may need to interact with people for the purpose of configuration, alarm reporting or everyday control. A Human-Machine Interface (HMI) is employed for this purpose.
A simple system may use buttons and lights to interact with the user. Text displays are available as well as graphical touch screens. Most modern PLCs can communicate over a network to some other system, such as a computer running a SCADA (Supervisory Control And Data Acquisition) system or web browser.

Communications

PLCs usually have built in communications ports usually 9-Pin RS232, and optionally for RS485 and Ethernet. Modbus or DF1 is usually included as one of the communications protocols. Others' options include various fieldbuses such as DeviceNet or Profibus. Other communications protocols that may be used are listed in the List of automation protocols.

History

The PLC was invented in response to the needs of the American automotive industry. Before the PLC, control, sequencing, and safety interlock logic for manufacturing automobiles was accomplished using relays, timers and dedicated closed-loop controllers. The process for updating such facilities for the yearly model change-over was very time consuming and expensive, as the relay systems needed to be rewired by skilled electricians. In 1968 GM Hydramatic (the automatic transmission division of General Motors) issued a request for proposal for an electronic replacement for hard-wired relay systems.
The winning proposal came from Bedford Associates of Bedford, Massachusetts. The first PLC, designated the 084 because it was Bedford Associates eighty-fourth project, was the result. Bedford Associates started a new company dedicated to developing, manufacturing, selling, and servicing this new product: Modicon, which stood for MOdular DIgital CONtroller. One of the people who worked on that project was Dick Morley, who is considered to be the "father" of the PLC. The Modicon brand was sold in 1977 to Gould Electronics, and later acquired by German Company AEG and then by Schneider Electric, the current owner.
One of the very first 084 models built is now on display at Modicon's headquarters in North Andover, Massachusetts. It was presented to Modicon by GM, when the unit was retired after nearly twenty years of uninterrupted service.
The automotive industry is still one of the largest users of PLCs, and Modicon still numbers some of its controller models such that they end with eighty-four. PLCs are used in many different industries and machines such as packaging and semiconductor machines. Well known PLC brands are Allen-Bradley, Mitsubishi Electric, ABB Ltd., Koyo, Honeywell, Siemens, Modicon, Omron, General Electric and Panasonic (a brand name of Matsushita).
In a similar way that Linux has changed personal and business computing there is an effort to bring Linux to the PLC world. With many challenges to overcome, the Linux open source PLC project is being worked on around the world. See the link below.

Other link
PLC Tutor

Article from "http://en.wikipedia.org/wiki/Programmable_logic_controller"