You are on page 1of 12

What is a Programmable Logic Controller?

A programmable logic controller (PLC) is a digital computer used for automation of


electromechanical processes, such as control of machinery on factory assembly lines, amusement
rides, or lighting fixtures. PLCs are used in many industries and machines. Unlike generalpurpose computers, the PLC is designed for multiple inputs and output arrangements, extended
temperature ranges, immunity to electrical noise, and resistance to vibration and impact.
Programs to control machine operation are typically stored in battery-backed or non-volatile
memory. A PLC is an example of a real time system since output results must be produced in
response to input conditions within a bounded time, otherwise unintended operation will result.
Figure 1 shows a graphical depiction of typical PLCs.

Figure 1: Typical PLCs

Figure 2: Examples of Hardware PLCs Control

History of the PLC


PLC invention was in response to the needs of the American automotive manufacturing industry
where software revision replaced the re-wiring of hard-wired relay based control panels when
production models changed.
Before the PLC, control, sequencing, and safety interlock logic for manufacturing automobiles
relied on hundreds or, in some instances, thousands of relays, cam timers, and drum sequencers
and dedicated closed-loop controllers. The process for updating such facilities for the yearly
model change-over was very time consuming and expensive, as electricians needed to
individually and manually rewire each and every relay.
In 1968 GM Hydramatic issued a request for proposal for an electronic replacement for hardwired relay systems. The winning proposal came from Bedford Associates of Bedford,
Massachusetts. The first PLC, designated the 084 because it was Bedford Associateseightyfourth 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,
the "father" of the PLC.
In other industries, PLCs replaced relay systems used in manufacturing applications. This
eliminated the high cost of maintaining these inflexible systems. In 1970, with the innovation of

the microprocessor, the machine that was originally used as a relay replacement device only,
evolved into the advanced PLC of today.

Advantages of PLCs
There are six major advantages of using PLCs over relay systems as follows:

Flexibility
Ease of troubleshooting
Space efficiency
Low cost
Testing
Visual operation

Flexibility: One single PLC can easily run many machines.


Ease of Troubleshooting: Back before PLCs, wired relay-type panels required time for rewiring
of panels and devices. With PLC control any change in circuit design or sequence is as simple as
retyping the logic. Correcting errors in PLC is both fast and cost effective.
Space Efficient: Fewer components are required in a PLC system than in a conventional
hardware system. The PLC performs the functions of timers, counters, sequencers, and control
relays, so these hardware devices are not required. The only field devices that are required are
those that directly interface with the system such as switches and motor starters.
Low Cost: Prices of PLCs vary from few hundreds to few thousands. This is minimal compared
to the prices of the contact, coils, and timers that companies pay to match the same things. Using
PLCs also saves on installation cost and shipping.
Testing: A PLC program can be tested, evaluated, and validated in a lab prior to implementation
in the field.
Visual observation: When running a PLC program a visual operation displays on a screen or
module mounted status lamps assist in making troubleshooting a circuit quick, easy, and
relatively simple.

Components of a PLC
All PLCs have the same basic components. These components work together to bring
information into the PLC from the field, evaluate that information, and send information back
out to various field. Without any of these major components, the PLC will fail to function
properly.
The basic components include a power supply, central processing unit (CPU or processor), coprocessor modules, input and output modules (I/O), and a peripheral device.

Figure 3: PLC Components

Input/Output Modules
The type of input modules used by a PLC depends on the type of input device. For example,
some respond to digital inputs, which are eitheronoroffwhile others respond to analog signals. In
this case, analog signals represent machine or process conditions as a range of voltage or current
values. The PLC input circuitry converts signals into logic signals that the CPU can use. The
CPU evaluates the status of inputs, outputs, and other variables as it executes a stored program.
The CPU then sends signals to update the status of outputs.
Output modules convert control signals from the CPU into digital or analog values that can be
used to control various output devices. The programming device is used to enter or change the
PLCs program or to monitor or change stored values. Once entered, the program and associated
variables are stored in the CPU. In addition to these basic elements, a PLC system may also
incorporate an operator interface device to simplify monitoring of the machine or process.

