You are on page 1of 175

M

I
C
R
O

M
E
N
T
O
R
M
i
c
r
o
M
e
n
t
o
r
U
n
d
e
r
s
t
a
n
d
i
n
g

a
n
d

A
p
p
l
y
i
n
g

M
i
c
r
o

P
r
o
g
r
a
m
m
a
b
l
e

C
o
n
t
r
o
l
l
e
r
s
Understanding and Applying
Micro Programmable Controllers
Mi c r oMent or
Understandi ng and Applyi ng
Mi cro Programmable Controllers
Soli d state equi pment has operati onal characteri sti cs di fferi ng from those of
electromechani cal equi pment. Safety Gui deli nes for the Appli cati on, I nstallati on
and Mai ntenance of Soli d State Controls ( Publi cati on SGI -1.1, Allen-Bradley Company)
descri bes some i mportant di fferences between soli d state equi pment and hard-wi red
electromechani cal devi ces. Because of thi s di fference, and also because of the wi de
vari ety of uses for soli d state equi pment, all persons responsi ble for applyi ng thi s
equi pment must sati sfy themselves that each i ntended appli cati on of thi s equi pment
i s acceptable.
I n no event wi ll the Allen-Bradley Company be responsi ble or li able for i ndi rect or
consequenti al damage resulti ng from the use or appli cati on of thi s equi pment.
T he examples and di agrams i n thi s book are i ncluded solely for i llustrati ve purposes.
Because of the many variables and requirements associated with any particular installation,
the Allen-Bradley Company cannot assume responsi bi li ty or li abi li ty for actual use based
on the examples and di agrams.
Reproducti on of the contents of thi s book, i n whole or i n part, wi thout wri tten
permi ssi on of the Allen-Bradley Company i s prohi bi ted.
1995 Allen-Bradley Company, I nc. Pri nted i n USA
TM
T he mi cro symbol i s a trademark of Allen-Bradley Company, I nc., a Rockwell I nternati onal company
Page
Pr ef ace . . . . . . . . . . . . . . . . . . . . . . . . . . .vi i
Chapt er 1
Int r oduct i on t o PLCs
1.0 Hi story of PLCs. . . . . . . . . . . . . . . . . . . 2
1.1 Why Use a PLC?. . . . . . . . . . . . . . . . . . .4
1.2 Tradi ti onal PLC Appli cati ons. . . . . . . . . 5
Chapt er 2
The Mi cr o PLC
2.0 Development of the Mi cro PLC . . . . . . 8
2.1 What Makes a Mi cro PLC a Mi cro? . . . 10
2.2 Capabi li ti es Overvi ew . . . . . . . . . . . . . 13
2.3 Mi cro PLC Appli cati ons. . . . . . . . . . . . 14
Chapt er 3
Mi cr o PLC Oper at i on
3.0 Components Overvi ew. . . . . . . . . . . . . 18
3.1 I nputs. . . . . . . . . . . . . . . . . . . . . . . . . 18
3.2 Outputs . . . . . . . . . . . . . . . . . . . . . . . . 20
3.3 Central Processi ng Uni t CPU . . . . . . 21
3.4 Types of Appli cati on Memory . . . . . . . 22
3.5 Data, Memory and Addressi ng. . . . . . . 23
3.6 Operati ng Cycle. . . . . . . . . . . . . . . . . . 24
3.7 Power Suppli es . . . . . . . . . . . . . . . . . . 26
3.8 Programmi ng Devi ces . . . . . . . . . . . . . 28
3.9 Operator I nterfaces. . . . . . . . . . . . . . . 30
T
A
B
L
E

O
F

