Introduction To Programmable Controllers: Thomas A. Hughes
Introduction To Programmable Controllers: Thomas A. Hughes
01
Introduction to
Programmable Controllers
Thomas A. Hughes
The information presented in this publication is for the general education of the reader. Because neither the
authors nor the publisher have any control over the use of the information by the reader, both the authors and
the publisher disclaim any and all liability of any kind arising out of such use. The reader is expected to
exercise sound professional judgment in using any of the information presented in a particular application.
Additionally, neither the authors nor the publisher have investigated or considered the effect of any patents on
the ability of the reader to use any of the information in a particular application. The reader is responsible for
reviewing any possible patents that may affect any particular use of the information presented.
Any references to commercial products in the work are cited as examples only. Neither the authors nor the
publisher endorse any referenced commercial product. Any trademarks or tradenames referenced belong to the
respective owner of the mark or name. Neither the authors nor the publisher make any representation regarding
the availability of any referenced commercial product at any time. The manufacturer’s instructions on use of
any commercial product must be followed at all times, even if in conflict with the information in this
publication.
No part of this publication may be reproduced, stored in retrieval system, or transmitted, in any form or by any
means, electronic, mechanical, photocopying, recording or otherwise, without the prior written permission of
the publisher.
ISA
67 Alexander Drive
P.O. Box 12277
Research Triangle Park
North Carolina 27709
Editor’s Introduction
This “mini-book” is available both in downloadable form, as part of the ISA Encyclopedia of
Measurement and Control, and bound in a print format.
“Mini-books” are small, unified volumes, from 25 to 100 pages long, drawn from the ISA catalog of
reference and technical books. ISA makes mini-books available to readers who need narrowly focused
information on particular subjects rather than a broad-ranging text that provides an overview of the entire
subject. Each provides the most recent version of the material—in some cases including revisions that have
not yet been incorporated in the larger parent volume. Each has been re-indexed and renumbered so it can
be used independently of the parent volume. Other mini-books on related subjects are available.
The material in this mini-book was drawn from the following ISA titles:
See Appendix A of this document to view the complete table of contents for Programmable Controllers,
Third Edition.
INDEX 27
v
1
Introduction to
Programmable
Controllers
Introduction
Programmable controllers were originally designed to replace relay-based
control systems and solid-state, hard-wired logic control panels. However,
the modern programmable controller’s system is far more complex and
powerful.
1
2 Introduction to Programmable Controllers
L1 L2
120V ac
Level Solenoid
Switch Valve
Push
Button
0 to 5 volts direct current [vdc]) used by the logic unit. The output circuits
convert the logic signals to a level that will drive the field devices. For
example, in Figure 1-1, 120-volt alternating current (vac) power is
connected to the field input devices, so the input circuits are used to
convert the 120 vac into the 0- to 5-volt logic signals used by the control
unit.
The introduction of the personal computer (PC) in the early 1980s greatly
increased the power and utility of the programmable controller system in
process and machine control. Because personal computers were
inexpensive they were used extensively as programming devices and
operator interface control stations. The development of low-cost graphical
control software packages for PCs has led to the extensive use of graphical
user interfaces (GUIs) in programmable controller applications.
4 Introduction to Programmable Controllers
Because personal computers are used widely both in control and business
applications, the abbreviation PC is generally reserved for personal
computers, and the abbreviation PLC is used for programmable
controllers or programmable logic controllers. Thus, the abbreviation PLCs
will be used in this book to represent programmable controllers.
INPUTS POWER
I/O
SYSTEM SUPPLY
OUTPUTS
PROCESSOR
PROGRAMMING
DEVICE MEMORY
The Processor
The processor consists of one or more standard or custom microprocessors
and other integrated circuits that perform the logic, control, and memory
functions of the PLC system. The processor reads the inputs, executes
logic as determined by the application program, performs calculations,
and controls the outputs accordingly.
Start Cycle
Output Scan Input Scan
Start
Start Control
Output Scan Program Scan
During the input scan, the PLC examines the external input devices to see
if a signal is present or absent, that is, if the input devices are in an ON or
OFF state. The status of these inputs is temporarily stored in an input
image table or memory file. During the program scan, the processor scans
the instructions in the control program, uses the input status from the
input image file, and determines if an output will or will not be energized.
The resulting status of the outputs is written to the output image table or
memory file. Based on the data in the output image table, the PLC
energizes or deenergizes its associated output circuits, which control
external devices. This operating cycle typically takes 1 to 25 milliseconds
(thousandths of a second). The input and output scans are normally very
short relative to the time required for the program scan.
Memory
Memory is used to store the control program for the PLC system; it is
usually located in the same housing as the central processing unit (CPU).
The information stored in memory determines how the input and output
data will be processed.
Memory stores individual pieces of data called bits. A bit has two states:
1 or 0. Memory units are mounted on circuit boards and are usually
specified in thousands or ‘‘K’’ increments, where 1K is 1,024 words (i.e.,
210 = 1,024) of storage space. Programmable controller memory capacity
may vary from less than 1,000 words to over 64,000 words (64K words)
depending on the brand of programmable controller. The complexity of
the control plan will determine the amount of memory required.
Although there are several different types of computer memory, they can
always be classified as either volatile or nonvolatile. Volatile memory will
6 Introduction to Programmable Controllers
The user can access two areas of memory in the PLC system: program files
and data files. Program files store the control application program,
subroutine files, and the error file. Data files store data associated with the
control program, such as input/output status bits, counter and timer
preset and accumulated values, and other stored constants or variables.
Together, these two general memory areas are called user or application
memory. The processor also has an executive or system memory that
directs and performs operational activities such as executing the control
program and coordinating input scans and output updates. This process
system memory, which is programmed by the PLC manufacturer, cannot
be accessed or changed by the user.
I/O System
The I/O system provides the physical connection between the process
equipment and the microprocessor. This system uses various input circuits
or modules to sense and measure the physical quantities of the process,
such as motion, level, temperature, pressure, flow, and position. In
response to the status sensed or the values measured, the processor
controls various output modules. These modules drive field devices such
as valves, motors, pumps, and alarms to exercise control over a machine
or a process.
Input Types
The inputs from field instruments or sensors supply the data and
information the processor needs to make the logical decisions required to
control a given process or machine. These input signals come from devices
as varied as pushbuttons, hand switches, thermocouples, strain gauges,
Introduction to Programmable Controllers 7
and so on. The signals are connected to input modules to filter and
condition the signal so the processor can use it.
Output Types
The outputs from the programmable logic controller energize or
deenergize control devices to regulate processes or machines. These
output signals are control voltages from the output circuits, and they are
generally not high-power signals. For example, an output module sends a
control signal that energizes the coil in a motor starter. The energized coil
closes the power contacts of the starter. These contacts then close to start
the motor. The output modules are usually not directly connected to the
power circuit but rather to devices such as the motor starter and heater
contactors that apply high-power (greater than 10 amps) signals to the
final control devices.
I/O Structure
PLCs are classified as micro, small, medium, and large mainly based on
the I/O count. Micro-PLCs generally have an I/O count of 32 or less, small
PLCs have less than 256 I/O points, medium-sized PLCs have an I/O
count of less than 1,024, and large PLCs have an I/O count greater than
1,024. Micro-PLCs are self-contained units comprised of the processor, the
power supply, and I/O. Because they are self-contained, micro-PLCs are
also called packaged controllers. A modular PLC is one that has separate
components or modules.
In medium and large PLC systems the I/O modules are normally installed
or plugged into a slot in a ‘‘universal’’ modular housing. The term
universal in this context means that any module can be inserted into any
I/O slot in the housing. Modular I/O housings are also normally designed
so the I/O modules can be removed without turning off the ac power or
removing the field wiring.
Figure 1-5 shows some typical configurations for I/O modular housings.
The backplane of the housings into which the modules are plugged has a
printed circuit card that contains the parallel communications bus to the
processor. It also contains the dc voltages for operating the digital and
8 Introduction to Programmable Controllers
Allen-Bradley
Micro-1000 PLC
Level I/O Address
Switch
I/0 O/0 M1
Pressure
Switch Pump Starter
I/1 VAC
I/2 O/1 K1
O/5
Spare I/9
VAC
DC Com
L1
+24 Vdc Out H
120 Vac In
N
L2
Power
CPU
Supply
4 I/O Slots
Power
CPU
Supply
8 I/O Slots
Power
CPU
Supply
12 I/O Slots
analog circuits in the I/O modules. These I/O housings can be mounted in
a control panel or on a subpanel in an enclosure. The housings are
designed to protect the I/O module circuits from dirt, dust, electrical
noise, and mechanical vibration.
The backplane of the I/O chassis has sockets for each module. They
provide the power and data communications connection to the processor
for each module.
Discrete Inputs/Outputs
Discrete is the most common class of input/output in a programmable
controller system. This type of interface module connects field devices that
have two discrete states, such as ON/OFF or OPEN/CLOSED, to the
processor. Each discrete I/O module is designed to be activated by a field-
supplied voltage signal, such as +5 vdc, +24 vdc, 120 vac, or 220 vac.
A
Push Button (NC)
00
In a discrete output (DO) module, the output interface circuit switches the
supplied control voltage that will energize or deenergize the field device.
If an output is turned ON through the control program, the interface
circuit switches the supplied control voltage to activate the referenced
(addressed) output device.
Figure 1-7 shows a wiring diagram for a typical discrete output module. It
can be thought of as a simple switch through which power can be
provided to control the output device. During normal operation, the
processor sends the output state that was determined by the logic
program to the output module. The module then switches the power to
the field device.
Hot Neutral
120 Vac
In TB-1 Field wiring
A N
0 Heater 1
1 H1
1 Heater 1
2 H2
Pump 3 Starter
4 5 P3
5 Pump 4 Starter 6 P4
6 Mixer 1 Starter 7 M1
7 Mixer 2 Starter 8 M2
N Neutral
N
Panel wiring
Typical devices that interface with digital input modules are binary
encoders, bar code readers, and thumbwheel switches. LED displays and
intelligent display panels are just two of the instruments that are driven by
digital output modules.
Special-Purpose Modules
The discrete and analog I/O modules will normally cover about 80
percent of the input and output signals encountered in programmable
controller applications. However, to process certain types of signals or
data efficiently, the programmable controller system will require special-
purpose modules. These special interfaces include those that condition
input signals, such as thermocouple modules, pulse counters, or other
signals that cannot be interfaced using standard I/O modules. Special-
purpose I/O modules may also use an onboard microprocessor to add
intelligence to the interface. These intelligent modules can perform
complete processing functions independent of the CPU and the control
program scan.
Programming Languages
The programming language allows the user to communicate with the
programmable controller via a programming device. Programmable
controller manufacturers use several different programming languages,
but they all use instructions to convey a basic control plan to the system.
“PB_1” “GO_Light”
&
“PB_2” =
diagram, called the wiring diagram, is used to show the physical connection
of the control devices. The discrete I/O module diagrams shown earlier
are examples of wiring diagrams. A typical electrical ladder diagram is
shown in Figure l-9. In this diagram, a pushbutton (PBl) is used to
energize a pump start control relay (CRl) if the level in a liquid storage
tank is not high. Each device has a special symbol assigned to it so the
diagram can be read easier and faster.
L1 Start L2
PB1 Tank Level Control
Not High Relay 1
Rung 1 CR1
SEAL
LSH-1
CR1(1)
Pump Starter
Rung 2 P1
CR1(2)
Run Pump
O:000/00
Pump ON
Run Pump Light
O:000/01
O:000/00
Rung 2
in the same way, from left to right, with the logic input conditions on the
left and the logical outputs on the right. In the case of electrical diagrams,
there must be electrical continuity to energize the output devices. For
programmable controller ladder programs, there must be logic continuity
to energize the outputs.
In ladder programs, three basic instructions are used to form the program.
The first symbol is similar to the normally open (NO) relay contacts used in
electrical ladder diagrams. This instruction uses the same NO symbol in
ladder programs. It instructs the processor to examine its assigned bit
location in memory. If the bit is ON (logic l), the instruction is TRUE and
there is logic continuity through the instruction on the ladder rung. If the
bit is OFF (logic 0), there is no logic continuity through the instruction on
the rung.
In Figure 1-10, the reference addresses for the logic bits are given by the
letters I and O followed by a five-digit number above the instructions. The
letter I before the five-digit number indicates an input bit, and the letter O
before the five-digit number indicates an output bit. The reference address
indicates where in the memory the logic operation will take place.
This same output bit is then used to ‘‘seal in’’ the start pushbutton
instruction. It also turns on the energized instruction bit O:000/01 to turn
on the pump run light.
The Boolean bit logic instructions are the most basic type of STL instructions.
These instructions perform logic operations on single bits in PLC memory.
The basic bit logic instructions are AND (A) and its negated form AND
NOT (AN), OR (O), and EXCLUSIVE OR (OR) and its negated form,
EXCLUSIVE OR NOT (XN). These instructions check the signal state of a
bit address to establish whether the bit is activated (1) or not activated (0).
16 Introduction to Programmable Controllers
Bit logic instructions are also called relay logic instructions since they can
execute commands that can replace a relay logic circuit. Figure 1-11 is an
example of AND logic operation. The STL program is listed on the left
side, and the relay logic circuit is shown on the right side for comparison.
In this example, the statement list program uses an AND instruction (A) to
program two normally open (NO) contacts in series. Only when the signal
state of both the normally open contacts is 1 can the state of output Q4.0
be 1 and the coil be energized.
input_1 &
output
input_2
Programming Devices
Programming devices are used to enter, store, and monitor the
programmable controller software. They can be dedicated portable unit
systems or personal computer-based systems. The personal computer-
based systems normally have these basic components: keyboard and
mouse; color graphics display or CRT; personal computer; printer; and
communications interface card and cable, as shown in Figure 1-13.
Color
Graphics
PLC Display
Comm.
Card PERSONAL
COMPUTER PRINTER
Communications Cable
Keyboard Mouse
Power
PLC DI DI DO DO AI AI AO TC TC
Supply
Power Supply
The power supply converts ac line voltages to dc voltages to power the
electronic circuits in a programmable controller system. These power
supplies rectify, filter, and regulate voltages and currents to supply the
correct amounts of voltage and current to the system. The power supply
normally converts 120 vac or 240 vac line voltage into dc voltages such as
+5 vdc, –15 vdc, or +15 vdc.
Process
AUTO
Gas In
FV1 FV2 OFF
MAN.
FV4
Heating
Gas In FV3
In High High In
Service Press Press Service
Out of Tower Tower Out of
Service Service
1 2
In Low Low In
Regen. Press Press Regen.
Heating FV5
Gas Out FV8
FV6
FV7
Process
Gas Out
In the GUI graphics of Figure 1-14, Tower 1 is shown in service so that its
process gas inlet valve FV-1 and process gas outlet valve FV-7 are open
and its heating gas inlet valve FV-3 and heating gas outlet valve FV-5 are
closed. Tower 2 is shown in regeneration with valves FV-4 and FV-6
opened and valves FV-2 and FV-8 closed. The open valves in Figure 1-14
have no fill color, and the closed valves are solid black. We can also display
process conditions on the graphics screen, such as tower pressure high or
low, as shown in Figure 1-14.
The process values, such as valves open and closed, are transmitted to the
GUI application with special communications interface software called
drivers. The GUI software is normally configured using a cross-referenced
table that lists the PLC input and output addresses that will drive or
animate each point or information window on the graphic displays.
Normally, a large number of communications drivers are provided with
the GUI software so you can interface with the various PLC manufacturer
and PLC types. The GUI programmer simply selects the correct PLC
manufacturer and the correct PLC model number for the application.
SoftLogic or SoftPLC
The original hard-logic PLC had the advantage of being designed for
harsh industrial environments. However, with recent designs of
industrial-grade personal computers this advantage has been lost. One
disadvantage of most PLCs is that they use proprietary software. With
personal computers, faster and more powerful capabilities are introduced
at rapid and regular intervals. Personal computer speeds have historically
doubled every eighteen months. This is not true of PLCs, however,
because their proprietary architectures require additional engineering so
advanced microprocessor technology can be adapted to them.
same rate, PLCs are having great difficulty keeping up with commodity
PCs retailing to consumers for under $1,000. Moreover, after a decade of
exponential growth in their capabilities, PCs now come in rugged
packages, with ever faster processors, real-time operating systems to
handle time-critical operations, larger memory, and a multitude of
Windows-based software products. All this comes at ever lower cost
because of competitive pricing and high-volume manufacturing.
EXERCISES
1.1 Explain the operation and purpose of the processor in a typical
programmable controller system.
1.2 What is the main purpose of the input and output system in a PLC
system?
1.3 List some discrete input devices typically found in process
industries.
1.4 List some discrete output devices typically encountered in
industrial applications.
1.5 List some analog signal values typically found in process
applications.
1.6 Explain the difference between volatile and nonvolatile memory.
1.7 List some common applications for personal computers in
programmable controller systems.
1.8 What device is most commonly used to program PLCs?
1.9 Discuss the three basic instructions used in ladder logic programs.
1.10 What is power flow in a relay ladder diagram?
1.11 Explain the concept of logical power flow in a ladder diagram
program.
1.12 What are the two basic structures used in STL instruction
statements?
22 Introduction to Programmable Controllers
BIBLIOGRAPHY
1. Allen-Bradley Co., Inc. Micro Mentor--Understanding and Applying
Micro Programmable Controllers (Allen-Bradley, 1995).
2. Gilbert, R. A., and J. A. Llewellyn. Programmable Controllers—
Practices and Concepts (Industrial Training Corp., 1985).
3. Jones, C. T., and L. A. Bryan. Programmable Controllers Concepts and
Applications (International Programmable Controllers, 1983).
4. Plato Computer-Based Training. Programmable Controller
Fundamentals (Allen- Bradley, 1985).
5. Webb, J. W., and R. A. Reis. Programmable Logic Controllers—
Principles and Applications, 3d ed. (Prentice-Hall, 1995).
6. Wisnosky, D. E. SoftLogic: Overcoming Funnel Vision (Wizdom
Controls, 1996).
Appendix A
Table of Contents for
Programmable Controllers,
Third Edition
PREFACE xi
INDEX 331
Index
27
28 Index
NOT function 15
operating cycle 4
OR function 15
output coil 14
output image table 5
read-only memory 6
relay 12, 13, 14
ladder logic 3
logic instructions 16
scan time 1
seal in 15
statement list language 15
statement list programming 16
strain gauges 6
system memory 6
thermocouple 6
thermocouple input module 11
troubleshooting 17
volatile memory 5
voltage 1, 9, 11