Power Supply
The function of the power supply is to provide the DC power to operate the PLC. It is supplied
by single-phase 120 or 240 VAC line power that powers the PLC system. See Figure x.

Figure 4:PLC Power Supply


The Power Supply is a module located in the PLC system module rack. The DC power (voltage
and current) it provides power the other modules in the rack, such as the CPU, Co-processor
Modules, and I/O Modules.
The line power provided to the PLC system also powers the I/O Field Devices. The PLC system
is protected against PLC module or field device malfunctions. The Fuse in Figure 4 provides this
protection.

Central Processing Unit CPU


The function of the CPU is to store and run the PLC software programs. It also interfaces with
the Co-Processor Modules, the I/O Modules, the peripheral device, and runs diagnostics. It is
essentially the "brains" of the PLC.
The CPU, shown in Figure X, contains a microprocessor, memory, and interface adapters.

Figure 5: CPU
The items shown inside the CPU and their basic functions are as follows:

The microprocessor codes, decodes, and computes data.


The memory (ROM, PROM/EEPROM/UVPROM, and RAM) stores both the control
program and the data from the field devices.
The I/O Interface adapter connects the Co-Processor Modules, the I/O Modules and the
Peripheral Device to the CPU.

Co-processor Modules
Co-Processor Modules are programmable general-purpose microcomputers that expand the
capability and functionality of a PLC system. A Co-Processor Module is controlled by the CPU,
and interfaces with the CPU as shown above.
Co-Processor Modules monitor and control peripheral systems such as the following:

Alphanumeric Displays
Video Graphics Displays
Communication Networks

Software
The function of Software is to provide instructions to the CPU and Co-Processor Modules.
Physically, software is a large group of logic ones and zeros stored in the memory of the CPU.

Peripheral Device

The function of the peripheral device is to input data and monitor the equipment operation. It
may be a personal computer, handheld programmer, or an operator touch screen.

Basic Operation of a PLC


The operation of a PLC is very simple. The processor makes decisions based on a "ladder logic"
program written by the user. In order to use the program properly, the PLC must communicate
with the various field devices it monitors and controls. It then compares the actual conditions of
the field devices with what the program instructs them to do, and updates the output devices
accordingly.
1. Input switch is pressed
2. Input module places a "1" in the input data table
3. The ladder logic program sees the "1" and caused a "1" to be put into the output data
table
4. The output data table causes the output module to energize associated point
5. The output device energizes

Figure 6: PLC Operation

Ladder Logic of a Hardwired System


Ladder logic is a programming language that represents a program by a graphical diagram based
on the circuit diagrams of relay-based logic hardware. It is primarily used to develop software
PLCs used in industrial control applications. The name is based on the observation that programs

in this language resemble ladders, with two vertical rails and a series of horizontal rungs between
them.
Ladder logic is widely used to program PLCs, where sequential control of a process or
manufacturing operation is required. Ladder logic is useful for simple but critical control
systems, or for reworking old hardwired relay circuits. As PLCs became more sophisticated, it
has also been used in very complex automation systems. Often the ladder logic program is used
in conjunction with a HMI program operating on a computer workstation.
Manufacturers of programmable logic controllers generally also provide associated ladder logic
programming 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 programming
languages rather than one language (the IEC 61131-3 standard has helped to reduce unnecessary
differences, but translating programs between systems still requires significant work). Even
different models of PLCs within the same family may have different ladder notation such that
programs cannot be seamlessly interchanged between models.
Ladder logic is a rule-based language rather than a procedural language. A "rung" in the ladder
represents a rule. When implemented with relays and other electromechanical devices, the
various rules "execute" simultaneously and immediately. When implemented in PLC, the rules
execute sequentially by software in a continuous loop (scan). By executing the loop fast enough,
the effect of simultaneous and immediate execution is achieved to within the tolerance of the
time required to execute every rung in the "loop" (the "scan time").