C
O
N
T
E
N
T
S
Page
Chapt er 4
Ladder Logi c Fundament al s
4.0 Programmi ng Languages. . . . . . . . . . . 34
4.1 Electri cal Ladder Di agrams. . . . . . . . . 35
4.2 Ladder Logi c Programs. . . . . . . . . . . . 36
4.3 Ladder Logi c I nstructi ons . . . . . . . . . . 39
4.4 Combi ni ng I nstructi ons. . . . . . . . . . . . 44
4.5 Program Executi on . . . . . . . . . . . . . . . 49
Chapt er 5
How t o Appl y a Mi cr o PLC
5.0 What i s a Potenti al
Control Appli cati on? . . . . . . . . . . . . . . 52
5.1 What are the Appli cati ons
Requi rements?. . . . . . . . . . . . . . . . . . . 53
5.2 Selecti ng a Control Method. . . . . . . . . 60
5.3 What are the PLC Speci fi cati ons? . . . . 66
5.4 Program Development Procedures. . . . 70
5.5 I nstallati on Requi rements . . . . . . . . . . 80
Page
Chapt er 6
Commi ssi oni ng and Tr oubl eshoot i ng
6.0 Commi ssi oni ng. . . . . . . . . . . . . . . . . . . 84
6.1 Troubleshooti ng Overvi ew. . . . . . . . . . 86
6.2 Fi ndi ng the Problem . . . . . . . . . . . . . . 87
6.3 Troubleshooti ng the PLC. . . . . . . . . . . 88
6.4 Troubleshooti ng I /O . . . . . . . . . . . . . . . 88
6.5 Program Troubleshooti ng . . . . . . . . . . 91
6.6 Faults. . . . . . . . . . . . . . . . . . . . . . . . . . 92
6.7 Safety. . . . . . . . . . . . . . . . . . . . . . . . . . 92
6.8 Troubleshooti ng Model. . . . . . . . . . . . . 93
Chapt er 7
Appl i cat i on Exampl es
7.0 I ntroducti on. . . . . . . . . . . . . . . . . . . . . 96
Basi c Logi c
7.1 OR Ci rcui t . . . . . . . . . . . . . . . . . . 96
7.2 AND Ci rcui t . . . . . . . . . . . . . . . . . 97
7.3 Start/Stop Ci rcui t . . . . . . . . . . . . 98
7.4 Fli p/Flop Ci rcui t . . . . . . . . . . . . 100
7.5 Alarm Ci rcui t . . . . . . . . . . . . . . . 102
7.6 Start/Stop wi th Jog . . . . . . . . . . 104
Page
T i mi ng and Counti ng
7.7 On Delay . . . . . . . . . . . . . . . . . 106
7.8 Off Delay . . . . . . . . . . . . . . . . . 108
7.9 One Mi nute Clock. . . . . . . . . . . 110
7.10 Up/Down Counti ng . . . . . . . . . 112
Data I nstructi ons
7.11 Movi ng Data. . . . . . . . . . . . . . . 114
7.12 Compari ng Data. . . . . . . . . . . . 117
7.13 Math Commands . . . . . . . . . . . 120
Advanced I nstructi ons
7.14 Sequencers. . . . . . . . . . . . . . . . 123
7.15 FI FO . . . . . . . . . . . . . . . . . . . . 125
7.16 Hi gh-Speed Counter . . . . . . . . 128
7.17 Two Stage Alternator. . . . . . . . 129
7.18 T hree Stati on Alternator . . . . . 133
Appendi ces
Glossary . . . . . . . . . . . ( Appendi x A) . . . 142
I nput and
Output Devi ces . . . . ( Appendi x B) . . . 153
I nstructi on
Executi on T i mes . . . ( Appendi x C) . . . 161
Sample Program
Worksheets . . . . . . . ( Appendi x D) . . . 164
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Welcome to Mi croMentor Understandi ng
and Applyi ng Mi cro Programmable
Controllers. I n less than a decade, mi cro
PLCs have gone from a bluepri nt to one of the
fastest growi ng segments of the control products
market. Unfortunately, scant li terature exi sts
about mi cro PLCs. I n addi ti on, many of the
current PLC text books are too cumbersome
for todays busy personnel.
Wi th those thoughts i n mi nd, Allen-Bradley
produced thi s book as an i ntroducti on to mi cro
PLCs for the desi gn engi neer, electri cal techni ci an
and mai ntenance person wi th li ttle or no
background i n programmable logi c controls.
Readers wi ll qui ckly learn about the mi cro PLCs
evoluti on, capabi li ti es, operati on, and advantages
over other control opti ons. Non-speci fi c to
any manufacturer, the text also covers basi c
programmi ng, i nstructi ons, appli cati on
examples, and troubleshooti ng.
Wri tten to be easi ly understood, the
M i croM entor can augment classroom materi al,
and i t can serve as a supplement to the operator
manuals and techni cal data suppli ed by mi cro
PLC manufacturers.
T he authors hope that those experi enced wi th
mi cro PLCs wi ll use thi s book as a trai ni ng ai d, and
that Mi croMentor prompts all readers to ask, What
i s the best control soluti on for my appli cati on?
Good Luck!
P
R
E
F
A
C
E
vi i
Hi story of PLCs . . . . . . . . . . . . . . . . . . . . 1.0
Why Use a PLC?. . . . . . . . . . . . . . . . . . . . 1.1
Tradi ti onal PLC Appli cati ons . . . . . . . . . . 1.2
C
H
A
P
T
E
R
Int r oduct i on t o PLCs
1
1
1
1.0
Hi st or y of PLCs
A programmable logi c controller ( PLC) i s an electroni c devi ce that
controls machi nes and processes. I t uses a programmable memory to
store i nstructi ons and execute speci fi c functi ons that i nclude On/Off
control, ti mi ng, counti ng, sequenci ng, ari thmeti c, and data handli ng.
PLC development began i n 1968 i n response to a request from the
Hydramati c Di vi si on of General Motors. At the ti me, GM frequently
spent days or weeks replaci ng i nflexi ble relay-based control systems
whenever i t changed car models or made li ne modi fi cati ons. To reduce
the hi gh cost of rewi ri ng, GMs control speci fi cati on called for a soli d
state system that had the flexi bi li ty of a computer, yet could be
programmed and mai ntai ned by plant engi neers and techni ci ans. I t
also had to wi thstand the di rty ai r, vi brati on, electri cal noi se, humi di ty
and temperature extremes found i n the i ndustri al envi ronment.
T he first PLCs were installed in 1969 and quickly became a success.
Functioning as relay replacements, even the early PLCs were more reliable
than relay-based systems, largely due to the ruggedness of their solid state
components compared with the moving parts in electromechanical relays.
PLCs provided material, installation, troubleshooting and labor cost savings
2 2
3
1
3
An early PLC
Fi g. 1-1 Typi cal electri cal ladder di agram
by reducing wiring and associated wiring
errors. T hey took up less space than
the counters, timers and other control
components they replaced. And their ability
to be reprogrammed dramatically increased
flexibility when changing control schemes.
Perhaps the bi ggest key to i ndustrys
acceptance of the PLC was that the i ni ti al
programmi ng language was based on the
ladder di agrams and electri cal symbols
commonly used by electri ci ans ( see
Fi g. 1-1) . Most plant personnel were already
1
trai ned i n ladder logi c, and they easi ly adopted i t for PLCs. I n fact, ladder
logi c sti ll plays an i ntegral role i n programmi ng and troubleshooti ng,
even though more advanced programmi ng languages have been
developed.
1.1
Why Use a PLC?
Should we be usi ng a programmable logi c controller? Duri ng the
1970s and early 80s, many engi neers, manufacturi ng managers and
control system desi gners spent consi derable ti me debati ng thi s i ssue,
tryi ng to evaluate cost effecti veness.
Today, one generally accepted rule i s that PLCs become economi cally
vi able i n control systems that requi re three to four or more relays.
Gi ven that mi cro PLCs cost only a few hundred dollars, coupled wi th
the emphasi s manufacturers place on producti vi ty and quali ty, the cost
debate becomes almost i mmateri al.
I n addi ti on to cost savi ngs, PLCs provi de many value-added benefi ts:
Reli abi li ty. Once a program has been wri tten and debugged, i t can
be easi ly transferred and downloaded to other PLCs. T hi s reduces
programmi ng ti me, mi ni mi zes debuggi ng, and i ncreases reli abi li ty.
Wi th all the logi c exi sti ng i n the PLCs memory, theres no chance of
maki ng a logi c wi ri ng error. T he only wi ri ng requi red i s for power and
i nputs and outputs.
Flexi bi li ty. Program modi fi cati ons can be made wi th j ust a few key
strokes. OEMs ( ori gi nal equi pment manufacturers) can easi ly
4 4
1
i mplement system updates by sendi ng out a new program i nstead of
a servi ce person. End-users can modi fy the program i n the fi eld, or,
conversely, OEMs can prevent end-users from ti nkeri ng wi th the
program ( an i mportant securi ty feature) .
Advanced functi ons. PLCs can perform a wi de vari ety of control
tasks, from a si ngle, repeti ti ve acti on to complex data mani pulati on.
Standardi zi ng on PLCs opens many doors for desi gners, and si mpli fi es
the j ob for mai ntenance personnel.
Communications. Communi cati ng wi th operator i nterfaces, other
PLCs or computers faci li tates data collecti on and i nformati on exchange.
Speed. Because some automated machi nes process thousands of
i tems per mi nute and obj ects spend only a fracti on of a second
i n front of a sensor many automati on appli cati ons requi re the
PLCs qui ck response capabi li ty.
Di agnosti cs. T he troubleshooti ng capabi li ty of programmi ng devi ces
and the di agnosti cs resi dent i n the PLC allow users to easi ly trace
and correct software and hardware problems.
1.2
Tr adi t i onal PLC Appl i cat i ons
No matter what the appli cati on, the use of PLCs helps i ncrease
competi ti veness. Processes usi ng PLCs i nclude: packagi ng, bottli ng
and canni ng, materi al handli ng, machi ni ng, power generati on,
HVAC/bui ldi ng control systems, securi ty systems, automated assembly,
pai nt li nes, and water treatment. PLCs are appli ed i n a vari ety of
5 5
1
i ndustri es, i ncludi ng food and beverage, automoti ve, chemi cal, plasti cs,
pulp and paper, pharmaceuti cals, and metals. Vi rtually any appli cati on
that requi res electri cal control can use a PLC.
6 6
Wastewater treatment faci li ty
Papermaki ng operati on
Tradi ti onal PLC
appli cati ons
Development of the Mi cro PLC . . . . . . . . 2.0
What Makes a Mi cro PLC a Mi cro?. . . . . . 2.1
Capabi li ti es Overvi ew. . . . . . . . . . . . . . . . 2.2
Mi cro PLC Appli cati ons . . . . . . . . . . . . . . 2.3
2
C
H
A
P
T
E
R
The Mi cr o PLC
7
2
2.0
Devel opment of t he Mi cr o PLC
Unti l the i ntroducti on of the mi cro PLC i n the mi d 1980s, the
potenti al to i ncrease automati on on si mple machi nes or less complex
processes remai ned largely untapped. T hi s was due to the lack of
attracti ve alternati ves to hardwi red relay control.
T hough OEMs had benefi tted by usi ng PLCs to control equi pment,
process li nes, or even whole plants, they could not always j usti fy usi ng
a PLC on small appli cati ons and low-cost machi nes. And i f cost was not
an i ssue, si ze often was. Someti mes even small PLCs were si mply too
large to fi t i n the space allocated for electri cal controls.
As such, the dri vi ng force behi nd the development of the mi cro PLC
was the demand by OEMs for a PLC that was small and i nexpensi ve
enough to replace relays, dedi cated ti mers and counters, and si ngle
board controllers. For a $5, 000 machi ne, a small PLC control system
costi ng $1, 000 i s not economi cal. However, at a few hundred dollars,
a mi cro PLC i s cost effecti ve and provi des all the benefi ts of tradi ti onal
PLC logi c control.
PLCs have followed a product development curve si mi lar to that
of the personal computer; early PLCs were large, cost thousands of
8
2
dollars, and had relati vely few features. But wi th the evoluti on of
mi croprocessors and other board-level components, PLCs grew i n
sophi sti cati on whi le si ze and cost shrank. I n fact, advanced features
that were consi dered stri ctly i n the domai n of medi um-si ze PLCs fi ve
years ago are now common i n mi cro PLCs.
Typical Micro PLC Features
Math capabi li ti es
Data handli ng i nstructi ons
9
Shown near actual si ze, a 16 I/O mi cro PLC. Hundreds of electromagneti c relays would
be needed to obtai n an equi valent level of control.
2
Hi gh-speed counti ng
BCD to bi nary conversi on routi nes
Drum ti mer and sequencer functi onali ty
Subrouti nes and i nterrupts
Programmed wi th a personal computer
Communi cati on wi th other electroni c devi ces
10
2.1
What Makes a Mi cr o PLC a Mi cr o?
Several cri teri a are used to categori ze PLCs as mi cro, small, medi um
or large. Cri teri a i nclude functi onali ty, number of i nputs and outputs
( see Fi g. 2-1) , cost, and physi cal si ze.
Fi g. 2-1 I/O count i s the most common method of categori zi ng PLCs.
2
Generally speaki ng, mi cro PLCs share the followi ng characteri sti cs:
32 I /O
Cost <$500
1K of memory
Small si ze, roughly:
- 5" ( 127 mm) long x 3" ( 76 mm) hi gh x 3" ( 76 mm) deep ( 16 I /O)
- 8" ( 203 mm) long x 3" ( 76 mm) hi gh x 3" ( 76 mm) deep ( 32 I /O)
Mi cro PLCs come as self-contai ned uni ts wi th the processor, power
supply, and I /O all i n one package. Because they are self-contai ned,
mi cro PLCs are also known as packaged controllers. A modular PLC i s
one that has separate components that i nterconnect. T he advantage of
11
A 32 I/O packaged mi cro controller i s consi derably more compact than a 32 I/O
modular controller.
2
Rel ay l ogi c i nst r uct i ons
examine if closed (normally open contacts)
examine if open (normally closed contacts)
output energize (coils)
output latch
output unlatch
one-shot rising
Ti mer s
on-delay timer
off-delay timer
retentive timer
Up and dow n count er s
Hi gh-speed count er
Mat h
add
subtract
divide
multiply
clear
square root
Bool ean l ogi c
AND, OR, Exclusive OR, NOT, Negate
Compar i son
=, , <, , >,
limit
Dat a handl i ng
move, masked move
FIFO and LIFO (First-In First-Out; Last-In First-Out)
BCD to binary conversion
binary to BCD conversion
Appl i cat i on speci f i c i nst r uct i ons
sequencer
bit shift
Pr ogr am f l ow
subroutine
MCR (master control reset)
immediate input or output with mask
selectable timed interrupt
jumps
12
Fi g. 2-2 The i nstructi on set of a typi cal mi cro PLC.
2
a packaged controller i s that the all-i n-one package i s smaller, less costly,
and conveni ent to i nstall ( see photo-p.11) . However, few packaged
controllershave expandable I /O capabi li ti es, where all modular
controllers can be expanded easi ly by addi ng more I /O cards to the rack.
2.2
Capabi l i t i es Over vi ew
A PLCs capabi li ti es are determi ned by the type of commands a
user can i nstruct i t to execute. Whi le the i nstructi on set and names of
i nstructi ons wi ll vary sli ghtly among mi cro PLC manufacturers, Fi g. 2-2
gi ves an overvi ew of the i nstructi ons commonly avai lable.
As has been noted, PLCs were i ni ti ally desi gned to functi on as
electroni c replacements for hardwi red control devi ces pri mari ly
relay coi ls and contacts, counters and ti mers. Today, these functi ons
sti ll compri se the maj ori ty of i nstructi ons used i n mi cro PLC
appli cati ons.
By way of example, i magi ne desi gni ng a control system for a
conveyor i n a food packagi ng operati on. Based on the status of fi eld
devi ces, a PLC can start a conveyor, sense the presence of a box,
move the box forward to the desi red posi ti on, hold i t there for a
predetermi ned fi lli ng ti me, and count the number of full boxes comi ng
off the li ne.
Mi cro PLCs also open up new control possi bi li ti es wi th advanced
functi ons such as: four-functi on math, data compari son ( i .e., equal to,
greater than, etc.) , data handli ng ( such as parts sorti ng or fault tracki ng) ,
sophi sti cated subrouti nes, sequenci ng ( replaci ng drum sequencers) ,
13
2
and other features that experi enced control system desi gners can
appreci ate. To demonstrate the value of these features, appli cati on
examples are provi ded i n Chapter 7.
Possi bly the most exci ti ng feature of mi cro PLCs i s thei r hi gh-speed
counti ng capabi li ti es. Speed, the key to success for many automated
appli cati ons, can also cause problems i f the speed of the PLC cannot
keep up wi th the manufacturi ng operati on. For example, i f parts or
materi al are movi ng at hi gh speed past a proxi mi ty sensor, a normal
PLC counter could mi ss some parts. T hi s i s because the parts are
movi ng faster than the PLC scans the sensors i nput.
However, a hi gh-speed counter operates i ndependently of the
program scan. T hi s enables i t to count at a much faster rate, typi cally
2, 000 to over 6, 000 ti mes per second. I n addi ti on, some hi gh-speed
counters can energi ze an output i mmedi ately ( i .e., wi thout havi ng to
wai t for the normal program scan ti me) , thus substanti ally i mprovi ng
speed and performance. T hi s enables the counter to affect control
operati ons when spli t-second accuracy i s cri ti cal.
2.3
Mi cr o PLC Appl i cat i ons
Mi cro PLCs are i deal for controlli ng stand-alone, di screte machi nery
or processes. Many appli cati ons that are presently controlled by relays
and/or custom si ngle board controls are mi grati ng toward mi cro PLCs.
Mi cro PLC appli cati ons are consi dered i n detai l i n Chapter 5 ( How to
Apply a Mi cro PLC) and Chapter 7 ( Appli cati on Examples) .
14
15
2
Canni ng operati on
Typi cal mi cro
PLC appli cati ons
Packagi ng machi ne
Components Overvi ew . . . . . . . . . . . . . . . 3.0
I nputs. . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . .3.2
Central Processi ng Uni t CPU. . . . . . . . . 3.3
Types of Appli cati on Memory. . . . . . . . . . 3.4
Data, Memory and Addressi ng. . . . . . . . . 3.5
Operati ng Cycle . . . . . . . . . . . . . . . . . . . . 3.6
Power Suppli es. . . . . . . . . . . . . . . . . . . . . 3.7
Programmi ng Devi ces. . . . . . . . . . . . . . . . 3.8
Operator I nterfaces . . . . . . . . . . . . . . . . . 3.9
C
H
A
P
T
E
R
Mi cr o PLC Oper at i on
3
17
3
3.0
Component s Over vi ew
I n order to learn how PLCs operate, a qui ck overvi ew of PLC
components i s necessary. All PLCs from mi cro to very large use
the same basi c components and are structured i n a si mi lar fashi on. PLC
systems consi st of:
I nputs
Outputs
Central processi ng uni t ( CPU)
Memory, for program and data storage
Power supply
Programmi ng devi ce
Operator i nterfaces
3.1
Input s
T he i nput screw termi nals on a PLC form the i nterface by whi ch
fi eld devi ces are connected to the PLC.
18
3
I nputs i nclude i tems such as pushbuttons, thumbwheel swi tches,
li mi t swi tches, selector swi tches, proxi mi ty sensors and photoelectri c
sensors. T hese are all di screte devi ces that provi de an On or Off status
to the PLC. Whi le larger PLCs can di rectly accept analog values ( vari able
voltage or current si gnals) such as from temperature or pressure sensors,
mi cro PLCs do not typi cally possess thi s capabi li ty.
T he electri cal si gnals that fi eld devi ces send to the PLC are typi cally
unfi ltered 120V ac or 24V dc. T he i nput ci rcui try on the PLC takes thi s
fi eld voltage and condi ti ons i t to be usable by the PLC. Condi ti oni ng
i s necessary because the i nternal components of a PLC operate on
5V dc, and thi s mi ni mi zes the possi bi li ty of damage by shi eldi ng them
from voltage spi kes. To electri cally i solate the i nternal components
from the i nput termi nals, PLCs employ an opti cal i solator, whi ch uses
19
Programming/
Communication
Devices
Central
Processing
Unit
I
N
P
U
T
C
I
R
C
U
I
T
S
C
I
R
C
U
I
T
S
O
U
T
P
U
T
CR
Optical
Isolation
MEMORY
program data
Optical
Isolation
Power Supply
Fi g. 3-1 Control of a machi ne or process entai ls moni tori ng the status of devi ces
connected as i nputs and, based on a user-wri tten program, controlli ng devi ces
connected as outputs.
3
li ght to couple si gnals from one electri cal
devi ce to another.
T he PLCs i nput ci rcui try also fi lters
fi eld voltage si gnals to quali fy them as vali d,
such as a si gnal from a sensor, or not vali d,
such as hi gh-frequency electri cal noi se or
stati c. I nput fi lters determi ne the vali di ty of
a si gnal by i ts durati on; they wai t to
confi rm that a si gnal i s a reference from
an i nput devi ce rather than electri cal noi se.
A typi cal fi lter ti me i s 8 ms, but some PLCs
have adj ustable i nput fi lter response ti mes. A
longer response ti me provi des better fi lteri ng
of electri cal noi se. A shorter response ti me
helps i n appli cati ons that requi re hi gh-speed
operati on ( e.g., i nterrupts or counti ng) .
3.2
Out put s
Connected to the output termi nals of the
PLC are devi ces such as solenoi ds, relays,
contactors, motor starters, i ndi cator li ghts,
valves and alarms. Output ci rcui ts operate
i n a manner si mi lar to i nput ci rcui ts: si gnals
from the CPU pass through an i solati on
barri er before energi zi ng output ci rcui ts.
Assorted I/O devi ces. See Appendi x B for a
more thorough descri pti on of I/O devi ces.
20
Transi stor, relay and triac for PLC output
circuitry. Paper clip indicates relative size.
3
PLCs use a vari ety of output ci rcui ts to energi ze thei r output
termi nals: relays, transi stors and tri acs.
Relays are for ei ther ac or dc power. Tradi ti onal PLC electromagneti c
relays typi cally handle current up to a few amps. Relays can better
wi thstand voltage spi kes, and they have an ai r gap between thei r con-
tacts whi ch eli mi nates the possi bi li ty of current leakage. However,
they are comparati vely slow and subj ect to wear over ti me.
Transi stors swi tch dc power, are si lent and have no movi ng parts to
wear out. Transi stors are fast and can reduce response ti me, but only
carry loads of 0.5 amp or less. Speci al types of transi stors, such as
FETs ( Fi eld Effect Transi stors) can handle more power, typi cally up
to 1 amp.
Tri acs stri ctly swi tch ac power. Li ke transi stors, tri ac outputs are
si lent, have no movi ng parts to wear, are fast, and carry loads of
0.5 amp or less.
Note: soli d state outputs ( tri acs and transi stors) can be damaged or
destroyed by over-voltage or over-current.
3.3
Cent r al Pr ocessi ng Uni t CPU
T he CPU, made up of a microprocessor and a memory system, forms the
primary component of the PLC. T he CPU reads the inputs, executes logic as
dictated by the application program, performs calculations, and controls the
outputs accordingly.
PLC users work wi th two areas of the CPU: program fi les and data
fi les. Program fi les store a users appli cati on program, subrouti ne fi les,
21
3
Even though EEPROM
and RAM memory can save
appli cati on programs i f power
i s lost, they do not necessari ly
save process data, such as the
accumulated value of a ti mer
or counter. If retai ni ng process
data i s i mportant for an
appli cati on, look for a mi cro
PLC that offers 100 percent
data retenti on. Upon power loss,
thi s type of PLC automati cally
saves process data to the
nonvolati le EEPROM.
and the error fi le. Data fi les store data
associ ated wi th the program, such as I /O
status, counter/ti mer preset and
accumulated values, and other stored
constants or vari ables. Together, these two
areas are called the appli cati on memory or
user memory.
Also within the CPU is an executive
program or system memory that directs
and performs operation activities such as
executing the user program and coordinating
input scans and output updates. System
memory, which is programmed by the
manufacturer, cannot be accessed by the user.
3.4
Types of Appl i cat i on Memor y
As the name i ndi cates, programmable
logi c controllers have programmable
memory that allows users to develop
and modi fy control programs. Memory
i s a physi cal space i nsi de the CPU where
the program fi les and data fi les are stored
and mani pulated.
Memory types fall i nto two categori es:
volati le or nonvolati le. Volati le memory can
22
3
be easi ly altered or erased, and i t can be wri tten to and read from.
However, wi thout proper backup, a power loss can cause the loss of
programmed contents.
T he best known form of volati le memory i s Random Access Memory,
or RAM. RAM i s relati vely fast and offers an easy means to create and
store users appli cati on programs. I f normal power i s di srupted, mi cro
PLCs wi th RAM memory use battery or capaci tor backups to prevent
program loss. ( However, note that capaci tors and batteri es may fai l.)
Nonvolati le memory retai ns i ts programmed contents wi thout a
battery or capaci tor backup even i f power i s lost. T he EEPROM
Electri cally Erasable Programmable Read Only Memory i s a
nonvolati le memory that has the same flexi bi li ty as RAM, and i s
programmed through appli cati on software, whi ch runs on a personal
computer or through a mi cro PLCs Hand-Held Programmer.
3.5
Dat a, Memor y and Addr essi ng
Whereas memory i s a physi cal space, data i s i nformati on stored i n
that space. T he CPU operates j ust li ke a computer; i t mani pulates data
usi ng bi nary di gi ts, or bi ts. A bi t i s a di screte locati on wi thi n a si li con
chi p that ei ther has a voltage present, read as a value of 1 ( On) , or not
present, read as a value of 0 ( Off) . T hus, data i s a pattern of electri cal
charges that represent a numeri cal value.
A bi t i s the smallest uni t of memory avai lable. Generally, CPUs
process and store data i n 16 bi t groups, also known as words.
However, users can sti ll mani pulate data on the bi t level.
23
Whi le PLCs operate i n
bi nary (1 and 0), they also use
bi nary to convert, accept and
mani pulate data from other
number systems. These systems
i nclude bi nary coded deci mal
(BCD), hexadeci mal, octal, and
gray code (see Fi g. 3-3).
Begi nni ng PLC users
probably do not need to know
how to use these di fferent
number systems, so they
wi ll not be explai ned further.
However, note that they may
need to be learned later, as
these numberi ng systems are
valuable when worki ng wi th
certai n types of i nputs. For
example, thumbwheel swi tches
usually requi re four bi ts per
wheel; i .e., they communi cate
i n BCD. Thus, any PLC used
wi th a thumbwheel must be
able to accept a BCD i nput.
Each word of data has a speci fi c, physi cal
locati on i n the CPU called an address or a
regi ster ( note that the terms word,
address, and regi ster are often used
i nterchangeably) . Every element i n the user
program i s referenced wi th an address to
i ndi cate where data for that element i s
located. When assi gni ng addresses to I /O i n
a program, note that the address i s related
to the termi nal where i nput and output
devi ces are connected ( see Fi g. 3-2) .
24
3
Decimal Hexadecimal Binary BCD Octal Gray code
0 0 000 0000 0 0000
1 1 001 0001 1 0001
2 2 010 0010 2 0011
3 3 011 0011 3 0010
4 4 100 0100 4 0110
5 5 101 0101 5 0111
6 6 110 0110 6 0101
7 7 111 0111 7 0100
8 8 1000 1000 10 1100
9 9 1001 1001 11 1101
10 A 1010 12 1111
11 B 1011 13 1110
12 C 1100 14 1010
13 D 1101 15 1011
14 E 1110 16 1001
15 F 1111 17 1000
Fi g. 3-3
3.6
Oper at i ng Cycl e
All the components of the PLC system
come i nto play duri ng the operati ng cycle,
whi ch consi sts of a seri es of operati ons
performed sequenti ally and repeatedly.
3
25
I/O Wiring
Input word
Output word
Pushbutton wired
to input terminal I/3
Pilot light wired
to output terminal O/2
Memory location of I/O status
This bit corresponds to
Input terminal I/3
This bit corresponds to
Output terminal O/3
Program with addresses
I/3 O/2
Fi gure 3-2 Thi s fi gure shows the relati onshi p between the actual I/O wi ri ng
termi nal locati on and the address of the i nstructi ons i n the program. Note:
The I/O address format may di ffer, dependi ng on the PLC manufacturer.
3
T he maj or elements of an operati ng cycle are:
1. The i nput scan. Duri ng the i nput scan
the PLC exami nes the external i nput
devi ces for a voltage present or absent;
i .e., an On or Off state. T he status of
the i nputs i s temporari ly stored i n an
i nput i mage memory fi le.
2. Program scan. Duri ng the program scan,
the PLC scans the i nstructi ons i n the
ladder logi c program, uses the i nput status
from the i nput i mage fi le, and determi nes
i f an output wi ll or wi ll not be energi zed.
T he resulti ng status of the outputs i s
wri tten to the output i mage memory fi le.
3. Output scan. Based on the data i n the
output i mage fi le, the PLC energi zes or
de-energi zes i ts output ci rcui ts, controlli ng
external devi ces.
3.7
Pow er Suppl i es
T he power supply provides power to the
controllers internal electronics, converts the
incoming voltage to a usable form and protects
the PLCs components from voltage spikes.
26
I
n
p
u
t
S
c
a
n
O
u
t
p
u
t
S
c
a
n
PLC
Operating
Cycle
Program
S
c
a
n
Fi g. 3-4 Image of operati ng cycle.
3
Gi ven that most faci li ti es experi ence li ne
voltage fluctuati ons, PLC power suppli es are
desi gned to mai ntai n normal operati on even
i f the voltage vari es from 10 to 15 percent.
Di ps or surges i n power are caused by
natural li ne losses from the uti li ty, brownouts
or the start-up or shutdown of nearby heavy
equi pment ( such as motors or arc welders) .
For voltage condi ti ons that are especi ally
unstable, consi der i nstalli ng a constant
voltage transformer between the PLC and
the pri mary power source.
T he PLCs power supply i s desi gned to
wi thstand short power losses wi thout
affecti ng the operati on of the system. A PLC
can operate for several mi lli seconds wi thout
li ne power before the power supply si gnals
the processor that i t can no longer provi de
adequate dc power to the system. T he power
supply then instructs the processor to execute
a controlled shut down, which saves the users
program and data i n memory.
Another factor affecti ng the functi on of the
PLC i s electromagneti c i nterference ( EMI ) or
electri cal noi se. Whi le PLCs are more rugged
than most electroni c equi pment ( especially
the PCs or single board controllerssometi mes
27
Speed
What i s the fastest acti on
requi red i n the control process?
How much ti me i s needed to
control that acti on? Speed i s
one of the pri mary advantages
of todays mi cro controllers.
Operati ng cycles typi cally take
1 to 25 mi lli seconds (thousandths
of a second). When judgi ng the
speed, i t i s i mportant to look at
total throughput ti me, not just the
operati ng cycle.
Components of throughput
ti me i nclude: ti me for actuati on
of the physi cal i nput; ti me for
PLCs i nput ci rcui t to sense
the si gnal; ti me for i nput scan,
program scan and output scan;
ti me for actuati on of the output
ci rcui t and correspondi ng fi eld
devi ce; and ti me for the CPUs
housekeepi ng or overhead
functi ons. See throughput ti me
worksheet i n Appendi x D.
For appli cati ons that requi re
hi gh-speed operati on, advanced
mi cro controllers offer functi ons
such as hi gh-speed counti ng
wi th di rect control of outputs
and i mmedi ate I/O update
i nstructi ons. These functi ons
enable the mi cro controller
to detect and react qui ckly to
changi ng i nput condi ti ons.
3
used i nstead of PLCs) , EMI may sti ll be a problem. I f so, the PLC should
be electrically isolated by installing an isolation transformer.
Unti l recently, all mi cro PLCs operated on 24V dc. However, several
mi cro PLC manufacturers now offer products that operate on ei ther
120V ac, 220V ac or 24V dc. T hi s gi ves the user the opti on of selecti ng the
voltage that best suits the application. For example, if ac power is used on
other parts of the machine ( actuators, for example) , a micro PLC that can
accept ac power may eli mi nate the need to i nstall a dc power supply.
3.8
Pr ogr ammi ng Devi ces
When enteri ng a program i nto a mi cro PLC, the two devi ces most
commonly used are a personal computer ( PC) and a Hand-Held
28
Most users create thei r programs wi th software run on a PC.
29
Plant techni ci ans
value Hand-Held
Programmers
(shown actual si ze)
because of thei r
portabi li ty,
ruggedness and
troubleshooti ng
capabi li ti es.
3
3
Programmer ( HHP) .
T he PC i s used to run PLC programmi ng
software. T hi s software allows users to
create, edi t, document, store and
troubleshoot ladder di agrams, and generate
pri nted reports. Software i nstructi ons are
based on graphi cal symbols for vari ous
functi ons. Usi ng such software does not
requi re knowledge of hi gher programmi ng
languages, j ust a general understandi ng of
standard electri cal wi ri ng di agrams.
Whi le the HHP can be used to program
the PLC, i t i s more commonly used as a
troubleshooti ng tool. T hi s i s because the
HHP i s compact and has i ts own memory to
store programs. HHPs are i nvaluable for
troubleshooti ng equi pment whi le on the
factory floor, for modi fyi ng programs, and
transferri ng programs to multi ple machi nes.
T he language used by the HHP i s a graphi cal
form of i nstructi on li st programmi ng based
on the PLCs ladder logi c i nstructi ons.
3.9
Oper at or Int er f aces
I n order to convey i nformati on about
30
Operator i nterface
3
machi ne status, the front panel of a mi cro PLC has a seri es of i ndi cator
li ghts. T hese are for such thi ngs as power, run, faults or I /O status. To
communi cate wi th the PLC to enter data or moni tor and control
machi ne status tradi ti onal operator i nterfaces i nclude pushbuttons,
thumbwheel swi tches, pi lot li ghts and LED numeri c di splays.
To i mprove the i nterface between the operator and the mi cro PLC,
a new generati on of electroni c operator i nterface devi ces ( or
peri pherals) can be connected. T hese are not programmi ng devi ces,
but graphi c or alphanumeri c di splays and control panels that
consoli date all the functi ons of tradi ti onal operator i nterface devi ces
i nto a si ngle panel.
T hese i nterfaces can output data and di splay messages about
machi ne status i n descri pti ve text ( Motor 1 On) , di splay parts count,
and track alarms. T hey can also be used for data i nput. By provi di ng
better and more easi ly conveyed i nformati on, these i nterfaces decrease
the need for operator trai ni ng on machi ne operati on and reduce
system, component, and i nstallati on costs.
T hese products communi cate wi th the PLC through an RS 232
communi cati ons port. T hi s opens up I /O poi nts, whi ch can be used for
sensors and output devi ces and enables a mi cro PLC to control a more
complex machi ne or process.
31
Programmi ng Languages . . . . . . . . . . . . . 4.0
Electri cal Ladder Di agrams . . . . . . . . . . . 4.1
Ladder Logi c Programs . . . . . . . . . . . . . . 4.2
Ladder Logi c I nstructi ons . . . . . . . . . . . . 4.3
Combi ni ng I nstructi ons . . . . . . . . . . . . . . 4.4
Program Executi on. . . . . . . . . . . . . . . . . . 4.5
4
C
H
A
P
T
E
R
Ladder Logi c Fundament al s
33
4
4.0
Pr ogr ammi ng Languages
A programi s a user-developed seri es of i nstructi ons or commands
that di rect the PLC to execute acti ons. A programmi ng language
provi des rules for combi ni ng the i nstructi ons so that they produce
the desi red acti ons.
T he most commonly used language for programmi ng PLCs i s
ladder logi c. I n fact, more PLC programs are wri tten i n ladder logi c
than any other language. T he ladder logi c programmi ng language i s an
adaptati on of an electri cal relay wi ri ng di agram, also known as a ladder
di agram. Because ladder logi c i s a graphi cal system of symbols and
terms, even those not fami li ar wi th electri cal relay wi ri ng di agrams can
easi ly learn i t.
Other control languages occasi onally used to program PLCs i nclude
BASI C, C and Boolean. T hese computer languages faci li tate programs
that requi re complex i nstructi ons and calculati ons too cumbersome to
i mplement wi th a ladder logi c program. However, mi cro PLCs that can
be programmed wi th BASI C and C are not wi dely avai lable.
T he i nstructi ons used to program most mi cro PLCs are based on a
combi nati on of Boolean, ladder logi c and mnemoni c expressi ons. A
34
4
35
M1
L1 L2
PB1
Stop
PB2
Start
Motor
M1
Rung
Power Bus Power Bus
Auxiliary
Holding
Contact
mnemoni c expressi on i s a si mple and easy to remember term whi ch
represents a complex or lengthy i nstructi on. For example, T ON stands
for ti mer on. Di fferent PLCs use sli ghtly di fferent i nstructi ons, and
these can be found by consulti ng the users manual.
4.1
El ect r i cal Ladder Di agr ams
Ladder logi c programs evolved from electri cal ladder di agrams, whi ch
represent how electri c current flows through devi ces to complete an
electri c ci rcui t. T hese di agrams show the i nterconnecti on between
electri cal devi ces i n an easy-to-read graphi cal format that gui des the
electri ci an when wi ri ng ( see Fi g. 4-1) .
An electri cal di agram consi sts of two verti cal bus li nes, or power li nes,
wi th current flowi ng from the left bus to the ri ght bus. Each electri cal
ci rcui t i n the di agram i s consi dered a rung. Every rung has two key
components: i t contai ns at least one devi ce that i s controlled, and i t
Fi g. 4-1 Electri cal di agram of a hardwi red start/stop ci rcui t.
4
contai ns the condi ti on( s) that control the devi ce, such as power from
the bus or a contact from a fi eld devi ce.
A rung i s sai d to have electri cal conti nui ty when current flows
uni nterrupted from left to ri ght across the rung ( i .e., all contacts are
closed) . I f conti nui ty exi sts, then the ci rcui t i s complete and the devi ce
controlled by the rung turns On ( see Fi g. 4-2) . I f conti nui ty does not
exi st, the devi ce stays Off.
36
M1
L1 L2
PB1
Stop
PB2
Start
Motor
M1
Rung
Power Bus Power Bus
Auxiliary
Holding
Contact
Electrical Continuity
4.2
Ladder Logi c Pr ogr ams
A PLC ladder logi c program closely resembles an electri cal ladder
di agram ( Fig. 4-3) . On an electri cal di agram, the symbols represent real-
world devi ces and how they are wi red. A PLC program uses si mi lar
symbols, but they represent ladder logi c i nstructi ons for the appli cati on.
A ladder logi c program exi sts only i n the PLCs software i t i s not
the actual power bus or the flow of current through ci rcui ts. Another
Fi g. 4-2 If PB1 i s NOT pushed and PB2 i s pushed, the ci rcui t wi ll be complete. Under
these condi ti ons, the rung has electri cal conti nui ty and the motor wi ll turn On.
4
di fference i s that i n an electri cal di agram, devi ces are descri bed
as bei ng open or closed ( Off or On) . I n a ladder logi c program,
i nstructi ons are ei ther True or False ( however, the terms are often
used i nterchangeably) .
37
] [ ( ) ] [
] [
Rung
Stop
I /1
Start
I/2
Motor - M1
Motor - M1
Auxiliary
Holding
Contact
Condition Instructions Control Instruction
Each rung i n a ladder logi c program must contai n at least one
control i nstructi on ( output) and usually contai ns one or more condi ti on
i nstructi ons ( i nputs) . Condi ti on i nstructi ons are programmed to the left
of the control i nstructi on. Examples of condi ti on i nstructi ons i nclude
si gnals from connected i nput devi ces, contacts associ ated wi th outputs,
and si gnals from ti mers and counters.
Programmed on the ri ght si de of the rung, a control i nstructi on i s
the operati on or functi on that i s acti vated/de-acti vated by the logi c
of the rung. Examples of control i nstructi ons i nclude output energi ze
( turn On the PLCs output ci rcui try to acti vate a fi eld devi ce) and
i nstructi ons i nternal to the PLC, such as bi t commands, ti mers, counters
and math commands.
Fi g. 4-3 Noti ce the si mi lari ty between the ladder logi c program and the hardwi red
ci rcui t i n Fi g. 4-1.
4
Recall from Chapter 3
that every element i n the user
program i s referenced wi th an
address to i ndi cate where data
for that element i s located.
T he control i nstructi ons are energi zed
or de-energi zed based on the status of the
condi ti on i nstructi ons i n the rung. T he PLC
does thi s by exami ni ng a rung for logi cal
conti nui ty ( i .e., all condi ti on i nstructi ons are
evaluated as True) . I f logi cal conti nui ty exi sts,
the PLC energi zes the control i nstructi on
( see Fi g. 4-4) . I f logi cal conti nui ty does not
exi st, then the PLC mai ntai ns the control
i nstructi on i n the Off or de-energi zed state.
38
] [ ( ) ] [
] [
Rung
Stop Start Motor - M1
O/1
M1
O/1
Auxiliary
Contact
Logical Continuity
I/2 I /1
Fi g. 4-4 If a si gnal i s NOT present at i nput termi nal I/1 and a si gnal i s present at
i nput termi nal I/2, the rung has logi cal conti nuity and the PLC wi ll energi ze output
termi nal O/1 controlli ng the motor.
4
4.3
Ladder Logi c Inst r uct i ons
T he most frequently used i nstructi ons i n a PLC ladder logi c program
are the normally open ( N.O.) i nstructi on, the normally closed ( N.C.)
i nstructi on, and the output energi ze i nstructi on ( see Fi g. 4-5) . T hese
i nstructi ons are represented as symbols placed on the rungs of the
program ( whi ch i s why PLC users may hear ladder logi c descri bed as
contact symbology) .
39
] [ ( ) ] [
] [
Normally
Closed Instruction
Normally
Open Instruction
Normally
Open Instruction
Output
Energize Instruction
/
Normally Open Instruction
A normally open i nstructi on exami nes a PLC memory locati on for an
On condi ti on ( i .e., i t checks to see i f the bi t element at the i nstructi ons
address i s On ( bi nary 1) ) . I f the PLC detects an On condi ti on, the
i nstructi on i s True and has logi cal conti nui ty.
For example, a N.O. pushbutton ( PB1) i s wi red to i nput termi nal
I /3 on the PLC. T he ladder logi c program contai ns the followi ng rung
( Fi g. 4-6.1) , where I /3 i s programmed as a N.O. i nstructi on.
When PB1 i s pressed ( On) , that On status i s wri tten to i nput i mage
Fi g. 4-5 Common ladder symbols.
Normally Closed Instruction
A normally closed i nstructi on exami nes the PLC memory for an
Off condi ti on ( i .e., i t checks to see i f the bi t element at the i nstructi ons
address i s Off, or 0) . I f the PLC detects an Off condi ti on, the i nstructi on
i s True and has logi cal conti nui ty.
4
memory locati on I /3 duri ng the PLCs i nput scan. When the rung
contai ni ng the N.O. i nstructi on wi th address I /3 i s scanned, that
i nstructi on i s seen as True and the PLC energi zes output O/4 duri ng
i ts output scan.
40
PB1
Input
Device
Input
Terminal
on PLC Ladder Program
Status of
Output
/ /
ON
True True
( ) ] [
I /3
I /3 O/4
0/4
Output
Terminal
on PLC
When PB1 i s released, the Off status i s wri tten to address I /3.
T he N.O. i nstructi on i s now False and the rung lacks logi cal conti nui ty
( 4-6.2) . Duri ng the PLCs output scan, output O/4 wi ll be de-energi zed.
Input
Device
Input
Terminal
on PLC Ladder Program
Status of
Output
OFF
PB1
False False
( ) ] [
/
I /3
I /3 O/4
/
0/4
Output
Terminal
on PLC
Fi g. 4-6.1 Normally open i nstructi ons.
Fi g. 4-6.2 Normally open i nstructi ons.
4
41
Input
Device
Input
Terminal
on PLC Ladder Program
Status of
Output
PB1
ON
True True
( ) ] [
I /4
I /4
/ /
O/5
/
0/5
Output
Terminal
on PLC
For example, a N.O. pushbutton ( PB1) i s wi red to i nput termi nal
I /4 on the PLC. T he ladder logi c program contai ns the followi ng rung
( Fi g. 4-7.1) , where I /4 i s programmed as a N.C. i nstructi on.
When PB1 i s not pressed ( Off) , that Off status i s wri tten to i nput
i mage memory locati on I /0 duri ng the PLCs i nput scan. When the rung
contai ni ng the N.C. i nstructi on wi th address I /0 i s scanned, that
i nstructi on i s seen as True ( NOT On) and the PLC energi zes output O/5
duri ng the output scan.
When PB1 i s pressed, the On status i s wri tten to address I /4. T he N.C.
i nstructi on i s now False and the rung lacks logi cal conti nui ty ( Fi g. 4-7.2) .
Duri ng the PLCs output scan, output O/5 wi ll be de-energi zed.
Fi g. 4-7.1 Normally closed i nstructi ons.
Input
Device
Input
Terminal
on PLC Ladder Program
Status of
Output
PB1
OFF
False False
( ) ] [
I /4
I /4
/ /
O/5
/
0/5
Output
Terminal
on PLC
Fi g. 4-7.2 Normally closed i nstructi ons.
4
42
Output Energize Instruction
( )
Controlled by the condi ti on i nstructi ons that precede i t on a rung,
the output energi ze i nstructi on ( OT E) turns On a bi t element i n the
output i mage fi le when rung condi ti ons are True. Output energi ze i s the
ladder logi c equi valent of a relay coi l on an electri cal di agram.
When logi cal conti nui ty exi sts on a rung, the On condi ti on ( bi nary 1)
i s wri tten to the locati on i n memory associ ated wi th the output
energi ze i nstructi on. I f the address i s that of an external output devi ce,
the PLC energi zes the output duri ng the output scan. When the rung i s
False, the PLC de-energi zes the output. T he output energi ze i nstructi on
PB1
Input
Device
Input
Terminal
on PLC Ladder Program
Status of
Output
( )
( )
PB1
( )
( )
PB1
( )
( )
PB1
( )
( )
] [
] [
] [
] [
] [
] [
] [
] [
/
/
/
/
/
/
/
/
/
/
/
/
A
A
A
A
A
A
W
X
X
Y
Z
Z
Y
W
B
B
B
B
B
B
/
/
/
/
OFF
ON
ON
OFF
ON
OFF
OFF
ON
W
X
X
W
Y
Y
Z
Z
Output
Terminal
on PLC
N.O. Pushbutton
Not Activated
N.O. Pushbutton
Activated
N.C. Pushbutton
Not Activated
N.C. Pushbutton
Activated
Fi g. 4-8 Condi ti on i nstructi ons and thei r results.
4
controls real world devi ces ( solenoi d valves,
motors, li ghts, etc.) or i nternal bi t elements.
Higher Level Instructions
Whi le relay logi c i s sui table for si mple
On/Off sensi ng and control, many
appli cati ons requi re more powerful
i nstructi ons. To allow thi s, enhanced ladder
language commands have been developed.
T hese i nstructi ons deal wi th numeri cal data
beyond si mple 1s or 0s by mani pulati ng data
i n bytes or words. Examples of hi gher level
i nstructi ons i nclude counters, ti mers,
sequencers, math, compari son and other
operati ons that N.O., N.C. and OT E
i nstructi ons cannot perform.
To keep the i mplementati on of these
operati ons si mple, hi gher level i nstructi ons
are usually represented i n ladder logi c
programmi ng as functi on blocks. As shown
43
Hardwired to Programmed
Remember to make a
di sti ncti on between the physi cal
i nput devi ce and i ts ladder logi c
representati on, and note that
an i nstructi on i n a ladder
program i s programmed
i ndependently of how the i nput
devi ce i s wi red. Therefore, the
status of a N.O. pushbutton can
be tested wi th a N.C. i nstructi on,
and vi ce versa. Fi g. 4-8
demonstrates all the possi ble
combi nati ons and thei r results.
Also remember that when PLC
i nstructi ons change state
(e.g., make a False-to-True
transi ti on), a normally open
i nstructi on does not change
to a normally closed i nstructi on.
Where electromechani cal relay
contacts open and close, PLC
i nstructi ons test a memory
locati on for a 1 or 0.
] [
Lower Gate
CTU
Count Up
Counter C5:10
Preset 500
Accum 0
(CU)
(DN)
Number of
Vehicles
in Garage
Fi g. 4-9 Hi gher level i nstructi ons such as thi s counter are represented wi th
functi on blocks i n the ladder program.
i n Fi g. 4-9, functi on blocks are li terally programmed as blocks on the
rung of a ladder program. Dependi ng on thei r operati on, hi gher level
i nstructi ons can be ei ther condi ti on i nstructi ons ( e.g., compari son
i nstructi ons) or control i nstructi ons ( e.g., ti mer or counter
i nstructi ons) .
4.4
Combi ni ng Inst r uct i ons
Two fundamental logi c operati ons AND and OR provi de the
rules for governi ng how i nstructi ons are combi ned.
AND Logic
Condi ti on i nstructi ons programmed i n seri es are the ladder di agram
equi valent of AND logi c ( Fi g. 4-10) . For example, pi cture a metal
stampi ng operati on where the machi ne acti vates only i f the operator
si multaneously pushes both a left-hand start button ( X) AND a ri ght-
hand start button ( Y) .
44
T he output of an AND equati on wi ll be True only i f all condi ti ons i n
seri es are True. I f any condi ti on i s False, then the rung does not have
logi cal conti nui ty and the output wi ll be Off.
Y X Z
( ) ] [ ] [
Fi g. 4-10 Wi th i nstructi ons programmed i n seri es, output Z wi ll be True (On) only i f
both i nput X ANDi nput Y are True (On).
4
4
OR Logic
Condi ti on i nstructi ons programmed i n parallel are the ladder
di agram equi valent of the OR operati on ( see Fi g. 4-11) . For example,
i magi ne a conveyor that has two run swi tches, one located at each
end. T he conveyor could be confi gured to start i f an operator pressed
a start button at one end ( X) OR the other ( Y) .
45
Y
X Z
] [
] [
( )
Fi g. 4-11 Wi th i nstructi ons programmed i n parallel, output Z wi ll be True (On) i f
ei ther X OR Y are True (On).
T he output of an OR equati on wi ll be True i f any condi ti on i n parallel
i s True. I f all condi ti ons are False, then the rung does not have logi cal
conti nui ty and the output wi ll be False.
4
Branch Operations
T he functi on of a branch i s to allow both condi ti on and control
i nstructi ons to be programmed i n parallel i n a si ngle rung ( Fi g. 4-13) .
Condi ti on i nstructi ons programmed i n parallel are the equi valent of
an OR operati on.
Control i nstructi ons programmed i n parallel are the equi valent of an
AND operati on.
46
Fi g. 4-12 Combi ni ng seri es and parallel logi c.
( )
( )
] [
] [
] [
] [
] [
] [
/
/
W
X
X
Y
Y
Z
Z
W
Noti ce that AND and OR logi c
(series and parallel circuits) can
be combined on a single rung, as
shown i n Fi g. 4-12.
4
Branch operati ons also provi de the relay wi ri ng equi valent of an
auxi li ary holdi ng contact or memory functi on ( refer back to Fi g. 4-3) .
Auxi li ary contacts keep thei r output energi zed after a momentary start
si gnal i s no longer present.
47
] [
/
] [
/
] [
/
] [
/
( )
( )
Front Door
Drivers Side
Front Door
Passengers Side
Rear Door
Drivers Side
Rear Door
Passengers Side
Bell
Dome Light
] [
Key Present
Fi g. 4-13 In thi s example, branch i nstructi ons are appli ed to a program controlli ng the
dome li ght and door ajar bell of a 4-door sedan. The li ght and bell (multi ple outputs)
wi ll turn On i f ANY of the doors (multi ple i nputs) are opened whi le a key i s present i n
the i gni ti on.
4
As shown i n Fi g. 4-14, an auxi li ary holdi ng contact i s always
programmed wi th the same address as i ts referenced output ( remember,
one of the advantages of a PLC i s that an address can be used more
than once) . Momentari ly pressi ng start button I /2 energi zes control
i nstructi on O/3 ( whi ch turns On the motor) , and i t also energi zes
condi ti on i nstructi on O/3. Energi zi ng O/3 i n the branch operati on
mai ntai ns the On status of the output unti l stop button I /1 i s pressed.
48
Stop Button Start Button Motor
Auxiliary
Holding
Contact
I/1 I/2 O/3
O/3
Fi g. 4-14 An auxi li ary holdi ng contact keeps i ts referenced output energi zed even
after a momentary start si gnal has been removed.
4
4.5
Pr ogr am Execut i on
Before readi ng how the PLC executes a ladder logi c program,
re-readi ng Chapter 3.6, Operati ng Cycle may be helpful.
T he PLC solves each rung sequenti ally, from top to bottom of the
program. Even i f the output of the current rung ( e.g., rung 5) affects
a previ ous rung ( e.g., rung 2) , the PLC does not go back to solve the
earli er rung unti l the next program scan. For the output of one rung
to affect an i nstructi on i n another rung i n the same scan, i t must have a
lower rung number than the rung i t i s to affect. T hat i s, the controlli ng
rung must be programmed before the controlled rung.
Whi le rungs are often ordered to show a sequence of events the
top-most rung i s the fi rst event and so on thi s i s done purely for
organi zati onal conveni ence. I n both electri cal di agrams and ladder
logi c programs, rung order does not necessari ly di ctate the sequence
of operati on. Remember, the status of the condi ti on i nstructi ons of
each rung di ctates the sequence i n whi ch outputs are controlled.
49
What i s a Potenti al Control Appli cati on? . 5.0
What are the Appli cati ons Requi rements?. 5.1
Selecti ng a Control Method . . . . . . . . . . . 5.2
What are the PLC Speci fi cati ons? . . . . . . 5.3
Program Development Procedures. . . . . . 5.4
I nstallati on Requi rements. . . . . . . . . . . . . 5.5
5
C
H
A
P
T
E
R
How t o Appl y a Mi cr o PLC
51
5
5.0
What i s a Pot ent i al Cont r ol Appl i cat i on?
Any si tuati on where coordi nated operati on of electri cal or electroni c
devi ces i s requi red i s a potenti al control appli cati on. Typi cal devi ces
controlled i nclude contactors, solenoi d valves, relays, li ghts and motors.
Machi nes or processes that operate based on any of the followi ng
characteri sti cs could be consi dered potenti al control appli cati ons:
Repeti ti ve operati ons Hi gh-speed control
T i me-dri ven operati ons Requi rements for data
Event-dri ven operati ons acqui si ti on/mani pulati on
Examples i nclude conveyors, form and fi ll operati ons, packagi ng
operati ons, strappi ng machi nes, palleti zi ng and wrappi ng machi nes,
traffi c li ght sequenci ng, gate control, cut-to-length li nes, semi -automati c
weldi ng and pai nti ng, storage and retri eval systems, pump alternators,
car washes, pri nti ng presses, vendi ng machi nes, and many more.
T hese appli cati ons may be able to be controlled by relays, PLCs, or
si ngle board controllers ( SBCs) all of whi ch possess logi c capabi li ti es.
However, before selecti ng a control system, the appli cati ons requi rements
must be determi ned, as they help gui de the selecti on process.
52
5
Personal computers ( PCs) are also someti mes used for control
appli cati ons, but always for more complex control requi rements than
the appli cati ons controlled by relays, mi cro PLCs or SBCs.
5.1
What ar e t he Appl i cat i ons Requi r ement s?
No matter what type of control system i s ulti mately selected, the
fi rst step i n approachi ng a control si tuati on i s to speci fy the appli cati ons
requi rements. T hi s i ncludes determi ni ng:
I nput and output devi ce requi rements.
T he need for speci al operati ons i n addi ti on to di screte ( On/Off)
logi c, i ncludi ng:
- T i mi ng - Sequenci ng
- Counti ng - Data acqui si ti on
- Hi gh-speed counti ng - Data calculati ons
T he electri cal requi rements for i nputs, outputs, and system power.
How fast the control system must operate ( speed of operati on) .
I f the appli cati on requi res shari ng data outsi de the process,
i .e., communi cati on.
I f the system needs operator control or i nteracti on.
T he physi cal envi ronment i n whi ch the control system wi ll
be located.
To determi ne appli cati on requi rements, desi gners need to begi n by
i denti fyi ng all operati ons the control system needs to perform and the
53
5
condi ti ons that affect the system. [Note: I f an operati on speci fi cati on
exi sts for the process/machi ne, consult i t before begi nni ng. I f no
speci fi cati on exi sts, i t needs to be created at thi s poi nt.]
As an example, i magi ne desi gni ng a control system for a parki ng
garage wi th a 500 car capaci ty. T he fi rst step i s to defi ne and descri be
the car parki ng process. Note that whi le descri pti ve text i s used here
( most people si mply wri te out a descri pti on wi th pen and paper) ,
sequence of operati on charts or process sheets are used, too.
What i s the desi red operati on for the parki ng garage?
T he car approaches an automated ti cket machi ne at a gate.
T he dri ver pushes a button on the ti cket machi ne to recei ve a ti cket.
I f there i s space left i n the garage, the dri ver wi ll recei ve a ti cket.
T he machi ne should not provi de a ti cket i f the garage i s full or i f
the gate i s already up.
Removi ng the ti cket rai ses the gate and turns on a green
enter li ght.
After the car clears the gate, the gate lowers and the green li ght
shuts off.
T he number of vehi cles i n the garage needs to be known at any ti me.
I f maxi mum capaci ty i s reached, a Garage Full si gn i s i llumi nated,
the ti cket machi ne wi ll not provi de a ti cket, and the gate wi ll
not rai se.
An alarm must sound when the gate i s obstructed.
Input and Output Requirements
After defi ni ng the operati on of the system, the next step i s to
54
5
determi ne what i nput and output devi ces the system requi res. Li st
the functi on requi red and i denti fy a speci fi c type of devi ce. Also, group
devi ces by whether they sense an event has occurred or i s occurri ng
( i nputs) or whether they control somethi ng ( outputs) .
From the descri pti on of the parki ng garage control system, the
followi ng I /O requi rements can be li sted:
Function (inputs) Device
T i cket request Pushbutton
T i cket taken Li mi t swi tch
Car cleared gate Photoelectri c sensor
Car departed garage Photoelectri c sensor
Gate obstructed Motor overload contact
Gate i n up posi ti on Proxi mi ty sensor
Gate i n down posi ti on Proxi mi ty sensor
Function (outputs) Device
Provi de ti cket Solenoi d
Garage Full si gn Li ght
Green li ght Li ght
Alarm Horn
Rai se gate Gear motor forward
Lower gate Gear motor reverse
From the li st of fi eld devi ces, the parki ng garage control system
requi res seven i nputs and si x outputs.
Advanced Function Requirements
Appli cati ons often requi re operati ons besi de si mple di screte ( On/Off)
logi c. T hese advanced functi ons i nclude ti mi ng, counti ng, sequenci ng,
communi cati ons, math, compari son, and many other operati ons
i nvolvi ng data mani pulati on and calculati on.
55
5
Li st the advanced functi ons requi red and note how they wi ll be used.
From the descri pti on of the parki ng garage control system, the followi ng
advanced functi on requi rements can be li sted:
Function Use
Up counter Count cars enteri ng garage
Down counter Count cars leavi ng garage
Electrical Requirements
When determi ni ng the electri cal requi rements of a system, consi der
three i tems: i ncomi ng power ( power for the control system) , i nput
devi ce voltage, and output voltage and current. Because the voltage
used wi th each devi ce may be di fferent, maki ng a di sti ncti on i s i mportant.
To deci de what voltage to use, consi der the followi ng:
What type of power i s avai lable ( e.g., 24V dc, 120 or 240V ac) ?
How wi ll the machi ne or process controlled be used?
Wi ll people come i n contact wi th the machi ne?
What power do the fi eld devi ces use?
What electri cal codes apply?
I n the parki ng garage example, safety i s a pri mary consi derati on
because people physi cally contact the ti cket machi ne. By usi ng 24V dc
power for the i nput and output devi ces, hazards to the user dramati cally
decrease. However, the gate controller selected for the parki ng garage
requi res devi ces capable of swi tchi ng 120V ac, such as dry contact relays.
( Si nce people do not touch the gate controller i n the normal course of
operati on, i t poses a mi ni mal hazard to users.)
56
5
Whi le i t may be more conveni ent to use one voltage, appli cati on
requi rements often di ctate the need for di fferent voltages. I f thi s i s the
case, as wi th the parki ng garage, i solate the di fferent voltages from each
other on separate commons.
Summari zi ng the electri cal requi rements for a control system i n a
chart faci li tates organi zati on. For the parki ng garage example, i t looks
li ke thi s:
Function (inputs) Device Voltage
T i cket request Pushbutton 24V dc
T i cket taken Li mi t swi tch 24V dc
Car cleared gate Photoelectri c sensor 24V dc
Car departed garage Photoelectri c sensor 24V dc
Gate obstructed Motor overload contact 24V dc
Gate i n up posi ti on Proxi mi ty sensor 24V dc
Gate i n down posi ti on Proxi mi ty sensor 24V dc
Function (outputs) Device Voltage
T i cket provi ded Solenoi d 24V dc
Full si gn Li ght 24V dc
Green li ght Li ght 24V dc
Alarm Horn 24V dc
Gate up Gate controller 120V ac
Gate down Gate controller 120V ac
Advanced functions Device Voltage
Up counter To be determi ned T BD
Down counter To be determi ned T BD
Control system Voltage
To be determi ned 24V dc or 120V ac
57
5
Speed of Operation
When determi ni ng speed of operati on, consi der these poi nts:
How fast does the process occur or machi ne operate?
Are there ti me cri ti cal operati ons or events that must be detected?
I n what ti me frame must the fastest acti on occur ( i nput devi ce
detecti on to output devi ce acti vati on) ?
Does the control system need to count pulses from an encoder or
flow-meter and respond qui ckly?
T he control system selected needs to meet the speed demands of the
process or machi ne, so knowi ng these cri teri a i s i mportant.
Clearly, the parki ng garage control system does not requi re a fast
response. Consi deri ng that PLC- or SBC-based control systems respond
i n mi lli seconds, the relati ve speed of operati on for many appli cati ons,
such as the parki ng garage, i s very slow compared to the processi ng
speed of a PLC or SBC.
Operator Interfaces and Communication
I n order to convey i nformati on about machi ne or process status, or
to allow an operator to i nput data, many appli cati ons requi re operator
i nterfaces. Tradi ti onal operator i nterfaces i nclude pushbuttons, thumb-
wheel swi tches, pi lot li ghts, and LED numeri c di splays. Electroni c
operator i nterface devi ces di splay messages about machi ne status i n
descri pti ve text ( Motor 1 On) , di splay parts count and track alarms.
T hey can also be used for data i nput ( see secti on 3.9 for detai ls) .
Communi cati on i nvolves shari ng appli cati on data or status wi th
another electroni c devi ce, such as a computer or a moni tor i n an
58
5
operators stati on. Communi cati on can take place locally through a
twi sted-pai r wi re, or remotely vi a telephone or radi o modem. PLC-based
control systems are desi gned to support communi cati on and electroni c
operator i nterfaces, where relay-based systems are not. SBC-based
systems typi cally support communi cati ons, and some operator i nterfaces.
As i t has been defi ned, the parki ng garage control system does
not requi re operator i nterfaces beyond the ti cket request pushbutton,
the green enter li ght and the alarm horn. However, advanced
communi cati on capabi li ti es could provi de benefi ts. For example, i f a
porti on of the garage was bei ng repai red and 50 parki ng spaces were
eli mi nated, i t would be advantageous for the garage operator to change
the control system parameters so that only 450 vehi cles could be
admi tted. I n addi ti on, the control system could also let dri vers know an
area had been temporari ly closed.
Environment
Consi der the envi ronment where the control system wi ll be located.
Wi ll i t be subj ected to temperature extremes? Water? Humi di ty?
Salt? Shock? Dust? Vi brati on? I n harsh envi ronments, house the
control system i n an appropri ate NEMA- or I P-rated enclosure. Also,
remember to consi der accessi bi li ty for mai ntenance, troubleshooti ng
or reprogrammi ng.
I f the control system for the parki ng garage i s located i n the ti cket
machi ne, i t needs to be housed i n an enclosure to protect i t agai nst
moi sture and di rt. Consi deri ng that outdoor temperature extremes may
exceed the control system operati ng temperature, the enclosure may
also need temperature and condensati on controls. See the secti on on
59
60
5
PLC Advantages
Whi le relay-based control
systems can perform some
advanced functi ons (typi cally
ti mi ng and counti ng, wi th
li mi ted sequenci ng), a wi de
range of higher level instructions
can only be performed by PLCs
or SBCs.
The data acqui si ti on and
communi cati on capabi li ti es
of PLCs also deserve speci al
menti on, as they far exceed the
capabi li ti es of tradi ti onal relays.
PLCs can gather i nformati on
from the machine for production
and status reports, out-of-spec
or faulty parts count, total
parts count, producti on
rates, and machi ne run ti me
(whi ch i s valuable for peri odi c
mai ntenance operati ons).
Further, PLCs can communi cate
thi s data to other control
equi pment or to operators i n
remote locati ons.
I nstallati on Requi rements later i n thi s
chapter for further envi ronmental
consi derati ons.
5.2
Sel ect i ng a Cont r ol Met hod
Once appli cati on requi rements have
been defi ned, the next step i s determi ni ng
whi ch type of control method can accompli sh
the task.
As noted at the start of thi s chapter,
system desi gners can select from three types
of control systems: relays, PLCs or SBCs. To
help determi ne whi ch control method
i s best sui ted for the task, develop a chart
whi ch i ntegrates appli cati on requi rements
wi th control methods. T he followi ng chart
( Fi g. 5-1) has been fi lled out for the parki ng
garage example.
61
5
Application Required? Quantity Can the control method accomplish task?
Characteristic Relay PLC SBC
I nputs Yes 7 Yes Yes Yes
Outputs Yes 6 Yes Yes Yes
T i mers No 0 Yes Yes Yes
Counters Yes 1 up/down Yes Yes Yes
Hi gh speed requi red? No 0 No Yes Yes
Data calculati ons? No 0 No Yes Yes
Data acqui si ti on No 0 No Yes Yes
Communi cati ons No 0 No Yes Yes
Operator i nterfaces No 0 No Yes No ( typi cally)
As Fi g. 5-1 shows, all three control methods can accompli sh the
task, so selecti ng a control method cannot be based on appli cati on
requi rements alone. However, thi s does not mean that all three
methods provi de the opti mum soluti on. To di fferenti ate between
control methods, evaluate the relati ve cost i mpact of each method
usi ng the followi ng cri teri a:
Criteria Relays Micro PLCs SBCs
System desi gn and development Not appli cable Not appli cable
****
Control system hardware
**/*** */** *
Panel assembly
*** * *
Panel space
*** * *
I mplementi ng logi c
*** ** ***
Dupli cati ng appli cati on
**** * *
Documenti ng logi c
**** * **
Modi fyi ng logi c
**** * **
Mai ntenance
*** * **
Fi g. 5-1 Compari son of appli cati on requi rements and control opti ons.
Fi g. 5-2 Relati ve cost compari son of control methods.
*
=Low
**
=Moderate
***
=Hi gh
****
=Very hi gh
Space and Cost
System desi gners usually consi der physi cal space and cost for
components the two most i mportant i ssues by far. Many appli cati ons,
especi ally machi nery, have a small, fi ni te amount of space allocated for
5
controls. I f an assembled control system occupi es more space than
allotted, i t often cannot be used because too many changes to the
machi nery would need to be made to accommodate i t.
Once mounted on a panel, a relay-based control system typi cally
occupi es much more space than the equi valent control i mplemented
wi th a mi cro PLC or SBC. Wi th mi cro PLCs avai lable i n the si ze of a
bri ck and smaller, only the si mplest relay-based system takes up less
space. Wi th the control system for the parki ng garage requi ri ng 13 I /O
and a counter, a mi cro PLC or SBC are the most space effi ci ent
control soluti ons.
Several cost factors i nfluence the selecti on of a control method,
i ncludi ng control system desi gn and development, costs for components,
assembly, space, and logi c i mplementati on.
Control system design and development costsare i ncurred i n
the desi gn of the system.
- For a relay system, these costs are not appli cable as the components
have already been desi gned and produced.
- For a mi cro PLC, these costs are not appli cable because the PLC
has already been desi gned and produced.
- For an SBC, costs i nvolve securi ng the servi ces of an electroni c
engi neer to desi gn the board and test i ts vi abi li ty ( unli ke relays and
PLCs, SBCs are not typi cally avai lable off-the-shelf) .
Note: Many i nstallati ons requi re the control system to meet global
i ndustri al standards, such as UL, CE or CSA. PLCs usually have been
certi fi ed to meet those standards, where relay- and SBC-based systems
typi cally are not.
62
5
Component costsare for the control-related hardware. Costs
also i nclude recei vi ng, i nventory, and the quali ty control of
the components.
- For a relay system, thi s i ncludes relays, mechani cal ti mers,
and counters.
- For a mi cro PLC, all necessary hardware i s packaged i n the PLC.
- For an SBC, thi s i ncludes the board, i ts components, and ci rcui try.
Assembly costscover putti ng the components together so they
are usable.
- For a relay system, thi s i ncludes mounti ng components on a panel
and wi ri ng the logi c power.
- For a mi cro PLC, the only assembly costs are for mounti ng the uni t
to a panel wi th screws or on a DI N rai l.
- For an SBC, thi s i nvolves securi ng a manufacturi ng faci li ty to
produce i t. For thi s reason, SBCs become economi cally vi able only i n
hi gh volume or very uni que appli cati ons.
Panel space costsi nclude the si ze of the panel and the enclosure
needed to house the control system. T he larger the enclosure, the
greater the materi al costs for i t.
- For a relay system wi th many components, si ze could be prohi bi ti ve.
- For a mi cro PLC, si ze i s mi ni mal.
- For an SBC, si ze i s usually mi ni mal.
Logic implementation costsrelate to the i nstallati on of the logi c
i nto the control system ( assumi ng costs for developi ng the logi c are
si mi lar for all three control methods) .
63
5
- For a relay system, i mplementi ng logi c i nvolves wi ri ng the
components together. Each subsequent appli cati on requi res the
same amount of labor to assemble, debug, and adj ust ti mer and
counter presets.
- For a mi cro PLC, costs i nclude purchase of programmi ng software
or a Hand-Held Programmer. Programmi ng a subsequent appli cati on
only requi res downloadi ng the program; there are no program
debuggi ng costs for dupli cate appli cati ons. However, users sti ll need
to commi ssi on each control system ( see Chapter 6) .
- For an SBC, costs i nvolve retai ni ng an electri cal engi neer to
program a mi croprocessor. Programmi ng each subsequent appli cati on
typi cally requi res copyi ng a memory chi p; there are no program
debuggi ng costs for dupli cate appli cati ons. Commi ssi oni ng i s
also requi red.
Future Costs
Total costs for a control system dont end after i mplementati on.
After system start up, i t may be necessary to modi fy the control logi c,
document system changes, and troubleshoot the system.
Wi th a relay-based system, re-wi ri ng costs associ ated wi th logi c
changes can be extraordi nari ly hi gh i t was j ust thi s type of si tuati on
that prompted General Motors to call for PLC development i n the
fi rst place. T he labor i nvolved wi th relays can be i ntensi ve and
costly, especi ally i f more than one machi ne needs rewi ri ng. Further,
documenti ng relay wi ri ng logi c changes requi res drafti ng a new
wi ri ng di agram. Because thi s task i s so tedi ous ( and adds cost) , system
changes can go undocumented. I n fact, short of traci ng every wi re, there
64
5
i s no way to ensure that the latest wi ri ng di agram actually reflects the
logi c bei ng executed by the system.
Wi th an SBC-based control system, users typi cally cannot communi cate
wi th the mi croprocessor, nor i s there programmi ng software avai lable.
Logi c changes are not easy to i mplement, automated documenti ng
capabi li ti es do not usually exi st, and users typi cally cannot upload or
download programs. SBC-based systems are di ffi cult to troubleshoot
because they rarely have troubleshooti ng features bui lt i nto thei r
software. Users of these systems must go to the manufacturer for
support because no one else understands the SBC operati on.
PLCs offer consi derably more flexi bi li ty. Programmi ng software
faci li tates relati vely qui ck logi c changes, and permi ts the new program
to be easi ly downloaded to multi ple machi nes. T he program i s always
up-to-date, and documentati on i s accompli shed wi th the push of a
button. Troubleshooti ng help and di agnosti c functi onsare a standard
part of the software, and can be conducted wi th the Hand-Held
Programmer as well ( see Chapter 6) .
PLCs are the easi est control system to support. Assi stance for
programmi ng and troubleshooti ng i s avai lable at reasonable costs
from many sources. And, i f a PLC fai ls, a replacement PLC can
be purchased off-the-shelf from the nearest i ndustri al electri cal
suppli er there i s no need to wai t for a shi pment from the factory.
Furthermore, the ruggedness of PLCs compared to SBCs gi ves them
a defi ni te advantage i n harsh envi ronments or when durabi li ty i s a
pri mary consi derati on.
65
66
5
Selecting the Micro PLC
For all cri teri a by whi ch control systems are evaluated cost,
si ze, flexi bi li ty, and supportabi li ty mi cro PLCs provi de the user
wi th di sti nct advantages over other control opti ons for many control
appli cati ons. T hus, a mi cro PLC has been selected to provi de the logi c
control for the parki ng garage.
5.3
What ar e t he PLC Speci f i cat i ons?
After determi ni ng appli cati on requi rements and selecti ng a method
for provi di ng system control, the next step i s to determi ne speci fi cati ons
for the control system. When determi ni ng PLC speci fi cati ons, i denti fyi ng
appli cati on requi rements i n certai n categori es can be helpful. Categori es
that typi cally need to be consi dered are:
Total number of I /O
Electri cal requi rements
Output ci rcui ts
Memory requi rements
Speed of operati on
Communi cati on
Operator i nterfaces
I/O Total
To determi ne a PLCs I /O requi rements, exami ne the appli cati on
requi rements to determi ne how many i nput and output devi ces the
PLC needs to moni tor and control.
5
Revi ewi ng the I /O requi rements for the parki ng garage, a PLC for
thi s appli cati on requi res seven i nputs and si x outputs.
Note: When determi ni ng I /O total, many people add an extra
10% for unanti ci pated I /O needs, as well as future changes to the
control system.
Electrical Requirements
To determi ne a PLCs electri cal requi rements, consi der the voltage
and current requi rements for the PLC ( i ncomi ng power) , each output,
and the i nputs.
Unti l recently, mi cro PLCs operated on 24V dc only. T hi s li mi tati on
often necessi tated i nstalli ng a dc power source, especi ally when the
other control system components operated on 120V ac. Newer mi cro
PLCs, however, offer users standard voltage opti ons: 24V dc, 120V ac, or
240V ac. For the parki ng garage, a PLC usi ng 24V dc may be the best
choi ce for the stated safety reasons. However, i f the PLC i s not located
i nsi de the ti cket machi ne, usi ng 120V ac may be acceptable.
67
NOT
USED
DC
24V- 0/11 0/10 0/9 0/8 0/7 0/6 0/5 0/4 0/3 0/2
DC
24V+ 0/1
VAC
VDC 0/0
VAC
VDC
DC IN
+ 24 -
Isolated relays Shared common relays
Output terminal strip
Fi g. 5-3 Di agram of a mi cro PLCs output termi nal. Note that output termi nals O/0 and
O/1 are i solated relays.
68
5
For appli cati ons requi ri ng control of di fferent output voltages, the PLC
selected needs to have i solated output termi nals to keep the voltages
separated. [Note: Power from di fferent sources or of di fferent voltages
must be i solated from each other.] I n the parki ng garage example, the
120V ac gate controller si gnal must be i solated from the other output
si gnals, whi ch are 24V dc. Some mi cro PLCs now offer i ndi vi dually
i solated outputs, wi th other outputs on di fferent commons ( Fi g. 5-3) .
A mi cro PLC accepts si gnals for all i ts i nputs at the same voltage level,
usually 120V ac or 24V dc. T he appli cati on requi rements and the power
avai lable di ctate whi ch voltage i s selected. Recall that for the parki ng
garage, the i nputs operate on 24V dc for safety reasons. T he chart below
summari zes the electri cal requi rements for the parki ng garage:
Incoming power Output voltages Input voltage
24V dc 120V ac ( 2 devi ces) 24V dc ( 7 devi ces)
24V dc ( 4 devi ces)
Output Circuits
Recall from secti on 3.2 that mi cro PLCs are avai lable wi th di fferent
types of outputs to sui t di fferent si tuati ons. For the parki ng garage,
relay outputs wi ll work best. Relays can swi tch both dc and ac current,
have adequate response ti mes, and wear i s not a si gni fi cant i ssue. I n
addi ti on, mi cro PLCs wi th relay outputs usually cost less than those
wi th soli d state outputs.
For appli cati ons requi ri ng fast response or havi ng a hi gh cycle rate
( such as a hi gh-speed cut-to-length li ne) , a mi cro PLC wi th soli d state
output ci rcui ts ( transi stor, FET or tri ac) mi ght be the opti mum choi ce.
69
5
T hese ci rcui ts respond faster and do not wear out because there are no
movi ng parts.
Memory Requirements
To qui ckly esti mate the memory an appli cati on requi res, a general
rule i s to add the number of I /O and then multi ply by 10, where 10 i s
the words of memory needed per I /O. T he parki ng garage control
system has 13 I /O, plus one extra for expansi on, yi eldi ng a total of 14.
14 x 10 words = 140 esti mated words of memory requi red.
Today, nearly all mi cro PLCs have at least 1/2K of memory avai lable
for appli cati on programs ( 1/2K equals 512 words) . For the parki ng
garage control system, as well as most low I /O count appli cati ons, mi cro
PLCs usually have more than suffi ci ent memory. Typi cally, appli cati ons
wi ll exceed a mi cro controller I /O capaci ty before i ts memory capaci ty.
Once the logi c requi red for an appli cati on has been developed, PLC
users can calculate how much memory a program wi ll consume by refer-
ri ng to the PLC operators manual, whi ch typi cally li sts memory use for
all of the i nstructi ons. See the worksheet i n Appendi x D for an example.
Speed of Operation
I f appli cati on requi rements i ndi cate the need for a PLC wi th hi gh-
speed operati on, look for a PLC wi th the followi ng features:
Adj ustable i nput fi lters ( see secti on 3.1) .
Transistor, FET or triac outputs ( not relays see section 3.2) .
Hi gh-speed counter, hi gh-speed i nterrupts, and i mmedi ate outputs.
5
Hi gh-speed counters, hi gh-speed i nterrupts and the abi li ty to
i mmedi ately update outputs allows PLCs to meet the demands of
most hi gh-speed appli cati ons. On user-speci fi ed condi ti ons, hi gh-
speed i nterrupts and i mmedi ate output i nstructi ons di rect the PLC
to i mmedi ately process the logi c and update the I /O i ndependently
of the normal program scan. T hi s can substanti ally i mprove speed
and performance.
Si mpli fyi ng the program also i ncreases performance, because program
length di rectly i mpacts scan ti me. Every i nstructi on i n a program takes
ti me to execute, and reduci ng or si mpli fyi ng the program reduces ti me.
PLC users can calculate program executi on ti me by referri ng to the
PLC operators manual, whi ch should li st executi on ti mes for all of the
i nstructi ons. See the worksheet i n Appendi x D for an example, as well
as a li sti ng of typi cal i nstructi on executi on ti mes i n Appendi x C.
5.4
Pr ogr am Devel opment Pr ocedur es
Even the si mplest programs rarely go di rectly from the programmers
head to the PLC. I n fact, attempti ng thi s ti me savi ng step often prolongs
the process. I nstead, begi n by wri ti ng out the operati on sequence
both sentences and flow charts work well. T here are three steps to
developi ng a sequence of operati on:
Defi ne the rules of operati on for each control poi nt.
I denti fy and label i nputs and outputs.
Convert the rules of operati on to ladder logi c.
70
71
5
Define Rules of Operation
What condi ti ons permi t or prevent responses from the control system?
Defi ni ng these condi ti ons i s known as developi ng the rules of operati on.
To begi n, carefully descri be the control system at i ts most basi c level.
Recall from secti on 5.1 that the parki ng garage control system was
descri bed li ke thi s:
T he dri ver approaches an automated ti cket machi ne at a gate.
T he dri ver pushes a button on the ti cket machi ne to recei ve a ti cket.
T he machi ne should not provi de a ti cket i f the lot i s full or the gate
i s up.
Removi ng the ti cket rai ses the gate and turns on a green li ght.
After the car clears the gate, the gate lowers and the green li ght
shuts off.
T he vehi cle populati on i s known at any ti me.
I f maxi mum capaci ty i s reached ( 500 cars) , a Full si gn i s
i llumi nated, the ti cket machi ne wi ll not provi de a ti cket and the gate
wi ll not rai se.
An alarm sounds when the gate i s obstructed.
Outputs Inputs
Provi de ti cket T i cket request pushbutton
Rai se gate T i cket taken li mi t swi tch
Lower gate Vehi cle cleared gate photo sensor
Garage Full si gn Car departed garage photo sensor
Green ( enter) li ght Gate obstructed ( motor overload contact)
Alarm Gate up proxi mi ty sensor
Gate down proxi mi ty sensor
5
72
To control any machi ne or process, fi rst i denti fy each acti on, or
control poi nt. Ask, What acti on i s the system controlli ng? T hen, create
a si mple descri pti on of the condi ti ons that control each acti on. Start wi th
the control poi nt and work back to defi ne the condi ti ons ( i nputs) that
produce the desi red acti on. Noti ce that each control poi nt corresponds
to an output on a rung of the ladder program.
When carefully wri tten, the rules of operati on convert easi ly to a
ladder logi c program, as the parki ng garage example shows:
Rules of Operation
Control poi nt: T he ti cket machi ne wi ll provi de a ti cket
Condi ti ons: I f the dri ver presses the ti cket request pushbutton
AND the Full si gn i s NOT on
AND the gate i s lowered
Rung 0
Ticket
Request PB
Garage is
Full
Gate is
Lowered
Provide
Ticket
Solenoid
( ) ] [ ] [ ] [
Control poi nt: Rai se the gate unti l fully up
Condi ti ons: After the dri ver takes the ti cket
AND the gate i s NOT up
AND the Full si gn i s NOT on
Rung 1
Ticket has
Been Taken
Limit Switch
Gate
is Up
Garage is
Full Raise Gate
Raise Gate
] [ ] [ ] [
] [
( )
5
73
Rung 2
Vehicle
Photo
Sensor
(gate)
Vehicle is
Clear of
Gate
Vehicle
Present
Latch
Vehicle
Present
Latch
( ) ] [
] [
] [
Rung 3
Vehicle
Photo
Sensor
(gate)
Vehicle
Present
Latch
Vehicle is
Clear of
Gate
Vehicle is
Clear of
Gate
Ticket
Request PB
] [ ] [ ] [
] [
( )
Control poi nt: Vehi cle present latch
Condi ti ons: Vehi cle has been detected
AND the vehi cle has NOT cleared the gate
Control poi nt: Vehi cle clear of gate
Condi ti ons: Vehi cle present latch i s on
AND a vehi cle i s NOT detected
AND the ti cket request pushbutton i s NOT pressed
5
74
Rung 5
Gate
is Up
Green (GO)
Light
( ) ] [
] [
Rung 6
Lower Gate
CTU
Count Up
Counter C5:10
Preset 500
Accum 0
(CU)
(DN)
Number of
Vehicles
in Garage
Rung 4
Gate
is Up
Vehicle is
Clear of
Gate
Lower
Gate
Lower Gate
Gate is
Lowered
Gate is
Obstructed
] [ ] [
] [
] [ ] [ ( )
Control poi nt: Lower the gate unti l fully down
Condi ti ons: I f the gate i s up
AND the car has cleared the gate
AND the gate i s NOT down
AND the gate i s not obstructed
Control poi nt: Turn on the green li ght
Condi ti on: I f the gate i s up
Control poi nt: Count cars enteri ng/turn on full si gn at 500th car
Condi ti ons: I f the gate has been lowered
I f accumulated counter value preset value of 500
5
75
] [
Rung 9
Gate is
Obstructed
( )
Alarm
Sounded
Control poi nt: Decrement the counter ( count departi ng vehi cles)
Condi ti on: I f a vehi cle departs the garage
Control poi nt: Sound alarm
Condi ti on: I f the gate i s obstructed
] [
Rung 8
CTD
Count Down
Counter C5:10
Preset 500
Accum 0
(CD)
(DN)
Number of
Vehicles
in Garage
Vehicle
Photo Sensor
(Departing Garage)
Programming Tips
When programmi ng condi ti on i nstructi ons, refer back to Fi g. 4-8
to determi ne i f a normally open or a normally closed i nstructi on
produces the desi red acti on.
Control poi nt: Turn on the Full si gn
Condi ti on: I f accumulated counter value preset value of 500
( )
Rung 7
] [
C5:10
DN
Garage is Full
5
When defi ni ng the rules of operati on, the text should use language
that helps convert the operati ng characteri sti cs to ladder logi c.
Recall from Chapter 4 that AND logi c connects i nstructi ons i n
seri es on a ladder di agram rung, whi le the OR logi c connects
i nstructi ons i n parallel.
I f an output needs to remai n on after the condi ti on that ori gi nally
energi zed i t i s no longer present, use an auxi li ary holdi ng contact
or a latched output.
A condi ti on i nstructi on can be used more than once i n a program
because i t exi sts i n the software ( a benefi t over hardwi red relays) .
Also, remember that the status of an output can be used as a
condi ti on i nstructi on.
Only program a speci fi c output i nstructi on once. I f an output
i nstructi on wi th the same address i s programmed more than once,
the last occurrence of the i nstructi on i n the user program wi ll
determi ne the actual output state.
When each I /O ( fi eld devi ce) i s wi red to a termi nal on the PLC, i t
then has a uni que address whi ch corresponds to that termi nal.
Follow the i nstructi on manual! Each PLC manufacturer uses sli ghtly
di fferent terms and techni ques. T hese should be noted and followed
carefully.
Addressing
All elements of a ladder di agram are labeled wi th a letter/numeri cal
desi gnati on. Because every PLC manufacturer has a vari ati on of thi s
desi gnati on, be sure to follow the addressi ng conventi ons outli ned i n
the operators manual.
76
5
T he parki ng garage example uses I to i ndi cate i nputs, O for
outputs. All i nput and output termi nals i n thi s example are numbered
starti ng wi th zero ( 0) . T he program for the parki ng garage has i ts
i nputs and outputs addressed as such:
Input address
I /0 T i cket request pushbutton
I /1 T i cket taken li mi t swi tch
I /2 Car cleared gate photoelectri c sensor
I /3 Car departed garage photoelectri c sensor
I /4 Gate obstructed ( motor overload contact)
I /5 Gate up proxi mi ty sensor
I /6 Gate lowered proxi mi ty sensor
Output address
O/0 T i cket provi ded solenoi d
O/1 Gate up motor controller
O/2 Gate down motor controller
O/3 Garage Full si gn
O/4 Green li ght
O/5 Alarm horn
Counter address
T he program for the parki ng garage also needs two counters ( noti ce
that the counter uses an i nternal address) :
C5:10 Count Up ( CT U) , for cars enteri ng
C5:10 Count Down ( CT D) , for cars departi ng
Wi th the addresses i nserted, the program for the parki ng garage i s
complete and looks li ke thi s ( see next page) :
77
78
5
Rung 0
Ticket
Request PB
Garage is
Full
O/3
Gate is
Lowered
Provide
Ticket
Solenoid
O/0
Rung 1
Ticket has
Been Taken
Limit Switch
Gate
is Up
Garage is
Full
O/3
Raise Gate
O/1
Raise Gate
O/1
Rung 2
Vehicle
Photo
Sensor
(gate)
Vehicle is
Clear of
Gate
B/2
Vehicle
Present
Latch
B/3
Vehicle
Present
Latch
B/3
Rung 3
Vehicle
Photo
Sensor
(gate)
Vehicle
Present
Latch
B/3
Vehicle is
Clear of
Gate
B/2
Vehicle is
Clear of
Gate
B/2
Ticket
Request PB
( )
( )
( )
( )
] [ ] [
] [
] [
] [
] [
] [
] [
] [ ] [
] [
] [ ] [
] [
I /0 I /6
I /1 I /5
I /2
I /2 I /0
79
5
Rung 4
Gate
is Up
Vehicle is
Clear of
Gate
B/2
Lower
Gate
O/2
Lower Gate
O/2
Gate is
Lowered
Gate is
Obstructed
Rung 5
Gate
is Up
Green (enter)
Light
O/4
Rung 6
Rung 7
Lower Gate
O/2
CTU
Count Up
Counter C5:10
Preset 500
Accum 0
(CU)
(DN)
Number of
Vehicles
in Garage
C5:10
DN
Garage is Full
O/3
Rung 8
CTD
Count Down
Counter C5:10
Preset 500
Accum 0
(CD)
(DN)
Number of
Vehicles
in Garage
Rung 9
Gate is
Obstructed
Alarm
Sounded
O/5
] [ ] [
] [
] [
] [
] [
] [
] [
] [ ] [ ( )
( )
( )
( )
Vehicle Photo
Sensor
(Departing Garage)
I /5 I /6 I /4
I /5
I /3
I /4
80
5
5.5
Inst al l at i on Requi r ement s
A PLC users manual contai ns detai led i nstallati on i nstructi ons
perti nent to that parti cular model, and they should be followed carefully.
As wi th any product bei ng i nstalled, proper planni ng assures smooth
start-up. When i nstalli ng mi cro PLCs, consi der the physi cal and
electri cal envi ronments and requi rements for power, mounti ng and
wi ri ng. T he followi ng are some suggesti ons for i nstalli ng PLCs.
Physical Environment
Whether the mi cro PLC i s mounted wi thi n a machi ne or i n a separate
enclosure, i t requi res protecti on agai nst temperature extremes, humi di ty,
dust, shock, vi brati on, or corrosi ve envi ronments.
Be careful about locati ng the PLC i n an enclosure wi th other
heat-generati ng sources; 55

C i s the maxi mum ambi ent operati ng


temperature for most mi cro PLCs. Ensure suffi ci ent venti lati on and
space between components. I nstall a fan to help ci rculate the ai r
i f necessary.
I nstalli ng the PLC i n a NEMA Type 12 ( I P 60) enclosure provi des
protecti on agai nst dust, falli ng di rt, and dri ppi ng noncorrosi ve li qui ds.
A NEMA 12 enclosure i s rated for both i ndoor and outdoor i nstallati on.
I nstalli ng the PLC i n a NEMA Type 4 ( I P 65) enclosure provi des
protecti on agai nst wi ndblown dust and rai n, splashi ng and hose-
di rected water, and external i ci ng. A NEMA 4 enclosure i s also rated
for both i ndoor and outdoor i nstallati on.
81
5
Enclosures do not protect agai nst the i nternal condensati on that can
occur wi th temperature fluctuati ons. To protect agai nst condensati on,
as well as extreme cold ( below 0

C) , consi der i nstalli ng some type of


heati ng element i n the enclosure.
Electrical Environment
Do not mount the PLC near hi gh voltage equi pment, such as motors
and arc welders, as electri cal i nterference could cause errors. A
properly grounded steel enclosure helps reduce electri cal i nterference.
I f possi ble, do not locate the PLC on the same power feed as hi gh
frequency equi pment, such as i nverters ( ac dri ves) . Power fi lteri ng
may be requi red for di rty or noi sy electri cal envi ronments.
Usi ng a shi elded, twi sted-pai r cable ( wi th the shi eld connected to
ground at one end) between fi eld devi ces and the i nput termi nals
reduces the effects of hi gh frequency di sturbances.
Power
Follow the manufacturers recommended procedures for wi ri ng
the PLC.
Place the mai n power di sconnect swi tch where operators and
mai ntenance personnel have qui ck and easy access to i t. I f the
bui lt-i n di sconnect swi tch i s mounted i nsi de an enclosure, make
sure to i nstall an externally panel-mounted swi tch.
Mounting
Mount the mi cro PLC usi ng the manufacturers recommendati ons.
5
Generally, mount the PLC to the back panel or si des of an enclosure
not the top or bottom usi ng ei ther a DI N rai l or mounti ng
screws. Be sure to provi de proper venti lati on.
Do not exceed the shock and vi brati on speci fi cati ons publi shed by
the PLC manufacturer. Avoi d sources of hi gh vi brati on. Use cushi oned
mounti ng i f necessary.
Allow enough clearance between the door and the components.
Consi der usi ng documentati on pockets, whi ch often are affi xed to the
i nsi de of the door.
Wiring
Allow at least 2 i n. ( 50 mm) between I /O wi ri ng ducts or termi nal stri ps
and the PLC for ease of access duri ng i nstallati on and mai ntenance.
Do not run si gnal or communi cati on wi ri ng and power wi ri ng i n the
same condui t. Wi res wi th di fferent si gnal characteri sti cs should be
routed along separate paths.
Follow manufacturers groundi ng i nstructi ons carefully.
I nducti ve output devi ces such as motor starters and solenoi ds may
requi re surge suppressi on to protect the PLC output contacts. Locate
the suppressi on devi ce ( e.g., a vari stor for an ac load, a di ode for dc)
as close as possi ble to the output devi ce.
82
Commi ssi oni ng. . . . . . . . . . . . . . . . . . . . . 6.0
Troubleshooti ng Overvi ew . . . . . . . . . . . . 6.1
Fi ndi ng the Problem. . . . . . . . . . . . . . . . . 6.2
Troubleshooti ng the PLC . . . . . . . . . . . . . 6.3
Troubleshooti ng I /O . . . . . . . . . . . . . . . . . 6.4
Program Troubleshooti ng. . . . . . . . . . . . . 6.5
Faults . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.6
Safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.7
Troubleshooti ng Model . . . . . . . . . . . . . . . 6.8
6
C
H
A
P
T
E
R
Commi ssi oni ng and
Tr oubl eshoot i ng
83
6
6.0
Commi ssi oni ng
Prepari ng a control system for start-up, also called commi ssi oni ng,
i nvolves executi ng a seri es of tests to ensure that the PLC, the ladder
logi c program, the I /O devi ces and associ ated wi ri ng operate accordi ng
to speci fi cati ons.
Before commi ssi oni ng any control system, the techni ci an must have
a clear understandi ng of how the control system operates and how the
vari ous components i nteract ( e.g., sequence of operati on, ti mi ng, and
speed-related i ssues) . For a PLC-based system, understandi ng the
appli cati on can be accompli shed by studyi ng a pri ntout of the current
program. I f properly documented, the pri ntout should note addresses
for I /O devi ces and contai n comments descri bi ng the operati on of each
program rung.
Assumi ng i nstallati on i s complete and the appli cati on program has
been loaded i nto the PLC, the followi ng checkli st provi des a good gui de
for commi ssi oni ng a PLC:
1. Be aware of the hazards posed by i nadvertently energi zed outputs.
Before applyi ng power to the PLC or the i nput devi ces, di sconnect
or otherwi se i solate any output devi ce that could potenti ally cause
84
6
damage or i nj ury ( typi cally an output that causes movement li ke
starti ng a motor, openi ng a valve, etc.) .
2. Apply power to the PLC and the i nput devi ces. To veri fy that there
i s proper power, check the PLC and i nput devi ces wi th a voltmeter.
I f there i s a power problem, ti ghten connecti ons and check for
broken wi ri ng or faulty i nput devi ces.
3. Exami ne the PLCs LED status i ndi cators. I f power i s properly
appli ed to the PLC, the power i ndi cator should be On, and there
should be no fault i ndi cati on ( Fi g. 6-1) . I f the PLC i s not poweri ng
up properly, the PLC may be faulty. However, remember that PLCs
rarely fai l. But i f they do fai l, i t usually happens i mmedi ately upon
poweri ng up. A PLC almost always functi ons ei ther as desi gned or
not at all ( they are desi gned not to run on a fault) .
4. After maki ng sure that the PLC has power, veri fy communi cati on
wi th the PLC. To do thi s, use a Hand-Held Programmer ( HHP) or a
PC runni ng the PLC programmi ng software. I f communi cati on i s
possi ble, the techni ci an can assume the PLC i s functi onal.
5. Place the PLC i n a mode that prevents i t from energi zi ng i ts output
ci rcui ts. Dependi ng on the make of the PLC, thi s mode may be
called the di sable, test scan or stop mode. T hi s mode permi ts
the PLC to moni tor i nput devi ces, execute the program, and update
the output i mage fi le whi le keepi ng the output ci rcui ts de-energi zed.
6. One at a ti me, manually acti vate each i nput devi ce. Veri fy that the
PLCs i nput status LEDs turn On and Off as expected. Usi ng the
HHP or PC, moni tor the associ ated condi ti on i nstructi on to veri fy
that the i nput devi ce corresponds to the correct program address,
85
6
and that the i nstructi on turns On and Off as expected. I f they
do not operate as expected, see the troubleshooti ng secti on
of thi s chapter.
7. Manually test each output. Many techni ci ans do thi s by applyi ng
power to the termi nal where the output devi ce i s wi red. T hi s
checks the fi eld devi ce and i ts associ ated wi ri ng.
8. After veri fyi ng all i nputs, outputs and program addresses, veri fy all
preset values for counters, ti mers, etc.
9. Place the PLC i n the run mode and veri fy that the run LED i s On.
Reconnect any output devi ces that were di sconnected i n step 1.
Test all emergency stop buttons. Test total system operati on.
6.1
Tr oubl eshoot i ng Over vi ew
When a control system error occurs, many new PLC users fi rst
suspect the PLC i s at fault. Usually, thi s assumpti on i s unj usti fi ed,
as devi ces other than the PLC, such as sensors, solenoi ds and wi ri ng,
cause the vast maj ori ty of faults. I t i s worth repeati ng that PLCs are
among the most rugged, durable and reli able control equi pment
avai lable today. However, faults are i nevi table i n any control system,
i ncludi ng PLCs. Fortunately, PLCs have been speci fi cally desi gned to
i ncorporate troubleshooti ng ai des that enable users to get the
86
6
appli cati on up and runni ng qui ckly. T hi s i s an advantage over relays,
SBCs and other control soluti ons.
Troubleshooti ng consi sts of three acti vi ti es: understandi ng how the
appli cati on ( control system) operates, fi ndi ng the problem and
correcti ng i t. Before troubleshooti ng any control system, the techni ci an
must understand how the system works and how the vari ous
components i nteract. As wi th commi ssi oni ng, a hard copy of the
program i s requi red.
6.2
Fi ndi ng t he Pr obl em
I f a control system has been operati ng, the techni ci an should be
confi dent of the accuracy of the program logi c. I n thi s case,
malfuncti oni ng fi eld devi ces or loose wi ri ng associ ated wi th the fi eld
devi ces cause most errors. For a control system that has never worked
( e.g., j ust bei ng commi ssi oned) , programmi ng errors should also be
consi dered.
Before spendi ng hours troubleshooti ng a system and searchi ng for a
compli cated problem, fi rst rule out any obvi ous problem ( e.g., a
broken belt or j ammed machi nery) . T hen, cycle power to the PLC.
Remember that power surges or other momentary problems may have
caused the PLC to stop, and i t may only need to be re-started.
87
6
6.3
Tr oubl eshoot i ng t he PLC
I f the PLC i s runni ng properly, i ts power and run LEDs should be On,
and there should be no fault i ndi cati on ( refer to Fi g. 6-1) . I f the fault
LED i s On, use a Hand-Held Programmer ( HHP) or a PC runni ng the
PLC programmi ng software to determi ne the cause of the fault. T hen,
consult the user manual to determi ne possi ble causes and correcti ve
acti ons ( refer to secti on 6.6 and Fi g. 6-2 for more detai ls) .
I f all LEDs are Off, veri fy that the PLC has proper power wi th a
voltmeter. I f a power problem exi sts, veri fy that all wi ri ng connecti ons
are good and that there are no broken wi res. Check for power from the
ci rcui t breaker or fuse block.
After veri fyi ng PLC power, check communi cati on wi th the controller.
Do thi s by usi ng a Hand-Held Programmer ( HHP) or a PC runni ng the
PLC programmi ng software. I f communi cati on i s possi ble, assume that
the PLC i s functi oni ng properly, and i nvesti gate fi eld devi ces, fi eld
wi ri ng and fi eld power.
6.4
Tr oubl eshoot i ng I/ O
I f attempts to re-start the PLC fai l to solve the problem ( and the PLC
has power) , most techni ci ans start troubleshooti ng at the outputs and
work backwards. T hi s i s usually the qui ckest and most effi ci ent
procedure. Typi cally, operators or techni ci ans fi rst noti ce a problem
when an acti on ( output) fai ls to occur.
Begi n troubleshooti ng by exami ni ng the output LEDs. [Note: Usi ng
88
6
89
If the LEDs indicate:
If the LEDs indicate:
If the LEDs indicate:
The
Following
Error Exists
Probable Cause
No input
power or
power supply
error
No Line Power
Power Supply
Overloaded
The
Following
Error Exists
Probable Cause
Hardware
faulted
Processor Memory
Error
Loose Wiring
The
Following
Error Exists
Probable Cause
Application
fault
Hardware / Software
Major Fault Detected
POWER
RUN
FAULT
FORCE
POWER
RUN
FAULT
FORCE
POWER
RUN
FAULT
FORCE
Fi g. 6-1
6
the HHP greatly si mpli fi es and speeds troubleshooti ng.]
I f the output LED i s On and the output devi ce i s not On, test for
power at the suspected output termi nal.
- I f there i s power at the output termi nal, the PLC i s functi oni ng.
- I f power i s not present on the PLC output termi nal, the PLC has
fai led and must be replaced.
Next, test for power at the non-functi oni ng output devi ce.
- I f there i s power, then the devi ce i s faulty and should be fi xed or
replaced.
- I f there i s no power at the devi ce, then there i s a blown fuse i n the
fi eld wi ri ng or another wi ri ng fault between the PLC and the devi ce.
I f the PLC and output devi ces are functi onal, exami ne the program
( a pri ntout wi ll be helpful, or use an HHP) and look at the rung( s) wi th
the non-functi oni ng output( s) . Determi ne what condi ti on i nstructi ons
( i nputs) need to be True to enable acti vati on of the output( s) and start
traci ng them to fi nd out whi ch condi ti ons are not sati sfi ed.
I f the i nput devi ce i s supposedly On, but the correspondi ng i nput
LED i s not On, use the HHP or a voltmeter to check for a si gnal at
the i nput termi nal.
- I f there i s no si gnal, exami ne wi re connecti ons between the
termi nal and the fi eld devi ce and ti ghten or repai r wi ri ng as
necessary.
- Check the devi ces for proper power, and see i f the fi eld devi ce
i s broken.
90
6
6.5
Pr ogr am Tr oubl eshoot i ng
For a system that was worki ng but has
stopped, suspect the program only after
checki ng the PLC and veri fyi ng the i ntegri ty
of the fi eld devi ces and associ ated wi ri ng.
However, the same procedure i s used to
debug new and exi sti ng programs.
Start program troubleshooti ng by
i denti fyi ng whi ch outputs operate properly
and whi ch outputs do not. T hen, usi ng the
HHP or programmi ng software, trace* back
from the output on the non-functi oni ng rung
and exami ne the logi c to determi ne what may
be preventi ng the output from energi zi ng.
Typi cal logi c errors i nclude:
Programmi ng a normally open i nstructi on
i nstead of a normally closed i nstructi on
( or vi ce versa) .
Usi ng an i ncorrect address i n the program.
* Most programmi ng software packagesand HHPshave a feature called the
trace, search or fi nd functi on. Si mply enter the addressof the i nstructi on
to be found, and the HHP searchesfor the fi rst occurrence of that address. I f
the addressi sfound, the search feature can also search for other i nstancesof
the same address. T hi sletsyou qui ckly fi nd all occurrencesof an addressand
veri fy that the logi c associ ated wi th i t i sboth correct and operati ng asexpected
( no I /O faults, etc.) .
91
The Hand-Held Programmer
For the techni ci an trouble-
shooti ng PLCs i n the fi eld or on
the plant floor, the value of a
Hand-Held Programmer cannot
be overstated. Features i nclude
an abi li ty to:
Identi fy the status (On/Off)
of any I/O or bi t element.
Di splay the data located i n
a hi gher level i nstructi on, such
as the accumulated value of a
ti mer or counter.
Trace or search for faulty
i nstructi ons.
Force instructions On or Off.
Identi fy and clear faults.
Download and upload
programs.
Hand-Held Programmers are
also more rugged and portable
than most PCs.
6
6.6
Faul t s
Fault messages are di splayed on the HHP or programmi ng software
for easi er problem i denti fi cati on. Error messages, coupled wi th
i nformati on from the PLC user manual, help locate the fault, determi ne
i ts cause, and suggest correcti ve acti ons. T hi s self-di agnosti c
capabi li ty ( whi ch i s not avai lable wi th most other control systems)
greatly faci li tates troubleshooti ng. Some of the more common causes of
faults i nclude memory errors, data corrupti on errors, watchdog ti mer
errors and momentary power problems.
6.7
Saf et y
After i denti fyi ng the problem and determi ni ng the appropri ate
correcti ve measure, consi der the followi ng safety measures when
repai ri ng the system:
Di sconnect the power to the whole system whi le maki ng repai rs, and
make sure there i s no chance of someone i nadvertently reconnecti ng
the power.
Make sure that no system elements can be harmed i f and when the
system i s restored to worki ng order.
92
6
Some appli cati ons requi re all system components ( fi eld devi ces) to
be i n a start posi ti on ( thi s i s often due to mechani cal
consi derati ons) . Before bri ngi ng a control system back on-li ne, know
the system requi rements.
After maki ng repai rs, ensure that the system works properly to the
extent that operators and bystanders are not j eopardi zed by system
operati on. T hi s may i nclude parti al or full testi ng of the system.
6.8
Tr oubl eshoot i ng Model
I n addi ti on to becomi ng fami li ar wi th all of the troubleshooti ng tools
and techni ques avai lable, i ts i mportant to develop a troubleshooti ng
routi ne. T he followi ng error recovery model ( Fi g. 6-2) demonstrates a
common routi ne for troubleshooti ng hardware and software problems.
After expendi ng all reasonable efforts to restore the PLC to proper
operati on, call your di stri butor or manufacturer. Good di stri butors and
manufacturers employ ski lled techni ci ans and engi neers who can
provi de assi stance, often over the phone.
93
Is the error PLC
related? (Fault
LED On)
Using the HHP or
programming software,
identify the error code
and description.
Refer to the
user manual for
probable cause and
recommended action.
Clear the fault.
Could you
successfully
clear the fault?
Place the controller in
program mode.
Correct the condition
causing the fault.
Return controller to
Run or any of the
Test modes.
No
No
No
No
No
No
No
Are the wire
connections
tight?
Is the Run LED
on constantly?
Is the PLC in Run
mode?
Yes
Yes
Yes
Can you
communicate
with the PLC?
Is an input
or output LED
showing proper
status?
Yes
Yes
Yes
PLC is functioning.
Check field devices.
Test and verify system
operation.
Refer to the user
manual for probable
cause and
recommended action.
Place PLC in Run
mode.
Tighten the wire
connections.
Yes
Yes
Yes
Is the Power
LED on?
Does the
controller
have power
supplied?
The PLC is faulty.
Replace PLC.
Check power.
Start
No
No
End
Fi g. 6-2 Troubleshooti ng Model
6
94
I ntroducti on. ...........................................7.0
Basi c Logi c
- OR ci rcui t .......................................7.1
- AND ci rcui t.....................................7.2
- Start/stop ci rcui t ............................7.3
- Fli p/flop ci rcui t...............................7.4
- Alarm ci rcui t...................................7.5
- Start/stop wi th j og..........................7.6
T i mi ng and Counti ng
- On delay..........................................7.7
- Off delay.........................................7.8
- One mi nute clock ...........................7.9
- Up/down counti ng........................7.10
Data I nstructi ons
- Movi ng data..................................7.11
- Compari ng data............................7.12
- Math commands...........................7.13
Advanced I nstructi ons
- Sequencers...................................7.14
- FI FO ..............................................7.15
- Hi gh-speed counter .....................7.16
- Two stage alternator ....................7.17
- T hree stati on alternator ..............7.18
7
C
H
A
P
T
E
R
Appl i cat i on Exampl es
95
7
7.0
Int r oduct i on
As the parki ng garage example i n Chapter 5 demonstrates,
developi ng a ladder logi c program for a PLC consi sts of i denti fyi ng
the logi c requi red and bui ldi ng the program one rung at a ti me.
Whi le di fferent programs can achi eve the same outcome, every
program uses the same bui ldi ng blocks: the mi cro PLCs
i nstructi on set.
T hi s chapter takes some of the most commonly used i nstructi ons
and demonstrates thei r use i n control appli cati ons. I n addi ti on to
explai ni ng how PLC users can apply these powerful tools, the examples
hi ghli ght typi cal mi cro PLC appli cati ons, and how to bui ld complex
programs from the si mple steps shown.
7.1
OR Ci r cui t
Uses
T hi s type of logi c i s used to turn On an output devi ce/control
i nstructi on when any i nput devi ce/condi ti on i nstructi on i n the rung
provi des logi cal conti nui ty.
96
7
Operation
Turn On an output wi th more than one i nput devi ce/condi ti on
i nstructi on.
Ladder Logic
T he logi c used i n thi s example consi sts of one rung wi th two
condi ti on i nstructi ons programmed i n parallel.
RUNG 0
T hi s rung shows that whenever i nput devi ce I /0 OR i nput devi ce I /1 i s
On, output devi ce O/0 wi ll be energi zed.
97
Tank
High-Level
Detector
I/0
Manual
By-Pass
Switch

I/1
Tank
Drain
Valve
O/0
Rung 0
] [
] [
( )
If the tank high-level detector is activated OR the manual by-pass switch is On, open the tank drain valve.
7.2
AND Ci r cui t
Uses
T hi s type of logi c i s used to turn On an output devi ce/control
i nstructi on when all i nput devi ces/condi ti on i nstructi ons i n the rung
provi de logi cal conti nui ty.
7
Operation
Turn On an output only when all i nput devi ces/condi ti on i nstructi ons
have logi cal conti nui ty.
Ladder Logic
T he logi c used to perform thi s consi sts of one rung wi th at least two
condi ti on i nstructi ons programmed i n seri es.
RUNG 0
T hi s rung shows that whenever i nput devi ces I /0 AND I /1 are
On, output devi ce O/0 wi ll be energi zed.
98
Clamp
O/0
In Position
in Holder
LS1
I/1
Part
Present
Photo Eye
I/0
If a part is present as detected by the photo eye AND it is in position as detected by the Limit Switch (LS1),
then operate the Clamp.
Rung 0
] [ ] [ ( )
7.3
St ar t / St op Ci r cui t
Uses
T hi s i s used to start a devi ce wi th a momentary i nput and stop i t
wi th a second momentary i nput. Typi cally the start and stop i nput
devi ces are momentary pushbuttons or a si mi lar type of devi ce. Once
the start pushbutton i s pressed, the output energi ze i nstructi on wi ll
stay On unti l the momentary stop pushbutton i s pressed.
Operation
Turn On an output wi th a momentary i nput, and keep i t On unti l
i nstructed to turn i t Off.
7
99
Wired
Normally
Closed
Pushbutton
Stop
I/0
Wired
Normally
Open
Pushbutton
Start
I/1
Motor
Starter
O/0
Motor
Starter
O/0
Start the motor running by pressing the Start pushbutton. Keep the motor running until the Stop pushbutton
is pressed.
Rung 0
] [ ] [
] [
( )
Ladder Logic
T he logi c used to perform thi s consi sts of one rung. Note that i n thi s
example the stop pushbutton i s a normally closed swi tch, but i s
programmed as a normally open i nstructi on.
RUNG 0
Before any i nputs are acti vated, N.O. i nstructi on I /0 i s True ( si nce a
N.C. pushbutton i s wi red to i nput termi nal I /0, and that pushbutton
has not been pressed) , and N.O. i nstructi on I /1 i s False.
When the start pushbutton i s pressed, N.O. i nstructi on I /1 becomes
True, energi zi ng output O/0. T he True status of control i nstructi on
O/0 i s reflected i n N.O. condi ti on i nstructi on O/0, whi ch i s
programmed i n parallel wi th the start i nstructi on. T hi s keeps the
output On even when I /1 i s no longer true.
When the stop pushbutton i s pressed, N.O. i nstructi on I /0 becomes
False, and the output i s de-energi zed.
7
7.4
Fl i p/ Fl op Ci r cui t ( Push-On/ Push-Of f )
Uses
T hi s ci rcui t i s used to provi de a si ngle change of state each ti me a
new condi ti on i s detected. T he mechani cal equi valent of thi s functi on
would be a push-On/push-Off pushbutton. T hi s type of logi c can be
handy for a wi de range of mi scellaneous uses, such as alternators or
memory ci rcui ts.
Operation
Turn On and mai ntai n an output wi th momentary pushbutton; turn
the output Off the next ti me the same pushbutton i s pressed.
Ladder Logic
T he logi c used to perform thi s consi sts of three rungs that make use
of speci al i nstructi ons. T he logi c also takes advantage of how the PLC
scans the user program.
RUNG 0
A momentary pushbutton wi red to i nput I /5 i s i n seri es wi th a one-
shot ri si ng [OSR] i nstructi on, B3/2, that controls output B3/0. An OSR
i s a speci ali zed i nstructi on that i s only energi zed for one processor
scan. T hi s causes control i nstructi on B3/0 to be energi zed for one
processor scan. Another way to thi nk of thi s i s as a leadi ng edge
tri ggered devi ce.
100
7
RUNG 1
T he second rung detects the pulse each ti me the condi ti on i nstructi on
I /5 i s energi zed and changes the output to the opposi te state each
ti me the pushbutton i n rung 0 goes True.
RUNG 2
T hi s rung di rectly controls the load devi ce wi red to termi nal O/0.
101
Push
Button
I/5
Leading
Edge
One Shot
B3/2
OSR
Pulse On
For 1 Scan
B3/0
Pulse On
For 1 Scan
B3/0
Toggle
B3/1
Toggle
B3/1
Toggle
B3/1
Pulse On
For 1 Scan
B3/0
Rung 1
This rung detects the pulse and changes the output to the opposite state.
Rung 0
This rung generates a pulse each time the pushbutton is pressed.
Toggle
B3/1
Load
O/0
Rung 2
This rung uses the toggle bit to turn on the load device.
] [ ] [
] [
] [
] [ /
] [
] [
( )
( )
( )
/
7
102
7.5
Al ar m Ci r cui t w i t h Fl ash and Acknow l edge
Uses
T hi s type of logi c i s used to detect, hold, and reset alarm events.
Operation
Detect the alarm condi ti on and mai ntai n the event.
Flash an i ndi cator to represent an alarm i s present.
Mai ntai n the i ndi cati on after the alarm has been acknowledged, but
i s sti ll present.
Reset ( clear) the alarm.
Ladder Logic
T he logi c used to perform thi s operati on uses three rungs. Note the
use of the i nternal ti mer, S4/4, used here as the flasher.
RUNG 0
T hi s rung latches the alarm state. When motor #1 ( i nput I /0) i s over
i ts temperature li mi t and the alarm reset button ( i nput I /2) has not
been pressed, the control i nstructi on B3/0 i s turned On.
RUNG 1
T hi s rung flashes alarm li ght O/0 when an alarm i s present as
i ndi cated by the condi ti on i nstructi on B3/0 bei ng On. I n thi s
example, S4/4 i s an i nternal PLC address that cycles On and Off at
.32-second i ntervals.
7
103
Alarm
Reset
I/2
Motor #1
Overtemp
Signal
I/0
Alarm
Latch
B3/0
Alarm
Latch
B3/0
] [
] [
] [ / ( )
Rung 0
Flasher
S4/4
Alarm
Latch
B3/0
Alarm
Acknowledged
Latch
B3/1
Alarm
Light
O/0
] [
] [
] [ ( )
Rung 1
Alarm
Acknowledged
Pushbutton
I/1
Alarm
Latch
B3/0
Alarm
Acknowledged
Latch
B3/1
Alarm
Acknowledged
Latch
B3/1
] [
] [
] [ ( )
Rung 2
RUNG 2
When the alarm condi ti on i s acknowledged by pressi ng the
pushbutton I /1, control i nstructi on B3/1 i s energi zed. T hi s address i s
also turned On as a condi ti on i nstructi on i n rung 1, bypassi ng the
flasher at address S4/4 and changi ng the state of alarm li ght O/0 from
flashi ng to steady.
7
I f at any ti me the alarm condi ti on i s corrected ( the motor cools
down) , I /0 goes Off. T he alarm condi ti on wi ll be mai ntai ned unti l
an operator acknowledges the alarm. T he alarm acknowledged
pushbutton I /1 must be pressed to unlatch B3/0. T hi s i n turn
de-energi zes alarm li ght O/0.
7.6
St ar t / St op w i t h J og Pr ogr am
Uses
Use thi s logi c to start a devi ce wi th a momentary i nput, or to j og the
devi ce wi th a separate i nput.
Operation
Turn On an output wi th a momentary i nput and keep i t On unti l
i nstructed to turn i t Off. Or, turn On an output whenever the j og
pushbutton i s pressed. I f the j og pushbutton i s released, the output
must turn Off.
Ladder Logic
T he logi c used to perform thi s consi sts of two rungs wi th three
condi ti onal devi ces programmed i n seri es and parallel:
RUNG 0
T hi s i s the start/stop rung. I t operates i n the same manner as i n the
start/stop example i n secti on 7.3, except that i nstead of energi zi ng an
external output address, i nternal bi t B3/0 i s energi zed when start
pushbutton I /1 i s pressed.
104
7
105
Rung 0

Rung 1
Pushbutton
Stop
I/0
Pushbutton
Start
I/1
Jog
Pushbutton
I/2
Motor Run
Internal
Status
B3/0
Motor Run
Internal Status
B3/0
Motor Run
Internal Status
B3/0
Motor
O/0
] [ ] [
] [
] [
] [
( )
( )
Wired
Normally
Closed
Wired
Normally
Open
RUNG 1
T hi s i s the rung that controls the actual output address O/0. I f bi t
B3/0 has been energi zed i n rung 0, the output i s energi zed. I f B3/0 has
not been energi zed, the output can be j ogged by pushi ng the j og
pushbutton I /2. Every ti me I /2 i s pressed, motor O/0 turns On.
7
106
7.7
On Del ay
Uses
T hi s logi c turns On a devi ce after a programmed ti me delay.
Operation
T he On delay can be programmed to delay acti vati on of a control
i nstructi on/output devi ce for a preset peri od of ti me.
Ladder Logic
T he logi c used i n thi s appli cati on consi sts of three rungs:
RUNG 0
T hi s i s the start/stop rung. I t operates i n the same manner as the
start/stop example i n secti on 7.3, however, i nstead of energi zi ng an
external output address, i nternal bi t B3/0 i s energi zed when start
pushbutton I /0 i s pressed.
RUNG 1
T hi s rung contai ns an On delay ti mer wi th an address of T 4:0. When
condi ti on i nstructi on B3/0 has been energi zed by the control
i nstructi on B3/0 i n rung 0, the ti mer begi ns ti mi ng. Noti ce that the
ti me base i n the ti mer functi on block reads one second. T hi s means
that the ti mer wi ll ti me i n one second i ncrements. Also noti ce that
the preset value reads 10. T hi s means that the ti mer wi ll be done
ti mi ng after a ti me delay of 10 one second i ncrements, for a total of
ten seconds. T he ti mer done bi t T 4:0/DN i n rung 2 wi ll be energi zed
at thi s poi nt. I f at any ti me rung 1 lacks logi cal conti nui ty ( B3/0 i s
Off) , the ti mer wi ll reset to zero.
7
T he length of the ti me delay can be adj usted by changi ng the preset
value. I n addi ti on, most PLCs allow the opti on of changi ng the ti me
base, or resoluti on of the ti mer. T he smaller the ti me base selected,
the better the accuracy of the ti mer. Typi cal ti me bases are 0.01, 0.1,
and 1.0 second.
T he accumulated value of the ti mer ( shown as ACCUM i n the
functi on block) i s the number of i ncrements the ti mer has
accumulated si nce i t began ti mi ng.
RUNG 2
T hi s i s the rung that controls the actual output address O/0. I f the
ti mer has ti med for 10 seconds ( the ti mer done bi t T 4:0/DN i s
energi zed) , the output O/0 i s energi zed.
107
Rung 2

10 Second
Timer
TON
TIMER ON DELAY
Timer
Time Base
Preset
Accum
EN
DN
Rung 0

Rung 1

Motor Run
Request
B3/0
Motor Run
Request
B3/0
Motor Run
Request
B3/0
10 Second
Timer Done
T4:0/DN
Motor #1
O/0
] [ ] [
] [
] [
] [ ( )
( )
( )
( )
T4:0
1.0
10
0
Wired
Normally
Closed
Pushbutton
Wired
Normally
Open
Pushbutton
Stop
I/0
Start
I/1
7.8
Of f Del ay
Uses
T hi s logi c turns Off a devi ce after a programmed ti me delay.
Operation
T he Off delay program allows a control i nstructi on/output devi ce to
be turned Off after a preset amount of ti me.
Ladder Logic
T he key i tem i n these rungs i s the normally closed condi ti on
i nstructi on programmed i n seri es wi th the control i nstructi on on the
fi rst rung.
RUNG 0
T hi s i s the rung that controls the actual output address O/0. I t
operates i n the same manner as the start/stop example i n secti on 7.3.
Noti ce that a normally closed i nstructi on has been added i n seri es
wi th the output. T hi s condi ti on i nstructi on has the address of the
ti mer done bi t, T 4:0/DN from the ti mer i n rung 1. I t i s the addi ti on of
thi s i nstructi on that creates the Off delay operati on of the rung.
RUNG 1
T hi s rung contai ns an On delay ti mer wi th an address of T 4:0. When
the output O/0 from rung 0 has been energi zed the ti mer begi ns
ti mi ng. Noti ce that the ti me base i n the ti mer functi on block reads
one second. T hi s means that the ti mer wi ll ti me i n one second
i ncrements. Also noti ce that the preset value reads 10. T hi s means
7
108
7
109
that the ti mer wi ll be done ti mi ng after 10 one second i ncrements
have passedfor a total delay of ten seconds. T he ti mer done bi t
T 4:0/DN wi ll be energi zed at thi s poi nt. T hi s wi ll de-energi ze the
normally closed i nstructi on T 4:0/DN i n rung 0, turni ng Off the output.
See the example i n secti on 7.7 for a more thorough descri pti on of
ti mer operati on.
10 Second
Timer
TON
TIMER ON DELAY
Timer
Time Base
Preset
Accum
T4:0
1.0
10
0
EN
DN
Rung 0

Rung 1

Stop
I/0
Start
I/1
Motor #1
O/0
Motor #1
O/0
10 Second
Timer Done
T4:0/DN
Motor #1
O/0
] [ ] [
] [
( )
] [
] [ /
( )
( )
Wired
Normally
Closed
Pushbutton
Wired
Normally
Open
Pushbutton
7
7.9
One Mi nut e Cl ock
Uses
T hi s i s an example of a repeti ti ve or free runni ng clock.
Operation
I n thi s example, the clock i nterval i s set for 1 mi nute, but any
i nterval could be selected. I f a di fferent ti me i nterval i s requi red, si mply
change the value i n the preset locati on i n the ti mer functi on block. As
di scussed i n the secti ons on On and Off Delays, the resoluti on of the
clock wi ll be determi ned by i ts ti me base. I n thi s example, the ti mer i s
programmed wi th a 1-second ti me base, so the ti mer wi ll only be
capable of ti mi ng accuraci es greater than or equal to 1 second. I f a
more accurate ti me i s requi red, then use a ti mer wi th a ti me base less
than 1 second.
Ladder Logic
T he logi c used i n thi s appli cati on consi sts of 2 rungs:
RUNG 0
T hi s i s the ti mi ng rung. Noti ce that the condi ti on i nstructi on that
controls the ti mer i s the done bi t of the ti mer, address T 4:0/DN. Si nce
thi s condi ti on i nstructi on i s normally closed, i t wi ll have logi cal
conti nui ty when the ti mer i s not done, that i s, when the accumulated
value i s less than the preset value. T herefore, pri or to the preset ti me
bei ng reached, the ti mer ti mes.
110
7
Once the preset value i s reached, the normally closed i nstructi on
becomes False and the ti mer resets to zero on the next scan of the
program. T he normally closed i nstructi on i s now True, and the ti mer
begi ns ti mi ng from zero.
RUNG 1
T hi s rung contai ns a counter i nstructi on. T he condi ti on i nstructi on
that controls thi s counter i s the done bi t from the ti mer i n the
previ ous rung. I n thi s case i t i s a normally open i nstructi on. As soon
as the accumulated ti me of the ti mer i n rung 0 reaches 60 seconds
( the preset value of 60, usi ng a ti me base of 1 second) , the done bi t
energi zes and i ncrements the counter.
111
Rung 1

Rung 0

One Minute
Timer
Done
Timing
T4:0/DN
One Minute
Timer
TON
TIMER ON DELAY
Timer
Time Base
Preset
Accum
T4:0
1.0
60
0
EN
DN
] [ /
( )
( )
CTU
COUNT UP
Counter
Preset
Accum
C10:1
5
0
] [
T4:0/DN
7
Retentive Timers
T i mers are avai lable that retai n thei r ti me when the condi ti ons
precedi ng the ti mer i nstructi on are False ( open) . Retenti ve ti mers are
very useful for keepi ng track of the amount of ti me a devi ce has been
On. T hi s can be very helpful for tracki ng devi ce mai ntenance or other
run-ti me type requi rements. Retenti ve ti mers are reset usi ng a separate
i nstructi on that i s used to clear a ti mer. T he i nstructi on i s called reset
( RES) , and i s programmed as a control i nstructi on.
7.10
Up/ Dow n Count i ng
Uses
Up/Down counters are often used to moni tor and track materi als i n
conveyi ng/packagi ng systems. An example i s a bottle labeli ng
appli cati on where the bottle maki ng machi ne produces bottles at a
greater rate than the labeli ng machi ne can apply labels. One method for
compensati ng for the di fference i n producti on rates i s to add a buffer
area where the bottles can stack up to awai t labeli ng.
Operation
A counter i s used to track how many bottles are i n the buffer. T he
counter i ncrements i ts count when a bottle enters the holdi ng area
from the bottle maki ng machi ne, and decrements each ti me a bottle
exi ts the holdi ng area.
When the holdi ng area i s full, a si gnal can be sent to the bottle
maki ng machi ne to stop produci ng bottles.
112
7
Ladder Logic
T he logi c used i n thi s appli cati on consi sts of 4 rungs:
RUNG 0
T hi s rung contai ns a count up i nstructi on wi th an address of C5:0.
Each ti me the li mi t swi tch wi red to the i nput termi nal I /0 i s acti vated,
condi ti on i nstructi on I /0 changes from False to True, and the counter
i ncrements by one count.
113
Rung 0

Count up
Limit Switch
I/0
CTU
COUNT UP
Counter
Preset
Accum
C5:0
10
0
(CD)
(DN)
] [
RUNG 1
T hi s rung contai ns the count down i nstructi on. Noti ce that i t has the
same address as the count up i nstructi on i n rung 0, C5:0. Each ti me
the li mi t swi tch wi red to termi nal I /1 i s acti vated, condi ti on i nstructi on
I /1 i s made True, and the counter decrements by one count.
I t i s i mportant to note that any number of condi ti on i nstructi ons can
be on the rung that controls a counter i nstructi on. Anyti me the status
of the rung goes from False to True, an up counter i nstructi on wi ll
i ncrement, and a down counter wi ll decrement by one count.
Rung 1
Count Down
Limit Switch
I/1
] [
CTD
COUNT DOWN
Counter
Preset
Accum
C5:0
10
0
(CD)
(DN)
7
RUNG 2
T hi s i s the rung that controls the output O/0. When the number of
counts accumulated i n the counter equals or exceeds the counters
preset value, the done bi t C5:0/DN i s energi zed, turni ng On output O/0.
114
Stop
Bottle Machine
O:0
Rung 2

Counter at
Preset
C5:0 /DN
] [
( )
Counter
Reset
C5:0
Rung 3

Reset
Counter
I/2
] [ RES ( )
RUNG 3
T hi s i s the reset rung. When the condi ti on i nstructi on I /2 comes On,
the accumulated value of counter C5:0 i s reset to zero.
7.11
Movi ng Dat a
Uses
One of the most useful and versati le features a PLC has i s i ts abi li ty
to move and mani pulate data. T hi s abi li ty turns the PLC i nto a powerful
processi ng platform, capable of changi ng data values i n i nteger fi les,
ti mers, counters, stacks and many other areas. Movi ng data i s done for
control purposes, or to si mply better organi ze i nformati on.
7
Operation
To move data i n a PLC i s a si mple command: Move data from poi nt A
to poi nt B. T he structure i s easy to understand and troubleshoot.
Ladder Logic
T he logi c used i n thi s appli cati on consi sts of 4 rungs; the fi rst three
rungs i llustrate actual move commands, whi le the thi rd i s used to clear
one of the desti nati on regi sters.
RUNG 0
T hi s rung demonstrates movi ng a constant to an i nteger locati on.
Whenever condi ti on i nstructi on I /0 i s energi zed, the PLC wi ll move
the data ( 1234) i n the Source locati on to the Dest ( desti nati on)
locati on ( I nteger locati on N7:10) . An i nteger locati on i s a speci fi c
word where the data i s stored. T he data i n the source locati on may
be ei ther a constant or an address i nternal to the PLC.
115
Rung 0
Press input I/0 to move the source data (here a constant) to the "Dest" (destination).
Perform
1st Data
Move
I/0 MOV
MOVE
Source 1234
Dest N7:10

] [
7
RUNG 1
T hi s rung demonstrates the movi ng of data from one i nteger locati on
to another. Whenever condi ti on i nstructi on I /1 i s energi zed, the data
at N7:10 ( Source) wi ll be moved to N7:20 ( Desti nati on) .
116
Rung 1


Perform
2nd Data
Move
I/1
Move the source data (here a variable) into the destination.
] [
MOV
MOVE
Source N7:10

Dest N7:20

RUNG 2
T hi s rung demonstrates the movi ng of data from an i nteger locati on
to the preset value of a counter. Whenever i nput i nstructi on I /2 i s
energi zed, the data at N7:20 ( Source) wi ll be moved to the counter
preset C5:10.PRE ( Desti nati on) .
Move the source data (here a variable) into the preset value of a counter instruction.
Rung 2

Perform
3rd Data
Move
I/2
] [
MOV
MOVE
Source N7:20

Dest C5:10.PRE

7
117
RUNG 3
T hi s rung i s si mply used to clear the data from the worki ng regi ster.
Whenever condi ti on i nstructi on I /3 i s energi zed, data i s cleared from
Desti nati on N7:20.
Rung 3
Clear all data at the Destination (dest) address.
Clear
N7:10
I/3
] [
CLR
CLEAR
Dest N7:20

7.12
Compar i ng Dat a
Uses
PLCs can moni tor and take acti on based on numeri cal values.
Operation
I n many i nstances, devi ces may need to be controlled when they
are less than, equal to or greater than other data values or set poi nts
used i n the appli cati on, li ke ti mer and counter values. Compari son
i nstructi ons are always programmed as condi ti on i nstructi ons.
LES
LESS THAN
Source A C5:10.ACC

Source B 3
Rung 2
O/0
( )
7
Ladder Logic
T he logi c used i n thi s appli cati on consi sts of 6 sample rungs:
RUNG 0 and RUNG 1
Rung 0 uses pushbutton I /0 to i ncrement a counter ( C5:10) . Rung 1
uses pushbutton I /1 to reset the counter. T hese rungs si mply setup
some data values to use i n the followi ng rungs.
118
CTU
COUNT UP
Counter C5:10
Preset 10
Accum 0
Counter 10
is used to
increment
the data
I/0
Pushbutton
to advance
counter 10
I/0
Rung 0
] [ CU
DN
( )
( )
Counter 10
is used to
increment
the data
C5:10
Reset Pushbutton
to clear
counter 10
I/1
Rung 1
] [ ( ) RES
RUNG 2
T hi s rung contai ns a Less T han i nstructi on. T he LES wi ll turn
On the control i nstructi on O/0 whenever the data i n source A
( the accumulated value of counter C5:10) i s less than the data i n
source B, a constant, 3.
7
119
RUNG 3
T hi s rung contai ns an Equal i nstructi on. T he EQU wi ll turn
On the control i nstructi on O/1 whenever the data i n source A
( the accumulated value of counter C5:10) i s exactly the same
as data i n source B, a constant, 5.
Rung 3
O/1
( )
EQU
EQUAL
Source A C5:10.ACC

Source B 5
RUNG 4
T hi s rung contai ns a Greater T han i nstructi on. T he GRT wi ll turn
On the control i nstructi on O/2 whenever the data i n source A
( the accumulated value of counter C5:10) i s greater than the data i n
source B, a constant, 7.
Rung 4
O/2
( )
GRT
GREATER THAN
Source A C5:10.ACC

Source B 7
7
120
RUNG 5
T hi s rung contai ns a Li mi t i nstructi on. T he LI M wi ll turn On the
control i nstructi on O/3 whenever data i n the Test posi ti on ( the
accumulated value of counter C5:10) i s greater than the data i n Low
Li mi t, the constant, 3, and i s less than the data i n Hi gh Li mi t, the
constant, 7.
Rung 5
O/3
( )
LIM
LIMIT TEST
Low Lim 3
TEST C5:10.ACC

High Lim 7
7.13
Mat h Commands
Uses
Most PLCs on the market today offer a range of math capabi li ti es. Some
examples of the use of math i nclude: combi ni ng parts counts, subtracti ng
detected defects, calculati ng run rates, and loggi ng or counti ng product.
Operation
Math operati ons are performed as control i nstructi ons i n the rung.
Here, we have i llustrated the program from a PLC that supports
functi on block math commands. T hi s type of math i nstructi on i s much
easi er to use than one that uses an accumulator for math operati ons.
7
121
Ladder Logic
T he four basi c math i nstructi ons are i llustrated below:
RUNG 0 and RUNG 1
T hese fi rst two rungs make use of a counter to provi de an easy
method of changi ng a data value to be used i n the math i nstructi ons
to follow. Condi ti on i nstructi on I /0 wi ll i ncrement counter C5:10
each ti me i t i s energi zed. Condi ti on i nstructi on I /1 wi ll reset the
accumulated value of counter C5:10 when i t i s energi zed.
Rung 1
I/0
I/1
CTU
COUNT UP
Counter
Preset 20
Accum 0
C5:10
RES
C5:10
] [
] [
CU
DN
( )
( )
( )
Rung 0
RUNG 2
When condi ti on i nstructi on I /2 i s on, the PLC wi ll enable the add
( ADD) i nstructi on. I n thi s example, the data i n source A ( i n thi s
case the constant, 5) wi ll be added wi th the data i n source B ( the
accumulated value of counter C5:10) , wi th the result bei ng placed
i n the Dest ( desti nati on) , N7:0.
Rung 2
I/2
ADD
ADD
Source A

Source B
Dest
] [
5
C5:10.ACC
N7:0
7
122
RUNG 3
When condi ti on i nstructi on I /3 i s on, the PLC wi ll enable the
subtracti on ( SUB) i nstructi on. I n thi s example, the data i n source B
( the constant, 5) wi ll be subtracted from the data i n source A ( the
accumulated value of counter C5:10) , wi th the result bei ng placed i n
the Dest ( desti nati on) , N7:1.
Rung 3
I/3
SUB
SUBTRACT
Source A C5:10.ACC

Source B 5

Dest N7:1

] [
RUNG 4
When condi ti on i nstructi on I /4 i s on, the PLC wi ll enable the multi ply
( MUL) i nstructi on. I n thi s example, the data i n source A ( the constant,
20) wi ll be multi pli ed by the data i n source B ( the accumulated value
of counter C5:10) , wi th the result bei ng placed i n the Dest
( desti nati on) , N7:2.
Rung 4
I/4
MUL
MULTIPLY
Source A 20

Source B C5:10.ACC

Dest N7:2



] [
7
123
RUNG 5
When condi ti on i nstructi on I /5 i s on, the PLC wi ll enable the
di vi de ( DI V) i nstructi on. I n thi s example, the data i n source A
( the accumulated value of counter C5:10) wi ll be di vi ded by the
data i n source B ( the constant, 2) , wi th the result bei ng placed i n the
Dest ( desti nati on) , N7:3.
Rung 5
I/5
DIV
DIVIDE
Source A
Source B
Dest
C5:10.ACC

2
N7:3
] [
7.14
Sequencer s
Uses
Many of the mi cro PLCs on the market today offer a command that
replaces electromechani cal devi ces called drum sequencers or drum
swi tches. T hese electromechani cal devi ces were desi gned for si mple
control systems that requi red speci fi c On or Off patterns of outputs
that are conti nuously repeated. A sequencer i nstructi on can perform
the same functi on as a drum swi tch, but wi th more flexi bi li ty. I t i s
typi cally used for sequenci ng the operati on of valves, solenoi ds or li ghts
for many vari eti es of machi nes or processes.
Operation
Typi cally, these i nstructi ons take the form of a si ngle hi gh level
i nstructi on. A memory locati on i s desi gnated wi thi n the PLC that forms
the pattern of the outputs duri ng the sequence. T he table below
i llustrates thi s archi tecture. ( Fi g. 7-14)
T he bi t data fi le ( B3:0 through B3:3) contai ns the data for each step
of the sequence controlled by the sequencer i nstructi on. T he bi t
patterns that are stored i n each of these locati ons form the output
pattern that wi ll be seen for each of the sequencer steps.
7
124
Bit Address
Output Address
Output Status
WORD
B3:0
B3:1
B3:2
B3:3
B3/4 B3/3 B3/2 B3/1 B3/0
0 0 0 0 0
0 0 0 1 1
0 1 1 0 0
1 1 1 1 1
O/4 O/3 O/2 O/1 O/0
0 1 1 0 0
STEP
0
1
2
3
Current Step
Fi g. 7-14
Ladder Logic
RUNG 0
T he sequencer i nstructi on typi cally looks li ke thi s: A si ngle
i nstructi on that i denti fi es where the output pattern data i s stored
( B3:0) , the desti nati on or address of that output data, and the length
or number of steps of the sequence. T hi s i nstructi on also manages or
tracks what the current sequencer posi ti on i s. Each ti me the
7
125
condi ti onal logi c precedi ng the i nstructi on changes from False to
True, the sequencer wi ll i ncrement to the next step.
I/0
FFL
FIFO LOAD
Source
FIFO
Control
Length
Position
] [
#N7:50
#N7:52
R6:0
10
0
EN
DN
( )
( )
EM ( )
Rung 0
7.15
FIFO ( Fi r st -In Fi r st -Out )
Uses
FI FOs are part of a speci al set of commands that deal wi th stori ng
numeri c data. T hese commands are pri mari ly used i n tracki ng products
and materi als duri ng processes. An example would be an overhead
conveyor system that feeds parts i nto a pai nt booth. Each part requi res
a di fferent color, and the color I D i s tracked whi le the part i s moved
through the manufacturi ng process. I f the conveyor i s runni ng and a
problem occurs i n the pai nt booth, the parts need to be stored unti l the
pai nt booth i s back on-li ne.
One method i s to have a holdi ng area i nto whi ch the PLC can redi rect
the parts. As each part i s sent i nto the area, the color I D i s loaded i nto a
FI FO stack. When the pai nt booth returns to operati on, the PLC wi ll
draw a part out of the holdi ng area and track the i denti fi er wi th i t. T hi s
assures that the part wi ll get the correct color of pai nt.
7
126
Operation
FI FO commands typi cally take the form of two hi gh level
i nstructi ons, FI FO Load ( FFL) and FI FO Unload ( FFU) . T hese
i nstructi ons are used i n pai rs. T he FFL i nstructi on loads words i nto a
user-created group of regi sters called a FI FO stack. T he FFU
i nstructi on unloads words from the FI FO stack i n the same order as
they were entered ( Fi g. 7-15) .
N7:50
Source
Register
Destination
Register
N7:51
FIFO
Stack
N7:52
N7:53
N7:54
N7:55
N7:56
N7:57
N7:58
N7:59
N7:60
N7:61
Position
0
1
2
3
4
5
6
7
8
9
Fi g. 7-15
T he uni que feature of the FI FO stack i s i ts abi li ty to manage where
the data i s. T hi s i s done by tracki ng where data i s entered i nto the
stack. T he FI FO i nstructi ons manage all aspects of enteri ng and
removi ng data from the stack.
Ladder Logic
RUNG 0
T hi s rung controls the transfer of data to the FI FO stack. When the
logi c precedi ng the FI FO Load i nstructi on changes from False to True,
the data located i n the source regi ster N7:50 i s stored i n the next
7
avai lable locati on i n the stack. T hi s locati on i s desi gnated by the
current value of the posi ti on parameter of the i nstructi on. As soon as
the data i s transferred, thi s posi ti on value wi ll poi nt to the next
posi ti on i n the stack. T he si ze of the stack corresponds to the value
programmed as the length parameter. I n thi s example, the FI FO stack
i s 10 words long.
RUNG 1
When the logi c precedi ng the FI FO Unload i nstructi on changes from
False to True, data i s retri eved from the stack. I n other words, the
oldest data ( the fi rst i n) wi ll be transferred to the desti nati on
regi ster N7:51.
127
I/0
FFL
FIFO LOAD
Source
FIFO
Control
Length
Position
] [
#N7:50
#N7:52
R6:0
10
0
EN
DN
( )
( )
EM ( )
Rung 0
I/1
FFU
FIFO UNLOAD
FIFO
Dest
Control
Length
Position
] [
#N7:50
#N7:51
R6:0
10
0
EU
DN
( )
( )
EM ( )
Rung 1
7
128
7.16
Hi gh-Speed Count er ( HSC)
Uses
Many mi cro PLCs on the market today have the abi li ty to detect and
control hi gh-speed operati ons. One of the most versati le features i s a
full functi on hi gh-speed counter. T hi s feature gi ves a mi cro PLC the
abi li ty to count a hi gh-speed i nput si gnal and control the correspondi ng
outputs based on the accumulated count, i ndependent of the
processors scan. T hi s capabi li ty allows mi cro PLCs to be used i n
appli cati ons that previ ously requi red much larger PLCs. Some of the
mi cro PLCs avai lable today even have the abi li ty to modi fy what
outputs wi ll be controlled duri ng the HSCs operati on. T hi s functi onali ty
allows the mi cro PLC to replace cut-to-length controllers, rotary cam
swi tches, programmable li mi t swi tches and other mechani cal devi ces.
Operation
Many of the mi cro PLCs on the market that are capable of HSC
operati on have a number of modes for speci fi c types of operati on ( Up,
Down, Up/Down, Quadrature, Quadrature Wi th External Hold & Reset,
etc.) . I n addi ti on, many also support speci al commands that are
i ntended to be used wi th the HSC, such as hi gh-speed compares,
resets, updates, etc.
Ladder Logic
RUNG 0
T he Hi gh-Speed Counter i nstructi on ( HSC) i n thi s rung contai ns all
of the parameters requi red to defi ne i ts mode of operati on. T hese
7
parameters are selected when the i nstructi on i s programmed. A
separate Hi gh-Speed Counter Load i nstructi on ( not shown here) i s
requi red i f outputs/control i nstructi ons are to be controlled di rectly
by thi s hi gh-speed functi on.
T he operati on of a hi gh-speed counter i nstructi on i s very speci fi c to
the mi cro PLC used. Consult the controllers user manual before
usi ng the i nstructi on.
129
HSC
HIGH SPEED COUNTER
Type Encoder
Counter
High Preset
Accum
(Res, Hld)
C5:0
360
0
CU
CD
( )
( )
DN ( )
Rung 0
7.17
Tw o St age Al t er nat or
Uses
T hi s type of logi c i s used to alternate devi ces ( typi cally pumps) i n
appli cati ons li ke the emptyi ng of wells, reservoi rs, and vessels ( tanks)
where the rate of flow i nto the tank i s not constant.
Operation
I n an appli cati on li ke thi s, two smaller pumps are frequently used
i nstead of one large one. Alternati ng pump operati on ( Pump 1 as the
pri mary, then pump 2 as the pri mary) reduces the mai ntenance
requi red on the i ndi vi dual devi ces and provi des more reli able operati on.
7
I n addi ti on, the secondary or standby pump i s avai lable i f the rate of
water enteri ng the vessel i s more than the fi rst pump can handle. I f thi s
si tuati on occurs, the second pump wi ll also turn On and assi st the
pri mary pump. T he tri ggers for these events could be analog si gnals, or
si mple di screte i nputs ( float swi tches, etc.) . T hi s i llustrati on shows a
typi cal appli cati on wi th float swi tches i n a tank ( Fi g 7-17) .
130
F1
F2
F3
F4
P1
P2
I/3
I/2
I/1
I/0
O/0
O/1
Fi g. 7-17
7
Ladder Logic
T he logi c used i n thi s appli cati on consi sts of 4 rungs:
RUNG 0 AND RUNG 1
T hese two rungs form a fli p/flop ci rcui t as descri bed i n the example i n
secti on 7.4. Each ti me the flui d i n the tank reaches the low level float
swi tch F1 ( I /0) , the alternator bi t i n rung 1, B3/2 changes state. T he
status of thi s bi t determi nes whi ch pump wi ll be the fi rst to turn On.
131
] [ ] [
Rung 0
B3/0
Low Level
Pulse
B3/1
( )
Low Level
F1
I/0
OSR
] [ ] [
] [ ] [
Rung 1
Alternator Bit
(Pulse On/Pulse Off)
B3/2
( )
Low Level
Pulse
B3/1
Alternator Bit
(Pulse On/Pulse Off)
B3/2
Alternator Bit
(Pulse On/Pulse Off)
B3/2
Low Level
Pulse
B3/1
/
/
] [ ] [ ] [
] [
Rung 2
Pump #1
O/0
( )
Low Level
F1
I/0
Pump #1
O/0
] [
Pump #2
O/1
First Call
F2
I/1
] [
Second Call
F3
I/2
] [
Pump #1
O/0
/
Alternator Bit
(Pulse On/Pulse Off)
B3/2
7
132
RUNG 2
T hi s rung controls the operati on of pump 1, O/0. I f the low float I /0 i s
On and the alternator bi t B3/2 i s Off, and the level i n the tank has
reached the Fi rst Call float F2 ( I /1) , thi s pump wi ll be the fi rst one
energi zed. I f B3/2 i s On, pump 1 wi ll be the second pump energi zed.
RUNG 3
T hi s rung controls the operati on of pump 2, O/1. I f the low float I /0 i s
On and the alternator bi t B3/2 i s On, and the level i n the tank has
reached the Fi rst Call float F2 ( I /1) , thi s pump wi ll be the fi rst one
energi zed. I f B3/2 i s Off, pump 1 wi ll be the second pump energi zed.
7
133
] [ ] [ ] [
] [
Rung 3
Pump #2
O/1
( )
Low Level
F1
I/0
Alternator Bit
(Pulse On/Pulse Off)
B3/2
Pump #2
O/1
] [
Pump #1
O/0
First Call
F2
I/1
] [
Second Call
F3
I/2
] [
Pump #2
O/1
One of the powerful features of PLCs i s the abi li ty to moni tor and
alert operators to alarm condi ti ons. You may have noti ced that float
swi tch #4 ( F4) i s not bei ng used i n the program. T hi s float swi tch i s an
alarm condi ti on. I t can be used i n the program to make sure the pumps
are runni ng i f thi s float i s tri pped. T hi s check operati on would help
mi ni mi ze damage i f the level 1 or level 2 floats malfuncti oned. I t can
also sound an alarm that i ndi cates the tank i s about to overflow.
7.18
Thr ee St at i on Al t er nat or
Uses
T hi s example i s si mi lar i n functi on to the example i n secti on 7.17,
except that we are addi ng an addi ti onal devi ce to alternate 3 rather
than 2. For ease of descri pti on, we wi ll di scuss three pumps that empty
a tank. T he control system needs to be able to rotate the pump that
turns On fi rst each ti me a request i s made, and also to bri ng other
pumps on-li ne as demand i ncreases.
Operation
A seri es of fi ve float switches are used to monitor the level of fluid in
the tank ( Fig. 7-18) . T he control system monitors these float switches, and
determines which pump is the primary pump, lag pump 1 and
lag pump 2.
Input Device Status Pump Requirements
Float Swi tch 1 Off All pumps off
Float Swi tch 1 On None
Float Swi tches 1, 2 On Pri mary pump On
Float Swi tches 1, 2 & 3 On Pri mary and Lag #1 pumps On
Float Swi tches 1, 2, 3 & 4 On Pri mary, Lag #1 and Lag #2 pumps On
Float Swi tches 1, 2, 3, 4 & 5 On ALARM condi ti on
Whenever the pri mary pump i s needed ( called) , the control system
wi ll then rotate the assi gnment of the pri mary pump. T hi s ensures even
wear between all three pumps and veri fi es that each pump i s
operati onal. As each pump i s desi gnated as the pri mary, the remai ni ng
lag pumps wi ll also be rotated.
A breakdown of pri ori ti es for each pump at any gi ven ti me i s
i ncluded here. T he sequence for the runni ng of each pump i s called a
stage. T here are three pumps, and therefore three stages that operate
as follows:
7
134
7
135
F1
F2
F3
F4
F5
P1
P2
P3
I/3
I/2
I/1
I/0
O/0
O/2
O/1
Fi g. 7-18
Stage Pump 1 Pump 2 Pump 3
1 Pri mary Lag 1 Lag 2
2 Lag 2 Pri mary Lag 1
3 Lag 1 Lag 2 Pri mary
EQU
EQUAL
Source A
Source B
] [ ] [
] [ ] [
] [
Rung 0
C5:10.ACC
1
First Call
F2
I/1
Stage 1
Internal Bit for
Pump #1
B3/0
Stage 1
Internal Bit for
Pump #1
B3/0
( )
Low Level
F1
I/0
EQU
EQUAL
Source A
Source B
] [
] [
Rung 1
C5:10.ACC
1
Second Call
F3
I/2
Stage 1
Internal Bit for
Pump #2
B3/1
Stage 1
Internal Bit for
Pump #2
B3/1
( )
Low Level
F1
I/0
Stage 1
Internal Bit for
Pump #1
B3/0
] [ ] [
EQU
EQUAL
Source A
Source B
] [
] [
Rung 2
C5:10.ACC
1
Third Call
F4
I/3
Stage 1
Internal Bit for
Pump #3
B3/2
Stage 1
Internal Bit for
Pump #3
B3/2
( )
Low Level
F1
I/0
Stage 1
Internal Bit for
Pump #2
B3/1
7
Ladder Logic
T he logi c used i n thi s appli cati on consi sts of 15 rungs. T he EQUAL
T O compari son i nstructi on at the start of the fi rst ten rungs compares
the accumulated value of the counter i n rung 13 to a constant. T he
value of the constant desi gnates whi ch stage i s to be run ( i .e., the
operati ng sequence of the pumps) .
RUNGS 0 through 8
T he fi rst 9 rungs i n the program set the pri ori ty assi gnment for the
pri mary, Lag #1 and Lag #2 pumps.
136
7
137
EQU
EQUAL
Source A
Source B
] [ ] [
] [ ] [
] [
Rung 6
C5:10.ACC
3
First Call
F2
I/1
Stage 3
Internal Bit for
Pump #1
B3/6
Stage 3
Internal Bit for
Pump #1
B3/6
( )
Low Level
F1
I/0
EQU
EQUAL
Source A
Source B
] [
] [
Rung 7
C5:10.ACC
3
Second Call
F2
I/2
Stage 3
Internal Bit for
Pump #2
B3/7
Stage 3
Internal Bit for
Pump #2
B3/7
( )
Low Level
F1
I/0
Stage 3
Internal Bit for
Pump #1
B3/6
] [ ] [
EQU
EQUAL
Source A
Source B
] [
] [
Rung 8
C5:10.ACC
3
Third Call
F4
I/3
Stage 3
Internal Bit for
Pump #3
B3/8
Stage 3
Internal Bit for
Pump #3
B3/8
( )
Low Level
F1
I/0
Stage 3
Internal Bit for
Pump #2
B3/7
EQU
EQUAL
Source A
Source B
] [ ] [
] [ ] [
] [
Rung 3
C5:10.ACC
2
First Call
F2
I/1
Stage 2
Internal Bit for
Pump #1
B3/3
Stage 2
Internal Bit for
Pump #1
B3/3
( )
Low Level
F1
I/0
EQU
EQUAL
Source A
Source B
] [
] [
Rung 4
C5:10.ACC
2
Second Call
F3
I/2
Stage 2
Internal Bit for
Pump #2
B3/4
Stage 3
Internal Bit for
Pump #2
B3/4
( )
Low Level
F1
I/0
Stage 2
Internal Bit for
Pump #1
B3/3
] [ ] [
EQU
EQUAL
Source A
Source B
] [
] [
Rung 5
C5:10.ACC
2
Third Call
F4
I/3
Stage 2
Internal Bit for
Pump #3
B3/5
Stage 2
Internal Bit for
Pump #3
B3/5
( )
Low Level
F1
I/0
Stage 2
Internal Bit for
Pump #2
B3/4
7
138
RUNG 9
T hi s rung sets i nternal bi t B3/9 when the fi nal stage has
been completed.
RUNGS 10, 11, 12
T hese three rungs link the preceding rungs to actual output terminals on
the PLC. Making use of internal bits for logic purposes provides an easy
method of controlling an output from multiple sources within a program.
EQU
EQUAL
Source A
Source B
] [
] [
Rung 9
C5:10.ACC
3
Stage 3 Internal
Bit for Pump #1
B3/6
Cycle Complete
B3/9
Cycle Complete
B3/9
( )
Rung 10
Stage 1
Internal
Bit for
Pump #1
B3/0
Stage 2
Internal
Bit for
Pump #1
B3/3
Stage 3
Internal
Bit for
Pump #1
B3/6
Pump #1
O/0
] [
] [
] [
( )
7
139
Rung 11
Stage 1
Internal
Bit for
Pump #2
B3/1
Stage 2
Internal
Bit for
Pump #2
B3/4
Stage 3
Internal
Bit for
Pump #2
B3/7
Pump #2
O/1
Rung 12
Stage 1
Internal
Bit for
Pump #3
B3/2
Pump #3
O/2
Stage 2
Internal
Bit for
Pump #3
B3/5
Stage 3
Internal
Bit for
Pump #3
B3/8
] [
] [
] [
( )
] [
] [
] [
( )
Pump #1
O/0
Pump #2
O/1
Pump #3
O/2
Sequence
Counter
Rung 13
CTU
COUNT UP
Counter C5:10
Preset
Accum
CU
DN
] [ / ] [ /
] [ /
( )
( )
3
1
RUNG 13
T hi s rung i s the counter rung and controls whi ch stage wi ll be run
next. T he counter i ncrements each ti me all pumps are off.
RUNG 14
T hi s rung resets the counter after the last stage i s run and starts the
enti re sequence over agai n.
Rung 14
Cycle
Complete
B3/9
Sequence
Counter
C5:10
Low Level
I/0
/
RES ] [ ] [ /
( )
Noti ce that float swi tch F5 i s not used i n thi s program. I t can be used
i n the program as an alarm condi ti on that ensures all pumps are
runni ng i f thi s float i s tri pped. T hi s would help prevent damage i f any
of the other floats malfuncti oned. Or, i t can sound an alarm to i denti fy
a problem wi th the tank, for i nstance, that i t i s about to overflow.
140
Glossary . . . . . . . . . . . . . . . . Appendi x A
I nput and Output
Devi ces . . . . . . . . . . . . . . . Appendi x B
I nstructi on
Executi on T i mes . . . . . . . . Appendi x C
Sample Program
Worksheets . . . . . . . . . . . . Appendi x D
A
P
P
E
N
D
I
C
E
S
Appendi ces
141
A
Appendi x A Gl ossar y
address: A uni que memory locati on, i denti fi ed by an alphanumeri c character. For
example, I /2 i s the memory address for data located i n bi t 2 of the i nput fi le.
alphanumeric: Character stri ngs composed of any combi nati on of letters or numbers.
analog: A numeri c value that represents measurable quanti ti es, such as temperature,
wei ght, pressure, etc. Compare wi th digital.
AND: A Boolean operati on that produces a True output only when all condi ti ons are
True, and a False output i f any condi ti on i s False.
application: A machi ne or process that requi res a control system for operati on.
application memory: T he porti on of the total system memory dedi cated to storage of
the appli cati on program and associ ated data.
BASIC: Begi nners All-Purpose Symboli c I nstructi on Codea versati le, easy to learn
computer language, commonly used for si mple programmi ng tasks.
battery backup: A battery or set of batteri es that provi de power to mai ntai n the
contents of processor memory i n case of a system power outage. Note: Processors
uti li zi ng EEPROM memory typi cally do not requi re battery backup.
BCD: Bi nary Coded Deci malA bi nary system i n whi ch each deci mal di gi t from 0 to 9 i s
represented by four bi nary di gi ts ( bi ts) . A thumbwheel swi tch i s usually a BCD
devi ce, and when connected to a programmable controller, each decade, or deci mal
place, requi res four wi res.
142
A
binary: A numberi ng system usi ng only the di gi ts 0 and 1. Also called base 2.
bit: T he smallest storage locati on i n memory. A bi t contai ns ei ther a 1 ( On/True)
or a 0 ( Off/False) .
Boolean operators: Logi cal operators such as AND, and OR, that can be used si ngly
or i n combi nati on to form logi cal statements or ci rcui ts. T hese statements must have
an output response whi ch i s ei ther True ( 1) or False ( 0) .
branch: A parallel logi c path wi thi n a ladder logi c rung.
bus: 1) A group of li nes used for data transmi ssi on or control. 2) Power di stri buti on
conductors.
byte: A group of adj acent bi ts usually operated upon as one uni t, such as when movi ng
to and from memory. T here are ei ght bi ts i n one byte. A byte i s capable of stori ng
and di splayi ng a numeri c equi valent between 0 and 255.
C: A computer system programmi ng language i ni ti ally developed for the UNI X
operati ng system.
communication scan: A part of the PLCs operati ng cycle that manages
communi cati on wi th other devi ces, such as a hand-held programmer. See also input
scan, output scan, and program scan.
condition instruction: I nstructi on pertai ni ng to the i nput porti on of a rung on a
ladder di agram. I t i s the condi ti on or status of these i nstructi ons that determi ne how
the control i nstructi on i s to be controlled. See also control instruction.
contact: 1) One of the conducti ng parts of a connector, swi tch, or relay that are engaged
or di sengaged to open or close an electri cal pathway. 2) Wi th reference to PLC ladder
logi c programs: a condi ti on that provi des a logi cal pathway ( conti nui ty) when True.
contact symbology: A set of symbols used to express logi c ( the control program) usi ng
conventi onal relay symbols. For i nstance, -] [- i ndi cates a normally open contact, -]/[-
i ndi cates a normally closed contact, and -( ) - i ndi cates a relay coi l or output.
143
A
continuity: Havi ng the capabi li ty of passi ng a voltage, logi c state, or any other
si gnal uni mpeded.
control instruction: I nstructi on pertai ni ng to the output porti on of a rung on a ladder
di agram. T hese commands detai l exchanges of data wi th external output devi ces or
i nternal devi ces such as ti mers, counters, math functi ons or other hi gh-level
i nstructi ons. See also condition instruction.
controller: A devi ce capable of controlli ng other devi ces. For example, a
programmable controller i s used to moni tor i nput devi ces, i mplement logi c, and
control output devi ces.
counter: A devi ce or software i nstructi on that counts the occurrence of some event. I t
may be pulses resulti ng from operati ons such as swi tch closures, or other di screte
events.
CPU: Central Processi ng Uni tT he deci si on-maki ng secti on of a programmable
controller that executes the i nstructi ons contai ned i n the user program.
CSA: Canadi an Standards Associ ati onAn agency whi ch regulates the speci fi cati ons
and testi ng requi red of electri cal devi ces used i n Canada.
cycle: A si ngle sequence of operati on. I n the PLC, one full operati ng scan from start
to fi ni sh.
data: Wi thi n the PLC, a general term for any type of i nformati on stored i n memory.
data table: T he part of the PLC memory that contai ns I /O values and fi les where data
i s moni tored, mani pulated, and changed for control purposes.
debug: T he process of locati ng the source of control system malfuncti ons and
correcti ng the problems.
diagnostics: T he detecti on and i ndi cati on of errors or malfuncti ons.
digital: I nformati on presented as a di screte value; 1 or 0. Compare wi th analog.
144
A
drum timer: A mechani cal devi ce, whi ch controls a sequenti al operati on by means of a
drum wi th pegs, where the presence of a peg represents a logi cal 1, and the
absence of a peg represents a logi cal 0. I ts operati on i s si mi lar to that of a musi c
box mechani sm.
EEPROM: Electri cally Erasable Programmable Read-Only MemoryA type of PROM
that i s programmed and erased by electri cal pulses. Data stored to a EEPROM wi ll
not be erased j ust by i nterrupti ng power to the chi p.
EIA: Electroni c I ndustri es Associ ati onAn agency whi ch sets electri cal/electroni c
standards. See also RS-232.
EMI: ElectroMagneti c I nterferenceMagneti c fi elds generated by electri cal devi ces.
execution time: T he ti me requi red to perform one speci fi c i nstructi on, a seri es of
i nstructi ons, or a complete program. T he executi on ti me for a gi ven i nstructi on may
vary dependi ng on the status of the i nstructi on ( True or False) and other parameters.
False: T he status of an i nstructi on that does not provi de logi cal conti nui ty on a
ladder rung.
fault: Any malfuncti on that i nterferes wi th the normal operati on of an appli cati on.
FET: Fi eld Effect Transi storA hi gh-performance, soli d state devi ce capable of
swi tchi ng hi gher current dc loads than transi stors.
FIFO (First-In First-Out): T he order i n whi ch data i s entered i nto and retri eved
from a fi le. See also LIFO (Last-In First-Out).
force: Software functi on that allows the programmer to energi ze or de-energi ze an
i nput or output i ndependent of the program logi c. I t i s used pri mari ly for
troubleshooti ng.
hardware: I ncludes all the physi cal components of the control system, i ncludi ng
the programmable controller, peri pherals and i nterconnecti ng wi ri ng. Compare
wi th software.
145
A
IEC: I nternati onal Electrotechni cal Commi ssi onAn i nternati onal associ ati on wi th
members representi ng electri cal manufacturers. T he I EC establi shes standards for
the constructi on and operati on of electri cal devi ces.
I/O (Inputs and Outputs): Consi sts of devi ces that provi de data to ( i nput) , and
recei ve data from ( output) the PLC.
input device: A devi ce, such as a pushbutton, sensor, or a swi tch of some sort, that
suppli es si gnals to the PLC.
input scan: Part of the controllers operati ng cycle. Duri ng the i nput scan, the
controller exami nes all i nput devi ces for an On or Off state. T hi s status i s
temporari ly wri tten to the i nput i mage memory fi le for use duri ng the program
scan. See also communication scan, program scan, and output scan.
instruction: A command defi ni ng an operati on to be performed by the controller. A
rung i n a program consi sts of a set of condi ti on ( i nput) i nstructi ons and control
( output) i nstructi ons. See also condition instructionand control instruction.
IP: I ngress Protecti onA desi gnati on code defi ned by I EC publi cati on number 529
speci fyi ng the level of resi stance an enclosure exhi bi ts towards penetrati on by
obj ects, dust or water.
ladder logic: A PLC program wri tten i n a format resembli ng an electri cal ladder
di agram. T he program i s used by a programmable controller to sense i nputs and
control output devi ces.
latch: A ladder program output i nstructi on that retai ns i ts state even though the
condi ti ons that caused i t to latch On may go Off. A latched output must be unlatched
to turn Off. A latched output wi ll retai n i ts last state ( On or Off) i f power i s removed.
LED: Li ght Emi tti ng Di odeA semi conductor di ode, the j uncti on of whi ch emi ts li ght
when passi ng a current. LEDs are used as di agnosti c i ndi cators on vari ous PLC
hardware components.
146
A
LIFO (Last-In First-Out): T he order i n whi ch data i s entered i nto and retri eved from
a fi le. See also FIFO (First-In First-Out).
limit switch: An electri cal swi tchi ng devi ce that i s actuated by some part and/or
moti on of a machi ne or equi pment.
logic: A process of solving complex problems through the repeated use of simple functions
that can be ei ther True or False. I t i s a general term for di gi tal ci rcui ts and programmed
i nstructi ons desi gned to perform deci si on-maki ng and computati onal functi ons.
Master Control Relay (MCR): A hard-wi red relay that can be de-energi zed by one of
any number of seri es-connected emergency stop swi tches. Whenever the master
control relay i s de-energi zed, i ts contacts open to de-energi ze all appli cati on I /O
devi ces.
memory: T he part of the controller where programs and data are stored.
mnemonic: An easy to remember term that i s used to represent a complex or lengthy
set of i nformati on.
modular controller: Programmable controller i n whi ch the power supply, processor,
and I /O i nterfaces resi de i n separate uni ts, or modules. Compare wi th packaged
controller.
NEMA Standards: Standards for the performance and constructi on of electri cal
equi pment that have been agreed upon and approved by the members of the
Nati onal Electri cal Manufacturers Associ ati on ( NEMA) .
normally closed contact: A swi tch or relay contact pai r that i s closed when the
swi tch or the coi l of the relay i s not acti vated, and open when the swi tch mechani sm
or coi l i s acti vated. Compare wi th normally open contact.
normally closed instruction: A ladder program symbol that wi ll allow logi cal
conti nui ty ( flow) i f the referenced address i s Off. Compare wi th normally open
instruction.
147
A
normally open contact: A swi tch or relay contact pai r that i s open when the swi tch
or the coi l of the relay i s not acti vated, and closed when the swi tch mechani sm or
coi l i s acti vated. Compare wi th normally closed contact.
normally open instruction: A ladder program symbol that wi ll allow logi cal
conti nui ty ( flow) i f the referenced address i s On. Compare wi th normally closed
instruction.
one-shot: A programmi ng i nstructi on that turns On a bi t for a si ngle program scan.
operating voltage: For i nputs, the voltage range needed for the i nput to be i n the On
state. For outputs, the allowable range for user-suppli ed voltage. T he PLC or other
control system i tself wi ll have a speci fi ed range of allowable voltage for system
operati on.
OR: A logi cal operati on that produces a True output when one of any number of
condi ti ons i s True, and a False output i f all condi ti ons are False.
output device: A devi ce, such as a pi lot li ght or a motor starter coi l, that i s controlled
by the PLC.
output scan: A part of the controllers operati ng cycle. Usi ng i nformati on obtai ned
duri ng the program scan about the status of the output devi ces, the controller
energi zes or de-energi zes i ts output ci rcui ts to control output devi ces. See also
communication scan, input scan, and program scan.
packaged controller: Programmable controller wi th the processor, power supply,
i nputs and outputs all i n one package. Compare wi th modular controller.
peripheral: External devi ces that are connected vi a a communi cati ons port to the
programmable controller, usually for programmi ng, data exchange or operator
i nterface.
power supply: Electri cal ci rcui t that fi lters, condi ti ons and suppli es appropri ate
voltages for system components and ci rcui try.
148
A
processor: A central processi ng uni t. See also CPU.
program: A set of i nstructi ons stored i n memory that are executed i n a predetermi ned
order by the central processi ng uni t.
program scan: A part of the controllers operati ng cycle. Duri ng the program scan the
ladder logi c program i s executed and the output data fi le i s updated based on the
logi c of the program and the status of the i nput data fi le. See also communication
scan, input scan, and output scan.
RAM: Random Access MemoryA fast, volati le ( when power i s i nterrupted, data i s lost)
form of memory. Each bi t i n RAM can be stored or retri eved i n the same amount of
ti me, at any ti me. Commonly referred to as read/wri te memory because i t can be
wri tten to as well as read from. T hi s type of memory typi cally uses a battery or
capaci tor for back up power.
read: To acqui re data from a memory locati on. For example, the controller reads
i nformati on from the i nput data fi le to solve the program.
register: A temporary storage space for vari ous types of i nformati on and data, such as
ti mer or counter values. I n PLCs, a regi ster i s normally 16 bi ts wi de ( 1 word) .
relay: An electri cally operated mechani cal devi ce, the contacts of whi ch open and
close based on the presence of an electri cal si gnal.
relay logic: A program wri tten wi th relay symbols ( contacts and coi ls) . Relay logi c i s
commonly referred to as contact symbology.
retentive data: I nformati on ( data) stored i n memory that i s not lost when power
i s i nterrupted.
RS-232: An EI A standard that speci fi es electri cal and mechani cal characteri sti cs for
seri al bi nary communi cati ons. I t i s a si ngle-ended seri al communi cati on i nterface.
rung: Ladder logi c i s compri sed of a set of rungs. A rung contai ns condi ti on ( i nput)
and control ( output) i nstructi ons.
149
A
SBC: Si ngle Board ControllerA custom control soluti on usi ng a propri etary electroni c
ci rcui t board desi gned to control one speci fi c appli cati on.
scan time: T he ti me requi red to read all i nputs, execute the control program, and
update all outputs.
sequencing: Usi ng a software devi ce to i ni ti ate or termi nate events i n a desi red sequence.
solenoid: A devi ce that transforms electri cal current i nto li near ( mechani cal) moti on;
i t consi sts of one or more electromagnets that move a metal plunger. T he plunger i s
someti mesreturned to i ts ori gi nal posi ti on after excursi on wi th a spri ng or
permanent magnet.
solid state: Ci rcui try desi gned usi ng only i ntegrated ci rcui ts, transi stors, di odes, etc.;
no relays or other electromechani cal devi ces are used.
software: 1) T he ladder logi c program stored i n the PLC. 2) Executable programmi ng
package used to develop ladder logi c programs. Compare wi th hardware.
system: A set of one or more PLCs that, together wi th I /O devi ces, computers,
associ ated software, peri pherals, termi nals and communi cati ons networks,
provi de a means of performi ng i nformati on processi ng for the control of machi nes
or processes.
system memory: T he total memory space wi thi n the controller, i ncludi ng the user
program, data and the operati ng system.
terminal: A poi nt on a PLC where external I /O devi ces, such as a pushbutton or pi lot
li ght, are wi red.
throughput: T he amount of ti me i t takes to sense an i nput and energi ze the
correspondi ng output.
thumbwheel switch: A rotary swi tch used to i nput numeri cal i nformati on i nto a
controller.
150
A
time base: T he uni t of ti me used by a ti mer to regi ster events. A one second ti me base
i s accurate to the nearest second. Many controllers are capable of operati ng wi th .01
or .001 second ti me bases.
transistor: A soli d state, electroni c devi ce that functi ons as an electri cally controlled
swi tch commonly used to control dc loads. A component of dc output ci rcui ts.
triac: A soli d state, electroni c devi ce that functi ons as an electri cally controlled swi tch
for ac loads. A component of ac output ci rcui ts.
True: T he status of an i nstructi on that provi des logi cal conti nui ty on a ladder rung.
UL: Underwri ters Laboratori esAn agency that recommends mi ni mum speci fi cati ons
for the constructi on and operati on of electri cal equi pment used i n the Uni ted States.
UL also tests equi pment to determi ne adherence to those speci fi cati ons.
watchdog timer: A ti mer that moni tors the logi cal operati ons wi thi n the ci rcui try of
the processor. I f the ti mer ever ti mes out, i t i ndi cates that there i s a problem wi th
the normal operati on of the processor, and operati on i s termi nated.
word: A uni t of memory composed of 16 i ndi vi dual bi ts. Words or porti ons of words are
used when programmi ng i nstructi ons, or performi ng math operati ons.
write: To move or copy data to a memory locati on. For example, the controller wri tes
the i nformati on to the output data fi le based on the logi c of the ladder program.
151
153
Appendi x B
Sampl e Input and Out put Devi ces
Input Devices
I nput devi ces are fi eld devi ces that act as
i nformati on gatherers for the PLC. T hi nk of them as
the eyes and ears of the PLC. Most mi cro PLCs need
to recogni ze a di screte ( On or Off) si gnal. I nput
devi ces typi cally communi cate wi th the PLC by
swi tchi ng current On or Off by ei ther electromechani cal
or soli d state contacts. Soli d state i nput devi ces li ke
transi stors, FETs and tri acs are sensi ti ve to i nput
wi ri ng condi ti ons, polari ty and leakage current i ssues.
Electromechani cal i nput devi ces such as swi tches and
relays close sets of contacts to allow current to pass,
and as such are less sensi ti ve to those si tuati ons.
Check the speci fi cati ons for the sensors and the PLC
before maki ng connecti ons. I t i s li kely that the
manufacturer of the sensor or swi tch you are usi ng
has a versi on of the devi ce that i s appropri ate for use
wi th your parti cular mi cro PLC.
B
B
Operator-Manipulated Switches
T he pushbutton swi tch i s one of the si mplest and
most commonly used forms of i nput control.
Pushbuttons are used to start and stop equi pment,
and to i ni ti ate processes.
Selector swi tches i ncorporate an operator, or
swi tch mechani sm, that has several posi ti ons. Selector
swi tches use a rotary moti on of the knob or other
operator to accompli sh swi tchi ng.
Foot swi tches are used where the operators
hands need to be used to mani pulate other
thi ngs whi le operati ng the equi pment, or where
repeti ti ve hand operati ons of a swi tch mi ght cause
the operator di scomfort.
Thumbwheel swi tches are a common way of
enteri ng numeri cal data i nto a control ci rcui t. Each
di gi t, or decade, has a physi cal marki ng that represents
a number from 0 to 9. Each decade requi res four
i nputs to connect i t to the PLC. By changi ng the
sequence of Ons and Offs ( BCD code) the swi tch
tells the controller what number has been entered.
154
B
Limit Switches
Li mi t swi tches are used to sense the posi ti on of
obj ects or materi als. Conveyors, doors, swi ngarms,
valves and many other devi ces use li mi t swi tches to
provi de control system i nformati on on the physi cal
posi ti on of equi pment. T he li mi t swi tch uses an
actuati ng mechani sm to make or break swi tch
contacts. Many types of actuati ng mechani sms are
avai lable, but the most common are the roller lever,
the push roller, the fork lever, and the wobble sti ck.
Float Switches
Float swi tches are the easi est means to moni tor
li qui d level i n a contai ner. T hey are typi cally used i n
wet wells, tanks, sumps, reservoi rs, etc. As the li qui d
level i n the contai ner changes, the actuati ng
mechani sm moves. Control of the level of li qui d i n the
contai ner i s achi eved by setti ng the li mi t swi tch to
acti vate at a desi red li qui d level.
Flow Switches
A flow swi tch i s i nserted i nto a pi pe or duct to
sense the movement of a flui d. T he flui d mi ght be ai r,
water, oi l, or some other gas or li qui d. T he sensi ng
element i s a valve or vane that extends i nto the flui d
stream. T he vane wi ll move and actuate electri cal
contacts whenever the flow i s suffi ci ent to exceed a
preset spri ng tensi on on the vane.
155
B
Pressure Switches
Pressure swi tches are used to detect a pressure
level and provi de di gi tal feedback to the PLC i f the
level exceeds a speci fi ed amount. T hey are typi cally
used to noti fy the control system or operator that an
excessi ve pressure condi ti on exi sts. Pressure swi tches
use a spri ng-loaded bellows mechani sm to close
contacts. Pressure of the flui d bei ng sensed i s di rected
i nto the bellows by tubi ng or other means. When the
pressure i n the bellows exceeds the preset spri ng
tensi on, the swi tch i s actuated.
Temperature Switches
Temperature swi tches are typi cally used to detect
overtemperature condi ti ons. When the temperature of
the obj ect or process bei ng moni tored approaches a
preset threshold, the devi ce swi tches. Bi metalli c and
bulb/capi llary type temperature swi tches typi cally use
swi tchi ng contacts, whi le thermocouple swi tches
typi cally use soli d state outputs.
Encoders
An encoder i s a form of sensor that changes rotary
moti on i nto hi gh-speed pulses. Encoders are ei ther
i ncremental, whi ch track speed and di recti on of
moti on of a shaft, or absolute, whi ch track shaft
posi ti on at all ti mes. T he number of pulses generated
corresponds to di stance or degree of shaft rotati on.
156
B
Proximity Sensors
Proxi mi ty sensors are used to detect the presence
or absence of an obj ect wi thout maki ng contact wi th
i t. Capaci ti ve sensors sense the change i n di electri c
fi eld strength as an obj ect moves closer to and further
from the sensor. I nducti ve sensors depend upon the
changes i n i nductance wi thi n a coi l when a metalli c
obj ect comes wi thi n range of the sensor. Whi ch sensor
i s appropri ate for a gi ven appli cati on depends on the
materi al to be sensed.
Photoelectric Sensors
Photoelectri c sensors use a li ght beam to detect
obj ects. T here are three basi c types of photoelectri c
sensors:
I n transmi tted beamsensors, the obj ect bei ng
sensed moves between a li ght source and a recei ver
module that contai ns the photodetector.
I n retroreflecti vetype sensors, the obj ect to be
sensed moves between the sensor, ( whi ch contai ns
both the li ght source and the photodetector) and a
reflector.
I n di ffusesensors, the natural reflecti vi ty of the
obj ect bei ng sensed causes the return si gnal that
tri ggers the photodetector.
157
B
Ultrasonic Proximity Sensors
Ultrasoni c proxi mi ty sensors use the comparati ve
strength of the return si gnal from a proj ected
ultrasoni c si gnal to sense how far an obj ect i s from the
source of the sound, i n much the same way that a bat
navi gates duri ng fli ght. T hey are typi cally used to
detect the level of materi als.
Output Devices
Output devi ces are fi eld devi ces used to carry out
the control i nstructi ons for the PLC. T hi nk of them as
the hands and feet of the PLC. T he mi cro PLC i s
capable of acti vati ng a large vari ety of output devi ces.
Output voltage and current characteri sti cs of the PLC
are the only li mi ti ng factors for output devi ce
appli cati on. T he followi ng i s a li sti ng of the most
popular output devi ces:
Lamps
Lamps are used to i ndi cate status of an operati on
or to warn of undesi rable or dangerous condi ti ons.
Lamp color can be used to di fferenti ate functi ons or
parameters. Lamps come i n several di fferent types:
i ncandescent, flourescent, neon and LEDs. Supply
voltage and current, lamp li fe and cost are the three
vari ables whi ch determi ne whi ch lamp i s best for a
gi ven appli cati on.
158
B
Audible Alarms
Audi ble alarms are avai lable i n the form of horns,
buzzers, bells, chi mes, capaci ti ve alerters, and even
synthesi zed voi ce modules. All may be used i n the
control process to alert the machi ne operator to a
condi ti on or event.
Relays
Electromechani cal relays use a low amperage
control si gnal to electromagneti cally engage a set of
contacts. T hi s set of contacts i s used to swi tch a
current that can be much hi gher than the ori gi nal
control si gnal. I n a si mi lar fashi on, semi conductor
devi ces li ke transi stors, FETs, tri acs or other devi ces
can use a lower amperage output from a PLC to
swi tch a hi gher current load. T hese devi ces are
someti mes referred to as soli d state relays.
Contactors
Contactors are relays that are able to swi tch hi gh
current loads ( >10A) . T he coi l voltage of a large
contactor i n many cases must be swi tched by a relay
contact, because the coi l operati ng current i s hi gher
than the output current of the PLC. Contactors are
used for swi tchi ng motors, heaters, etc.
159
B
Motor Starters
Motor starters are contactors whi ch have the
protecti on of an overload ci rcui t. An overload ci rcui t
protects the motor from damage i f operati ng current
i s less than the starti ng i nrush current ( the current
rati ng of the fuses) , but greater than the current
normally observed duri ng operati on.
Solenoids
Solenoi ds convert electri cal si gnals to mechani cal
moti on. An electromagneti c coi l attracts a plunger or
other mechani sm to an alternate posi ti on when
energi zed. Spri ng tensi on or gravi ty i s used to return
the plunger to the ori gi nal posi ti on when the
electromagnet i s de-energi zed. Solenoi ds are most
commonly used as part of other machi nes or
components.
Valves
Solenoi d operated valves are a very common type
of output devi ce. A li near solenoi d operates the valve
mechani sm to control the flow of materi als i n a
process. T he addi ti on of the valve allows the PLC to
control pneumati c and hydrauli c operati ons i n
addi ti on to electri cal and electromechani cal
operati ons.
160
C
161
Appendi x C Inst r uct i on Execut i on Ti mes
Typical Instruction Execution Times and Memory Usage
T he table below li sts the executi on ti mes and memory usage for controller i nstructi ons typi cally shown i n a PLC.
Instruction Type Name Mnemonic Time needed to Time needed to Memory
execute the execute as a usage
instruction when True (1) statement (user
it is not True (0) (approx. sec.) words)
(approx. sec.)
Appli cati on Speci fi c Bi t Shi ft Left BSL 19.80 53.71 + 5.24 x 2.00
posi ti on value
Appli cati on Speci fi c Bi t Shi ft Ri ght BSR 19.80 53.34 + 3.98 x 2.00
posi ti on value
Appli cati on Speci fi c I nterrupt Subrouti ne I NT 0.99 1.45 0.50
Appli cati on Speci fi c Selectable T i mer I nterrupt Di sable ST D 3.16 6.69 0.50
Appli cati on Speci fi c Selectable T i mer I nterrupt Enable ST E 3.16 10.13 0.50
Appli cati on Speci fi c Selectable T i mer I nterrupt Start ST S 6.78 24.59 1.25
Appli cati on Speci fi c Sequencer Compare SQC 27.40 60.52 2.00
Appli cati on Speci fi c Sequencer Load SQL 28.12 53.41 2.00
Appli cati on Speci fi c Sequencer Output SQO 27.40 60.52 2.00
Basi c Count Down CT D 27.22 32.19 1.00
Basi c Count Up CT U 26.67 29.84 1.00
Basi c Exami ne i f Closed XI C 1.72 1.54 0.75
Basi c Exami ne i f Open XI O 1.72 1.54 0.75
Basi c One-Shot Ri si ng OSR 11.48 13.02 1.00
Basi c Output Energi ze OT E 4.43 4.43 0.75
Basi c Output Latch OT L 3.16 4.97 0.75
Basi c Output Unlatch OT U 3.16 4.97 0.75
Basi c Reset RES 4.25 15.19 1.00
( ti mer/
counter)
Basi c Retenti ve T i mer RT O 27.49 38.34 1.00
Basi c T i mer OffDelay T OF 31.65 39.42 1.00
Basi c T i mer OnDelay T ON 30.38 38.34 1.00
Compari son Equal EQU 6.60 21.52 1.50
Compari son Greater T han GRT 6.60 23.60 1.50
Compari son Greater T han or Equal GEQ 6.60 23.60 1.50
Compari son Less T han LES 6.60 23.60 1.50
Compari son Less T han or Equal LEQ 6.60 23.60 1.50
Compari son Li mi t Test LI M 7.69 36.93 1.50
Compari son Masked Compari son for Equal MEQ 7.69 28.39 1.50
C
Compari son Not Equal NEQ 6.60 21.52 1.50
Data Handli ng And AND 6.78 34.00 1.50
Data Handli ng Convert from BCD FRD 5.52 56.88 1.00
Data Handli ng Convert to BCD T OD 6.78 49.64 1.00
Data Handli ng Decode 4 to 1 of 16 DCD 6.78 27.67 1.50
Data Handli ng Encode 1 of 16 to 4 ENC 6.78 54.80 1.50
Data Handli ng Exclusi ve Or XOR 6.92 33.64 1.50
Data Handli ng FI FO Load FFL 33.67 61.13 1.50
Data Handli ng FI FO Unload FFU 34.90 73.78 + 4.34 x 1.50
posi ti on value
Data Handli ng Fi le Copy COP 6.60 27.31 + 5.06/ 1.50
word
Data Handli ng Fi ll Fi le FLL 6.60 26.86 + 3.62/ 1.50
word
Data Handli ng LI FO Load LFL 33.67 61.13 1.50
Data Handli ng LI FO Unload LFU 35.08 64.20 1.50
Data Handli ng Masked Move MVM 6.78 33.28 1.50
Data Handli ng Move MOV 6.78 25.05 1.50
Data Handli ng Negate NEG 6.78 29.48 1.50
Data Handli ng Not NOT 6.78 28.21 1.00
Data Handli ng Or OR 6.78 33.68 1.50
Hi gh-Speed Counter Hi gh-Speed Counter HSC 21.00 21.00 1.00
Hi gh-Speed Counter Hi gh-Speed Counter HSD 7.00 8.00 1.25
I nterrupt Di sable
Hi gh-Speed Counter Hi gh-Speed Counter HSE 7.00 10.00 1.25
I nterrupt Enable
Hi gh-Speed Counter Hi gh-Speed Counter Load HSL 7.00 66.00 1.50
Hi gh-Speed Counter Hi gh-Speed Counter Reset RES 6.00 51.00 1.00
( hi gh-speed counter)
Hi gh-Speed Counter Hi gh-Speed Counter RAC 6.00 56.00 1.00
Reset Accumulator
Hi gh-Speed Counter Update Hi gh-Speed Counter OT E 7.00 12.00 0.75
I mage Accumulator ( hi gh-speed counter)
Math Add ADD 6.78 33.09 1.50
Math Clear CLR 4.25 20.80 1.00
Math Di vi de DI V 6.78 147.87 1.50
Math Double Di vi de DDV 6.78 6.00 1.00
Math Multi ply MUL 6.78 57.96 1.50
Math Scale Data SCL 6.78 169.18 1.75
162
Instruction Type Name Mnemonic Time needed to Time needed to Memory
execute the execute as a usage
instruction when True (1) statement (user
it is not True (0) (approx. sec.) words)
(approx. sec.)
C
163
Math Square Root SQR 6.78 71.25 1.25
Math Subtract SUB 6.78 33.52 1.50
Program Flow Control I mmedi ate I nput wi th Mask I I M 6.78 35.72 1.50
Program Flow Control I mmedi ate Output wi th Mask I OM 6.78 41.59 1.50
Program Flow Control Jump to Label JMP 6.78 9.04 1.00
Program Flow Control Jump to Subrouti ne JSR 4.25 22.24 1.00
Program Flow Control Label LBL 0.99 1.45 0.50
Program Flow Control Master Control Reset MCR 4.07 3.98 0.50
Program Flow Control Return from Subrouti ne RET 3.16 31.11 0.50
Program Flow Control Subrouti ne SBR 0.99 1.45 0.50
Program Flow Control Suspend SUS 7.87 10.85 1.50
Program Flow Control Temporary End T ND 3.16 7.78 0.50
Instruction Type Name Mnemonic Time needed to Time needed to Memory
execute the execute as a True usage
instruction when (1) statement (user
it is not True (0) (approx. sec.) words)
(approx. sec.)
D
164
Appendi x D Sampl e Pr ogr am Wor ksheet s
Throughput Time Worksheet
T hroughput i s the amount of ti me i t takes for the PLC to sense an i nput and energi ze the correspondi ng
output. Components of throughput ti me i nclude: ti me for the PLCs i nput ci rcui t to sense the si gnal; ti me for
the i nput, output and program scans; ti me for actuati on of the PLCs output ci rcui ts; and ti me for the CPUs
housekeepi ng functi ons.
Once your program i s wri tten, use the followi ng worksheet to esti mate PLC throughput ti me. To assi st you,
typi cal ti mes have been provi ded where needed. To determi ne actual throughput ti me, consult your PLC users
manual. T hi s i s very i mportant, as executi on ti mes di ffer between PLC manufacturers.
Procedure Maximum Scan Time
1. I nput scan ti me 8 s ( typi cally)
2. Output scan ti me 8 s ( typi cally)
3. Housekeepi ng ti me 180s ( typi cally)
4. To esti mate program scan ti me, take your
program and add i nstructi on executi on
ti mes when all i nstructi ons are True s*
5. To esti mate program throughput ti me:
A. Wi thout communi cati ons**, add secti ons 1-4 s
B. Wi th communi cati ons, add secti ons 1-4 and multi ply by 1.05 s
6. PLC i nput ci rcui t fi lter ti me s
7. PLC output ci rcui t turn-on ti me s
8. To esti mate total throughput ti me for the PLC, add secti ons 5-7 s
(Note Thi s wi ll result i n the worst case, or longest possi ble throughput ti me)
* An example set of i nstructi on executi on ti mes i s provi ded i n Appendi x C.
** Communi cati on wi th devi ces, such as a Hand-Held Programmer, a personal computer, or an electroni c
operator i nterface.
D
165
Estimating Memory Usage for The Control System
Once your program i s wri tten, use the followi ng worksheet to esti mate memory usage. To assi st you, typi cal
words of memory have been provi ded where needed. To determi ne actual memory usage, consult your PLC
user manual. T hi s i s very i mportant, as the amount of memory consumed by vari ous i nstructi ons di ffer between
PLC manufacturers.
1. Determi ne the total number of i nstructi on
words used by the i nstructi ons i n your
program and enter the result *
2. Multi ply the total number of rungs by
0.75 and enter the result do not count
Start of Fi le or End of Fi le rungs
3. Words allocated by controller 280 ( typi cally)
4. Add steps 1-3 for total esti mated memory usage
5. Subtract the total from 1024 to determi ne
memory remai ni ng
I mportant: T he calculated memory usage i s only an esti mate. Actual memory usage can vary by 10 to 15% .
* An example set of i nstructi on memory usage i s provi ded i n Appendi x C.
address 24-25, 38, 76-79, 84, 86, 91-92, 142
AND logi c 12, 44, 46, 97, 142
appli cati on memory 22, 142
auxi li ary holdi ng contact 47-48, 76
BASI C programmi ng language 34, 142
basi c i nstructi ons 161
battery backup 23, 142
BCD 10, 12, 24, 142
Boolean 12, 34, 143
branchi ng i nstructi ons 46-48
bus 35, 143
C programmi ng language 34, 143
communi cati on wi th programmi ng devi ce 31
communi cati on wi th operator i nterface 5, 31
compari son i nstructi ons 44, 117, 161
condi ti on i nstructi ons 42, 44-46, 75-76, 143
contact symbology 39, 143, 149
control i nstructi ons 37-38, 44, 46, 144
counter i nstructi ons 111, 113, 128-129
I
N
D
E
X
Index
167
CSA 62, 144
EEPROM 22-23, 145
EMI 27-28, 145
FET 21, 68-69, 145
floati ng poi nt deci mal 24
functi on blocks 22, 43-44, 106-108, 110, 120
GM 2, 64
Gray code 24
hexadeci mal 24
HHP, fault codes 91-92
HHP, use i n programmi ng 28-30
HHP, use i n troubleshooti ng 30, 85, 88, 91
hi gh-speed counter 14, 69-70, 128-129
I EC 146
i nput devi ce 18-19, 43, 84-85, 90, 146, 153-158
i nput scan 22, 26, 40-41, 146
i nstallati on 62-63, 80-82
i nstructi on set 12-14, 96, 161-163
i nteger 24, 114-116
I P 59, 80, 146
ladder logi c 4, 36-44, 49, 70, 72, 146
languages, programmi ng 3-4, 30, 34, 142-143
latched output 76, 146
li mi t swi tch 19, 55, 57, 147, 155
logi cal conti nui ty 38-45, 96-96, 145, 147, 148, 151
math i nstructi ons 9, 12, 120-122, 162-163
mi cro PLC, capabi li ti es 13-14
mi cro PLC, characteri sti cs 9-10
mi cro PLC, i ntroducti on 8-9
mi cro PLC, typi cal appli cati ons 14
mi cro PLC, typi cal features 8-9
mnemoni c 34-35, 147
168
I
N
D
E
X
modular controller 13, 147
NEMA 4 80, 147
NEMA 12 80, 147
normally closed i nstructi on 39-40, 75, 91, 108-111, 147
normally open i nstructi on 39-40, 43, 75, 91, 99, 111, 147
octal 24
operati ng cycle 24-27, 49, 143, 146, 148, 149
operator i nterfaces 5, 18, 30-31, 58-59, 148
opti cal i solati on 19-20
OR logi c 12, 44-46, 76, 96, 143, 148, 162
OSR ( one-shot ri si ng) 100, 161
output devi ce 20, 24, 42, 53-54, 84, 86, 90, 148, 158-160
output i mage fi le 26
output scan 26-27, 40-42, 148
packaged controller 11, 13, 148
photoelectri c sensors 19, 55, 57, 157
PLC, advantages over relays 2, 61
PLC, economi c benefi ts 2-5, 61
PLC, hi story of 2-3
PLC, typi cal appli cati ons 5-6
power suppli es 11, 18, 26-28, 148
program fi le 21-22
program pri ntout 84, 90
program scan 14, 26-27, 49, 70, 149
programmi ng examples 57-61, 68, 72-79, 96-140
proxi mi ty sensors 14, 19, 157-158
pushbuttons 19, 31, 39, 41, 43, 58, 98, 154
RAM 22, 23, 149
regi ster 24, 149
retenti ve data 22, 149
retenti ve ti mers 12, 111
RS-232 31, 149
I
N
D
E
X
169
RES ( reset) 112, 161
rung 35-46, 49, 72, 149
SBC, descri pti on 52, 150
SBC, typi cal appli cati on 60
SBC, use of 62-65
solenoi d 20, 43, 52, 82, 86, 123, 150, 160
system memory 22, 142, 150
temperature li mi tati ons 59, 80-81
throughput ti me 27, 150, 164
thumbwheel swi tches 19, 24, 31, 58, 142, 150, 154
ti me base 106-111, 151
ti mer i nstructi ons 12, 37, 43-44, 112, 161
transi stor 21, 68, 69, 145, 150, 151, 153, 159
tri ac 21, 68, 69, 151, 153, 159
twi sted-pai r cable 59, 81
UL 62, 151
warni ng lamps 20, 158
I
N
D
E
X
170
1761-MMB September 1995 1995 Allen-Bradley Company, Inc. Printed in USA
Micro Programmable Logic Controllers
Small enough to fi t i n one hand, the compact mi cro PLC provi des a powerful soluti on to todays
electroni c control appli cati ons from the si mple to the complex at an affordable pri ce.
T he MicroMentor reference book serves as an i ntroducti on to mi cro PLCs for anyone, from desi gn
engi neers or electri cal techni ci ans to mai ntenance personnel and students. Whi le some knowledge of basi c
electroni c controls i s helpful, i t i s not requi red, nor i s previ ous experi ence wi th programmable logi c controllers.
T hrough easy-to-understand text and numerous i llustrati ons, the reader wi ll gai n a practi cal
understandi ng of mi cro PLCs. Mi croMentor demonstrates the advantages of mi cro PLCs over
electromechani cal controls, and i t helps readers evaluate the best control system for thei r appli cati on.
Topi cs covered i nclude:
Hi story of PLCs
Mi cro PLC capabi li ti es and operati on
Programmi ng wi th ladder logi c
How to apply a mi cro PLC
Commi ssi oni ng and troubleshooti ng
Appli cati on examples
Worldwide representation.
Allen-Bradley Headquarters, 1201 South Second Street, Milwaukee, WI 53204 USA, Tel: (1) 414 382-2000 Fax: (1) 414 382-4444
Argentina Australia Austria Bahrain Belgium Brazil Bulgaria Canada Chile China, PRC Colombia Costa Rica Croatia Cyprus Czech Republic Denmark
Ecuador Egypt El Salvador Finland France Germany Greece Guatemala Honduras Hong Kong Hungary Iceland India Indonesia Ireland Israel Italy
Jamaica Japan Jordan Korea Kuwait Lebanon Malaysia Mexico Netherlands New Zealand Norway Pakistan Peru Philippines Poland Portugal
Puerto Rico Qatar Romania RussiaCIS Saudi Arabia Singapore Slovakia Slovenia South Africa, Republic Spain Sweden Switzerland Taiwan Thailand
Turkey United Arab Emirates United Kingdom United States Uruguay Venezuela Yugoslavia
Allen-Bradley, a Rockwell automation business, has been helping its customers improve
productivity and quality for more than 90 years. We design, manufacture and support a broad
range of automation products worldwide. They include logic processors, power and motion control
devices, operator interfaces, sensors and a variety of software. Rockwell is one of the worlds
leading technology companies.

You might also like