Programmable Logic Controller: o o o o
Programmable Logic Controller: o o o o
Programmable Logic Controller: o o o o
Siemens Simatic S7-400 system at rack, left-to-right: power supply unit PS407 4A, CPU 416-3,
interface module IM 460-0 and communication processor CP 443-1.
A programmable logic controller, PLC or programmable controller is a digital computer
used for automation of typically industrial electromechanical processes, such as control of
machinery on factory assembly lines, amusement rides, or light fixtures. PLCs are used in many
industries and machines. PLCs are designed for multiple analogue and digital 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 batterybacked-up or non-volatile memory. A PLC is an example of a "hard" real-time system since
output results must be produced in response to input conditions within a limited time, otherwise
unintended operation will result.
Contents
1 History
2 Development
o 2.1 Programming
3 Functionality
o 3.1 Programmable logic relay (PLR)
4 PLC topics
o 4.1 Features
o 4.2 Scan time
o
o
o
o
o
o
o
History
Before the PLC, control, sequencing, and safety interlock logic for manufacturing automobiles
was mainly composed of relays, cam timers, drum sequencers, and dedicated closed-loop
controllers. Since these could number in the hundreds or even thousands, the process for
updating such facilities for the yearly model change-over was very time consuming and
expensive, as electricians needed to individually rewire the relays to change their operational
characteristics.
Digital computers, being general-purpose programmable devices, were soon applied to control of
industrial processes. Early computers required specialist programmers, and stringent operating
environmental 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-floor
environment, it would support discrete (bit-form) input and output in an easily extensible
manner, it would not require years of training to use, and it would permit its operation to be
monitored. The response time of any computer system must be fast enough to be useful for
control; the required speed varying according to the nature of the process.[1] Since many
industrial processes have timescales easily addressed by millisecond response times, modern
(fast, small, reliable) electronics greatly facilitate building reliable controllers, especially because
performance can be traded off for reliability.
In 1968 GM Hydra-Matic (the automatic transmission division of General Motors) issued a
request for proposals for an electronic replacement for hard-wired relay systems based on a white
paper written by engineer Edward R. Clark. 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.[2] 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.[3] The Modicon brand was sold in 1977
to Gould Electronics, and later acquired by German Company AEG 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 in North
Andover, Massachusetts. It was presented to Modicon by GM, when the unit was retired after
nearly twenty years of uninterrupted service. Modicon used the 84 moniker at the end of its
product range until the 984 made its appearance.
The automotive industry is still one of the largest users of PLCs.
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 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.
Modern PLCs can be programmed in a variety of ways, from the relay-derived ladder logic to
programming languages such as specially adapted dialects of BASIC and C. Another method is
State Logic, a very high-level programming language designed to program PLCs based on state
transition diagrams.
Many early PLCs did not have accompanying programming terminals that were capable of
graphical representation of the logic, and so the logic was instead represented as a series of logic
expressions in some version of Boolean format, similar to Boolean algebra. As programming
terminals evolved, it became more common for ladder logic to be used, for the aforementioned
reasons and because it was a familiar format used for electromechanical control panels. Newer
formats such as State Logic and Function Block (which is similar to the way logic is depicted
when 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 the
timing of the logic sequence more easily than would be possible in other formats.
Programming
Early PLCs, up to the mid-1990s, 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.[2] Some proprietary programming terminals
displayed the elements of PLC programs as graphic symbols, but plain ASCII character
representations of contacts, coils, and wires were common. Programs were stored on cassette
tape cartridges. Facilities for printing and documentation were minimal due to lack of memory
capacity. The very oldest PLCs used non-volatile magnetic core memory.
More recently, PLCs are programmed using application software on personal computers, which
now represent the logic in graphic form instead of character symbols. The computer is connected
to the PLC through Ethernet, RS-232, RS-485 or RS-422 cabling. The programming software
allows entry and editing of the ladder-style logic. Generally the software provides functions for
debugging and troubleshooting the PLC software, for example, by highlighting portions of the
logic to show current status during operation or via simulation. The software will upload and
download the PLC program, for backup and restoration purposes. In some models of
programmable controller, the program is transferred from a personal computer to the PLC
through a programming board which writes the program into a removable chip such as an
EEPROM or EPROM.
Functionality
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. Regarding the practicality of these desktop computer based logic controllers, it is
important to note that they have not been generally accepted in heavy industry because the
desktop computers run on less stable operating systems than do PLCs, and because the desktop
computer 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 hardware
limitations of desktop based logic, operating systems such as Windows do not lend themselves to
deterministic 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 automation
and use in small facilities where the application is less demanding and critical, because they are
generally much less expensive than PLCs.
magnitude less than a PLC and they still offer robust design and deterministic execution of the
logic.
PLC topics
Features
Control panel with PLC (grey elements in the center). The unit consists of separate elements,
from left to right; power supply, controller, relay units for in- and output
The main difference from other computers is that PLCs are armored for severe conditions (such
as dust, moisture, heat, cold) 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 use machine vision.[4] On the actuator side, PLCs operate electric motors, pneumatic or
hydraulic cylinders, magnetic relays, 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.
Scan time
A PLC program is generally executed repeatedly as long as the controlled system is running. The
status 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 rung
down to the last rung. It takes some time for the processor of the PLC to evaluate all the rungs
and update the I/O image table with the status of outputs.[5] This scan time may be a few
milliseconds for a small program or on a fast processor, but older PLCs running very large
programs could take much longer (say, up to 100 ms) to execute the program. If the scan time
were too long, the response of the PLC to process conditions would be too slow to be useful.
As PLCs became more advanced, methods were developed to change the sequence of ladder
execution, and subroutines were implemented.[6] This simplified programming could be used to
save scan time for high-speed processes; for example, parts of the program used only for setting
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 such as encoders, can
be used where the scan time of the processor is too long to reliably pick up, for example,
counting pulses and interpreting quadrature from a shaft encoder. The relatively slow PLC can
still interpret the counted values to control a machine, but the accumulation of pulses is done by
a dedicated module that is unaffected by the speed of the program execution...
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 different
functions. The processor and selection of I/O modules are customized 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.
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 or
everyday control. A human-machine interface (HMI) is employed for this purpose. HMIs are
also referred to as man-machine interfaces (MMIs) and graphical user interfaces (GUIs). A
simple system may use buttons and lights to interact with the user. Text displays are available as
well as graphical touch screens. More complex systems use programming and monitoring
software installed on a computer, with the PLC connected via a communication interface.
Communications
PLCs have built in communications ports, usually 9-pin RS-232, but optionally EIA-485 or
Ethernet. Modbus, BACnet or DF1 is usually included as one of the communications protocols.
Other options include various fieldbuses such as DeviceNet or Profibus. Other communications
protocols 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 computer
running a SCADA (Supervisory Control And Data Acquisition) system or web browser.
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 devices such as keypads or PC-type workstations.
Programming
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 program is stored in
the PLC either in battery-backed-up RAM or some other non-volatile flash memory. Often, a
single PLC can be programmed to replace thousands of relays.[7]
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. Initially most PLCs utilized Ladder Logic Diagram
Programming, a model which emulated electromechanical control panel devices (such as the
contact 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 Pascal
programming language), instruction list (IL; similar to assembly language) and sequential
function 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 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.
Security
Prior to the discovery of the Stuxnet computer virus in June 2010, security of PLCs received
little attention. PLCs generally contain a real-time operating system such as OS-9 or VxWorks
and exploits for these systems exist much as they do for desktop computer operating systems
such as Microsoft Windows. PLCs can also be attacked by gaining control of a computer they
communicate with.[9]
Simulation
In order to properly understand the operation of a PLC, it is necessary to spend considerable time
programming, testing, and debugging PLC programs. PLC systems are inherently expensive, and
down-time is often very costly. In addition, if a PLC is programmed incorrectly it can result in
lost productivity and dangerous conditions. PLC simulation software is a valuable tool in the
understanding and learning of PLCs and to keep this knowledge refreshed and up to date. The
advantages of using PLC simulation tools such as PLCLogix are that they save time in the design
of automated control applications and they can also increase the level of safety associated with
equipment since various "what if" scenarios can be tried and tested before the system is
activated.[10]
Redundancy
Some special processes need to work permanently with minimum unwanted down time.
Therefore, it is necessary to design a system which is fault tolerant and capable of handling the
process with faulty modules. In such cases to increase the system availability in the event of
hardware component failure, redundant CPU or I/O modules with the same functionality can be
added to hardware configuration for preventing total or partial process shutdown due to hardware
failure from any kind.
Example
As an example, say a 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 by
controlling the valve that refills the tank. Shown is a "ladder diagram" which shows the control
system. A ladder diagram is a method of drawing control circuits which pre-dates PLCs. The
ladder diagram resembles the schematic diagram of a system built with electromechanical relays.
Shown are:
Two inputs (from the low and high level switches) represented by contacts of the float
switches
An output to the fill valve, labelled as the fill valve which it controls
An "internal" contact, representing the output signal to the fill valve which is created in
the program.
A logical control scheme created by the interconnection of these items in software
In ladder diagram, the contact symbols represent the state of bits in processor memory, which
corresponds to the state of physical inputs to the system. If a discrete input is energized, the
memory bit is a 1, and a "normally open" contact controlled by that bit will pass a logic "true"
signal on to the next element of the ladder. Therefore, the contacts in the PLC program that
"read" or look at the physical switch contacts in this case must be "opposite" or open in
order to return a TRUE for the closed physical switches. Internal status bits, corresponding to
the state of discrete outputs, are also available to the program.
In the example, the physical state of the float switch contacts must be considered when choosing
"normally open" or "normally closed" symbols in the ladder diagram. The PLC has two discrete
inputs from float switches (Low Level and High Level). Both float switches (normally closed)
open their contacts when the water level in the tank is above the physical location of the switch.
When the water level is below both switches, the float switch physical contacts are both closed,
and a true (logic 1) value is passed to the Fill Valve output. Water begins to fill the tank. The
internal "Fill Valve" contact latches the circuit so that even when the "Low Level" contact opens
(as the water passes the lower switch), the fill valve remains on. Since the High Level is also
normally closed, water continues to flow as the water level remains between the two switch
levels. Once the water level rises enough so that the "High Level" switch is off (opened), the
PLC will shut the inlet to stop the water from overflowing; this is an example of seal-in
(latching) logic. The output is sealed in until a high level condition breaks the circuit. After that
the fill valve remains off until the level drops so low that the Low Level switch is activated, and
the process repeats again.
| (N.C. physical
(N.C. physical
|
|
Switch)
Switch)
|
|
Low Level
High Level
Fill Valve
|
|------[ ]------|------[ ]----------------------(OUT)---------|
|
|
|
|
|
|
|
|
|
|
Fill Valve |
|
|------[ ]------|
|
|
|
|
|
A complete program may contain thousands of rungs, evaluated in sequence. Typically the PLC
processor will alternately scan all its inputs and update outputs, then evaluate the ladder logic;
input changes during a program scan will not be effective until the next I/O update. A complete
program scan may take only a few milliseconds, much faster than changes in the controlled
process.
Programmable controllers vary in their capabilities for a "rung" of a ladder diagram. Some only
allow a single output bit. There are typically limits to the number of series contacts in line, and
the number of branches that can be used. Each element of the rung is evaluated sequentially. If
elements change their state during evaluation of a rung, hard-to-diagnose faults can be generated,
although sometimes (as above) the technique is useful. Some implementations forced evaluation
from left-to-right as displayed and did not allow reverse flow of a logic signal (in multi-branched
rungs) to affect the output.