Simple Ladder Diagram of a Hardwired Circuit


The language itself is a set of connections between logical checkers (contacts) and actuators
(coils). If a path traced between the left side of the rung and the output, through asserted (true or
closed) contacts, the rung is true and the output coil storage bit is asserted 1. If no path is traced,
then the output is false (0) and the coil by analogy to electromechanical relays is considered deenergized.
Ladder logic has contacts that make or break circuits to control coils. Each coil or contact
corresponds to the status of a single bit in the PLCs memory. Unlike electromechanical relays, a
ladder program can refer any number of times to the status of a single bit, equivalent to a relay
with an indefinitely large number of contacts.
Contacts may refer to physical or hard inputs to the PLC from devices such as pushbuttons and
limit switches via an integrated or external input module, or may represent the status of internal
storage bits, which may be generated elsewhere in the program.
Each rung of ladder language typically has one coil at the far right. Some manufacturers may
allow more than one output coil on a rung.

( ) - Regular coil. It is energized whenever its rung is closed.


(\\) - "Not" coil. It is energized whenever its rung is open.
[ ] - Regular contact. It is closed whenever its corresponding coil or an input which
controls it is energized.
[\\] - "Not" contact. It is open whenever its corresponding coil or an input which controls
it is energized.

The coil or output of a rung, may represent a physical output, which operates some device
connected to the PLC, or may represent an internal storage bit for use elsewhere in the program.

Figure 7: Simple Ladder Diagram


Ladder logic is typically 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 an input. In a
complex system there will be many rungs on a ladder, which are numbered in order of
evaluation.

PLC Operations
Basic Operation
The operation of a PLC is very simple. The processor makes decisions based on a ladder logic
program written by the user (see Topic I). In order to use the program properly, the PLC must
communicate with the various field devices it is tasked with monitoring and controlling. It then
compares the actual conditions of the field devices with what the program instructs them to do,
and updates the output devices accordingly.

Operational Sequence
The operational sequence shown in Figure 6 is as follows:
1. Input switch is pressed
2. Input module places a "1" in the input data table
3. The ladder logic program sees the "1" and caused a "1" to be put into the output data
table
4. The output data table causes the output module to energize associated point
5. The output device energizes

Figure 8: PLC Operational Sequence

The Scan Cycle


PLCs operate by continually scanning programs and repeat this process many times per second.
When a PLC starts, it runs checks on the hardware and software for faults, also called a self-test.
If there are no problems, then the PLC will start the scan cycle. The scan cycle consists of three
steps: input scan, executing program(s), and output scan. Figure 7 shows the three steps.
Input Scan: A simple way of looking at this is the PLC takes a snapshot of the inputs and solves
the logic. The PLC looks at each input card to determine if it isonoroffand saves this information
in a data table for use in the next step. This makes the process faster and avoids cases where an
input changes from the start to the end of the program.
Execute Program (or Logic Execution): The PLC executes a program one instruction at a time
using only the memory copy of the inputs the ladder logic program. For example, the program
has the first input ason, since the PLC knows which inputs are on/off from the previous step it
will be able to decide whether the first output should be turned on.
Output Scan: When the ladder scan completes, the outputs are updated using the temporary
values in memory. The PLC updates the status of the outputs based on which inputs were on
during the first step and the results of executing a program during the second step. The PLC now
restarts the process by starting a self-check for faults.

Figure 9: PLC Scan Cycle

Logic Scan
Ladder logic programs are modeled after relay logic. In relay logic, each element in the ladder will
switch as quickly as possible. Program elements can only be examined one at a time in a fixed
sequence. The ladder logic graphic in Figure 8 is interpreted left-to-right, top-to-bottom. The ladder
logic scan begins at the top rung. At the end of the rung, it interprets the top output first, then the
output branched below it. On the second rung, it solves branches, before moving along the ladder
logic rung.

Figure 10: PLC Logic Scan

You might also like