+ All Categories
Home > Documents > A Programmable Logic plc

A Programmable Logic plc

Date post: 06-Apr-2018
Category:
Upload: vijay-rohilla
View: 266 times
Download: 0 times
Share this document with a friend

of 16

Transcript
  • 8/2/2019 A Programmable Logic plc

    1/16

    A programmable logic controller (PLC) orprogrammable controller is adigital computerused forautomation ofelectromechanicalprocesses, such as control of machinery on factoryassembly lines,amusement rides, orlight fixtures. PLCs are used in many industries andmachines. Unlike general-purpose computers, the PLC is designed for multiple inputs and outputarrangements, extended temperature ranges, immunity to electrical noise, and resistance to

    vibration and impact. Programs to control machine operation are typically stored in battery-backed-up ornon-volatile memory. A PLC is an example of a hardreal time system since outputresults must be produced in response to input conditions within a bounded time, otherwiseunintended operation will result.

    Contents[hide]

    1 History

    2 Development

    2.1 Programming

    3 Functionality

    4 PLC topics

    4.1 Features

    4.2 Scan time

    4.3 System scale

    4.4 User interface

    4.5 Communications

    4.6 Programming

    5 PLC compared with other control systems

    6 Digital and analog signals

    6.1 Example

    7 See also

    8 References

    9 Further reading

    10 External links

    [edit] HistoryThe PLC was invented in response to the needs of the American automotive manufacturingindustry. Programmable logic controllers were initially adopted by the automotive industrywhere software revision replaced the re-wiring of hard-wired control panels when productionmodels changed.

    Before the PLC, control, sequencing, and safety interlock logic for manufacturing automobileswas accomplished using hundreds or thousands ofrelays,cam timers, anddrum sequencers anddedicated closed-loop controllers. The process for updating such facilities for the yearly model

    http://en.wikipedia.org/wiki/Digital_computerhttp://en.wikipedia.org/wiki/Digital_computerhttp://en.wikipedia.org/wiki/Automationhttp://en.wikipedia.org/wiki/Electromechanicalhttp://en.wikipedia.org/wiki/Electromechanicalhttp://en.wikipedia.org/wiki/Assembly_linehttp://en.wikipedia.org/wiki/Assembly_linehttp://en.wikipedia.org/wiki/Amusement_rideshttp://en.wikipedia.org/wiki/Amusement_rideshttp://en.wikipedia.org/wiki/Light_fixturehttp://en.wikipedia.org/wiki/Non-volatile_memoryhttp://en.wikipedia.org/wiki/Real-time_computinghttp://en.wikipedia.org/wiki/Real-time_computinghttp://en.wikipedia.org/wiki/Programmable_logic_controllerhttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=1http://en.wikipedia.org/wiki/Relayhttp://en.wikipedia.org/wiki/Relayhttp://en.wikipedia.org/wiki/Relayhttp://en.wikipedia.org/wiki/Cam_timerhttp://en.wikipedia.org/wiki/Cam_timerhttp://en.wikipedia.org/wiki/Drum_sequencerhttp://en.wikipedia.org/wiki/Drum_sequencerhttp://en.wikipedia.org/wiki/Automationhttp://en.wikipedia.org/wiki/Electromechanicalhttp://en.wikipedia.org/wiki/Assembly_linehttp://en.wikipedia.org/wiki/Amusement_rideshttp://en.wikipedia.org/wiki/Light_fixturehttp://en.wikipedia.org/wiki/Non-volatile_memoryhttp://en.wikipedia.org/wiki/Real-time_computinghttp://en.wikipedia.org/wiki/Programmable_logic_controllerhttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=1http://en.wikipedia.org/wiki/Relayhttp://en.wikipedia.org/wiki/Cam_timerhttp://en.wikipedia.org/wiki/Drum_sequencerhttp://en.wikipedia.org/wiki/Digital_computer
  • 8/2/2019 A Programmable Logic plc

    2/16

    change-overwas very time consuming and expensive, aselectriciansneeded to individuallyrewire each and every relay.

    Digital computers, being general-purpose programmable devices, were soon applied to control ofindustrial processes. Early computers required specialist programmers, and stringent operatingenvironmental control for temperature, cleanliness, and power quality. Using a general-purpose

    computer for process control required protecting the computer from the plant floor conditions.An industrial control computer would have several attributes: it would tolerate the shop-floorenvironment, it would support discrete (bit-form) input and output in an easily extensiblemanner, it would not require years of training to use, and it would permit its operation to bemonitored. The response time of any computer system must be fast enough to be useful forcontrol; the required speed varying according to the nature of the process.[1]

    In 1968 GM Hydramatic (the automatic transmission division ofGeneral Motors) issued arequest for proposal for an electronic replacement for hard-wired relay systems. The winningproposal came from Bedford Associates ofBedford, Massachusetts. The first PLC, designatedthe 084 because it was Bedford Associates' eighty-fourth project, was the result. [2] BedfordAssociates 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 whoworked on that project was Dick Morley, who is considered to be the "father" of the PLC. [3] TheModicon brand was sold in 1977 to Gould Electronics, and later acquired by German CompanyAEG and then by French Schneider Electric, the current owner.

    One of the very first 084 models built is now on display at Modicon's headquarters inNorthAndover, Massachusetts. It was presented to Modicon by GM, when the unit was retired afternearly twenty years of uninterrupted service. Modicon used the 84 moniker at the end of itsproduct range until the 984 made its appearance.

    The automotive industry is still one of the largest users of PLCs.

    [edit] Development

    Early PLCs were designed to replace relay logic systems. These PLCs were programmed in"ladder logic", which strongly resembles a schematic diagram of relay logic. This programnotation was chosen to reduce training demands for the existing technicians. Other early PLCsused a form ofinstruction list programming, based on a stack-based logic solver.

    Modern PLCs can be programmed in a variety of ways, from ladder logic to more traditionalprogramming languages such as BASIC and C. Another method is State Logic, avery high-levelprogramming language designed to program PLCs based on state transition diagrams.

    Many early PLCs did not have accompanying programming terminals that were capable ofgraphical representation of the logic, and so the logic was instead represented as a series of logicexpressions in some version ofBoolean format, similar toBoolean algebra. As programmingterminals evolved, it became more common for ladder logic to be used, for the aforementionedreasons and because it was a familiar format used for electromechanical control panels. Newerformats such as State Logic and Function Block (which is similar to the way logic is depictedwhen using digital integrated logic circuits) exist, but they are still not as popular as ladder logic.A primary reason for this is that PLCs solve the logic in a predictable and repeating sequence,and ladder logic allows the programmer (the person writing the logic) to see any issues with thetiming of the logic sequence more easily than would be possible in other formats.

    [edit] Programming

    http://en.wikipedia.org/wiki/Changeoverhttp://en.wikipedia.org/wiki/Changeoverhttp://en.wikipedia.org/wiki/Electricianhttp://en.wikipedia.org/wiki/Electricianhttp://en.wikipedia.org/wiki/Electricianhttp://en.wikipedia.org/wiki/General_Motorshttp://en.wikipedia.org/wiki/Bedford,_Massachusettshttp://en.wikipedia.org/wiki/Bedford,_Massachusettshttp://en.wikipedia.org/wiki/Bedford,_Massachusettshttp://en.wikipedia.org/wiki/Dick_Morleyhttp://en.wikipedia.org/wiki/Gould_Electronicshttp://en.wikipedia.org/wiki/AEGhttp://en.wikipedia.org/wiki/Schneider_Electrichttp://en.wikipedia.org/wiki/Schneider_Electrichttp://en.wikipedia.org/wiki/North_Andover,_Massachusettshttp://en.wikipedia.org/wiki/North_Andover,_Massachusettshttp://en.wikipedia.org/wiki/North_Andover,_Massachusettshttp://en.wikipedia.org/wiki/General_Motorshttp://en.wikipedia.org/wiki/General_Motorshttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=2http://en.wikipedia.org/wiki/Ladder_logichttp://en.wikipedia.org/wiki/Instruction_listhttp://en.wikipedia.org/wiki/State_Logichttp://en.wikipedia.org/wiki/State_Logichttp://en.wikipedia.org/wiki/Very_high-level_programming_languagehttp://en.wikipedia.org/wiki/Very_high-level_programming_languagehttp://en.wikipedia.org/wiki/Very_high-level_programming_languagehttp://en.wikipedia.org/wiki/State_diagramhttp://en.wikipedia.org/wiki/Boolean_logichttp://en.wikipedia.org/wiki/Boolean_algebrahttp://en.wikipedia.org/wiki/Boolean_algebrahttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=3http://en.wikipedia.org/wiki/Changeoverhttp://en.wikipedia.org/wiki/Electricianhttp://en.wikipedia.org/wiki/General_Motorshttp://en.wikipedia.org/wiki/Bedford,_Massachusettshttp://en.wikipedia.org/wiki/Dick_Morleyhttp://en.wikipedia.org/wiki/Gould_Electronicshttp://en.wikipedia.org/wiki/AEGhttp://en.wikipedia.org/wiki/Schneider_Electrichttp://en.wikipedia.org/wiki/North_Andover,_Massachusettshttp://en.wikipedia.org/wiki/North_Andover,_Massachusettshttp://en.wikipedia.org/wiki/General_Motorshttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=2http://en.wikipedia.org/wiki/Ladder_logichttp://en.wikipedia.org/wiki/Instruction_listhttp://en.wikipedia.org/wiki/State_Logichttp://en.wikipedia.org/wiki/Very_high-level_programming_languagehttp://en.wikipedia.org/wiki/Very_high-level_programming_languagehttp://en.wikipedia.org/wiki/State_diagramhttp://en.wikipedia.org/wiki/Boolean_logichttp://en.wikipedia.org/wiki/Boolean_algebrahttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=3
  • 8/2/2019 A Programmable Logic plc

    3/16

    Early PLCs, up to the mid-1980s, were programmed using proprietary programming panels orspecial-purpose programming terminals, which often had dedicated function keys representingthe various logical elements of PLC programs.[2] Programs were stored on cassette tapecartridges. Facilities for printing and documentation were very minimal due to lack of memorycapacity. The very oldest PLCs used non-volatile magnetic core memory.

    More recently, PLCs are programmed using application software on personal computers. Thecomputer is connected to the PLC through Ethernet, RS-232, RS-485 orRS-422 cabling. Theprogramming software allows entry and editing of the ladder-style logic. Generally the softwareprovides functions for debugging and troubleshooting the PLC software, for example, byhighlighting portions of the logic to show current status during operation or via simulation. Thesoftware will upload and download the PLC program, for backup and restoration purposes. Insome models of programmable controller, the program is transferred from a personal computer tothe PLC through aprogramming board which writes the program into a removable chip such asanEEPROM orEPROM.

    [edit] Functionality

    The functionality of the PLC has evolved over the years to include sequential relay control,motion control,process control, distributed control systemsand networking. The data handling,storage, processing power and communication capabilities of some modern PLCs areapproximately equivalent todesktop computers. PLC-like programming combined with remoteI/O hardware, allow a general-purpose desktop computer to overlap some PLCs in certainapplications. Regarding the practicality of these desktop computer based logic controllers, it isimportant to note that they have not been generally accepted in heavy industry because thedesktop computers run on less stable operating systems than do PLCs, and because the desktopcomputer hardware is typically not designed to the same levels of tolerance to temperature,humidity, vibration, and longevity as the processors used in PLCs. In addition to the hardwarelimitations of desktop based logic, operating systems such as Windows do not lend themselves todeterministic logic execution, with the result that the logic may not always respond to changes in

    logic state or input status with the extreme consistency in timing as is expected from PLCs. Still,such desktop logic applications find use in less critical situations, such as laboratory automationand use in small facilities where the application is less demanding and critical, because they aregenerally much less expensive than PLCs.

    In more recent years, small products called PLRs (programmable logic relays), and also bysimilar names, have become more common and accepted. These are very much like PLCs, andare used in light industry where only a few points of I/O (i.e. a few signals coming in from thereal world and a few going out) are involved, and low cost is desired. These small devices aretypically made in a common physical size and shape by several manufacturers, and branded bythe makers of larger PLCs to fill out their low end product range. Popular names include PICOController, NANO PLC, and other names implying very small controllers. Most of these have

    between 8 and 12 digital inputs, 4 and 8 digital outputs, and up to 2 analog inputs. Size is usuallyabout 4" wide, 3" high, and 3" deep. Most such devices include a tiny postage stamp sized LCDscreen for viewing simplified ladder logic (only a very small portion of the program being visibleat a given time) and status of I/O points, and typically these screens are accompanied by a 4-wayrocker push-button plus four more separate push-buttons, similar to the key buttons on a VCRremote control, and used to navigate and edit the logic. Most have a small plug for connectingvia RS-232 or RS-485 to a personal computer so that programmers can use simple Windowsapplications for programming instead of being forced to use the tiny LCD and push-button set

    http://en.wikipedia.org/wiki/Computer_terminalhttp://en.wikipedia.org/wiki/Computer_terminalhttp://en.wikipedia.org/wiki/Cassette_tape_cartridgehttp://en.wikipedia.org/wiki/Cassette_tape_cartridgehttp://en.wikipedia.org/wiki/Cassette_tape_cartridgehttp://en.wikipedia.org/wiki/Magnetic_core_memoryhttp://en.wikipedia.org/wiki/Ethernethttp://en.wikipedia.org/wiki/RS-232http://en.wikipedia.org/wiki/RS-485http://en.wikipedia.org/wiki/RS-422http://en.wikipedia.org/w/index.php?title=Programming_board&action=edit&redlink=1http://en.wikipedia.org/wiki/EEPROMhttp://en.wikipedia.org/wiki/EEPROMhttp://en.wikipedia.org/wiki/EPROMhttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=4http://en.wikipedia.org/wiki/Process_controlhttp://en.wikipedia.org/wiki/Distributed_control_systemhttp://en.wikipedia.org/wiki/Distributed_control_systemhttp://en.wikipedia.org/wiki/Computer_networkhttp://en.wikipedia.org/wiki/Computer_networkhttp://en.wikipedia.org/wiki/Desktop_computerhttp://en.wikipedia.org/wiki/Desktop_computerhttp://en.wikipedia.org/wiki/Computer_terminalhttp://en.wikipedia.org/wiki/Cassette_tape_cartridgehttp://en.wikipedia.org/wiki/Cassette_tape_cartridgehttp://en.wikipedia.org/wiki/Magnetic_core_memoryhttp://en.wikipedia.org/wiki/Ethernethttp://en.wikipedia.org/wiki/RS-232http://en.wikipedia.org/wiki/RS-485http://en.wikipedia.org/wiki/RS-422http://en.wikipedia.org/w/index.php?title=Programming_board&action=edit&redlink=1http://en.wikipedia.org/wiki/EEPROMhttp://en.wikipedia.org/wiki/EPROMhttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=4http://en.wikipedia.org/wiki/Process_controlhttp://en.wikipedia.org/wiki/Distributed_control_systemhttp://en.wikipedia.org/wiki/Computer_networkhttp://en.wikipedia.org/wiki/Desktop_computer
  • 8/2/2019 A Programmable Logic plc

    4/16

    for this purpose. Unlike regular PLCs that are usually modular and greatly expandable, the PLRsare usually not modular or expandable, but their price can be twoorders of magnitudeless than aPLC and they still offer robust design and deterministic execution of the logic.

    [edit] PLC topics

    [edit] Features

    Control panel with PLC (grey elements in the center). The unit consists of separate elements,from left to right;power supply, controller, relayunits for in- and output

    The main difference from other computers is that PLCs are armored for severe conditions (suchas dust, moisture, heat, cold) and have the facility for extensiveinput/output(I/O) arrangements.These connect the PLC to sensorsand actuators. PLCs read limit switches, analog processvariables (such as temperature and pressure), and the positions of complex positioning systems.Some usemachine vision.[4]. On the actuator side, PLCs operate electric motors,pneumatic orhydrauliccylinders, magnetic relays, solenoids, or analog outputs. The input/outputarrangements may be built into a simple PLC, or the PLC may have external I/O modulesattached to a computer network that plugs into the PLC.

    [edit] Scan time

    A PLC program is generally executed repeatedly as long as the controlled system is running. Thestatus of physical input points is copied to an area of memory accessible to the processor,sometimes called the "I/O Image Table". The program is then run from its first instruction rungdown to the last rung. It takes some time for the processor of the PLC to evaluate all the rungsand update the I/O image table with the status of outputs..[5] This scan time may be a fewmilliseconds for a small program or on a fast processor, but older PLCs running very largeprograms could take much longer (say, up to 100 ms) to execute the program. If the scan timewas too long, the response of the PLC to process conditions would be too slow to be useful.

    http://en.wikipedia.org/wiki/Orders_of_magnitudehttp://en.wikipedia.org/wiki/Orders_of_magnitudehttp://en.wikipedia.org/wiki/Orders_of_magnitudehttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=5http://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=6http://en.wikipedia.org/wiki/Power_supplyhttp://en.wikipedia.org/wiki/Relayhttp://en.wikipedia.org/wiki/Relayhttp://en.wikipedia.org/wiki/Input/outputhttp://en.wikipedia.org/wiki/Input/outputhttp://en.wikipedia.org/wiki/Input/outputhttp://en.wikipedia.org/wiki/Sensorhttp://en.wikipedia.org/wiki/Sensorhttp://en.wikipedia.org/wiki/Actuatorhttp://en.wikipedia.org/wiki/Switchhttp://en.wikipedia.org/wiki/Switchhttp://en.wikipedia.org/wiki/Machine_visionhttp://en.wikipedia.org/wiki/Machine_visionhttp://en.wikipedia.org/wiki/Electric_motorhttp://en.wikipedia.org/wiki/Pneumatichttp://en.wikipedia.org/wiki/Pneumatichttp://en.wikipedia.org/wiki/Hydraulichttp://en.wikipedia.org/wiki/Hydraulichttp://en.wikipedia.org/wiki/Relayhttp://en.wikipedia.org/wiki/Solenoidhttp://en.wikipedia.org/wiki/Solenoidhttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=7http://en.wikipedia.org/wiki/Programmable_logic_controllerhttp://en.wikipedia.org/wiki/File:PLC_Control_Panel.pnghttp://en.wikipedia.org/wiki/File:PLC_Control_Panel.pnghttp://en.wikipedia.org/wiki/Orders_of_magnitudehttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=5http://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=6http://en.wikipedia.org/wiki/Power_supplyhttp://en.wikipedia.org/wiki/Relayhttp://en.wikipedia.org/wiki/Input/outputhttp://en.wikipedia.org/wiki/Sensorhttp://en.wikipedia.org/wiki/Actuatorhttp://en.wikipedia.org/wiki/Switchhttp://en.wikipedia.org/wiki/Machine_visionhttp://en.wikipedia.org/wiki/Electric_motorhttp://en.wikipedia.org/wiki/Pneumatichttp://en.wikipedia.org/wiki/Hydraulichttp://en.wikipedia.org/wiki/Relayhttp://en.wikipedia.org/wiki/Solenoidhttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=7http://en.wikipedia.org/wiki/Programmable_logic_controller
  • 8/2/2019 A Programmable Logic plc

    5/16

    As PLCs became more advanced, methods were developed to change the sequence of ladderexecution, and subroutines were implemented.[6] This simplified programming and could also beused to save scan time for high-speed processes; for example, parts of the program used only forsetting up the machine could be segregated from those parts required to operate at higher speed.

    Special-purpose I/O modules, such as timer modules or counter modules, could be used where

    the scan time of the processor was too long to reliably pick up, for example, counting pulsesfrom a shaft encoder. The relatively slow PLC could still interpret the counted values to control amachine, but the accumulation of pulses was done by a dedicated module that was unaffected bythe speed of the program execution.

    [edit] 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 has insufficient I/O.

    Modular PLCs have a chassis (also called a rack) into which are placed modules with differentfunctions. The processor and selection of I/O modules are customized for the particularapplication. 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 distributedaway from the processor, reducing the wiring costs for large plants.

    [edit] User interface

    See also: User interface and List of human-computer interaction topics

    PLCs may need to interact with people for the purpose of configuration, alarm reporting oreveryday control. A human-machine interface (HMI) is employed for this purpose. HMIs arealso referred to as man-machine interfaces (MMIs) and graphical user interface (GUIs). A simplesystem may use buttons and lights to interact with the user. Text displays are available as well asgraphical touch screens. More complex systems use programming and monitoring softwareinstalled on a computer, with the PLC connected via a communication interface.

    [edit] CommunicationsPLCs have built in communications ports, usually 9-pin RS-232, but optionally EIA-485 orEthernet. Modbus, BACnet orDF1 is usually included as one of the communications protocols.Other options include various fieldbuses such as DeviceNetorProfibus. Other communicationsprotocols that may be used are listed in the List of automation protocols.

    Most modern PLCs can communicate over a network to some other system, such as a computerrunning a SCADA (Supervisory Control And Data Acquisition) system or web browser.

    PLCs used in larger I/O systems may havepeer-to-peer(P2P) communication betweenprocessors. This allows separate parts of a complex process to have individual control whileallowing the subsystems to co-ordinate over the communication link. These communication linksare also often used forHMI devices such as keypads orPC-type workstations.

    [edit] Programming

    PLC programs are typically written in a special application on a personal computer, thendownloaded by a direct-connection cable or over a network to the PLC. The program is stored inthe PLC either in battery-backed-upRAM or some other non-volatile flash memory. Often, asingle PLC can be programmed to replace thousands ofrelays.[7]

    http://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=8http://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=9http://en.wikipedia.org/wiki/User_interfacehttp://en.wikipedia.org/wiki/List_of_human-computer_interaction_topicshttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=10http://en.wikipedia.org/wiki/RS-232http://en.wikipedia.org/wiki/EIA-485http://en.wikipedia.org/wiki/Ethernethttp://en.wikipedia.org/wiki/Modbushttp://en.wikipedia.org/wiki/BACnethttp://en.wikipedia.org/w/index.php?title=DF1&action=edit&redlink=1http://en.wikipedia.org/wiki/Communications_protocolshttp://en.wikipedia.org/wiki/Fieldbushttp://en.wikipedia.org/wiki/DeviceNethttp://en.wikipedia.org/wiki/DeviceNethttp://en.wikipedia.org/wiki/Profibushttp://en.wikipedia.org/wiki/List_of_automation_protocolshttp://en.wikipedia.org/wiki/SCADAhttp://en.wikipedia.org/wiki/Peer-to-peerhttp://en.wikipedia.org/wiki/User_interfacehttp://en.wikipedia.org/wiki/Personal_computerhttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=11http://en.wikipedia.org/wiki/RAMhttp://en.wikipedia.org/wiki/RAMhttp://en.wikipedia.org/wiki/Flash_memoryhttp://en.wikipedia.org/wiki/Flash_memoryhttp://en.wikipedia.org/wiki/Relayhttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=8http://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=9http://en.wikipedia.org/wiki/User_interfacehttp://en.wikipedia.org/wiki/List_of_human-computer_interaction_topicshttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=10http://en.wikipedia.org/wiki/RS-232http://en.wikipedia.org/wiki/EIA-485http://en.wikipedia.org/wiki/Ethernethttp://en.wikipedia.org/wiki/Modbushttp://en.wikipedia.org/wiki/BACnethttp://en.wikipedia.org/w/index.php?title=DF1&action=edit&redlink=1http://en.wikipedia.org/wiki/Communications_protocolshttp://en.wikipedia.org/wiki/Fieldbushttp://en.wikipedia.org/wiki/DeviceNethttp://en.wikipedia.org/wiki/Profibushttp://en.wikipedia.org/wiki/List_of_automation_protocolshttp://en.wikipedia.org/wiki/SCADAhttp://en.wikipedia.org/wiki/Peer-to-peerhttp://en.wikipedia.org/wiki/User_interfacehttp://en.wikipedia.org/wiki/Personal_computerhttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=11http://en.wikipedia.org/wiki/RAMhttp://en.wikipedia.org/wiki/Flash_memoryhttp://en.wikipedia.org/wiki/Relay
  • 8/2/2019 A Programmable Logic plc

    6/16

    Under the IEC 61131-3 standard, PLCs can be programmed using standards-based programminglanguages. A graphical programming notation calledSequential Function Chartsis available oncertain programmable controllers. Initially most PLCs utilized Ladder Logic DiagramProgramming, a model which emulated electromechanical control panel devices (such as thecontact and coils of relays) which PLCs replaced. This model remains common today.

    IEC 61131-3 currently defines five programming languages for programmable control systems:function block diagram (FBD), ladder diagram (LD),structured text (ST; similar to the Pascalprogramming language), instruction list (IL; similar to assembly language) and sequentialfunction chart (SFC)[8]. These techniques emphasize logical organization of operations.[7]

    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 programsare never perfectly interchangeable between different makers. Even within the same product lineof a single manufacturer, different models may not be directly compatible.

    [edit] PLC compared with other control systems

    Allen-Bradley PLC installed in a control panel

    PLCs are well-adapted to a range ofautomation tasks. These are typically industrial processes inmanufacturing where the cost of developing and maintaining the automation system is highrelative to the total cost of the automation, and where changes to the system would be expectedduring its operational life. PLCs contain input and output devices compatible with industrial pilotdevices and controls; little electrical design is required, and the design problem centers onexpressing the desired sequence of operations. PLC applications are typically highly customizedsystems so the cost of a packaged PLC is low compared to the cost of a specific custom-builtcontroller design. On the other hand, in the case of mass-produced goods, customized controlsystems are economic due to the lower cost of the components, which can be optimally choseninstead of a "generic" solution, and where the non-recurring engineering charges are spread overthousands or millions of units.

    For high volume or very simple fixed automation tasks, different techniques are used. Forexample, a consumerdishwasherwould be controlled by an electromechanical cam timercostingonly a few dollars in production quantities.

    A microcontroller-based design would be appropriate where hundreds or thousands of units willbe produced and so the development cost (design of power supplies, input/output hardware andnecessary testing and certification) can be spread over many sales, and where the end-user wouldnot need to alter the control. Automotive applications are an example; millions of units are builteach year, and very few end-users alter the programming of these controllers. However, some

    http://en.wikipedia.org/wiki/IEC_61131-3http://en.wikipedia.org/wiki/Sequential_function_charthttp://en.wikipedia.org/wiki/Sequential_function_charthttp://en.wikipedia.org/wiki/Sequential_function_charthttp://en.wikipedia.org/wiki/Function_block_diagramhttp://en.wikipedia.org/wiki/Ladder_logichttp://en.wikipedia.org/wiki/Structured_texthttp://en.wikipedia.org/wiki/Structured_texthttp://en.wikipedia.org/wiki/Pascal_programming_languagehttp://en.wikipedia.org/wiki/Pascal_programming_languagehttp://en.wikipedia.org/wiki/Instruction_listhttp://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Sequential_function_charthttp://en.wikipedia.org/wiki/Sequential_function_charthttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=12http://en.wikipedia.org/wiki/Automationhttp://en.wikipedia.org/wiki/Automationhttp://en.wikipedia.org/wiki/Dishwasherhttp://en.wikipedia.org/wiki/Dishwasherhttp://en.wikipedia.org/wiki/Cam_timerhttp://en.wikipedia.org/wiki/Microcontrollerhttp://en.wikipedia.org/wiki/File:BMA_Automation_Allen_Bradley_PLC_3.JPGhttp://en.wikipedia.org/wiki/File:BMA_Automation_Allen_Bradley_PLC_3.JPGhttp://en.wikipedia.org/wiki/IEC_61131-3http://en.wikipedia.org/wiki/Sequential_function_charthttp://en.wikipedia.org/wiki/Function_block_diagramhttp://en.wikipedia.org/wiki/Ladder_logichttp://en.wikipedia.org/wiki/Structured_texthttp://en.wikipedia.org/wiki/Pascal_programming_languagehttp://en.wikipedia.org/wiki/Pascal_programming_languagehttp://en.wikipedia.org/wiki/Instruction_listhttp://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Sequential_function_charthttp://en.wikipedia.org/wiki/Sequential_function_charthttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=12http://en.wikipedia.org/wiki/Automationhttp://en.wikipedia.org/wiki/Dishwasherhttp://en.wikipedia.org/wiki/Cam_timerhttp://en.wikipedia.org/wiki/Microcontroller
  • 8/2/2019 A Programmable Logic plc

    7/16

    specialty vehicles such as transit buses economically use PLCs instead of custom-designedcontrols, because the volumes are low and the development cost would be uneconomic.[9]

    Very complex process control, such as used in the chemical industry, may require algorithms andperformance beyond the capability of even high-performance PLCs. Very high-speed orprecision controls may also require customized solutions; for example, aircraft flight controls.

    Single-board computers using semi-customized or fully proprietary hardware may be chosen forvery demanding control applications where the high development and maintenance cost can besupported. "Soft PLCs" running on desktop-type computers can interface with industrial I/Ohardware while executing programs within a version of commercial operating systems adaptedfor process control needs.[9]

    Programmable controllers are widely used in motion control, positioning control and torquecontrol. Some manufacturers produce motion control units to be integrated with PLC so thatG-code (involving a CNC machine) can be used to instruct machine movements.[citation needed]

    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 ofa 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 distributedcontrol system(DCS) would instead be used. As PLCs have become more powerful, theboundary between DCS and PLC applications has become less distinct.

    PLCs have similar functionality as Remote Terminal Units. An RTU, however, usually does notsupport control algorithms or control loops. As hardware rapidly becomes more powerful andcheaper, RTUs, PLCs and DCSs are increasingly beginning to overlap in responsibilities, andmany vendors sell RTUs with PLC-like features and vice versa. The industry has standardized onthe IEC 61131-3 functional block language for creating programs to run on RTUs and PLCs,although nearly all vendors also offer proprietary alternatives and associated developmentenvironments.

    In recent years "Safety" PLCs have started to become popular, either as standalone models (PilzPNOZ Multi, Sick etc.) or as functionality and safety-rated hardware added to existing controllerarchitectures (Allen Bradley Guardlogix, Siemens F-series etc.). These differ from conventionalPLC types as being suitable for use in safety-critical applications for which PLCs havetraditionally been supplemented with hard-wired safety relays. For example, a Safety PLC mightbe used to control access to a robot cell with trapped-key access, or perhaps to manage theshutdown response to an emergency stop on a conveyor production line. Such PLCs typicallyhave a restricted regular instruction set augmented with safety-specific instructions designed tointerface with emergency stops, light screens and so forth. The flexibility that such systems offerhas resulted in rapid growth of demand for these controllers.

    [edit] 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). Push buttons, limit switches, andphotoelectric sensors are examplesof devices providing a discrete signal. Discrete signals are sent using eithervoltage orcurrent,where a specific range is designated as On and another as Off. For example, a PLC might use 24V DC I/O, with values above 22 V DC representing On, values below 2VDC representing Off,and intermediate values undefined. 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

    http://en.wikipedia.org/wiki/Single-board_computerhttp://en.wikipedia.org/wiki/G-codehttp://en.wikipedia.org/wiki/G-codehttp://en.wikipedia.org/wiki/G-codehttp://en.wikipedia.org/wiki/CNChttp://en.wikipedia.org/wiki/Wikipedia:Citation_neededhttp://en.wikipedia.org/wiki/Wikipedia:Citation_neededhttp://en.wikipedia.org/wiki/PID_controllerhttp://en.wikipedia.org/wiki/Distributed_control_systemhttp://en.wikipedia.org/wiki/Distributed_control_systemhttp://en.wikipedia.org/wiki/Distributed_control_systemhttp://en.wikipedia.org/wiki/Remote_Terminal_Unithttp://en.wikipedia.org/wiki/Remote_Terminal_Unithttp://en.wikipedia.org/wiki/Remote_Terminal_Unithttp://en.wikipedia.org/wiki/Distributed_Control_Systemhttp://en.wikipedia.org/wiki/IEC_61131-3http://en.wikipedia.org/wiki/Trapped_key_interlockinghttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=13http://en.wikipedia.org/wiki/Photoelectric_sensorhttp://en.wikipedia.org/wiki/Voltagehttp://en.wikipedia.org/wiki/Voltagehttp://en.wikipedia.org/wiki/Current_(electricity)http://en.wikipedia.org/wiki/Single-board_computerhttp://en.wikipedia.org/wiki/G-codehttp://en.wikipedia.org/wiki/G-codehttp://en.wikipedia.org/wiki/CNChttp://en.wikipedia.org/wiki/Wikipedia:Citation_neededhttp://en.wikipedia.org/wiki/PID_controllerhttp://en.wikipedia.org/wiki/Distributed_control_systemhttp://en.wikipedia.org/wiki/Distributed_control_systemhttp://en.wikipedia.org/wiki/Remote_Terminal_Unithttp://en.wikipedia.org/wiki/Remote_Terminal_Unithttp://en.wikipedia.org/wiki/Distributed_Control_Systemhttp://en.wikipedia.org/wiki/IEC_61131-3http://en.wikipedia.org/wiki/Trapped_key_interlockinghttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=13http://en.wikipedia.org/wiki/Photoelectric_sensorhttp://en.wikipedia.org/wiki/Voltagehttp://en.wikipedia.org/wiki/Current_(electricity)
  • 8/2/2019 A Programmable Logic plc

    8/16

    accuracy depending on the device and the number of bits available to store the data. As PLCstypically 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. Analogsignals can use voltageorcurrentwith a magnitude proportional to the value of the processsignal. For example, an analog 0 - 10 V input or4-20 mA would be convertedinto an integervalue of 0 - 32767.

    Current inputs are less sensitive to electrical noise (i.e. from welders or electric motor starts) thanvoltage inputs.

    [edit] Example

    As an example, say a facility needs to store water in a tank. The water is drawn from the tank byanother 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(Low Level andHigh Level). When the water level is above the switch it closes a contact and passes a signal toan input. The PLC uses a digital output to open and close the inletvalve into the tank.

    When the water level drops enough so that the Low Level float switch is off (down), the PLC

    will open the valve to let more water in. Once the water level rises enough so that the High Levelswitch is on (up), the PLC will shut the inlet to stop the water from overflowing. This rung is anexample of seal-in (latching) logic. The output is sealed in until some condition breaks thecircuit.

    | || Low Level High Level Fill Valve ||------[/]------|------[/]----------------------(OUT)---------|| | || | || | || Fill Valve | ||------[ ]------| || || |

    An analog system might use a waterpressure sensoror a load cell, and an adjustable (throttled)control (e.g. by a valve) of the fill of 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 themotion of the valve, and reduce its wear.

    A real system might combine both approaches, using float switches and simple valves to preventspills, and a rate sensor and rate valve to optimize refill rates and prevent water hammer. Backupand maintenance methods can make a real system very complicated

    A function block diagram (FBD) is ablock diagram that describes a function between inputvariables and output variables. A functionis described as a set of elementary blocks. Input andoutput variables are connected to blocks by connection lines. An output of a block may also beconnected to an input of another block:

    http://en.wikipedia.org/wiki/Voltagehttp://en.wikipedia.org/wiki/Voltagehttp://en.wikipedia.org/wiki/Current_(electricity)http://en.wikipedia.org/wiki/Current_(electricity)http://en.wikipedia.org/wiki/4-20_mAhttp://en.wikipedia.org/wiki/Analog-to-digital_converterhttp://en.wikipedia.org/wiki/Analog-to-digital_converterhttp://en.wikipedia.org/wiki/Current_loophttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=14http://en.wikipedia.org/wiki/Float_switchhttp://en.wikipedia.org/wiki/Float_switchhttp://en.wikipedia.org/wiki/Valvehttp://en.wikipedia.org/wiki/Valvehttp://en.wikipedia.org/wiki/Pressure_sensorhttp://en.wikipedia.org/wiki/Load_cellhttp://en.wikipedia.org/wiki/Hysteresishttp://en.wikipedia.org/wiki/Deadbandhttp://en.wikipedia.org/wiki/Water_hammerhttp://en.wikipedia.org/wiki/Water_hammerhttp://en.wikipedia.org/wiki/Block_diagramhttp://en.wikipedia.org/wiki/Function_(computer_science)http://en.wikipedia.org/wiki/Function_(computer_science)http://en.wikipedia.org/wiki/Voltagehttp://en.wikipedia.org/wiki/Current_(electricity)http://en.wikipedia.org/wiki/4-20_mAhttp://en.wikipedia.org/wiki/Analog-to-digital_converterhttp://en.wikipedia.org/wiki/Current_loophttp://en.wikipedia.org/w/index.php?title=Programmable_logic_controller&action=edit&section=14http://en.wikipedia.org/wiki/Float_switchhttp://en.wikipedia.org/wiki/Valvehttp://en.wikipedia.org/wiki/Pressure_sensorhttp://en.wikipedia.org/wiki/Load_cellhttp://en.wikipedia.org/wiki/Hysteresishttp://en.wikipedia.org/wiki/Deadbandhttp://en.wikipedia.org/wiki/Water_hammerhttp://en.wikipedia.org/wiki/Block_diagramhttp://en.wikipedia.org/wiki/Function_(computer_science)
  • 8/2/2019 A Programmable Logic plc

    9/16

    Functional block diagram of the attitude control and maneuvering electronics system. June 1962.

    Inputs and outputs of the blocks are wired together with connection lines, or links. Single lines

    may be used to connect two logical points of the diagram: An input variable and an input of a block

    An output of a block and an input of another block

    An output of a block and an output variable

    The connection is oriented, meaning that the line carries associated data from the left end to theright end. The left and right ends of the connection line must be of the same type.

    Multiple right connection, also called divergence can be used to broadcast information from itsleft end to each of its right ends. All ends of the connection must be of the same type.

    Function block diagram is one of five languages forlogic orcontrolconfigurationsupported bystandardIEC 61131-3 for a control system such as a Programmable Logic Controller(PLC) or aDistributed Control System (DCS). The other supported languages areladder logic,sequentialfunction chart, structured text, andinstruction lis

    Ladder logic is aprogramming language that represents a program by a graphical diagram basedon the circuit diagramsofrelay logichardware. It is primarily used to develop software forprogrammable logic controllers(PLCs) used in industrial control applications. The name is basedon the observation that programs in this language resemble ladders, with two vertical rails and aseries of horizontal rungs between them.

    Contents 1 Overview

    2 Example of a simple ladder logic program

    3 Examples

    4 Additional functionality

    5 Limitations and successor languages

    6 See also

    7 External links

    http://en.wikipedia.org/wiki/Logichttp://en.wikipedia.org/wiki/Logichttp://en.wikipedia.org/wiki/Control_theoryhttp://en.wikipedia.org/wiki/Control_theoryhttp://en.wikipedia.org/wiki/Computer_configurationhttp://en.wikipedia.org/wiki/Computer_configurationhttp://en.wikipedia.org/wiki/Computer_configurationhttp://en.wikipedia.org/wiki/Standardizationhttp://en.wikipedia.org/wiki/IEC_61131-3http://en.wikipedia.org/wiki/Control_systemhttp://en.wikipedia.org/wiki/Programmable_Logic_Controllerhttp://en.wikipedia.org/wiki/Distributed_Control_Systemhttp://en.wikipedia.org/wiki/Ladder_logichttp://en.wikipedia.org/wiki/Ladder_logichttp://en.wikipedia.org/wiki/Sequential_function_charthttp://en.wikipedia.org/wiki/Sequential_function_charthttp://en.wikipedia.org/wiki/Sequential_function_charthttp://en.wikipedia.org/wiki/Structured_texthttp://en.wikipedia.org/wiki/Instruction_listhttp://en.wikipedia.org/wiki/Instruction_listhttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Circuit_diagramhttp://en.wikipedia.org/wiki/Circuit_diagramhttp://en.wikipedia.org/wiki/Relay_logichttp://en.wikipedia.org/wiki/Relay_logichttp://en.wikipedia.org/wiki/Programmable_logic_controllerhttp://en.wikipedia.org/wiki/Programmable_logic_controllerhttp://en.wikipedia.org/wiki/File:Functional_block_diagram_of_the_attitude_control_and_maneuvering_electronics_system_.jpghttp://en.wikipedia.org/wiki/File:Functional_block_diagram_of_the_attitude_control_and_maneuvering_electronics_system_.jpghttp://en.wikipedia.org/wiki/Logichttp://en.wikipedia.org/wiki/Control_theoryhttp://en.wikipedia.org/wiki/Computer_configurationhttp://en.wikipedia.org/wiki/Standardizationhttp://en.wikipedia.org/wiki/IEC_61131-3http://en.wikipedia.org/wiki/Control_systemhttp://en.wikipedia.org/wiki/Programmable_Logic_Controllerhttp://en.wikipedia.org/wiki/Distributed_Control_Systemhttp://en.wikipedia.org/wiki/Ladder_logichttp://en.wikipedia.org/wiki/Sequential_function_charthttp://en.wikipedia.org/wiki/Sequential_function_charthttp://en.wikipedia.org/wiki/Structured_texthttp://en.wikipedia.org/wiki/Instruction_listhttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Circuit_diagramhttp://en.wikipedia.org/wiki/Relay_logichttp://en.wikipedia.org/wiki/Programmable_logic_controller
  • 8/2/2019 A Programmable Logic plc

    10/16

    [edit] OverviewAn argument that aided the initial adoption of ladder logic was that a wide variety of engineersand technicians would be able to understand and use it without much additional training, becauseof the resemblance to familiar hardware systems. This argument has become less relevant giventhat most ladder logic programmers have a software background in more conventionalprogramming languages, and in practice implementations of ladder logic have characteristics,such as sequential execution and support for control flow features, that make the analogy tohardware somewhat inaccurate.

    Ladder logic is widely used to programPLCs, where sequential control of a process ormanufacturing operation is required. Ladder logic is useful for simple but critical control systemsor for reworking old hardwiredrelay circuits. As programmable logic controllers became moresophisticated it has also been used in very complex automation systems. Often the ladder logicprogram is used in conjunction with an HMI program operating on a computer workstation.

    Manufacturers of programmable logic controllers generally also provide associated ladder logicprogramming systems. Typically the ladder logic languages from two manufacturers will not be

    completely compatible; ladder logic is better thought of as a set of closely related programminglanguages rather than one language. (The IEC 61131-3standard has helped to reduceunnecessary differences, but translating programs between systems still requires significantwork.) Even different models of programmable controllers within the same family may havedifferent ladder notation such that programs cannot be seamlessly interchanged between models.

    Ladder logic can be thought of as a rule-based language rather than aprocedural language. A"rung" in the ladder represents a rule. When implemented with relays and otherelectromechanical devices, the various rules "execute" simultaneously and immediately. Whenimplemented in a programmable logic controller, the rules are typically executed sequentially bysoftware, in a continuous loop (scan). By executing the loop fast enough, typically many timesper second, the effect of simultaneous and immediate execution is relatively achieved to withinthe tolerance of the time required to execute every rung in the "loop" (the "scan time"). It issomewhat similar to other rule-based languages, like spreadsheets orSQL. However, proper useof programmable controllers requires understanding the limitations of the execution order ofrungs.

    [edit] Example of a simple ladder logic programThe language itself can be seen as a set of connections between logical checkers (contacts) andactuators (coils). If a path can be traced between the left side of the rung and the output, throughasserted (true or "closed") contacts, the rung is true and the output coil storage bit is asserted (1)or true. If no path can be traced, then the output is false (0) and the "coil" by analogy to electro-mechanical relaysis considered "de-energized". The analogy between logical propositions andrelay contact status is due toClaude Shannon.

    Ladder logic has contacts that make or break circuits to control coils. Each coil or contactcorresponds to the status of a single bit in the programmable controller's memory. Unlikeelectromechanical relays, a ladder program can refer any number of times to the status of a singlebit, equivalent to a relay with an indefinitely large number of contacts.

    So-called "contacts" may refer to physical ("hard") inputs to the programmable controller fromphysical devices such as pushbuttons and limit switches via an integrated or external input

    http://en.wikipedia.org/w/index.php?title=Ladder_logic&action=edit&section=1http://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Programmable_logic_controllerhttp://en.wikipedia.org/wiki/Programmable_logic_controllerhttp://en.wikipedia.org/wiki/Programmable_logic_controllerhttp://en.wikipedia.org/wiki/Hardwiredhttp://en.wikipedia.org/wiki/Hardwiredhttp://en.wikipedia.org/wiki/User_Interfacehttp://en.wikipedia.org/wiki/IEC_61131-3http://en.wikipedia.org/wiki/IEC_61131-3http://en.wikipedia.org/wiki/Procedural_languagehttp://en.wikipedia.org/wiki/Spreadsheethttp://en.wikipedia.org/wiki/SQLhttp://en.wikipedia.org/wiki/SQLhttp://en.wikipedia.org/wiki/SQLhttp://en.wikipedia.org/w/index.php?title=Ladder_logic&action=edit&section=2http://en.wikipedia.org/wiki/Relayhttp://en.wikipedia.org/wiki/Relayhttp://en.wikipedia.org/wiki/Claude_Shannonhttp://en.wikipedia.org/wiki/Claude_Shannonhttp://en.wikipedia.org/w/index.php?title=Ladder_logic&action=edit&section=1http://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Programmable_logic_controllerhttp://en.wikipedia.org/wiki/Hardwiredhttp://en.wikipedia.org/wiki/User_Interfacehttp://en.wikipedia.org/wiki/IEC_61131-3http://en.wikipedia.org/wiki/Procedural_languagehttp://en.wikipedia.org/wiki/Spreadsheethttp://en.wikipedia.org/wiki/SQLhttp://en.wikipedia.org/w/index.php?title=Ladder_logic&action=edit&section=2http://en.wikipedia.org/wiki/Relayhttp://en.wikipedia.org/wiki/Claude_Shannon
  • 8/2/2019 A Programmable Logic plc

    11/16

    module, or may represent the status of internal storage bits which may be generated elsewhere inthe program.

    Each rung of ladder language typically has one coil at the far right. Some manufacturers mayallow more than one output coil on a rung.

    ( )A regular coil, energized whenever its rung is closed.

    (\)A "not" coil, energized whenever its rung is open.

    [ ]A regular contact, closed whenever its corresponding coil or an input whichcontrols it is energized.

    [\]A "not" contact, open whenever its corresponding coil or an input which controlsit is energized.

    The "coil" (output of a rung) may represent a physical output which operates some deviceconnected to the programmable controller, or may represent an internal storage bit for useelsewhere in the program.

    [edit] ExamplesHere is an example of what one rung in a ladder logic program might look like. In real worldapplications, there may be hundreds or thousands of rungs.

    For example:

    1. ----[ ]---------|--[ ]--|------( )X | Y | S

    | ||--[ ]--|

    Z

    The above realizes the function: S = X AND ( Y ORZ )

    Typically, complex ladder logic is 'read' left to right and top to bottom. As each of the lines (or

    rungs) are evaluated the output coil of a rung may feed into the next stage of the ladder as aninput. In a complex system there will be many "rungs" on a ladder, which are numbered in orderof evaluation.

    1. ----[ ]-----------|---[ ]---|----( )X | Y | S

    | ||---[ ]---|

    Z2. ----[ ]----[ ]-------------------( )

    S X T

    2. T = S AND X

    This represents a slightly more complex system for rung 2. After the first line has beenevaluated, the output coil (S) is fed into rung 2, which is then evaluated and the output coil Tcould be fed into an output device (buzzer, light etc..) or into rung 3 on the ladder. (Note that thecontact X on the second rung serves no useful purpose, as X is already defined in the 'AND'function of S from the 1st rung.)

    This system allows very complex logic designs to be broken down and evaluated.

    For more practical examples see below:

    http://en.wikipedia.org/w/index.php?title=Ladder_logic&action=edit&section=3http://en.wikipedia.org/wiki/Logical_ANDhttp://en.wikipedia.org/wiki/Logical_ORhttp://en.wikipedia.org/w/index.php?title=Ladder_logic&action=edit&section=3http://en.wikipedia.org/wiki/Logical_ANDhttp://en.wikipedia.org/wiki/Logical_OR
  • 8/2/2019 A Programmable Logic plc

    12/16

    ------[ ]--------------[ ]----------------( )Key Switch 1 Key Switch 2 Door Motor

    This circuit shows two key switches that security guards might use to activate an electric motoron a bank vault door. When the normally open contacts of both switches close, electricity is ableto flow to the motor which opens the door. This is a logical AND.

    +-------+----------------------------+ +----+-------+

    Remote Receiver

    --|-------[ ]-------+-----------------( )| ||-------[ ]-------|

    Interior Unlock

    This circuit shows the two things that can trigger a car'spower door locks. The remote receiver isalways powered. The locksolenoid gets power when either set of contacts is closed. This is alogical OR.

    Often we have a little green "start" button to turn on a motor, and we want to turn it off with abig red "stop" button. The stop button itself is wired as a normally closed switch. This means thatwhen the stop button is in its normal state (not pushed), the PLC input will be true. When thestop button is pushed, the input will go false. This will make the rung false and stop the "run"output. A normally-open contact must be used in the ladder diagram, since this input is normallyturned on through the normally closed pushbutton contact, and turns off when the button ispressed.

    --+----[ ]--+----[ ]----( )| start | stop run

    | |+----[ ]--+

    run

    -------[ ]--------------( )run motor

    This latch configuration is a commonidiom in ladder logic. In ladder logic it is referred to asseal-in logic. The key to understanding the latch is in recognizing that "start" switch is amomentary switch (once the user releases the button, the switch is open again). As soon as the"run" solenoid engages, it closes the "run" switch, which latches the solenoid on. The "start"switch opening up then has no effect.

    [edit] Additional functionalityAdditional functionality can be added to a ladder logic implementation by the PLC manufactureras a special block. When the special block is powered, it executes code on predeterminedarguments. These arguments may be displayed within the special block.

    +-------+-----[ ]--------------------+ A +----

    http://en.wikipedia.org/wiki/Logical_ANDhttp://en.wikipedia.org/wiki/Logical_ANDhttp://en.wikipedia.org/wiki/Power_door_lockshttp://en.wikipedia.org/wiki/Power_door_lockshttp://en.wikipedia.org/wiki/Solenoidhttp://en.wikipedia.org/wiki/Logical_ORhttp://en.wikipedia.org/wiki/Logical_ORhttp://en.wikipedia.org/wiki/Latch_(electronic)http://en.wikipedia.org/wiki/Idiomhttp://en.wikipedia.org/wiki/Idiomhttp://en.wikipedia.org/w/index.php?title=Ladder_logic&action=edit&section=4http://en.wikipedia.org/wiki/Logical_ANDhttp://en.wikipedia.org/wiki/Power_door_lockshttp://en.wikipedia.org/wiki/Solenoidhttp://en.wikipedia.org/wiki/Logical_ORhttp://en.wikipedia.org/wiki/Latch_(electronic)http://en.wikipedia.org/wiki/Idiomhttp://en.wikipedia.org/w/index.php?title=Ladder_logic&action=edit&section=4
  • 8/2/2019 A Programmable Logic plc

    13/16

    Remote Unlock +-------+Remote Counter

    +-------+-----[ ]--------------------+ B +----Interior Unlock +-------+

    Interior Counter

    +--------+--------------------+ A + B +-----------

    + into C ++--------+

    Adder

    In this example, the system will count the number of times that the interior and remote unlockbuttons are pressed. This information will be stored in memory locations A and B. Memorylocation C will hold the total number of times that the door has been unlocked electronically.

    PLCs have many types of special blocks. They include timers, arithmetic operators andcomparisons, table lookups, text processing, PID control, and filtering functions. More powerful

    PLCs can operate on a group of internal memory locations and execute an operation on a rangeof addresses, for example,to simulate a physical sequential drum controller or a finite statemachine. In some cases, users can define their own special blocks, which effectively aresubroutines or macros. The large library of special blocks along with high speed execution hasallowed use of PLCs to implement very complex automation systems.

    [edit] Limitations and successor languagesLadder notation is best suited to control problems where only binary variables are required andwhere interlocking and sequencing of binary is the primary control problem. Since execution ofrungs is sequential within a program and may be undefined or obscure within a rung, some logicrace conditions are possible which may produce unexpected results; complex rungs are best

    broken into several simpler steps to avoid this problem. Some manufacturers, e.g.Omron, avoidthis problem by explicitly and completely defining the execution order of a rung, howeverprogrammers may still have problems fully grasping the resulting complex semantics.

    Analog quantities and arithmetical operations are clumsy to express in ladder logic and eachmanufacturer has different ways of extending the notation for these problems. There is usuallylimited support for arrays and loops, often resulting in duplication of code to express cases whichin other languages would call for use of indexed variables.

    Asmicroprocessors have become more powerful, notations such as sequential function chartsandfunction block diagrams can replace ladder logic for some limited applications. Very largeprogrammable controllers may have all or part of the programming carried out in a dialect thatresembles BASIC orC or otherprogramming language with bindings appropriate for a real-time

    application environment.Structured text is one of the 5 languages supported by the IEC 61131-3 standard. It is designedforprogrammable logic controllers(PLCs). It is a high level language that isblock structuredand syntactically resembles Pascal. All of the languages share IEC61131 Common Elements.The variables and function calls are defined by the common elements so different languages canbe used in the same program.

    http://en.wikipedia.org/wiki/PID_controllerhttp://en.wikipedia.org/wiki/Finite_state_machinehttp://en.wikipedia.org/wiki/Finite_state_machinehttp://en.wikipedia.org/w/index.php?title=Ladder_logic&action=edit&section=5http://en.wikipedia.org/wiki/Race_conditionhttp://en.wikipedia.org/wiki/Omronhttp://en.wikipedia.org/wiki/Omronhttp://en.wikipedia.org/wiki/Microprocessorshttp://en.wikipedia.org/wiki/Microprocessorshttp://en.wikipedia.org/wiki/Sequential_function_charthttp://en.wikipedia.org/wiki/Function_block_diagramhttp://en.wikipedia.org/wiki/Function_block_diagramhttp://en.wikipedia.org/wiki/BASIChttp://en.wikipedia.org/wiki/C_(programming_language)http://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/IEC_61131-3http://en.wikipedia.org/wiki/Programmable_logic_controllerhttp://en.wikipedia.org/wiki/Programmable_logic_controllerhttp://en.wikipedia.org/wiki/Block_structuredhttp://en.wikipedia.org/wiki/Block_structuredhttp://en.wikipedia.org/wiki/Pascal_(programming_language)http://en.wikipedia.org/wiki/IEC61131_Common_Elementshttp://en.wikipedia.org/wiki/PID_controllerhttp://en.wikipedia.org/wiki/Finite_state_machinehttp://en.wikipedia.org/wiki/Finite_state_machinehttp://en.wikipedia.org/w/index.php?title=Ladder_logic&action=edit&section=5http://en.wikipedia.org/wiki/Race_conditionhttp://en.wikipedia.org/wiki/Omronhttp://en.wikipedia.org/wiki/Microprocessorshttp://en.wikipedia.org/wiki/Sequential_function_charthttp://en.wikipedia.org/wiki/Function_block_diagramhttp://en.wikipedia.org/wiki/BASIChttp://en.wikipedia.org/wiki/C_(programming_language)http://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/IEC_61131-3http://en.wikipedia.org/wiki/Programmable_logic_controllerhttp://en.wikipedia.org/wiki/Block_structuredhttp://en.wikipedia.org/wiki/Pascal_(programming_language)http://en.wikipedia.org/wiki/IEC61131_Common_Elements
  • 8/2/2019 A Programmable Logic plc

    14/16

    Complex statements and nested instructions are supported:

    Iteration loops (REPEAT-UNTIL; WHILE-DO)

    Conditional execution (IF-THEN-ELSE; CASE)

    Functions (SQRT(), SIN())

    Contents[hide]

    1 Sample Program

    1.1 Additional ST Example Programming examples

    1.1.1 Function Block example

    2 External links

    [edit] Sample Program

    (* simple state machine *)TxtState := STATES[StateMachine];CASE StateMachine OF

    1: ClosingValve();ELSE

    ;; BadCase();END_CASE;

    [edit] Additional ST Example Programming examples

    // PLC configurationCONFIGURATION DefaultCfg

    VAR_GLOBAL

    Start_Stop : BOOL; // Global variable to represent OperatorInputON_OFF : BOOL; // Global variable to represent Output

    CoilEND_VAR

    // Schedule the main program to be executed every 20 msTASK Tick(INTERVAL := t#20ms);

    PROGRAM Main WITH Tick : Monitor_Start_Stop;

    END_CONFIGURATIONPROGRAM Monitor_Start_Stop // Actual Program

    VAR_EXTERNAL

    Start_Stop : BOOL;ON_OFF : BOOL;

    END_VARVAR // Temporary variables for logic handling

    ONS_Trig : BOOL;Rising_ONS : BOOL;

    END_VAR

    // Start of Logic

    http://en.wikipedia.org/wiki/Structured_texthttp://en.wikipedia.org/w/index.php?title=Structured_text&action=edit&section=1http://en.wikipedia.org/w/index.php?title=Structured_text&action=edit&section=2http://en.wikipedia.org/wiki/Structured_texthttp://en.wikipedia.org/w/index.php?title=Structured_text&action=edit&section=1http://en.wikipedia.org/w/index.php?title=Structured_text&action=edit&section=2
  • 8/2/2019 A Programmable Logic plc

    15/16

    // Catch the Rising Edge One Shot of the Start_Stop inputONS_Trig := Start_Stop AND NOT Rising_ONS;

    // Main Logic for Run_Contact -- Toggle ON / Toggle OFF ---ON_OFF := (ONS_Trig AND NOT ON_OFF) OR (ON_OFF AND NOT ONS_Trig);

    // Rising One Shot logicRising_ONS := Start_Stop;

    END_PROGRAM

    [edit] Function Block example

    //=======================================================================// Function Block Timed Counter : Incremental count of the timed interval//=======================================================================FUNCTION_BLOCK FB_Timed_Counter

    VAR_INPUTExecute : BOOL := FALSE; // Trigger signal to begin

    Timed CountingTime_Increment : REAL := 1.25; // Enter Cycle Time (Seconds)

    between counts

    Count_Cycles : INT := 20; // Number of Desired CountCycles

    END_VAR

    VAR_OUTPUTTimer_Done_Bit : BOOL := FALSE; // One Shot Bit indicating

    Timer Cycle DoneCount_Complete : BOOL := FALSE; // Output Bit indicating the

    Count is completeCurrent_Count : INT := 0; // Accumulating Value of

    CounterEND_VAR

    VAR

    CycleTimer : TON; // Timer FB from CommandLibrary

    CycleCounter : CTU; // Counter FB from CommandLibrary

    TimerPreset : TIME; // Converted Time_Incrementin Seconds to MS

    END_VAR

    // Start of Function Block programmingTimerPreset := REAL_TO_TIME(in := Time_Increment) * 1000;

    CycleTimer(in := Execute AND NOT CycleTimer.Q

    ,pt := TimerPreset);

    Timer_Done_Bit := CycleTimer.Q;

    CycleCounter(cu := CycleTimer.Q,r := NOT Execute,pv := Count_Cycles);

    Current_Count := CycleCounter.cv;

    http://en.wikipedia.org/w/index.php?title=Structured_text&action=edit&section=3http://en.wikipedia.org/w/index.php?title=Structured_text&action=edit&section=3
  • 8/2/2019 A Programmable Logic plc

    16/16

    Count_Complete := CycleCounter.q;END_FUNCTION_BLOCK


Recommended