Beruflich Dokumente
Kultur Dokumente
I RegisterBasics
9 PLC Timer Functiqns
L0 PLC CounterFunctions
a
RegisterBasics
OUTLINE
o E-2 Ceneral
8-l Introduction Cha&.terisrirs : t-3 HoldinsRegkters
oiRegisrers
E E-4 lnputRgistersr
Single
andCrou!-- t-S outpurRegisters:
SingleandCroup^
OBJECTIVES
youwill beeblero
Al theendofthischapter,
E Lis!rhefivecornmon
typesof PLCragisrels.
E Describethe functionof eachof theive reeisrer
1!pes.
o Describehow eachof th fiVecommontypesoiPLC regisrer!is usedin pLC
tt1
8
8-3 HOLDINGREGISTERS
A holding,or working,register(HR) ''holds-lhe i.:::;iis of q calcqlalion. arirh-
,!9!g a. 19cjc.Conceptually,it is in the midCl. .,4:heCPU. as shownin fig-
ufe 8-1.
Because in manyPLCs,panicularly smalleror.i. ::e holdingregisteris not
dircctlyaccessible to inpuls or outputs.inpul and ri:.!t rcgrslers(singleor
group)interlhcethe holdingrcgistercontentsto the L.ulirtie$orld. Signaldala
from a specificinputdeviceis first "deposired. in lhe lorln of0s and ls, in an
iiso inputregister.ll may $en be manipulated by the microprocessor and rhe resuhs
he mtcroprocessoi sentto a holdingregis!er.Conversely, bforetheconte.lsof the holdingregisrer
.rb! the user.These canallccltheoutputdevice,theyarelransfefrd ro an ou:!ur regisrer.
The outpur
.focessor)help regisle.'s0s and ls "drive" oulputintedacede!ice\ sucha! optoisolators.
ther
'nTyout theirtasks.i To illustrateholdingregisteruse,we can look L.riefl!at rheir functionin
on code reglsters; arithmetic,timer,andcounleropefations.Keepin mind.rho!!h. lhatnot only are
temporafllyst theseoperations covcrcdin muchgreaterdctailin larer.h.ti.rs. buralsoholding
riammedfunctions,. .egistersareusedin numerous otherfunctions thatarcao\ eredIn futurechaDters,
. arsocontatnsslots / In arithmetic operarions. a holJingregistermign(rJ.iJrn rhe fir(r Jp;rdnd:
OnS ,Or a d d reS S eS , \another holding register,
lhe second operand; and a final holdingregisler,rhe
' \le assumthese ldestination of the mathematical manipulation(see figure 8-:).
5uch rcglsrersor / In the timer function,the presettimevalue would t'e placed
lheuserprogram, /(\ designatedregister.The holding registeris the registerin which
. lora 0 , Yo uca n tlr place(seefigure8-3A).
on a keyboard.Il The tefr lulnctlon
nI( I ilar (
ncti( IS Ssimilr Gee figure B ).
:8--3 8 . The presetcountvalueis
.i a typed printout. alsoplacr ed l n ons slant isigna
lant ot des latedd regtster.Th ,ldingreginer.ofcourse.is
ronlentsor prinling ist,fi n 'nclhthec rt tak
the regist *es l
.':;:r;xi:::i
\lems.Dependi Ho'" many Ldina iing re dste
I6. ln largemachinesthereare hundreds
there?in ! LallIPLCs
.r possibiliriesare
ll other PLCS art
nem. usuallythe FIGURE 8-I
PLC Registers(Reprintedfrom
rY numbers,as is w e b b , J .. a n d G .e s b o c kK, .
: OG2,represents t993.Indusnial Caf,ttu|Elec-
merical seriesof tr,,i.r, 2nd ed. Macmillan.)
8-12 r@ 1000 3-t:
iodel of PLC has
iJ
O PE F A N OI I\-?L
HR 0 0 7 5 T}le :
O P EFA N2D
H B0076 .
INPUT lhat e.
DESTNATION One in
nals)-l
syslen:
FICURE8-2
Reeiste6in Arithme!icOperations o
PFESETS WHEFETI.]E
or
FTGUREE.3 c
HoldingRegisters
in Timersand TIM]NGVALUE15SET,
ITMAYBEA CONSTANT I c
Counrers oi
ORA OESIGNATEDBEGiSTEB.
I
c
oi T
, 'T
o,-
a
c
c
I or
9
8gG. ISTI']EOESIGNATED L c
{HOLOING) AEGISTERIN ol
WI'IICHTHECOUNTTAKES c
PLACE. o C
T MEF l{
c
o c
P FE S E TJS W Ii E qE IH E F c
C OU N TV A LUSES E T.
LTMAYBEA CONS'TANI o C
OA A OESIGNATEO REGISTER. o
c
(
(
ON
ON
ON
-a U
I ON
ON
T
T ON
ON
ON
I
N ol
-!D L ON
<E S ON
l
o ON
N ON
o
n
ON InpulG|oupFegslerlG 0002
o ON
ON
ON
o!
I
33,4{l tG 0003
4$64 tG ooo4
FIGURE8-4
Scheme
tnputCroupRegister
I I E C I];1 E RB AS IC S
V
ON
FI(i
0 ia
r001 0000 1000 I r0o Die,
19 ON
2A ON
0 2r
c 22
0100 0011 1111 0001
23 ON
oG2 1" 25
2-<,
1011 I 0 t 0 0 t 0 0 1 l 0 l
\ \0 2i
ON
32 CN
29 ON
1 ON
OG3wouldbe 33-48 0 3r
32 ON
v
FICURE8-6
Outputcroup RegistefScheme
lll
OL T P L T REGISTERS:SINGLEAND GROt' P
_'1 _
L.i. :rr'np-r re!i..c . rne oulpJr-etr'rLrh.r'he -mc o-' c'hrr'cr' "
ihe holdingregisler. The outputre8isierdiffcrsfrom the inputregistr'however'
io rtrt lr is readityaccessible to th oLrlputmodules terrninxlsand ports The
numberof outpu!regislers is normallYequalto the numberof input reSislers'
The oulputgroupregister(OC) is ofSanized in a mannersrmrlarto the rnput
nrorpr.s,rt.r. lr diftcr' trom rhe IG rn a mrrner 'rr il rr ro Lhe'rrffcrcnce bet\^een
Figure 8-o hosr how rhe oC Icgi'ler lunc-
inouiree]'ren"nd ourpurreSr'rcrs
iiinr. O-n"OC.egi.t"r.an control l6outpttls lfaIisinab;lposition itwiLlturn
ii"ilii .o*"tpo"ai"g ourputon A 0 triLliurn ils corfesponding ouipulotT The
' groLn eg'l.r' r' ir l r 'r 'tre rnnJl gioup regr'ler
eruLrornr ichemefur oulpul
I,ren.-ttrc groulir; chcm( r"hotr'n nr''''-- l''rlo :rJrp regr\lrrl.
..'flr.uldrl\ ,.<iJl rn .cquen.<roprr"l or' .l : | 6
'n
: : - : . i :i 3 a ti d , or
' P. r n ,-i
^--j
EXERCISES
, - : ers i h a t c o. le- $hereea chr vpef it s
:: i- su re 8 i. l . L h tth e fi vc maj ortypesof reei stes U sea bbck di rgtrm to sho*
i n to rh e P L C scheme of operal ' on
Wh a r* ' o u l dthei nP u!groupregi stcrl ook l i kefoL(hethrcei npulmodul esl alusar r ange_
r" " ,' rr,.".i " ngi ,t" i -l l w h;! w oul dthe nufl berof 0r' h Io rtgj ncr beI whar would
rh erc g i rterconl eni s be. i n bi nary_?
-i_l o^ *
FIGURI]8.7
lT_l ore Diseramtbr Erercise2
ION .s!491 !1!!.e! sl!!!:
's -lorv
zo -!s- -!.9,
105 0N
-!9-
209 oFF
49 0N
21 0 0N
:r-l o.-r
-;;---1^--
50 0N
11.7 ON
52 0N io8 oFF 21 2 0N
do * 213 0N
2a loFr
-?!_-.] orr 55 0N 215 0N
--:o-'l or 56 0N 112 0N 216 oFF
57 0N 217 0N
li_l orr rS Bi( PLC) 218 0N
oFF
_4,
29
59
60
0N
OFF
219
llN 61 0N 221 oFF
:o--']or.r 62 0N 222 0N
223 0N
64 0N 224 oFF
l2 lo N
rl
and-inplt
3. What would be the stalus ol the correspondingoulpuls for rhe four outpur
rne
groupregiste.sshownin lisure8-8? Whata.e lhe c ore \potding outpu! numbe'sror
four OG and IC reeistersshownl
LU RE C] S -I' E RB' \S]C 5
PL
.j'.J*,- \
OUTL'
i, i lor b'\r . , ,,, 1 9-1 lnt
Typcsc
q . \ r ,q1 .\ ', f, \,1,-.r,,., t
f' ., ,r1,,i i
. I il OBJE.
ntt'utt'tl
.
\l - ll'"'
,.,
\\- r'i,i'.iL o- I E Desi
a List
\'
\, \ \
\ lHR. J \
!?:lr;:1\
\
\ O'h
ir
14o ! tt
ii L I
Llr'..t!\r 1 ' ,1 , i( f,I,.l ,-l f,, r'\
' \1
l-iFL) 1 rr ,t1 ; i
.1.r 0!
UFf
GI 4- I{,io\
rri r
a fa
a
:Irj wr
-: ':
:: G
OUTLINE
o 9-2 TheBasicPLCTinrerFunction
9-1 Introduction : 9-3 EramDiesot Nine
TypesoiTimerFunction E 9-4 An Indusrrial
Applications Pro.ess
TiminsApplicaiion
OBJECTIVES
A t th e n do ft hi s chapter,you w i l l be abl eto
o Describethe PLC .tentivetimer function.
tr Lisl and describeeicht major timins funcriors rhar are comnonly used in circuits and
Processes.
o Apply PLC funclionsand PLC circuitry to processcontrol for eachof theseeighr
mejor timing funciions.
ApplyPLC timersin rnultipletiniDgproblenstha!conbineiNo oimore ofthe basic
dmjngtunctions.
Aplly PLC timersfor the controlofindustdalprocesses.
Pt_cl]\,1t]R[L \i tr)\5
INTRODUCTION
T h c m o ._ .u m n o r.- rr ' J I o .cr. cur ,rul Jc. c(
-o,i . JnJ i onr.,ctr r! rh, inpur
r ime r. I h c m o .- c o m -ro r:--; rr r f-rcr:or ' , fl V L D-r..r
F L.c y O:,J. h:ch :! rhe ba\;,
i u n !i ,,. r'" ,. e " throu
- -t.o n -rior her
i""e .""nc;' ,
J re L l I' o m r( o f ro re .i h r -J.r, TtIIL D fLA y ON ";;;..;:;;:
"".i .n,.,on,. pL.. hdve
lhe one basicfLncliontimercapabiijryin mulriples.This chaprcriltuslralesrhe
basrcPLC TI\i E DELAY ON functionandsvenotherderivedtimingfunctions.
upper
Tvpicalof rhe derivedfuncrion5 areTIME DLAy OFF, intcrvalpulseriming,
and multiplcpulsetimingof morethanone piocessoperation.
time.
\-ormallyoniv oneofrwo typerofthe basicpLC timingfunctionat btocksis
jn a PLC- The timing black functionsare
usedwith variouscontactarrangements
and in multiples !q 4qgAqplishvarioos liming tasks. T!,picat indusrrial timin;
task5includerimingof lhe intervalsfor l('ckjjng,iainti;g. anrt hear trearingl
Timerscan alsopredererminc the inrc.\,alberweenr\{o operations. Whh a pLt
!ou canulilizeas manytimerblocksasyou need,withinlhe pLC nemory limila_
llons. {i.,., ,n. i,/^ .ecf
What does lhe PLC rimer tunclion replace?I)etailcd descriprionsof rradi_
tionalindustrialrimcrsflay befoundin controls!exrs,including th;se Iistcdin the
bibljography. Synrbolsfor convenlional timersmay be foundin appendixC. pLC
trmerfunctionscanreplaceony of thesejndustrialtimers.Whetheithc industrial
iimeris motofdrivcn,RC rinreconstant, or Cash.por,it canbe easilysirnutateJly
a PLC.
lhc Jililtl..,.1rd-.,.,rc.
(Jccr(on:c rjnrer;\ore rechnololiJal nepabu\..the
.
rhreerlpc. ot InJL:r rt ljmersj-.1 ljsreJ.The.e digir"ltlmrngde!icesrre
also
discussed in varioLrscont|olslexts.lhe pLC rimlngfunctionis ilo.e uersoriie ana
llexiblcthanellherthc industrialo. the digitalelectronic tjllar!. .
. Onemajoradvanlage of rhepLC rimeris thatits timemay be a programma- Ena
ble variable rime as we as a 6xed !ime. The variabterime intervai miy te
in
accordance with a changing .egi!rervalue.Anotheradvantage ofthe pLC rimeris
thatits timeraccuracyxnd .epearabilily areext.emelyhighbecause it is basedon
solid-sta!e technologv
y be a programma:
nle.val may be id
jlthe PLc rinef
ruse it is basedo
\\J
Bes.rsrhdesisnared
A ElockFormal
N7 .Fl
: somePLCs.
F-r lry
:l?#fi'::l
: IN 00t is: ifrt
tN6 ,FS.
J;#r
'nput the
ionds), rl Tirne
ti
H|---''- ___-{o Ourpul(78)
|
ro,r",
" "ou
I.IGURE 9-2
DoublelflpulTimer
1tr8 P L C T IIl E R F U N C IIO \S
+o x o
Elc. ..
X- Conlaci Closed
' O-Co.laclOpen
,sen-for example
EXAMPLE Example9-listhesimpleslformoftimedela) \\ hnihe.i..uit is turnedon. one
n figure9-3. 9-1 action takesplace.A specifiedlime lalei, anolher aciilin !r..urs Bolh relay logic
t,nil'"'.'s
b) & stare
xvention.In
and PLC logic diagramsare shown in this exampleoii! to. conparison. Subse-
quent exampleshave PLC diagramsonly. Figure 9-.1 shoss the program for
example9-1.
The sequencefor exampie9-l is
L WhenswhchI is tumcdon.iighrA lights.
2, EightsecondsafterA lights,B Iighis.
go
3. BothlighN off or stayoff whenever swhchI is opened.
off at a constant
EXAMPLE Example 9*3 involvestwo parls. The 6rsl part is for a singletime interval, the
'i"'flH,"lf,"J 9-3 secondis a multiplelime interval xample.
Example9-3-l illustratesa situationin which two inputsgo on at lhe same
g inlerval. !ime. Then,oneof themisto go offafterapreset periodof time. Figure9-6 shows
ie of this timing this situationfor two outputs.One output,A, stayson; the olher output, B, tums
offat the end of lhe timing interval. Resetringis accomplishedby tuming IN 001
, times could be and 002 off.
Figure 9-7, examplc9-3-2, shows a multiple application timing system.
':rnt time inter_ Threeoutputstuft on at tbe sametime. One slayson. Anolher. M, shutsoff after
8 seconds.The third output. N, shutsoff afler l,{ seconds.
I LC T I\IER F L 5 C T IO\5
Swl a Sec L2 L1 L2
+
T
N0o1 cFro017
18
; 2A
21
2?
23
8 Sec 24
HBO O l
rIG
TlmlngDlagram EI :
On
LT l- CF0 o 1 7 otf Er
EXA}lPLE
9-1
"i " r ;-
tir
On luf
LT 2. CF0 0 1 8
olt im
I
sw1-lNoo1 sw1nN001
on th.
FIGURE 9.4
Example9-1. Time Delay On
E]L{}IPLE Er.
9-5 ati
pf
-------,J-r L\.r\!P[aoFNINE fYPLSOFrlrlIRl]trNCllON,'\PlLlC.\flO)l5 l.l I
N001
TS
1N001 cR o16
Timesro20whe.motor
cF018 cR0r9
a
:2
_3
il--e-J '-_ l-"
O.
oH
oi,olio
lN000l tNoo0l
On olr
FIGURE9.5
Example9-2. TimeDelayOfI
1i
" l"-J
It
t, td
--r *11
E ll
"la li t:
"i
n--l;--t
oo oo
) E
= P:
=a 3F;
i
o
E
!
1
F
F: !
s
o
o o o o oo o
5
q
a o
d I E
6
E
!
II
a
I
E
I o
6 __l
lll
q\ E ,!
t-
?- d i6
,6 il
:(}
m 9
I
3
e a
I a
6 g_ -L
-aE5
p fE
o
133
l3r 1' II : ] I ' I\IIR J ' L \C .l II)\5
tN00o1rT259
I lNi
IH
N'
rNo00rTT259
I,H LiqhlA I rf.i:
1 N 000r
TT259
ir'
I LightB
L---.1
I
TT259
oll
ofr
On
atl
II Oulpul 018 e.ergizes aher 7 sec and 019 aier 12 sec {5 more) afier 1N001s energrzod
c Fo 1 7
4!
-l
I
O
.{1
Or
:" 1 c8018
},],,s,,,"
nning 0i.9ram
rNO02is rre e^e,e reser.FUl
On
cF0017
otl
cR0018
q
l
+_ I -)Bolh resel by N0002
4
o cF0019
On
otl
I I
o lN00l tlN00r
On
rNoo2
ofi
FIGURE 9-11
Exanple 9-7. Dual On Delay-Two Schemes
I' IT IE I{ F L \C ' IION 5
EX-{MPLE Dualtimcdetayoff.isillurrrared
in figurc9_lt. W" u." onu.,uutrppti*in;;
9-8 rl{ustratron.
Whenrhclighrsareturnedoff i
::::i:
.emain:: i:: ;,llt"l;l.,:"';;;:',;,:J,*;i'i;:,:1,:;J ::[i*il l:
on for 1
anaddirional
J miaures
arterthedoortlsil g;!1 .ri.ii""il".j!
outpulsare identifidin lhe figure.Fo. mc
off oulpuls. an addiiional
repearedlwo lrnesof losic are addeda. ,"oJii"uoi'*
9-4 AN INDUSTRIALPROCESS
TIMING APPLICATION
Thc iolloring problenrequirestheuseoffi
jii:I,{:.'"ml*i',""'".yl:
:,",,ll::;li*,I*t *llx'#il]::il:'+r:
.n'pri't.a
ry, ;;;",;i;j;'",:;";t "ffi:::lJi::,#Tiil#ff:,:i;
',L,ingrapidry).
rheme;ri*ei*r
*,"r,i. ."r"il"ir"yi"ii
:J..;::,::Tr!::l:r.,iJery "
The heatingis do"nby a nonconracr lnouctlonheatingprocess.A hieh
currentin theci.cular
coilaroundtheoulsic
currcnrs
inrh
part.
rhep".,h","r".";;;ij"";r":li
Hililfi : i::i;::"j:li:i.
:.ff;f ii;l"lJ:',""'.1
l';iliJ"'tll,li
i;,'1.'1.,[.J::L'X,filJkl":liqi
quenchwuteri5 pumpcdintorhcinnerhatioj
*h1iffi
ril,,f*t'y'.$*l#: ;?,;ii'ff',rJH
#,T*::'i"i is
station
isshown
in6sure
e-r4 rh
'."""i'ff::iil'fjJ:1tl,"jr'*:,i#::"
j:::::::,'turnins
I lii l"xi'iJ;liii",li'i,';, rh
svs,em
on
J. Borhlefr and dghrc,arLburronsarc dcpres,ed.
" anv o'he.irne purhingan1 rrop burron
sropsarl
i.:::,.:,::'::,:;:,
5. The.parr is raisedfrom bottom !o lop
by pneumaucarr aclron.A soie_ Ft(
noid valve supptieslhis airto a pneu;ari;
;levati"c iir" l";".- Er
"yri"a...
fRocEsS fl\ll\G ''\l'l'LICAll()\
9-r ,\\ I),,11)usllilAL
D o o rL o qc N . . i a , , C .
NO01 CFl
alter the start of
: The fan is ro co
til I6 seconds
igure9-13sho\rs
it.
225
.1.TION
_amming as wellas
iingmachine. The
ir. Hardeningis ac-
. lhenrmmediately
i\ a .elativelyhard
iprocess. A high
:s high circulating Tlni.9 D|lgrrm
re coil hascooii
-imoverheatingor
Jr on rhe pan. The
I Sprayingthe part
,roll results in fast
ficu]-14.
Doo,Lis ffl
_JV
x *l**"
The
I
r bulton stops all tNo01 rN001
Closed
r action.A sole_: FIGURE 9_U
lrnder,The lower- Exadple 9-8. Dual Off Delay
tlli ft_c illlliR FUNCI lONS
F I G U R E 9 -1 3
E r a mp l e9 -9 . l m b c d d e dl n te r
! al T i m i n g
i, lNl
tr
Ir TS
ntttd
, \cc4:l c5
ol
limi! swirch must be aciualed before lhe parl will rise Lower-limit
switchacluarionindicaiesthalibfeis a pan on themandrelandtha!the
mandrelis down. \ote thal ihe limh switch opensas the part leaveslhe
boltomPosition.
6. The mandrelmales conlactwilh a lini! switch at the top of th travel.
'7. lleat comeson for I0 secondsand goesoff.
8. Quenchcomeson for 8 secondsand goesoff.
9. The part retums down by gravity and spring action The upper-limit
switch becomesinaclivatedwben the mandrclstans down
10. The part and mandrelreachlhe boltom. The downlimit switch is again
.tr:::--+
l'^--l
loonl CyLinder I
lootrl l up-l
iGra!ityiSpingr
i F6rum i
FIGURE9.I4
StalionLaYou!
Heat/Quench
TS 1 LsD
flGURE
Connecli
EXERCISES
Wnte a
proSran
1 A11
sqi
CFlB
-_wOl r
3.E
cR22 4. G
FIGURE9-T5
HearQuenchMachineProgram
L X IJR CI5 E\ lJl
1T
1
T9
20
21
22
23
25
26
o 27
2A
29
30
31
32
- '"",
FTGURE9-16
DiagranFo. PLC\{odule.Inpurs.
C!nnection andOutputs
EXERCISES
Write a PLC programfo. thcse chapr.f problemi. rnsci th.nr inro a PLC and tesl the
Prcgramslor co.fect ope.aoon
1 . A l i m e .i s to l um on afan sw nch8.6secondr ar,era $al l s\enchi s tumedon. I f dle wall
switch is turned off during the 8.6 secondtine inten-al. rhe timer is !o reset to zero
seconds,so that when the wall swnch is aeainru.n.d on, the delav h the firll 8 6
I
I)r,c It\ltrR FU\c flo)r5
rI
5. ' i w o p u l s e .ss ra na r th c s a mel i m e.P ul seoul purJ i s to pul sccverr I: scco.ds.puts
o u tP u tK i ! to p u l s cc v c ry l s e conds.
6. W h e nL i s l u me do n . M i s ro g o on l l seconds
m a l te rh o w l o n g L i s i !me d o n .
Larer.V S oeson afte. seconds,
ll. I h rre .r- th ,e e :,,.r8 d e \rc or d proce.(i ngLne A . B . Jnd C A fcr rhe prJce\s
, x .A j s i o n a n a J i e r7 sconds
b e g j n smi el apse.
N cxt, mi xerB i s ro sta 3.6seconds
a fte fA . M i x e r C ,s ro 5 ta ni s e .o ndsafterB . A l l thenremai non unri la masterE nabt
s w i tc hi s tu rn c do fT
12. W h e na s l l n b u to n i s d e p re s j e d. ;U goeson. Fi ve secondsl arer.N goeson. W hen
S(opis pushed.bort \l 3nd \ Sooff. In addition,6 secondsafterM and N Boofi, tan F,
$ h i c h h a d p re v i o u s l )b c e no fT .toes on. F rmai nson unti l the stad bul toni s agai n
d e p r s s e da.t $ h i ;h ri mei t q o c so { T.
ll. A w o o d s a e . w . 3 a n . F . a n da lubri cati on pump,P , al l go on w hena stan burroni s
p u s h e dA . s ro pb u i (.n rro p srh esawonl y.Thc fan i s to r!n an addi ri onal 5 seconds ro oul
b l o w th e c h i p sa q a \ T h e l u ti ep umpi s to run l br8 secondsal rershu(dow nof W . l0- 1
A d d i ri o n n l l yi .f (h . i 3 s h 3 sru n morethanone rni nul ,the fanl houl d stavon i nde6,
nuely.The fan ma) then,\r!med oifby pushinga separatefan rcserbutton. Iilhe saw
hasrun lessthanone flrnure.rhepumpshouldo offwhen rhe saw is turnedoff. The 8-
O BJ
secondtime delai orTdoesnor iake placfor a runnjngtine of lessthan one minute.
cDe
E Li:
PLC CounterFunctions
:nC5bter lor t
. sr?n3,6sconl
i:d a masterEnab
a
rd N go oii', fan
:1 burron is ag
OU JLINE
1, J Introduclion c 10-l (:a.rer:::lni:l.s
o 10-2ThBasicPI-CCoun(e.
c.rEcrlvDs
A i c end oi ihis chapler, you will be abie tc
L ' scribe thc PLC countef tunc1ioq.
|j r ' .i s o m eo f l he maj orcounti ngtun,:ti onsusedrn ci r;r' :s and .i .i .sser
c ci rcuj l .v ro P rl ccss
. .p l y l h e P L(l counterfuncl i onand associ al ed
' utri l !l
o ,.lply combinationsof counlcr! and timers to P.o.ess cont.ol
o
l:ll FUNCTIONS
PLCCOUN'I'ER
10-1 rNTRoDUcrroN
PLC countershave programming formatssimilar to timer formats.One in
furnishescount pulse!whichthe PLC functionanalyzes,Anotherinput
ou! Enable-reset,asit doesin lhe timerfunclion.Conventional countersrep
by this PLC functioncanbe mechanical, electrical,or eleclronic.Typicalex
plesofsolid-statecountersmaybefoundin manufaclurers'manuals and
texts.
Most PLCs includeboth down countersand up counters,which
similarly.The up countercountsfrom0 up to thepresetcount,wheresomeact
takesplace.The downcounlergoesffom a presetnumberdownto 0, where
actionoccurs,Havingbothup anddown countersenablesa commooregister
keeptrackof a net count,Usingtwo or mofePLC counters can helpcon
processes. The useof diffefentand multiplecountersin industrialapplicalions
discussed in thischapter.
0c107
uco!7
.- :: l, lhere
:- --.anregislea
=r help co
-:- epptrcarioo
]"",",",
,"h;:-:
:he programmi (74)
Ourput
, becallse
tumi
3lier eachpul
FIGURE1O-1
?ulsesareby ThePLCCounter
Fuoction
a c o u n to f ? l
UC cc:
cF021 cBOZ;
EXAMPI.i]
10-3
FIGURE 1O-2
Example
l0-1. BasicPLCCounrer
Operarion
FICUREIO-3
l0-2 DualCountcr
Example
rN003
=:; a :ted
: _:: a:.:r1l
by a ti
PrrtC
ic)
iaPLC
. ne outputcan
PartD
(D )
After rhe
018
-raT<::z=E
l4E PLC COUNl'ERFUNCTIONS lo-l
cFo17
ai
L
IB
tN00t
DC
iN003 c8019
Olt Count
stIo
7
ot 15
,fi- J'l'l
-nn^r.
SpBy.Onror25
l'7*' FTCURE1O-5
Examplel0-4. CountandTimePIo8]am
-f- serro
_irals---\
1500!8
of pans on
d noneare
.tion.It does
n-oF logic is
he maximuft, Counting
processcount
n for 25
| _l|eration
FICURE 10-6
Examplel0-5. Delayof the Stan of the CountinSProcess
Closi.g1N0027
ttlOOzzjlSoOzZ
hooe,r- UC0081
Slad Counr
9999
1xe66q\$n'f:" "
lHBor06
J
ro"0000".
FIGURtr1O-7
Example
l0-6. Rare,per-Time-period
program
t".,,",rff J"Tlf:r::::il,t
*lT*i:+rji il:il,rff
:,,:,:?tr."""J::.,:,fl
i;ili"{{,;ii-:l' lir:*:#
ii*h*il#: r
{i,li;l",..ffi
ffffi::'drril
fL+:*::r
*#h
Hn:t:;lf*$n:,
--i
EXERCISES
Dsi8n,
consrruct,
andtesrpLC ci.cuirs
fo. thefolowjngprocesses
t on$,hen
aco!nrreaches
fijl:,ft'lii,fi:jil:d8o 23rherishtisrhen
rosooffwhen
2. A machine,M, is !o be tumed
on eilhef $.he
uptoro.o*
Eos r,ii* I orwhen
coun,
B
-3. ""p lin:j.::r
A fi n , F , i s ro b e l u .n e do n $ h cn".',*i,:;,;li:il
l'*ru*.lir::1,:. j""t1J,iT""llit;iT;
;i:
coun!L eoe
#:::;::":iilJTt',i,"J
" f;:':lli'i:#,;*x
:ili?,"""JJi,.,:nxxi."hlllJ"1,ilil,li3
5iil.,iJ;
EXERCISES
* [q
on lo I
FTGURE1O-8
fof Exercise5
Diag.ram
5s s 80 o{f
it- I
Arithmetic Functions
OUTLINE
11.I Inlroduction
o 1l-2 Addirion c 11-3The Repetiri\c
andSubtracrion ll..k .
U-.1 Multiplicalion and Dieision o l1-5 SQUAREROOTandDOUBI-EPRl.:CISION
Oir,iECTIVES
youwill
At thceodof thischapter,
o ,\dJ and subtractnumbersusingthe PLC ADD andSUBTRACTiunctions.
o Explainand demonsrfale how |he PLC handlesoverflowind nesativenumbersior
rlr: ADD andSUBTRACTfLrnclions.
o Nirttiplyand dividenumbersusinslhe PLC MULTIPLY funciion.
o Squarenunbefsusingthe PLC SQUAREfunction.
Find squarerootsusingthe PLC SQUAREROOTfunction.
lil)iplainhow rhe PLC usesDOUBLE PRECISIONto takecareof largenumbers.
o Explainhow DOUBLE PRECISIONcanbe usedfor moreaccuracyil) compulations
b o Apply aUsix arithmeticopelalionsto processcontrol.
o Apply combinations ofPLC arilbmeticfunctionsto processes.
155
Ii 6 \ l) lII{ Il l l Il C F U \! l t, )N S
t ll
FIGUREI1-I
ThePLC ADD Funcrion
rR006a
N80041
,*l
p?n. c.1rer,nq the mainconvelor is rhcnclcrerm_incd
by rddrngrhc t$J feeder 'otal
co1!elof counrsusrngrhe ADD funclion.for illL\lra-
t ion..we.monil or lhe rorrl counre\ cn. r0 second..The input of rhe A DD funclion
otr oy pu,.ingrhe {DD flncrion enable..l he counr
I rs pulsedon and immediarely
coulo be plnted oul as shown in 6gurell_3 elery J0 seconds,
Note that lhis addirionmethod is an ahematesolution to a similar problem
in
chapterl0 usingcounrersand d commonresijter,
,! The PLC formarfor SUBTRA.T ir th; (rme ar for ADD, and lhc fLrncrion
operal;on-is
IUnCItOn.
similar.For sLrbtr"crion. oper"ndI js .ubtrdcledfrom operrnd L fhe
resull rs touno ln the dcsrjnarionregister.figure'n_4 sholvsrhe SUB.I
RACT
, \ RI1 I ].\IIJI' IC F ' U N C ' T I0 N S
HFoo75 HR0075
0462
9642 \
Hn0076 Qli
oti
0327
I I
I {
A00030
ao0o30
Oi
H80075
lt80075
4462
9642
Hn0076
4327
HF0076
3471
3
HF0077 Sum H F0077,-(t3,113-l OOOO)
0789-'-
31T3'
A. S0 n !.d e r
e - Sln Over
1 0 ,0 0 0
10,000
TIGURE 11-2
lwo Addition Examptes
ffi1fri;,gfr
5;",31ffi:j;t'i,'ffi
'$:ffi
*#t*d#-il#ffitiffi;r:
input
count
are
ava'ab,".
urr"u,rr,,rr:'ili.,'i,rJnl5i
it*{$ii.[r#
ili"t':jl!:t{rqjt{;,;;i{.iil^"'*:U,-*rn"
il].".""f$
II.2 ADDIIION AND SUB'I'RAC'I
ION 159
PanCounlerlorConvyof
A
ValuPlacedinHB00al
f,t r1----l',r*F
=+ Mainconveyor i- l
I
- r&oo PanCountrtorConveyor
B
VaiuePlacedin HR00a2
On
(HF0043)
r3.10,000)
FIGURE 11_3
UsingrheADD Funclion
for a ConleyorPartCoun!
h addilion,the
'n somePLCS, FIGURE 11-4
:nificantfor a The PLC SUBTRACTFunction
- action differs
J rhe resultis
I is on andthe
ind a negative
A BlockFormat
andonly one
ible for some r2r
1t valuefaom I _*_ .f_ l"- |
againdeter-
jconds,used,
FH"H"HH
10547 16 31 |
for accurate
*_--".-r--r,-.ll-i.- -
160 R] THMITIC FUNCTI'iS
Bctoro n.bt6
B.toro En.bb
HF0132
4642 H R 0t32
4621 \
H R 0 t3 3
621 oit H F0133
7307 of,
HRo134
AnyproviousVatuo
I HBo134
Any Prcviousvalu
I
|
r'1F0132
hF0132
H80133
H Fo133
H80134
3:
hFlol32
8642
1.1F0133
6218
H8013?
4621
H A O133
I
0n o
7307
HF0134
2424 H 80134
H(
2686
A-Diferenc-positive Usl
I' Ditte.ence,
Negarive
FIGURE 1I-5
Two tubtractionExamples
operation.Initializatjonfigures
theinitjalnunberof partson
c0untrnSresulls, conveyor
B inrolne
pa;,$ffi5t****u*f
i::,":r,$d,"j:i:.13il:l?Ji:o
lsil*d,J,:t#F*1;i":T,;,tffi
#:xll#fr
i*lpffi,*l,g,-$"':ffi
II-? ADDMON AND SUBTRASIION
A Conv'or PartsColntol
valu6Placsdin HF0251
El + Mainconvoyor
MainConwyor Colnlsr
valuPlacsdin H80252
Enabl
CountsElsry
30 Ssconds 30Sconds
b
FIGURE 11-6
Usingthc SUBTRACTFunctionfor a conveyorCount
:1tothe -T-----r-- /t
,.6275
HBcno4
ange, HB00o2
base
rickly
smit-
posr-
Hn0003
tgutg
:raJn-
rm is Nol6:NumboBafe In mik (0001Inch)
e set On6mll = 0 001hch
. and TIGURE 11-7
-9 is craphic Rlresentationof Dimensions
, \ l tl l l l Il l :-fl C It.i t!C f tON :i
H F000l
I
.._
n:
H Fooo2 R.
se,Pi nr + upperroreran*= upJiillfur
IrF0c!5
Ti
FIGUREI1-8
PLC Operarion
wirhSeipoinr5?id ioie:::.es f
rcxer
r;r;r a"e-er-u
ai3'jrhevappear inHRoo01and tl-4
iiItJ6S;.'ii.liiii,lll
oro,,::o'ilbTili:';::; ",1;"..j;ic*;;tT nr3'|hei'1aiicar
\ arL,es
in HR000
r,
:H::a;'#:l;fl
nili ::;;
ii{,,1!;i':
;?i:il.[*:?:t.{iii:!;;:,
*r'icr'."ou".s
.omp"ii.ln
i;;.i;;;,: i,.,l;:l;1,]l
ilAil;t,#,na.r**nce
"i;;l,['Ji::;'J;:j:ff:::l
regisrers
isdiscussed
inchaprer
rq,*.rrich
coversitre
:;:ri:"*::titii
llfu jT,lj:tr
funciions
,';ily;xilsilr
dis
il::
i'",i,'ili;fo
:;*.*:r"*:::LiHr:*:;':ri;,ll""lh:t"r_"nltl*';:
FigureIl_9 showsa repetitive clockarrangement.
A coil turos itselfoffand
on at a very fast rate, about t\ro times thr
*:lir::riri;u:;,}
ir[dT.
i*t*#rii5i,':iiI":'"::"j,i;::
,,,,j:.' ;,[: :"1,,!:.T:".:flT:il:fl"Tli
":'i,"l:.,i"i,'.'il]'::il:1ffi
i r \t( t.tii,t.t( \ rr)] \\t) t)i\'t5t()\ t63
T IG L R E I I_ 9 cF0043
cFoo43 | i- : nr ''
_r-\l i''
It.fe ti ti !e C l o c k a l i f. ri
l+r___
' \_/
_l
* cFoo43 l
_,.1 1 * ro drc!I ro be
i c o n t r n l o u s l yp l s e d
tr--
\ R f i l l )1 t:I1 C t-U \c .f l o N 5
FlcuR! u-10
lhc M U LT I P LY F u n c ti o n
FIGURE 11-1
The DIVIDE I
N.,",F",,"""',"f
,".";;";i;:::"".,"",
".,,
ffiil;l}:'dJ"i,xT.'fl i:i'fl,'.'',:
rl*'HiHilllr"",'"J"Fi:i::^,'ffi
ililffi
:f i;;:'il1::Xl.':lii ;'i:il1,::'l',",;:tr1ii","#::i
i1:;
:iTil:$
*::*i'i$+l*i#i:tfi
*LT:'g.:,m,,,::m Constanlvatu6
//..-
(F0001)
' oot'='""*t t'""*0",
181FolTult
(0lo81so)
t
ll
MSOB LSDS
fIGURE 11-11
MultiplicationExample
ll-,r NtLLI tfllc \t toN \i\n Dt\ tSti_)N /
r65
cF0127
f ,,".*il-f,"*d=fi-#H'"ff
'*L_dl
FIGURtr 11-12
T1 Squarinsby the MULTIPLY Funcrion
'/ FIGURE11-13
i TheDIVIDE Function
: -]
i H800ts3
6ndHF0034
Tot3lD6rin.tion Inctudes
Hn@61
rannglssimplya
ro operand2 ofa 030 031 032 033
i iten appearsin
I: - 1:. We show H"H"H-X- 034 2@
s srrnilarto the
?-1dI, the divi-
.i rhe division 032 4 033 035 O1O
{.;3in. the divi-
"H=H"H=H
Nor6:Vtloisin0i2 andDcimstis
in033,
FIGUREII-I,I
FtGL'
DMDE DcninrrionRcgistcr Opsrand1 l Tbe :
ConlcntDe!c.minarion varuinTwoRgislsl3J 48,127
dividsdby 267 I
Operand2 1 x ) 646,,
ConsrarrVatu " .-. 2421 )
.quars 7 zat.itoas qu31s) i 720
VaUsin rhTwoFgisrls
@ | 1720|
For i
FIGURE1I-15 9ysl
Exampleol rh ProcessUseof lfate
theDMDE Funcrion AD .
(HR0078and Haoo7g)
0012
, OnOtzl , ;, OB ol 2s .
\ ,/\FemaLndd/
' r
FICUREI I-16
l 648,1 The SQUAREROO'I Funcrion
l
) 1720
391
doublethenumbcrof oLrtputdecimaldigits,for example,from four diSitslo ei8ht.
For morepreciseproceises,thisincreasedaccurJcy maybetequired. The PLC's
systemto increase
accLrracyis calledDOUBLE PREClSlON Figure I I-17 illus-
tratesonemanufacturer'ssystem for carrying
out DOUBLE PRECISION for the
ADD function- your
Consult user'smanual for how yourparlicularPLC does lhis.
,f
or, indeed,whether
it cando at all.
'!
MSDS LSOS
t rinooor_]fHnoootl
ement + t HFoom
I THBooo4l
remenl
To get I rnooos
I
with a
.arsin l--a,'] I
-l
'main- l-Fnoois t Hnoooo
I
p (not
sukin
-deci-
s ten-
block
)eup
I and
l9 in
.! t he FTGURE11-17
iy to TypicalDOUBLE PRECISIONFunclionForna!
F U N C l ' IO N 5
EXERCISES
A ll e .x c rc i \eas s s u meth .u d l n o mbenarc i n dcci mi r ,
form.
l. a J n (rrx c l a b rs i c p L C AD D tu ncri on.U \c i :
*:.:
lnscnl"*:::::l{:}::::r;;q66
rcilrivety
smalnumbcrs
J"llii
1l;J"l,:[ffi hyl!li:.Hl
in HR000,m rli*p,-*rir"'iffi;il;::ft
verify thar rhe resuhingsumin HR 0003is correct
use the nPPropriateoumbering
sysremto accomptish tbe addirion.
Nexr, insen targenumberswhosesume
or HR 0003and
obse.vcrhc resurt.Doest* **,, *"*o*o ljlJ',',lhercapabilitv
' l[".,:"i"lJjii;l[i!"i#1j.::r"?:;:T
;i'"I.::ff
i:'"i",:1:n"il:ilHi:1
p r.h o n th e m a i n c o n v e y o r. F
As an additionajexe.cis,usea rimerto updatethe roral
3. Constructa SUBTRACTfuncrionin a mannersimilaf
rheoperands
thatrcsuh
inaposirive
desrinarion
numt",rG_i"*
very l5 seconds.
to xercisel. Inserrnumbers,n F
a nesarivcanswef.Doesrhe nesariveanswefproduce i'iii._r*
,h; ,;J," "ii""ii,"l,
;:;;;;;is_
LrreI t-5?
4, Two convyors,A and B, ieeda rnainconveyo.,C.
A rhirdconveyor,R, removes
rejecrsa shortdistancedowntbemainconveyor.Th"
f". **"vi" e, i'a,,.
R a,eefth inpurinroholdins regi\rer( ""*"
in rheir-c. c"",i;.ij pLi,,.i,,-",n i.iii""
rhe total output,c, pan colrnt,
As an additionalexercise,usea timer ro updatelhe rolal
ar a rime inrervatof youl
t pLc proErarnfo oq ins,he,r.<rem <nown,n nsurelI r_7 and
::,""p_".i,::::':l:"q
Lnenomrnal vajLre poinL
',-6. orser is^tJ.tj inches.the,oterances-are _0.27ano
-0.27 inches.Show!hatrheresulrins rLL_catculared rjmnsarecorlec!.To funhertcs!
tl" programs_validiry,changerhe ser point and rolerances
_
- a aiff"r"nt
checkrheresults_ "rfu"l "no
6. Repeatexercise5 wirh diffefenttolerancs. Borh loterances are neSative,_0.05 ro
-0.20.
7. A m.rn co eyor hasrwo convcyorsfee,iinfit. Onefeedcrputs
6_packson rhefiain
conveyor;rheorhrfeedsB-packs. Borhfeederconv"yor"t a"" counr"r,rf.,at
nu'lber ofpacksleavinSrhem.Designa prosramto gi""
u.ruf *" *"ni o" "ouni.i".
,i"..i"
conveyor,
8.A:gi*v",y".9-,1, ndr2-packsofcanndsodanterinsir.Eachsizeofanenterinr
pack hasan individualpackquantitycounrerfeedt", pLC
re";;,;;. T;;;;;;*
oany lotal caosareenterinS thecolj "
uo program for mulliplyingand thcn
addingto Sivea total can 'u"tot' ""t "
"ounr.
9. Wehaveanoxrputthrtgivesusa dimen(ion in Inches.
We
di.pl{yed in feerand yirds. Developa pLC prog_am wishlo haverhedimcn:ion
ro ourpurat rfr*e a;men,ionr.
radlruserr!odivision,io.r,oouip,:aa.aon.ai.".,."..:;;,;;;;-...,'..",,
10. Stup a pLCproBram roobrainanor oR 0015rhe ourPutis to 8i!e
a varueba(edon rwo in!u,,, ,"0 {o'J
.\. r equars rhesquarc
ol N -0,1.'li:i':rer of NIpluslhesquareroot
"
U. Developprosramsfor olher math equationsof your
cnoice.Example:N = (J +
UseHR 0001
of HR 0003and
NumberComparison
Functions
T"''*'.^
rE::ji is to give
. :\= (J +
tio \ Llllr-lllLlttlj
!l; fi\r r,r,'rj
ta - | ri"\*
I'RODUCTI()N
lVcrliumand trrge pLCs ha1,e
numbcr(
flir",r,i;*til*ffi
i:;:;,t*rr##f*i*
**'**X"liliil"!d,[#itrklJ'"':i:r'i'.';#ff
ilJ:ii:
*:*:T:*j:j
*:1u$;f**E*i*:';3i.
t2-2 CONIPARISONFUNCTIONS
lruU i:ut--,#
*tf.,r*$.{il,.:,#
;*6=*iEitiiim"n*nmli*+"
,'."*:ii.l.'-*-i.:,1"":
il"1,,::.;i:"JHx::il
H:H:;[T,":,,".T.1,il:
;":::
i",;5;i1',.:ffi j,
j[
il;;;Ti!":iffiH#'#iii.;
r82
a'\or'(:5r
,*iiri*i3i:-
i !'""'^ttru*l
l*,#lai:
fl"t"t
:ill#}$friti+f+iltrf
..,'
#;iilF**.iltii{n*,*'#fr}l[1
I
Clrcuir (cond!.1. when
EQ
Eqra (EO)
EO
ssirrylor
Ale _+ts_
GE
'3
parisonsof (GE )
GE
e may wrshto .--.'-*|-
GE EQ
--1-?
6
rk and horv lhey
FIGURE12-1
ThSix COMPAREFunctions
)nsland3are
s denvedfunc-
l. Then B, the
I
I |NOO71
Enab{6
0P1
0P2
37
are merefore / \
/ lspecfYl
a, ,*
F|--{)-l 0"""
Jf "s,
Go6on wh6n nu.t'b6E
*Nm*iill,l;,ffi
72-3
*****ffi
-
APPLICATION EXAMPI,ES
iifi:;,,#:["##imri*:",-rinilliilff
i'
ir*rEldlftf E]L{}IPLE
E\ A } I P L E e ." ,n p t.r-
.*,,.,,1 n *o ;1^*- ;
g,;i;;i::r*i#i[[i,#l*,n:;',ff
:::.;".::,Ht":
****dffi***ffi
;N'fr#],ffiif4gf
I
ll -.1 llf.rN LX,^tllPL.lts l7J
^1,1'Llc.\
.)*is cntcrcd
T.IGURET2-3
cqual)andIN Exnmplel2*L Equnl--fo
(hercoil-type
COMPAREFunction
.)requaltofor
, I is energized.
Thc lwo num-
bea constant,
ttn numerical
I io the func-
,rl.isonis made.
r. not tme, the
continuously
. In someothea flRo123
on. To make
::rally similar.
i.I COMPARE HFto147
rLrldQerhe coil
Compa son ot Two Numbrg
process
theoutside intoHR 0123andHR 0147for theillustntion.Whcnenabled,
outputCR0l0l wil!comeon anytimethenumbers in thetwo .egisters
areexactly
ionsin PLC equal.
iicarionwith
COMPARE
EXAi!IPLE Examplel2-2 is for the nol-equal-to function.Figurel2-4 showsits program-
ming.In theexample, theoutputis to beon exceptwhenaninputcountis exactly
87. The inputcountis trackedin lR 0062,Operand2 can be program,ned as lhe
COiVIPARE number 0087.lt couldalsobeprogranmed asa register,
HR 0183.Thenunber87
'rnction
(not wouldthenbe inserted into HR 0183.
,as Iheyate
rningcount
res40, the
019is con- FTGUREU-4
emovaland Example
l2-2. Not-Equal-To
otherfunc- COMPARE F!nction
tR0062
operation.
'rd somedo Operand
2
lpter 22.
is case,an
ues do not
NolEqual
re fed from
I
NI ]\1 I,ER C O]vIIj
I \J II\I )N I.U N C,IIoN S
FIC
EX.{illPLE An uulomLrtic pill-bortlc-ltlling
opcr ion h,r5two po\siblcbuttlcsize5 Onc bottl;
l2-3 is ro be fitledto a coun!of 225or more.The oth;r is ro t uuelzs o. more. ihil CC
ernmplc.I2-3. u,<cs r grenrer-rhiln.or-eqrel
lo COMpAREfuncrion. figure f2_l
showsthc funclionto controlrhe pill counrs.The pill counr(co-unter no-t
shown)is fed-PLCfrom an input to lR 0142as lhe boltle is filled.The appropriaie
minimumnumber of pillsforpropefnlling,225or 4ZS,is inserted inroHIi 0i28.4
botll. is put underthepilldispenser (rol shown).Fora smallbottle,the225limii
is pul into HR 0128:for a lae borrle,475 -.
wouldbe enrered inroHR 0128.
FIGURE I2-S
Examplel2-3. Crearer-Than,
or-Equal-ToCOMp.{RE
rFo142 EXAMPLE T l .
Ttt
Opeland
2
NR0128 tti
o
FeEislerselal
i rher225
0r475
As rhebolllesta|1s tillijrg,
En3bleis continuously pulsed, Thecomparison is
unlrueand ourputCR 00j0 is off. Oncethe pill coun! reaches225for the smali
botrle,.CR 0030goeson. Ourpul CR OO3O is condectedto a cap-and-remove
operatlon {notshorn).Thebottleis capped andrcmoved, andthep;ocess is reset
andc_an be repealed. The sanesequence wouldbecarriedout forihe largebotile
wirh HR 0128seral.lii.
. Why not usean equal-rofunctionfor exampleC? EQ wouldprobablywork,
bui wharifrheprocess overshoors?Suppose theiounrsometrowgot roZZdfoittre
snall bor!le.The ill \r.ouldgo on unabared. lf the countgot to 221(or 476for the
large-size),
ho\iever.lhefill processwouldnot eftoneously conlinueil you usethe
CE func on.
FIGURE T2-6
i'- Cic aaide Examplel2-4. Less-Tlran
r ::e{=. Thi. COMPAREFunclion
a ::Frlpcale :
: I{R 0t?t. A
i R 0r2 8 .
ioftparisonis
br the small HR0011
-and-remove tFI0o12= 3r3
rcessis reset l i H B oC 11sr
: largebottle 347 ( c"atl <u
2
oporand or I CF:t22 4'
H80012 l!:t LcBaaa a.
)bablywork,
r 226for rhe 38 i ca:ci a.
i 476for the eracrly
i ceaiz c-
youusethe
hR0o11 349 i Cq:':? a-
I CF:t:' a'
j- ce,:*: :.
OpeGnd2
. f ota
,n!:theline,
rre than 18
tum olT.If
ie required
.arn that is
. operand 1. FIGURE U-7
COMPAREFuncri'n
Examplel2-5. Creater'Than
1 76 NL}lIII]R COMP IIISONI:UNC1'IONS
EXA}TPLE Thclcss-thrn-urcqui,l.lo
CUN.JpARE lunction,Exumplct2-6,is shownin 6e;
12-6 I:-8- A proJuctit')n
\y\tcm proJulc\r proJu.ttt"r ."n b" on" oiihr;;:;il.:
red.whrre,or btuc.Th('p.uducrion
i. tjmiredro 148btueunit,p"i a"v. if," U'frg
unitsare countcJby L\jn8x color..en.irive
deleclor.ff," a.t,i.ro.J*ni ir'iJ'
to the PLC into HR 0llt. The maximumdcsiredcount,34S,is insen;J
i;i;
HR OOI2,
HF00r2= 3,18
- - TcF@2r on
""o y { cFoo22
exacr I cFoo23
on
on
o,
34s r CFOO2]
Oi
oI ( CF002?
oir
moreLcRooz3ori
l.rRoo
l2
On il l-180011
s 348
FIGUR,E12.8
Examplel2-6. Less"Than-or-Equat-To
Funcrion
.t
Theiodicatoris on for countsbelow34g.Whenthecountreaches
stayson, andEQ conre(on.Theoutputremain,on. 34g.GE
Wt.n rt !o.i rrl o-rli
mo-eto 349,Ee goesoif. indicaringrharrheproducrion " "ount
lirni,
reached.The outpu!is now off and-willremainof for frigher
f;;;l;;;rr;;;
counis.
- _'-" ---" _!_-
E)LA.MPLI
EXAMPLE ExamplcI2-1. shownin figLrret2-9. i, a multiple-comparison 1r-E
programfor light-
ilg an indicatoronly whc.rlhe counl is bet\reentj
and :2. ,q.
Gi fu-nction ls ul.i
for thelowercount.Anolher GEfunclion is us"a ." i"al""r",i"iii
at 23.IN 00t6enablesrhefuncrions.Betow15,,h.".,"p CE;;;;;;;ft.,'i.;;; ""Jli."i
the outputin the lower ladderline of.
i P PL IC A ' i JO\ LX r\TIP LLS l-
-::- - :::..icr
cF00r7
:rt :-. r:re L09ic'GE
_ : r-:: :5 :ad
15
lN00i0 cH001a
Logic-GE
23 HFt0261
rN0016
c80017cR0018
::
?
*
t- 115ta22)
15andup
I'iGURE 1?.9
rt Examplcl2-7. Multiple-Coorparison
Progmm
l ll""f
When the count, startingfrom 0, reacheslj, the lop GE funcliongoeson.
iJl;is,i8f i,
,il:t*"8,
i,i
:il:i;:5"::1"::li::'
closes.The other
'1 tion hasnot yetcomeon.
the lowerGE func-
N 003 D Ct0
II
LOGIC
Y
+ EQ 11
T l N0 0 1 GE 12
t LOGIC
Fof .F lg12. 6
GE
cR12
i
YELLOW
t
Rei. Fig 12-7 _______________
,
GE EQ
cF tl cF 14
RED
FIGURE U-10
Example12-8.PLC Programfor PilorLight Indicatio!of CooveyorPartCount
EXERCISES
ConslructandrestPLC COIVIP-\RE funcrionprogramsfor lhe foilowiogproblemsl
1. A lighr is to cone on only if a PLC counrerhasa valuof 45 or 78. (,m,rj Two Ee
firnctionswith ouipursin paraltel.)
IJ XE R C i S ES
-119
Ll-gw
.EQ
- -t,ft'
The SKIP and MASTER
CONTROL RELAY
Functions
ta
OUTLINE
E 13-2 TheSKIPFunclion
13-l Inrroducrion andApplicadons c 13-3 TheNI,{STER
CONTROL RELAYFunction tr
andApplications 13-4 The Function
JUlvlP
OBJECTIWS
At the ndof this chapter,you will be ableto
a Descdbethe operationof the SKIP function.
! Describethe opeBlionofthe MASTERCONTROLRELAY function,
D Apply the SK nndMCR functions10operetionaL alplicalions,
tr Describerhe operationof th JUMPfunction.
181
Lt- l
t'
FIGURE 13.I
The SKIP Funcrion
rr .: rHLshtr,r,LNLlJ-N ,ii6]tt,-Liiia-Ns
r;'"
rrccrs that SKIp I
t#**ffi#R
tr'nrchmakesit
,rmars.
f UMpll
1I cF0o87
1-_t-i:rj- Aficr .cpair, lhc parl rccntcrsar rhe bcginningof thc convcyor.Thei
rr::i:.1 iow and conveyorlayoutare shownin figure
a partarrivesat thcbcginning '3-3, (norshown)
of thcline,a scnsor delects
"\'ien of the partsat rhe bcginningof the conveyorand causesthc eight
:hc presence I I tNoosr
!=:jcas io bc set up for operation.The sensorcausesregjsterconlenlsto tum ,l l Fr-
r..h of thc cight setup switch contactsChe BP/lR contacts)on or off. Figure Il-4
!:o!r's this setup system on the left, The sctup functions are CR OO4lthrough CR
I aPoool
I tnosou
C+4E.As lhe par{ proceedsdown the conveyof, each operalion js performed(ifset _
up) whenthe part is detected
by sensors
at eachstation.Thesescnsors are lN,.
N f--
0021lhroughlN 0028,asshownoo|he rightof 6gureIl-4. TheoperalionsareCR l I BP0oO2
lRo3o7
0061lhfo,rghCR 0068. I
lf a part is rejected a! stalion 3, i! is shunted to repair. Later, when lhe on
fepairedpart reentersthe conveyor,the setupsofstationsI through3 do not have
rt--
BPoOO3
I
to be reset.Unnecessary resetis preventedby the two SK functions,00ll and I lFo3o7
0060.The two SK functionsare turnedon by a sensorat the repairreenlrypoint. o" l---1F-
I ePoooa
I lBo3o7
ot
l---t F-
ra * r up :r to8
SrUpr4roB
SkipI ro3
I BPooo5
I lFo307
S!alion oi
Fr--
I BPooo6
1 ,t I
o" l---1l---
lF03o7
2 2 -l I ePooo;
I lnosoz
3 3 OfiHts_
I
I BPoooB
I lBo3o7
on Fr-
5 5 I S{-UP
6 6
I a
,f
FIGURT l}4
SKtP APPlica!ion
FIGURE 13-3
SKIP FunctionApplicationLayou!
I]-]'IIIf, SKIPFU]C1'IONANDAPPLICATIONS
j ionveyor. The
56l lJp
I
I
1
: sho*d) detccts I
:iruses rhe eight
iontentsto turn
r|l. Figure I3-4 Slalion
}Jl throughCR Only
i\ .'(1
.rlbl-rned(if set
sensorsare IN
:entrons arc cR
BP0008
ln0307
st-Up
. 140307
Typlcalnegisrer (8 Bit)
8+ 21
}'
FIGURE T}-4
SKIP ApplicationProsram
i.
I
iKIP AN D \lASl ER CONTROL REt.Ay FUNC. O^-S
tl
i tNo073 ooo3 |
i ,, enabl e /-\\
h\ N .a@ o' r_es
| - I obetL..eaor
fo,
Figurel3-6 showshow the MCR funclionoperatesin a program.Thereare
eightIines.Thethirdlineis theMCRfunction. Theothersevenli-nesarecontact_
coilfunctions.For fail-safereasons,the MCR mustbe tumedon to be inaclive.If
thefunctiongoesoff for somereason, it is activeandturnsthespecind linesoff,
also.WhenMCRis oa, theothersevenlinesoperate normallv. tvhcnMCR.is off,
thenextthreelines,4 through 6, areturnedofT.Linesl, 2, 7. and8 areuneffected.
FIGURE 13-6
NlCRFunctionPLC Operation
I
1
t
' I -.1 IIIE Il .\ S | f, ! C {J)l I R OI. kLl .A t l j U N (' f tON .\),rD /\l l ' l .tC A I l o \ s lv
With MCR o[, tbefcis no way to lurn on coils4 rhrough6 by encrgizing thcir
cnrblcIincs.WhcnlvlCRis turnedol-f,theladdcroprates in thenormalmanncr.
rlarlo thc SK A production linc examplcsimilarto thc SK example will bc usedfor thc
-nrblc linc is MCRapplication illustmtion- Thcrearcag|Iincightproduction stations.Whclher
.j\jcr diagram cachstulionoperates for a givcnpartnumbcrastheparlgocspastdepends on lhe
sctup(notshown).Eachstation's operation is initiated by proximityswitches at
he olf sttrle. eachstation. The proximityswirchs arc IN 0081throughIN 00E8.Figurell-7
showstheproduction Iinelayoutandproduclflow.
Station5 is an inspeclionstalion.Rejectedparts are shuntedto a repair
convevor' A-&!19!1q:!!9PgILl!9qlgrslblc-orYeJlr. \Vhelritleilterr it trms
on lN 0011,whichlu.nson andsealsan MCRrelav.CR 002,1. Thefirstfivesteps
are lhereforenot fepealedfor tbe part. because the first five operalionsare pre-
venledby lhe MCR. Whenlhe part gets!o s(ation5, lhe MCR is unsealed,
enabling nalions6lhrough8 to function.Theselaslthfeestepswerenot per-
formedlhefirsltimethrough, butarenowperformed to complete theprocess. The
.:n.Thereare
MCR programfor theseoperationsis shownin figurel3-8.
5 are conlact_
;e inactive.lf
ed linesoff,
IICR is off,
unaffccted.
,tt'tl Slalion
1
a
2
_.J 5
6
132is oll
FIGURE I3_7
MCR ApplicarionLayou!
{ND \Ir\SI'I]RCoNl'R0L I{ELAYFUNClIONS l; l( ; t ilall l. l- 9
rhr J U ivlP Funcrr
FIGURE1.]_8
\!CR Application
Prosram
cR0
MC F0o2l
0005
t^,ie"
MCF00?1tN0085
i,n.'A tb
trc@l
l:.11r!o\
lNo085
1N0086
FIGURE 13-I{
Th JUIVIP-TO
tN 0087
Funclion
1N0088
20
2
21
127 011
3
22 t8L_-H
04 0a
HH
5 I
o
6
TIGURE13-10
ThJUMP-TO-SUBROUTINE
Funclion Li.21
t
I
tesrnuchthe , 107
lwo typesof
P function.If 1C{l
LBL inputis
ikipped. For
.rsstale.
1 o
ionshownin 110
I-BL input is
when it sees
SRlire.This
:s withoutre-
snown).
E I ERC ISES
l F or rh e l l ,h d d .r l i n c p fo g n ,mi r tigufc t3_ , i nscd rbrccS K i .uncri ons
onc at ! ri me.
T hc 6 rs tp ro b l c mi s ro s k j pJ i n c sI rh ro!!h j . 1
*'i,i":,r,n,,,
Il:llll j:,1"- rn',.r,..,,.t"",'ii:#fi
iTl[ :ill'ilifi
;:;H:.
nu(litecrrhc uu(\'arus nrc!
;::lJi."# li:ili:l ; T. :i;:li.:l ;.1 ; '"'""hou'J
and
arso
rherinc ,, ,t,i,,i,i".,.''ii#"1?',1:l;jl,,liiJl,",il""hJlj"l.j?
3rhrougn
bot h l re ru rn e do n l
FIGURE13-1I
Diasramfor Excrci5eI
I
2. Repesr exerciseI usingrte UCR iunctioninsladofrheSK iunclion. WhenMCRis on,
allMCR-desisnared lincsshoutdbeoii. Addirionatiy. *v ii"i:, i"p"i
slatusfor lvlcR.conrrotlrd
linrsshouidhaveno e ecr "r,"nr;"e "o"i,"i
on rrsourput.
Repal theaddedproblcmin erercisel. irsjngIICR insread of SK.
Devisan I{CR sysremro con(rolrhe assembly lineshownin frEurell_12. All lJ
starionsarero funcrjonas serup by oncof t*o ;egi""". Sr,"n,"j i"if
o"n, or. ,."i
o.v
-"i;'"^"
--Fid._ 2 3 5 8 9 10 rl 12 t3 14 15
On On Or On
'o On Oil On On 3t 3 t 3 t g 3 t 3 t 3 t $ 3smail
t#3t
Las
o
.' hrn tllcR is on,
l|ol tin'sinput
i rJ_12.AI lJ
o
Data Move Svstems
OUTLINE
14-1 InkoduclionE 14-2 Thc MOVE Functionand Applicarions: 11-3 triovinc
LargeBlocklofDala o 14-{ Tableand RegisterMoves
OBJE TIVES
A( the endof lhis chapter,you wiil be ablero
o Dcscribethe MqE function.
o ApplytheMO\!function to indusrrial ,r c. rlbri.(.onwrrhorhcrPLC
problem.
14-l INTRODUCTION
All compulcrsy\lcm\, in(luJi1! PLe.. h...e thc inlctnlltirbilityto
move dsra
numhcr\. dnJ bit) liom onc Iocrlron o .rnolhcrJuring computer
smallerPLCs.the movingof daraffom onc rcglrr", ,o o*,t "p";",;;.'il
int"rnoitl ir'.lm.j
ou( automrtically.The movementof dalirIikcs placc,but we ", cannotmonitor
;;
conlrol ils opcralion.
In mediumand larSerpLCs, prografirming functionsare availableto conlrol
_
dalll movcment.The PLC's programmable data movestake datafrom one place
and move_itto another.This chaptefexplainsthrce typesof these
dat; ;;;i;;
programming functions.Fjrsl, rhechaptercovers$e ba;ic systemof.""i;; ;;:
regrsrerI conlentsinto one othe. register.The basicMOVE function
taies a
word, blre, or group bit palternfroorone placeand movesil !o
another.Som;
PLC syslemsuse a CET/PUT formal insrcadof MOVE. We use MOVi.
The secondtypeof PLC datamovcinvolvesmovinggroupsofdata
from two
or mofc con<ecutive registcr(ro Iso o more other con.ecuiiveregisrers.
(ecord rypeis u(u.,ll)dc.ignaredI. BL/ thii
CK MOVE in pLCr. f, rnor-..
Lrive groupofregisrers darr pJrrefn) u anorherconsecurive ".onr""_
cr""o
Some PLC fofmalscal lhis FILt-TO FtLE. We u.e BLoCK"MCiV;. '
"i;;i:;;;..
Ihc thi.d type of dala move involvcstwo subtypes.One type sequentiallv
movesdarafrom designared groupregrslers inro a singleregister.ihi. i.
T-A.BLE-TO-REctSTER move. SomepLC formatscartrh-isFtt_E-fO-WOnDl ""ii.J-l
We LrseTABLE,TO-RECtSTER.The orhersubtypetakesrhe datavalue
from a
sinBleregisterrnJ mo\e. r) rJlLe ,..-rcr :s nofmallyuaryinglsequenriatiy-i;
a
ponion ol r rdb c. The )cqJenr.rt-ro.c. re ofr.n aesigniteaJ;; il;1;;
This is calledthe REGISTER-TO-TABLEo. FIle_fO_Wdnl -i
f"""ii"".-W"
REGISTER-TO-TABLE. "r.
Inill moves,the conlenlsof rhe originalsoufceregisterare retained:you
essentrr'lythen.duplrcare the ro_rcc Jegister'\value i^ ,.gi.t.r. C."_
ver5r-ry. (neoeslrnatrOn "*,f,".
fegl(ter.v htch-eLeive5the duplicated new dala,loseSits.
prevlousvalue.In otherwords,the ofiginalvaluein the receiving
registerbefore
rhe move is normally lost. tf you wish to keep its original valu-ef;.;4";;";-
addilionalnrogrrmmingr( need"dro dul)ljcare and sroreir elsewher.bef; rb.
move.
,
TIGUREI,I_I
Thc MOvE Funcrion
tF0r07
.:a :rio!ing
-:or rng one
':t lakes a
.ef, some
026 078
- ' E.
MVO072
T
HR005l lar
is
H 8o10t
at
FIGURE I.{-4
_ - "' _ t' l lvlOVE-Addi!i!
/ H80101
I
0000 0000 oooo 1111 {1sJ
H R 0101
HF0052
FIGURE 14_2
MOVETimingExanrple
",--|"**l
\F;l
o
FIGURE 14-3
MOVE*Addirion Sysrem
1.1-l IHt Nt{)vEtju\clloN AND APPLIC,\llr)NS lt)1
T]GURE 1.I_4
MOVE-Addition Pros|am
",*,
]**-
R0c52
A OD 0160
H 80142
.:-r
:J H 80143
I
I tN 00171N 0018
1N 00181N 0017
0
D.\ l.\ Ir()v[ 5\ 5l ff,ts
T.",";il.:lT:
i:lH::
:|Jfj.',:tr.t*".ll#t.#!",:i,i:";.:ilJ,,J,r
14-3 MOVING LARGE BLOCKSOF DATA
14-4
d*si+ttlqri]Tftiil*,i.: *iitr
ffi *ittttt'*,,,.,,,",11ll:rl;;iru,.,+f
iiffi*T'Fll*si*,*rtfll;r
j:lw*i,*::i:ili;'J.'::i,
:::,j:.,i
J:::.f:,;:
:x,:l,:l,;xn:J:ii1,;:
:.ll",,lir:x#:
rF i;f
;:ru:i';:llil
:j:ll::;;,",:f ,:fix:
::iif
ff;:':'i"i::"#i:'"1
:,'"Til
JlL*'.':l
xfi3;?l;';+""*:i:li:lFit
Data
rFoo$
f----\ onorzo Coilgoesonwhendatatrom
a I 10rclistersarclranstered.
I I I I \
rr---____-_ I _.
tNooo7 aT(
Hl rnoos+| I I o*,' I I
F*-_l-1.-_1.------iJ
,1-i,
rFoo62 oRo137
I | | |
Aclton
FIGURE 14-5
BLOCK TRANSFERFuncrion
l t-!
cJ:prl a;l: ;.i'. i. 5c urjlizcdin lhc mj,jdlcoi thc lfullsttf_.cih oi!t drlir eid .c*.
Jala i!oLld be in lhe rcccivingregisrers. $hich could praC!c. sonr. oper^iioiral
nplete.The I
rhe output
.rrtionto its
rion. If the
F.-.l
l;;;l
r :l \ / sp.,,t"a
T-:::-"_-l
t **-t =-;\J \,r, OesrrnaronB eq,sre r
rffil =_".:,:;7
F;l
r""-.;l
t;;-l
t - "* ' t
FIGURE 1,1_6
TABLE-TO-REcISTER
MOVESysrem
: 0r l sYstIrts
m,*#m*i*tr''n'trd*
tl:,,1:,r"
l.:g.X.t j
inpLrro^rhe
nr"nin ru".,;on. btockfsrhepoinLer
rocation,
foundin
n ;;;,iiiiii'",liiilii;,ii",l",ii
il:1,1;li:l:l.Ji::"
."vsi""" ;."",",.;",..::T,,""ll:
i:il1;j.::,,T"i:L:.^""jp"'p"-"'
"'""';"i-ri;";.:;ii
eilj,;:H'i::il1ilX:.nff:
i::,11:'n:::.:,1',::^r"'-'""i'
/u, "i
succesevedala valuer is .pec:fiedas
_,,,rc a fouflh ir nput to the functional
block.
J;
ffis$m**+*zuffi
lli,yfrllr]i,llglABLE-rRr)
f:."::i:,ii'T
runction,s
; :'ifa's;"i'i-;i ;,1":
s,m,rar
t'''e'*"'q'i*:'ir;';;;;':rotherR function.
;;i#JJffi;,X:?:'"';::.,i:rt
" ";::,'i:l:"1:"ii i;l;i;lH"d:I'J-"ri
'"ii''"i'in.,"0,,
i;:::iLT,i:
jlff:::";,:1",:i;1LI:::T'rt"Jrili:ei#"^i'
jt iii;"#'li iif
:;'j"iT"T::::'L!:
:::T::i_.::
fff,i.l:::l::",::"f,::,a"i,;",, :,.e;,,'"";);:;,lil",Xll ilii:
l,i.iiii,iii;f,o,j!
flhe
;i,i;llli;";,.:::l::.,:,".u" ""iii*p"'r"i:;:ru;Uil::l?f
"f.i :rl;li:
i;::'"1',::,:l:.',:'*'ll,:T
from *f,;.f, l:
onc rcgisrer
j::Jl::, #'"ilffix
,f,. a"," i" ,o {'L,ij'JJ'ffi
.o...
:l#::
.o,ra
i:rell:l:l:1,:: t. ,r,"p..;oJi.
,."odrns
o|dara.
p,ogiimmcJ;;l*r,t
i;;i:":;;:Uri".:';;'jXXl.,jl"?iii:i1;ij,::g:,:::?i.:
parameter.The
FIGURE14-7
TheTAALE.To.REoIsTER
MOVEFuncrion
i r ir iar=
I
F*l
-.::r :R 110.!J
I
f"--l
I
:1- i:r"ild in
i-,-:nito the
I
I
.,.|''.'. t"-* I
:. desrination
3 funcrional
l-;*'" I ["*;l
-
rhe middle
_:gis!er. The
:gisterwhen Speciliod Last --------t
t"".'"1
itepped.The
'on lransfers
F;l
rus:,fiPtumed
F;,l
nction, the I
function, It FIGURE14-8
ofconsecu- REGISTER.TO'TABLE
MOVESystem
.-8.
The inpur singleregister's changing
valueis constantly aslheProcesschangcs, Thisregis+er
l4-9,Table is usedasthesource, To recordils valueevery10seconds for 5 minutes,we need
e endis the 6 tirnes5, or 30,registerslo recordlhe rquired readings.
seqLlential The func-
,n operates lenglhneds
tion'ssteplineis pulsedevely l0 seconds. The tabledeslination
on specifies to be 30registers.The 10-second arethenrecorded
intcrvalresults in order.The
30 sequential valuesappearin orderin the specified sericsof 30 dcstinrtion
:le register rcaistrs.
ne!er.The
FIGURE 14-9
-v._TF0327
1 |
| The REGISTER-TO-TABLE
MOVE Function
l'f
ll
al
E XERC ISES
i*i,:+:l*:'l#Tfr
f;*-*lhll$-ltlw-'irWl;
jiif
*:r;rim*,"1"#i
n*ffi
:#!:*"j,ilil-:#:,l.'"?lTlt:
FIGURElJ-10
Diagramfof Exerciser
L
t
' }ffi3T':'*Hfd"r#rlj;$jjrrih:"1il:i,'"'ff-*""
o
*H,i'""'ll."llf'il{":#,ii."'i"t:ffi
:,i}lft;itt",'-'#iiflti3
^f OFs
'l E
oP1
fl
aP2
O6st,
"f
TIGURE 14-11
a Diasramfor Exercise2
AdvancedIntermediate
Functions
I
15 UtitizingDigital Bits
t6 The SEQUENCERFunction
17 Matrix Functions
)
Utilizing Digitat Bits
OUTLINE
li
15-1 InrroducriooE 15-2 Bit Patteftsin a Rcgistcro l5-3 Changinga R.cister Brr
SratusE l5-4 Shift RegisterFunclionsE l5-5 Shift R.gist.r APPlicalions
OBJECTIVES
At the nd of this chaptr,you will be ablelo
o Desc.ibe$e PLC dieitalbit conrol systen.
E Describelhe BIT PICK CONTACTfunction5nd ils use
E Use digiralbits to tum outputson and off,
o Modiiv and controldigitalbils in a register.
o Use shift r.8islersto movedigilaLbiis within and lhrouShregisters
E Apply digitalbit regislersystemsto processcontrolprog|ans-
!T L L l z l i ! i L l C l l .\L Irl l S -----, It
. Flr
15-1 TNTRoDUC'rroN BI
Ilos! PLCsarecaprbleof wofkinswithdisitalbi!s.Insrcad of controingoutput
devicesfronr individualcontacts,these PLCSuse .gisre.bits in groLrps.For
exanpl,if theon-oli5rarus of l6 mrchines musrbeconrrolted,just oneof rhet6
bitsin a l6-bitregislercouldcontfoleachof rhe 16 machincs. If thereare lj7
machins!o turn on andoff. only l0 of thesel6-bit registersare neededlor on-off
contfol{157/16 = 9.815,or 9 recjsters pluspartof a l0th one).By conrrast, a
contact-coilladdercontrol wouldneed l5T ladd.linesin lhe Drosram. tr
The PLC not only use\ a fixedpattemofresisrerbirs,but caneasilymanipu-
latand chlnse individualbits.The PLC canpick, set,latch,and manipularethe :. in
individualbitsin chosenregisrers. It alsocanshifrrhe.egistercontentsto lhe right
or letl. Registershifls can be set to move rhe bits one posirionper input putse,
Shiftsnay alsobe se! for muhipleposilionmovemen!(two, three,or more).This
multiplebh shiit functionis otlen designated the N-bi! shift. LI
Functionsdiscussedin othf chaplersalso play a pad in processconrrol
with digital birs. For example,MOVE enablesyou !o replacrh entireregisrer
conlentsin orderto chsngerhe l6 oulputcommands. If youwantan on-offDallem fIGURE 15-3
changed,shiit in an appfopdalenewregisterpanem.Ivlovesoi darainto registers Ten OutPutsC(
can be done for one registefonly. but darainovescan be madefor a onsecutive RegisterBlls
seriesof manyregisters.
The digitalbit sysremrstheioundation oi mulriple machine contfol.The bit
systmis usedexlensively in all rypesof auromation sysrems. Oneverypowerful
bh controlsystemis rhedmm controller sequeic.fdiscussed in chspref16.
FI G LRE I 5 _ 2
BI T. PI C K C O N T \ C T C o . r r o l
lrollingoutpur
By contrasr,a
rrolledby bit 12,you woulddesignale the con|aclsas sho\\nin figure15-2.A
eaiilymanipu- menuappears whcnyou presstheconlactkeyon theke!boardInsleadofchoos-
ins CR or IN, as you hale beendoing.in thiscale voLr*ould .hooseBP.
nts lo the riAhl Takethe6rst!enbitslf.om theriehtis standard) andusethemIo controlten
:f jnputpulse. outputs,as shownin figurel5-3. Theoutpuiswitha feedefbil of I wouldbe on,
andthosewith 0 bit rvouldbe off. lf you modiiy HR 0:07to anotherpattemoibils,
rheoutputswouldchangeslatusaccordingly. An approprialeBP conlacls) stem
FIGURE 15-3
:F
Ten OutputsConlrol]edby Ten
RegisterBi!s ESij i; ;;; *sam *
= 2, = = =: P anem
)nlrol.The bit
rl+ t f lt f
0 0 0 0 0
t6 15 14 13 12 1110 9 8 7 6 5 4 3 2 1
ed addresses.
| /e3!sret. 15-3 CHANGINGA REGISTERBn srATUs
Iters for PLC
r's numerical Supposeyou wish to changebh 4 in HR 0207fron 0 to 1. Call up rcgisierHR 020?
's ard 0's. on the screenandcompletelvrcwnte hs bit pattern PushingReturnwould insert
e l5_l. A bit lhe patierninto the PLC CPU Otherwisemovethe cursoroverbit 4 and change
reenand lhen bit I only. This changeprocessis veiy siow
Bit staluschangesaremorequicklyaccomplishd by usingoneoflhree PLC
, rhe fgister
l7 now hasan functions.Theseare BIT sET (BS),BIT CLEAR (Bc)' andBIT FOLI-ow(BF)'
aleni decimal We illustratelhe tuit funclion usingthe founh bit of holdingregisterHR 0207
0207 ^
is set ro 1 (if idt
is poinrionly when the BS functionis enabledin figure 15-4, bit I of HR
r
I to (andfrom) was not already a 1). Tuming th function off would have no further effect on the
bit-i! would renain a l.
tby a rgister The BIT CLEAR funclion,shownin figwe 1J-5, hasthe oppositeeffectof
lR 0082con- BIT SET. The examplein figure l5-5 operateson bil 5 of HR 0207 When en-
abld,|he BC tunctio; wouldihangebit 5 irom I 100. Ifvou hadappliedBC to bil
6, nothingwould havehappned; becausebit 6 is alreadya 0 Whe[ BC is tumed
off, nothing further happens
:ta G r rLIZI\C DtCtfnL Brts
Permanonlly
ch6ng6dlo a 1"
whenBS0@4is tumedon
0 0 0 0 0
Slthg
FIGUREI5.5 EC0o05
TbeBIT CLEARFunction rNoo64 HXot
I I
Ft___--___{H
lcra,ln
rrnq i
-
Peman6ntly
chenged lo . ,O'
ln3n ACOOOS
isturnedon
HBO?07
Sning
t
BCO0O6/
H8O2O7
ls tumdon
FIGURE15-6 8F0004
The BIT FOLLOWFunction rNoo65 '13t t
H|._-___--_-_-{H.
sevclegr
:o ! I
o 0 0 0 0 0 1
C H ' \r" C I\C { i tE C IS fE R Il fI S T.\TLS
Vz
".2 %
,% v,
'2. %,
0 0 0 0 0 0
1 6 1 5 1 4 1 3 1 2 i 1 1 0 I 6 7 6 s 4 3 2 t +8 i l
HF0207 NlJmbr
BPOOo1
Sp.ayGun
8P0002
8P0003
Elc.
BP00r5
iiroio;
J
b BP0o16
NAO207
pLCCo.rrol
IIGURI 15-7
Spray-PairtPattemdd Progam
L t il llL\ t r Dlt ili \ L llll S
W 3l 2
i
/z 7/z./,
6 3
o o
I
r <-
'z 1 6 1 5 1 4 1 3 1 2 1 1 1 0 9 3 7 65 Bit
'/l' %: HF0207
BCoors
T -_1
-
;, -
1---
I "fl"
f---r -
FIOURE15-E
SFray-Paint
Revised andPrograft
Parte.n
1N0052 oriarr t; _ o
Optiona:ON/OFFwrh rhe
i 1N0053
* ait
I 1 0 0 1 0
FIGURE15-9
t "'",',-,"-
-,rts rz qr:-l r"'r^Ll s I LNol\2 oa!9-!9
, r5la11! --i-T
i ,r1'Jl e""t'"
0
zofr
0 ' i. l" r,_,.,r=
lolo rrc*E,li,.TB.ecr
3 on ;\.1,
ofl
the!L
5 MO\
I
goT.
1 paf,l
I
on
I 011
10 oll
r1 oll
\2
13 On
o\t\o1o
ffi, ,')-,=- lo
oi
,.l l f
0 0 \--rr
FO .5 On
, 0 1 0 0
, lo lo
olt
I'nli.ii"i';;'* u*"'"
slGuRE 1s-10
;::;;:*r;x*,uf*"+iiilTh*:r{i:l'r
*.*,,t*,*o :**: r*k[*$p.rtE4i':f i*$"j
a';'-'*""
**{':*"..:'"t*"",i*$r':i+tl*i:
;
,Sljil:rl;.
jiv':i':'1}:;"*llr;*:x''i-'i"nu.
"';"Ji: l:::lll:
l^:.,i:"1t,"'l'JlX
ffit",**ii*
I5 ,,I J JFII
F' TR E OIS TE RFU N C ' | ION S
F IG L R E 1 5 _ 1 1
SH IF r R IGH TR EC ISTE R -trl ul ti pl e
R egi ste6
* i
orRe.l I
^'.--_|
(2) ( -=f-"":-| I
- ,68,ur I J
---------------
I
-____,
[ \___
-1
a
@
again.This ,t*rn/\-)
ich is found
ns example FIGURE 15-12
The REGISTERROTATE Funclion
l-rttrzt:rt,Dtelrtt s Is
w hi ch i s the Il th bi ! The P oi nl
re e n te fth e i n i l i a l rc g i * c ra l thel i _mi nu1-l 6poi nt
;;i;.:;:'l;li;:.:;i,l :ili ;, hlFi-Ji;""i'.^,
?':',:': : y,r..L
:;.i;';" :,t'.,"' *: u, t re'J bc
miun( MLFt:
rJbereo L-rr-
;J;
r,".',",";l
llimr sr;l I*;-;rlltiiii::r :i.J:i,-ih:gl*i i.;Jii
N'
" -' ""
lffS[::,*:l'J$::fili,iiliii#""1;,lix;;',i'iiri"ri*",
*.'--F- oi*."
tou"
-"a" ",
"*,pr". lh"'t: ",Tb:i ;t:lj;jlili;i; f ,,x111,1"1!l,il
lf :}ff:::ilJ:xi: :;f :::;:l;'i:iJli:!.,.reand af,er pa,,ems
resis,er ar
ii"*"'"ne-"" Ls-r: .T:i5;';i:iil'ji:iiffi'ji'i,$l,lio"'" ..,'.
numberins
.i"p'., ir," ri' iden;ncarion
,",' aliiilii r'iI'n"rl ",n,n
in
svsle"' arr'or
m*1"*i;m."*,1'*i*,*+';.""r*',*{;ii:
i;il;tn";'t;'
i::"'T';:"i;;ru;;';i;
:;*iH:,';:i:Lii:
3::1"":i'I't
1N0207
i-;;
tsr-
*?:on
I
[---1r
ro
a 0
Functioo
i1!Ll""1iil1"t'.t'., RIcHr
:- ir ra-: laciSTERFL\CTIO\5
bit.Thepoint
'
JHIFT LEFT
)eledIIULTI-
L). or N-BIT
'shili registe..
rn thantheSR
: at a time,N, shllt lear Shifi Flghl
tatLForan
heriheserial-
of ihift regis-
identificaiion
ou
fIGURE 15-14
SHIFT REGISTEROperationSummary
U l l L l Z l \C D l G ffr\L Il ff5
O1 O,. 422
O,u Or "
O,o O,' O2o
o" o o'' o25
05 O,, O,e Oue
06 O, 3 Oro An
O7 o,. o ,'
1 2 3 4 5 6 7 8I r0 1112 13 1415 16
FIGURE 15-15
FlashinsArrow ?atternand Registers
ililFt Ral]t\|Er.(\Pt,ir( itu,\Ls
jri
.. r***lrffip$ffiliifr
il:H';: ;j'"jllT..,:
+;""::i.T-l,":;, ",:il,.,
lrhroughl4);
at :herop (1, *fu
i,n*im[*"i",:*pr*
*]:,:f
il
0002
St6ppingSFoISO
Lrght2
Lighl 3
I
t
L 9rrt27
Q Lrghl28
FIGURE 15-16
PLC Programfor FlashingAnow Movemnt
L i l l -i z l \c l )i c l f,\ l - Bl f5
0l
: ac oE F !1 ,
J^
rlr rror
erio rr 3:
ST
r ..r .-. sos
l\
-,-
N u m e d rs t"l\
3
-o: .r.ir r rrr-rr lrrr
dor dol dor dash dash dash dot dol do1
ra'raa l-aaa
i| llllll
a.aar aaaaa
-'.u-.. --n--.
Plnctuatio. and Othor-.3--
Slgns
.-i"sl-
c.ron -:"Jllll-
5mcolon
ili1l":i:i",1
OloratonMar$ L . . . 1 1 ...1 ...1 ..'l
1 'll l'll '
*o/ th!.:a
ra I alna. "..1
space spacs - - spacos
*g:ll-T* uT"l's*..."J8i..
aaaar - a ra
flF0175
1 T
1F0052
o ol0 0 0 0 0 0 0 ol, 0 0 0 0
s s
I
FIGURE 15-17
Mose Codein SR RegisterFoml
C
S H IFT R E C IS ' I' E R
.\P P LIC A TION S 22L
1l
.
l l. lil
i l'lR00s1
H F0175
shlit ghr
0002
_-T--T--l
0ll 0
a
FIGURE 15-18
MorseCodeShift RegisterProgram
L i tL tz t\(i I)l o t1 .\J , !i tf5
EXERCTSES
T h e frrs (rh .* c h rp re .e xe!.,ses.r. rpcl j ..ri onsi or r.3;rer bi r con$otproeE moi ns.
Includea ske(choi rhe har.js3.ene.dedior erchexerc,*. * ,""tr * lo. ti," p."ei",i.
l . A p ro d u cm do$. a0 3sseobtrl i ne (harhas l"*
r o v e sc o n ri nuorsL! j srl rj ons.S et u, a
.egNter,co_n(oLled producrionltoe for rhe palle:nlor produciA onty. The A parter;
is
s h o l v ni n ff8 u .etj - i 9.
23 5 10 l1 12 13 15
ofi or ofl O n oti On oft Of o'l Or ofl
B ion oil on ofi oft On ott ori
Ofl O. otl otl On ott ort
FICURE I5- 19
Diagrln fo. ExercisesI add 2
r dor(onebil)
g. Appropriale
"*"'.'"''
FIGURE15-20
luring shifting.
in a ROT,A.TE- i,*l':',It,:
11ilr+l11iil:""rrJr*:,,.';.;..omp,iih.his'alion
i::;l"J:l:jJ "J:l,Ilil,ll;";,:;;,;,;;-."
FIGURE 15-21
Diaeramlor Erercile 5
eeo a o a
-l
o
3On
2On
10n
OUTLINE
16-1 IntroductionE 16-2 Elect.omechanicalScquencing
o 16-3 The P!.C
SEQUENCERFunctionand Applicaliona 16-4 Timins and ChaininsSequencc$
OBJECTI'!'ES
A! the end ofthis chaprr,you will be ablto
,
o Compa.ethe advantages and disadvantages ofa conventionaldrum switch whh the
PLC DRUM CONTROLLER/SEQUENCER function.
o Describethe lrogram layoutofa PLC SEQUENCERfunction.
o Constnrcta matrix for a process-outputstareversusintervaland tim.
E Prog-ama SEQUENCERtuncdoqinro rhe PLC.
n5
276 fl r 1 l S IIQ U EN C IRF U r,.' Cl lO\
16-1 INTRODUCTION
Th PLC SEQUENCERfunctionis otlen calledrh DRUM CONTROLLER
function-We uselhr tunctiondcsignarion DR, instead
of SQ, whichhasal.eady
bcendcsignalcd ior squareroot.The SEQUENCERconcep!hasevotvedfrom
the mechanicaldrum s!r'itch,which is an importantconrroldevice,bu! the PLC
SEQUENCERiunctionhffidleslarsesequencins conlrolprobtems moreasily
thrn does the drum ssitch. Anothcf advantageof lhe PLC is that irs SE-
QUENCER programminsis relativelystraightforward and userfriendly.
Traditionaldrum swirchesare manuallyoperated.Ii a timing of the steps
beingconlrolledby rh drum switchis.equircd,manualoperarion rjmedby a
clock is nceded.The PLC SEQUENCERfunclionscanopemlebtweenstepsby
programmed timesequencs.Thischapter explainshowthePLC SEQUENCER
tunctioo operatesand can be appliedto conifol problems.SomPLCSuse the
TABLE-TO-REGISTERor FILE'TO-WORD lunclionsas an altemaliveto rhe
SEQUENCERlunclion.Howver,lhesefunclions arenotrs complete or versa-
tile as the SEQUENCERfuncriondescribedin this chapter.
'."'"*u"
llll"l,u.',i"1"'-
.ROLLER
{
{
ri lh PLC
I
rar its SE-
3lv
)f the steps
QUENCER
*.$*$*ry;*tltn
LCs use lne
r is a lhae'
'ctionsare il-
drud switch
ratedin frgur
)rthree'Phase
;le-phaseAC'
and about 12
u"'
)vicesand 138 3 Pha.6 ' 3
wl'' Lolor "***'"5ii'ilii""*
ich can easily
rum switch in
ted numbef ol
Shud
Ot,""rCuli"nl' IA
S'ri.s l/loror
Olr.cl Cutr'nt '
tj"o.t}*ll,i*, 16-r
rorFisure
^*r""'ons
U I:N C E RF U N Cl l ON
0 o
c
|-o-o-
ft*
I
c
a(
|{+
l*="- c
c
' ' H l r' l c . r.L l :\, I R r" .1.' \ \\D \D oLl \-l r-\
',
N 001
2 rN 002
3 N003
5 N005
.i
hown id fi8ure
rchs,one for
002,parlern2, FIGURE 16-6
PLC Coil/ConractLiehr PaIremcontlol
] '''i':'
r_
f-] 011
'Y'
f------r f-
lvr
m!lipteconta6ls cFo17rhElgh cF('32
FIGURETG7
Typical
PLCSEQUENCER
Function
601,,,0r
10
02...0101
603,..0010
604.,,0001
3
5
6
6
I
c
flGURX 16_8
PLC SEQUENCERFudctionandpatremfor lie Light Sequedce
1 6 -l ' ,fuE P LCi i r L E \ -i rt !a fto\ r\t.
(
|J-|
000
0t to fiR253
Oltpurs+ 6 5 ,1 3 I
1t
x6y ?3. .. 17
x+on +1
Ba n k + o ft +o otoc2
FTGURE16-9
DrshwasherFuncrionMarrix and ReEisterParrernt
o",oiFF -_ f+
cF0039 0F0040
s"a
f-,-]HP
T5004l
rR259
I FIGURE 16-T|]
Sequencerwith Time! P'rlsins
s.
ofmuhiples'
timesinsread
r youwan!variable vou
'j If set up for
rogerherOne !\oxld
sequencer ffi:':r"r'.";T;::i'T:;
ooeiat'nq
:aled. irri*irun:'l;tr;L{H!'ii:[i:#i!,''
".r
o**'u-'
r
(, -s may or
Ji'fii,i',iiil.ii;"
:r'Jiil":""::il::iliTlL
times are all 1.6-4 TIMING AND CHAINING SEQUENCERS
i".'6
l"'#lj.;#
ilil:Tilii'::*:1[J::TA"d: :"'H:'.:l:f
i[jlij:^",::*
lt'6i
ljm*i'::;I;":n'",x::i:l'illiil H"x1,'1:1il
i,":'.ffi
I l l tr 5 Il L E N C ERI-U N C 1' ION
F IC U R !] 1 6 -II
s .q u rn c .r N IUri p l e ti o c
I
0o 1000
00 r 00o HR26
0o 0110 NR269
- ---3+H+l+ff+I
I
oo 0001I HF?72
00 0001i HF273
- - -3e I
o0 @01 | HF274
a
-ar#l#;+
I
00 0001| HR2?
i{
I
LogicSFImOn-Samea! In Ftq,l-10
DR
CF00rl(l
I rsoo<r
srep f-----l F
F*'-F
l "*
I CF@9
Ensbrsl__JF
]-rher-Sameasin Fig.16_10
FIGURD 16-12
PLC Proe:mmfo. Fielre t6_ll
sil Pan;rn SequercerBolh-
12
-HF2i
-HF2E
269
I -!E2LL
2 1.1F0352
I
15
II
t I
10. I
HA0362
12
**.""
Jf",'"1""''.",
!li"u"ll
i?il#*ii,ii,ll"ii!+"","iff:ii:n#l!,-
i"ii"T j;$tfllfj[',[q
'*r'iti:li::,;ruillt]l'tilit. t *'
't^'e 'equerc
"eedio
::::r;*l*::;i*ihihiii::r;*Hrff ';:T':r":
ilJr;:tli:r::;,tiiir[:,i:"iij
jti$..;Til:":::
i.,x;;::
ffi-lri$"1il:;ii:iii;m
fu
lxlt:i'l,+:1i""ffi
SI r ] li J jNajljR FU\ lC l l O t
I Enerna!.eds
(DaraEnlry On =0)
-1 Orr Sreo C.la Eitry On= r Ofi- Ol
B c 0 E_- lPRValle)
o{t oft atl oll
2 orl ot'i : cF an o' r cr
-3
oft Cn ci C. an on
cn cri ai ci c. 12! secon
-r
eeg'nnfg wilhlhe seqLencerresel:Whe. the T ''s . t u - " - " .
soo rnsrlctiongoes Ttue slep 1 s in(ated: a s r n er m e - . h v e ns c c s 4 ! e . . e :
olrpursAlh.olqh E areofi Aheradwettm
oi 5 seco.ds (assumn!SOO remainsTr!e). D u f n qr r r er n e r . a l : : : i c ! . a , s r e : : r l l r e S O n s l r u c l i o n
slep 2 beqns: outpursB a.d 0 go On Afier 4 re se On oinl
20 seconds,slep 3 begns: ollpu a and c r . ! i r : r 'c : ! . : i ; r d r e s tfre
go On.Aher60soconds. srep4 begi.s;ourpuls p r o g a m m e d. F L r . a r a . r : : e : : : e r
B a.d C go Ofi olrplr E goes On. Aller 10
seconds3 cof,relLonbn rs sr on and lhe
cycrorcoeaisw rh step 1.
FIGURE 16-14
Four SequercerOptions
Iri I fl l l l N r , ANl) fH.\lNl\d 5t U IN C E R S
IIGURE 16-15
LadderC ontcl
S e q u e ncer
$ Diaslam
UENCER FUNC'I'ION
Machhe -_-"""2:Z':#,"?;1,
Numbe, 1614 1210 36 42
15t3 119 75 31
0 0 0 10 l T o 01001010 rlr1 1000 0101 tJ00
2 0000 01T1 1 0 1 1 1 0 1 0 1t 1l 0101 1001 0l0l
3 0000 1111 1 1 1 1 0 0 1 0 0000 0100 1010 0000
I
20
I HFsior OF02
I siadlngar Htu51
t HFsrorDFo2s
I StarlinSal HF25l
HF25I sysien,Fasr.ndnabt
cncuirs
a6 alsoident@1.
HF250
IIGURT 16-16
ExpandedSeqlencer
Conrrclfor ManyOutputs
FIGUNN
Dilgra[1
o
E XE R C l S l -l s
T50001
0010
HR0203= 20
HF0199 H80203= 15
OFOO!3willcoiltol oulpulsCROOr7
0010 thrclghCRO032 assps.lriedn HR0O01
lhfo0ghHFtoo10,wjlhlh6 nietoa
btwnstePs63spc,idby ih slps
oloF0002,
oG0o02
fTGURE 16-17
ControLlor Many StcPs
ExpandedSequencer
EXERCISES
l proefam Progmn
1. Placerhenachinemalrix shownin fisure16-18in E PLC sequencer
operadon
for manual,event-actuated
Numbr
Machins
Frc;REr6-u
for ExerciseI
Diaeram I 76543 , _:
1 -On
2 On On
3 on-of,
on on on On o.
-5
6
T
6 -On
T H E 5 E U EN C E RF U N C TION
5 . C h a i dr P L C tb . c h a i n e d
stepsfor 4 or5 ourputbi rs.E xceedl hen!mberofoutD u!steD s
ro _o rc p ro c rrmo l o c x .to r e^rmpl erfrhel i mi rr.tt8.u:e B 5.A sdi n,choosel ouro;n
IO-RECiSTER
cf the sE-
OUTLDiE
17-1 Inrroduction: U-2 Applring Vatrix Functionsto Reduce?lograrnLength tr
17-3 The .{ND a.d OR }latrix Functionso 17-4 COMPLEMENTand COMPA-RE
ivlatrixFunctions: 1?-5 ConbinationMatrix OPeralions
OBJECTT1TS
Ar rhe end ofihis chapler.you wilLbe able !o
a Defin. rhe conceptsofrhe COMPLEMENTand CoMPAREfunctions.
E Desc.ibeihe PLa nalri)( constructionsysiefl in relistr form.
o Desfibc and programrhe followinsnatrix tunctions:AND, OR, XOR,
C O \IP LE } IE N T,C OMP A R E .
E Use marrixtunclionsin combinationto sihulatecombination Eatessuchas NAND
and NOR.
247
NI r \TRJ X FI - I N' TI ( ] NS
L7-l IN'TRODUCTION
ln.Ti,fi itxiJt
:'ff;lli T:H;,:tTtl
:"::;1,"1.,
iff,:,:?ili
:"#,i:.I+:,itl
il#*lf,Iffi
ffi ,:',3*r*:;#ru"#:"
:it#ii.il*ri:*[tt*i:"::r,:,$
t7-2
if, 6..Itl$ Iti"T+I FUNCTT
oNsro REDUCE
Suppose
.",.,:
i,;,.r"".
i#* ft:[if?d{ftit+""_",:T;l
!ou had20; oilortights.eachof v
::r:1::
rr",
ji:'ln::T:*:lti:tih:T**=t*,"i'"
i."lll :ijz""i"rp're'*'
4 ;;;i*rxlr[
;i1: r;:;:'rrr-';;:
ffi fli:lljhl#
rir.ifu
tuk;.*:ilr*fff*,T *;: ;inl
:,T,T;
,"1E$*i:f:1,+,';i'',';ffi
i".r;#1;IjiIi{r"j;Hn
ff ;[i::*:
;*:tl*:llti*im:. ""*?i.:':ii"'x'J:fi
t7-3 THE AND d\D OR }L{TRX FTT_CTIONS
liT",:,'":,,r"T
;iJ$l:il,T."ffi::..,"'"'J:3iEilii:
;:ffi;,"""T::,ii};
The upper rection of ffgure I7__rsho!,
6ffi g1
;*;;;r1;kll;;lli
::ihifrT# $i*H:l.
ff :.l'",-#i;::'"'"il,i
::t"1,:
?'.1:H;:",ffi"t.*;i;{l,l"l',fl"r;:
-n1r ; rr \,' D l-i1i-!!):l lll
' lllll
It h of two
- 1., w n lwo
)r a conven-
of program-
]trl ANAND
x function 1NO3O5 NO45 cR50
ts on or off,
atus(l or 0)
In! ano tnen
cR506
tN@a6 1N6C6
n if eithror
3 processas
availableas rN@7
tN@?
-1HF
A AND
|l :! .ln four
MGUBE 17-1
Long Reperitivehoe$ms
of matrixB.
D situation,
nalrix C.
FrcuRulT l I 1 N 0 2 1 71 N 0 2 1 3
F o trrO u tp u l rw i th l ' w o Srri cs
tN0219 1N0220
rN0221tN0222
iN0223 IN0224
-z.^>
'ror,, '--, I I ;-..
'"or.nI
rN022 ,N0223
| ,i,0..,
tN0222 '^orro
l....* ")0,0, "oo,ou
N0224 cqo1o9 cBo1.o
flGURE I7-4
Two-by-TwoAND Analysisfor
Figure lt-l
HF0002
HB00o3
Notused-
Statusln evant
FIGURX 17-5
A PLC Malrix For 53 Functions
24
]'HL U\D,\\D L)R \1 \IRL\ LLN.fIt)\S
oco00i
oG00023 2 l J 1 l 3 0 2 sl 2 ! 127126125124123t22t21
oG0004| 64
FICURE17.6
AND MatrixResults
FIGURE 17_7
TypicalPLc AND lvlatrix
F IG U RE I7-8
T t p i c rLA l l ow rbl eP l -CN i rtri x
Si rc b y R egi srer TyP t
IG
OG
TIGURE 1?.9
OR NlatrixResults
113| 17
32| 31130| 2e| 2s | 27| 2612512412312212112a11e
54153152| 51Is0149
111i01s ls IzIjLi-Ll-Lj-!3
161151.11131121
hpoo 2 | i 8 | ! 7 1 4 6 | d 5 4 ! | 4 l | 4 2 , 4 - L . o I 3 s I l 8 l 3 7 l 1 6 l 3 s I l 4 | 3 3
De$ina on Marh
ocooolI 16 | 15 | I 4 | 13 | I 2 | 11 I 1o I e Is | 7l6l5l4l3 l2l 1
]**.
DestinatonEnd
M ,\T R IX F U N C ' I' ION 5
FIGURE 17.I(J
oG0004
t
1 2l r
16115114113 o 9l -16 5 1 3 2
_
I
H F 0 0 1 13 2 | l ,3 0 2 9 1 2 8 2 7| 2612al 24123| 2212t 20! 9, 3
B
H F 0 o 1 2a8 l d7l a6 l c s 1 44 l ! 3 11 2 14 . 14 0 13 9 1 3 8 | 3 7 13 6 l 5 3 4 1 3 3
s4 53 5215r s0| 49
oG0002 3 213 1| 3 0 12 s t 2 8I 2 " | 26| 2st 24I 23| 22| 21| 20t .e t.8 | .-
48 | 47 | 46 | !5 | 44 | I 4r | !1 I d0 | 3s I 38 | 37 | 36 | 35 | 34 I 33
oG0004| 64
L7-5
FIGURE 17-11
XOR Malrt,{Results
l--5 Cr'i\rts]!,:f!l! MA IR I\ ' ]P E R .\] !2!:
F IGU R E 1 7-'
XOR Matdx Functron
ococ04
T
:i:r;frii*l:{r:
ru*siririin
*,*,"- -l:linitir r'"n'ope'
s/e'lm' J
i'iffu::''
::-iJi,iiill."t*,'ff"-^"JJl::";f
FUNCTIONS
11-4 COMPLEIIIENT AND COMPARE M'q'TRIX
j:r+:T:l"s$lji+'f"1$"il'lr:l
I jlxiilts ;iliJ:i ;i .'"":i
!lltili I;J,:,T,1T,::',"il*Xi[J::X::;and
in6sure
isshown li-14'Limiis
'" '"1T!"?" ,""","" r"r CoMPLEMENT
a **"ilX:".i:?ll:}"'Tf;: logicisthecoMPARE runction$hichcompares
g*w"t'L"'t
}n*:;
ffi"#t :x*,'il"Jf ?J,ll ""
i?:;""'"'r'"""
ril::::
-"-iru,:irnin:,:;i:';'.*s:l;#l't: #T#l:
l':il'J:
:"*;ii'filir'r"
::*,*i*,1**ifil:'#::{':l'" "'"''''^,
O i:,."i tif::x.ln'*#;1i",',;':'.i",':ls:
rf,'#.'ri:il
operalionsmanual
!1l5lls2 sr tso 4s
oG0001
oG0003 J 3 d - 1 .5 1 4 5 l c 4 l 4 3 l 42
i .' l do I 3el .tr37t36t3st34t33
T.IGURE17-13
COMPLEMENT MarrixRes!lrs
FIGURE 17-14
The COIIPLEME!"T F!ncrion
oG0o04
I
FIGURE17-15
o
COMPAREFuncdonTruth
Table c I
0 1
0 o
lb-rtel:.ri I tu:r N!\ I F L\ oPIR\ ll]'N5
s4 53 52 511s0149
lroor:
I
oG0001 rrlrol9lslT
1-sra ri
ocooozl 32| 311!o l 2sl 2sJ27| 26| 2s12112312312,1I ?01 l L
cPor13
FIGURE 17-17
The COMPAREFunction
I
Mr\' T R IXF L N C ' | ION S
fi:i,:"-T;?."...,""
1
!r
.
E"HE"--E
In_versions
of inputsare accomplished
by usinga COMPLEIllE\T irnction
iJ;f":1:1,:'":i,':;,*irur:u:;:i::l:ki;,f:-::#:.
b<rof MOvE funcrions
or otherdati movesystems
avarablern thepLC frnc:ion
list.TheEXCLUStVEOR funclionmay be usedro p..folIn
","f.i,...0rp,..
EXERCISES
The followingtwo nat.ices are to be usedfor exercsesI thrcuh
?:
Mlirix I
I00llrl00l
0 001
001t0001 1l I
rlt00lt110 0
{, 1010001 011
00 I 100
ll0l1l00 10
0001001011 0 0rl
0000000110
I ut0
1010101001 0 001
0 lll
I
LiXillt ClS I l 5
C'
1. AND A and B to dcternrinematlix
2 . OR A ai d B to,.l ctermi nc ortdx D '
3. XOR A and B io detemine mattix E
I NANoI
:1. COivtPAREA and B io determinemltrix F
I Fsur'I c H' and J
."n"es A, c and E !o deierdi'e marrices
i. .oiittu"t"t
K
6 . N AN D B JndC Lode' ermrl emrrrrx
7. NOR A antl C to deiermine matrix L
i. The fesult
lemntedby proeramming rh'n on a PLCI
Exadine the follovios exanpLesbv
IPLEMENT
8 . F i g urel t-6. A N D
9. Ficure l7-9 OR
{PLEMENT 1 0 . F i g u rel r-l l . X OR
originaltwo 1 1 . F i g urei 1-Ii C OU P LE ME N T'
O . F i g u re17_16C OII{ P A R E '
11. Figure l?-l8 }"AND
1 4 . F i e ureLr-19,l OR
ii .*". *'."*.'.',:,i *r 1::e-t liiffi'JJ
:tl.'r",":';llll'ii-l,iii;lil
a n 3l vsrs r* o i ul l cgrs(erspN sl tal
$rl l requrrc cone- ror et aci
nr-" l i j l no b' rneP Lc compal etheresul ts
" " " J" i ' " , " ;1"
NT function
nI Dea num-
LC funciion
:ive comple-
o- I
I
I
0
I
0
I
t
AlternateProgramming
Languages
OUTLINE
18-1 Inroduction : r&2 L2id.r Logic and Beyond: 18_3 BASIC: A StepUp E
1E-4 C|afccr:f tlj8n'Le.el P:o-c:'sminsLanguagelor PLCS
OBJECTN'ES
At the cnd of $i5 chapt.;. lou triI be ableto
o Explainwh! ladderloejc nar not be suitedfor mofeelaboratePLC machineand
E7
3 A L ' I' ER ]\AT EP R OGR A M)' IN CLA TC U ,\C E S
1F1 INTRoDUCTIoN
Ladderlosic remainsthc dominan(progrrmminglansuagefor todav s-PLCs' at
leastin rh; UnitedStates.I{ore than 30%of all PLC progrxmmingin the United
18-3
ifldusrdaicootrol.
ln lhischaplef.we bginwkh a brieflookat theoriginsofladderlogicwhile
examininga felv of its morc obviouslimitations Next. *e take a slep up and
exploretheBASIClanguage asaPLC in-lineprogramming-loolFinally'i!isonto
an'analysis PLc languaS-crafcet-,
of a full-bl;wn, high-lvel,graphics'basd
ftat was developedin Europeand hasrecentlyspreadto lhe United States
F IGU R E T E -I
A Panial BASIC InstrucrionSer
LE T N P IT 18-4
lHEN
TIMERON
TME R S TOP
1oo r N.EcER c( r )
e { r ' .! flEN si ri .r
TIGURE IE-2
A Ber BASIC Plosam (CounesyofDivelbissCoa.)
18-4 GRAFCET:A HIGH'LEvEL PROCRAI\lMlNG
I,ANGUAGE FOR PLCS
l8-2. The
l,: ilriir;:*::':
ilJrir,:r*t' llill".'ill'iii'i1l.?
+':u;fi -oe!
15 , are gohg
Lments,it
,::'.'i:'i,l.:':?.1ll
:"ii:li:::*;;:i:;lt,;:.',','.ux;:ff soesoa-r'ne
?ii,"i.i".."a. tar''",od"droInetarsetPI c Frfh theDlogrnm
;e, Sequential
)arallelproblems
il:tr*-
tiltJ, ,in'll#mu:"'"lx
:",",',ff :;:;7
ll'f:,;:7;,?:","
; e."*i"ro.-; i..
tr'.r
: is goodfor
will excelat \l"l;';"';'.H.':;:ru:,?".-j:".*J"J:l""iiill1-",'that.'sesa
with3napprication
w" iLr""ti"te
*" ";i;;;;;i,Jq"'r"" (se6gure 18"3)'Th
",:lti:i;
,"i"i-"t an objec! from on level to the next
ai next, may be
;l'iffii:ff[:l
#l***:;i:;ll.f:tm:"'l*:::l"H"l,Ti''ff
-.i*
FICURE I8-3 FI
Robot Ar.n Positions E
F
GR IPC LOS E D
GNIPCLOSED
G F IPO P E N E D
TIGURE IE-4
Editinga Graph(Co!fiesy of ll lll
ffil
L___Jl
il
B
llt
r#
FI
:T"---_-
il
+ D
ffi
[=Jt
i;-l
t:l
E
figure18-5'
Si;r.The graphsequencis compleredas sho$n in
. td ro the beginnins and wait for lhe
irrrr.-ir1"'*"",'irt" .retum and the
we"ntroLiei
areale a trn( letqeen lhe last tmnsitjon
next "stan itput.
rnitialstePrseefr$re 18-61
The graphhas now beenProExammed
iitt'rt rtre qapt rs anal\zedIo cfe:( for gtaph errors li thereare
' incremented ** .::.?;',;t;iJ;::
"."
:";;ii.;;;';:Jj;j,1":?qi;'j: j:r,.'t'
roi stalement ,ion. f. i.* t].vt"oi.t und a fcs sccord' of compilingis all iI takes 1ntl:"':
to e3taDrrsn
qirdow s l apDearsiLh in-formarionabouttbe
.rol evaluatesanil ii. u"i"r",..'o"1.it, is dooe d {\ee figure
*d details
nple,the action ,ppi.",i"". t.fuai"e ""t"i"g, .,to' *tt'ugt' "Dphcalion
r8-7).
264 ALTERNATE PROCRAMlI IN.C LAI.C UACES
.4
FIGURE 18-5
G a p h Se q u e .c eC o m p l eted t! | G;"^ "-;
EDrloRs
I
L_:l
-l-
-i_
i-l CLOSE-GRI!
Plc
I
Doc'I4ENr
a=. I
urlt rrrEs
l- 1
Exrr
I
l
Next, slage3, we translateAe appiicaliar. which meanswe eenerate "--
chine"specific objecrcode!o run a pariicularpLC. Tle sourcecodefo. lhe TIGURE18
lation is the dalabasejust creared.In our robot ann eramDt,rhe Allen,Bradelv CraphChec^
PLC 5 rs the targetPLC
When the translationis complere.rhe CadeFasoftwarepackagelists
wamings,errors,andfatale.rofsduero p.oer-.r.:i1i:1g errorsno! dtecredin slagi
I or 2 fsee6gure18-8r.
FIGURE18.6
TheCompltedcmph proSrarn
(Counesy
of Fanic)
I r.q-.r:crr
CLOSE GRI'
o
OPEN CRIP
fl^lcu.cr ron"tG 4E
;i
ffi@@G'itT=--"*^!!!llrl
iE-r
t
i--o,:"."' cuteu
rePort
-(OOOOg:O0tl1
<!sc>--APPMatlon
5
5
o
9
2
U{ 1 IT !lIES
____)
los codrands-
.e!tr're' H"],!t.#t?>
) generate
:ode for lhe llllJ&lloi'**"
' ".o'
packaglists any uea,e-,ead)-tgrp:oc":]j:r'#'
Berore : "::H.":I:'it1[:t?iffT
'- '
pnv)'."''
n delectedill stage toLhe
iJ*ii''"'"i''""''""4
t"::i*H:::l1""i'ill
- ii";'fi
, **,.*,!," ['5'
i;fu
:!.::'#:.\i,:;gi:liitdizlf
pm5
::'l:::ll:ift!jj
r,:il;:,::.t';:
"'";$.:Til"'ln'i.,
:'i[J:,TJf.tl;t'oo".'""
i]';.,i'"i'-',,'"
:'jHi::::i:la'lt'.'r'ru:!'"
It"'i"-i' i"
"oo"ot
,I 1
::::::-i:::T:---
t'i*"f,*}i.i"*""*"*' {ota1 a' nhgs:
o
0
o
I i:::l ?:::i";""..'
r**srjccEss**'
l to contlnue'
Pless ao!' key
AL T E R N A' I' EP R OOR AMMIN C
LA N C U A C E S
t.
_t t-t t -(
6.
_t t-l I
FIGURE 18.9
PadialLadderLogicfor Robo!Arn (Courtesy
ofFamic)
EXERCISES
1. Interviewindusry personneltofind out what theylhink aboutladderlogicversushiglr-
LevellaneuaSssuchas Crafcet.
2. Obtaina PLC proeran lr,ritlenin BASIC and anaLyzeit, line for line.
7n7
E XE R C IS E S
deterdinewhai progrannrnglanguaSes'
l. Codlacthalf a dozetrPLC danuiacture6and vith
' r.ei. ,heir machinesare compatibl
ii"il"Jo*
"',i,., PLC programminslan-
on !h'ee high'level sr^phics-based
l. OUtarntn" specificalions
dozenkeys
surel8-9
ges,replaceladdl
itely a movein
andpr
rocessing
languageswill
led, it seems,is
iangua8ssuch
ogrc
esrgnm a
ay diagramslo
der logic
a
AnalogPLC Operation
OUTLINE
andSyslems E 19_3PLC
l9-1 lnroduction: 19-: TypesoIPLC AnaloeModuLes
I"i"r-Sie.a n**ttg : ii-'l BcD or Data
Muxibit E
Prccssine 19-5
Exzspl.sof PLCAlzto! Ourpur ^Pplicalion
OBJECTrlS
At the.nd of rhischapter,]ou edlbe able!o
o Differeodateb.teeen discreiemd ealog oPlation ofa ?LC'
E Lisi md defde!b. v&iousmajortvpesof PLc analog inpulsdd outputs'
E Descfibe thedaraflowandnunber co.veniobs involvedin PLCanalog
operatloo
E Conven input io
sisnalq a folm usablebv inpu! m'dues
E Convert outputmodulesiSnals to usablevalues for outPutdevrces'
E D.scribeibe irt.mat PLC for
oPeration analos I/o oPeration
o Prosama PLCfor usewith bothBCDandbinarYanalog svstens'
E Appt themalogPLCtunclion'so!ratiotr to indusaialproblens
269
to ANALOG PLC OPERA'IIOI
t9-L INTRODUCTION
This texl hasso far dealtwiih discrelePLC operationrinput andoutputnatuss
havebeenon or off. Thischapter considersanalogPLC ope.arion. AnalogPL
controlcan be usedro controla.y o.ocesswiih variablesas a contrclconsi
a.ion.Many mediumandla.gePLCsareablelo deaiwirh analogsignalsashaving
discrctefunctions.For analosoperatron, rhelevelof a PLC inputsisnalis sensed
by an analog input modul. ln 3ddirion. the level of the outpul can be a vafiabkl
valuesent !o lhe processfrcm an analosoulput module.Th PLC analoginput
capabiliry
enables you to monito.luch delicesas thermalindicalo.s,pressure
transducersilctricalporentiometers,
and many othr data inpul deviceswirh
varyingsisnalvalues.OutputPLC analo-q conlroldvicescanbe polilioned at
manyinlermediale posiliors.
Ttis ourpurconrrolconlrasts
with discrereconkol,
w h i c h o p e ra te so n l ." a" t i ts i * o er(i ei i res.
BC D P L C a n a l o gi n pui 3i i c.!rrur \al !e rangesafe di vi dedi nto a nLrmberof
s i e p s . B C D a n a l o si n !u i deri c.5 i nci ude:humb$heel s.encodefs.and Ihe l i ke.
A n a l o g o u tp u r d e v i . s . oni foi :u.h i e;i crs ar di grralnul r.tberi5e!en-i
. esment'
displat/s,andstepper moior:
PLC analog.apabrliiies allo{ mani lifTereotactionsfor onesinglinput,
dependingonlheinpul svalue.Foferample.aprocessin*hichl0ligicareused
to indicarehorvfull a tank is in ii,. incremenlsneedsonly one analoginput and
drscreiesystemneedsl0 on-otr sensorsand 20 inpul5.Analog
oulputprog|amshavesirnilaradvantags: for example,a singleanalogourpurcan
positiona vaLvein manydifierenlposilions.
Analogcapabililyenables youro conrrolconiinuousprocesses in suchindus-
tris as chemicaland petrolum.Ary nunber of variabLeinput signalscan be
receivedby a PLC moduleandlhenprocessed mathgmaticallyby the CPU.The
resuhiflganalogvalueor valuesarc theDsentto an output moduie.The analog;
oulput modulsignalthenconrols a variableprocessor processes,
sco BCO
3
I
---'1 I
rg iignalsas ha
putsignalissen lil =l
,ll
-)
' PLC analog
-l
.I
I =
inputdevices
ro be posilioned
ed into a numbr.
ders, and the I
,\. : singl
tl 'I
FIGURI 19-I
:h 20lightsare
AnalogBCD Iiput and OutputSvslems
re analoginput
20 inputs.
e analoSoutpur
Oigilal
t
120 120
112.5 15
105 105 14
13
12
I I th
;l
I I
145 I ll
30 :l
15
3
2
1
l"ff".."
0 + o i a l s l i n g + 1 0 0 9. 0+ oigital-100%
lrucAn.lo
FIGURE 19-3
AnalogSignalConversionro Digital Steps
I
+' 'f --
I,l_-l :;'.:;,1 - I _--:.!ii
- I _-1j#:',.
l r'--ll(eH
ttt_ _ L -:-
s.]-.,* . -*
-- lj .,rr".: . '",
nii lectricalvalue '*:.
i ! Ac
a value up to 256 in
lhnt the input moduleis an eight'bitbas,which can hold
irom0VtoTSV
se a 0-5 VDC [{u*:";[lll 11;'i11i:ll
Hlr':"]:i":i\itliil;1H":::tifl,iiTi;l
-5VDC,asshown * pe'rectrv
isnot whn
rinear
l nodul is "i:::ii?i"?ll'illli*1,i:.ili"H#i:;"'
orrhis "nd
svstemoiiltli!;,l,fiii;,l,llilll
tr,.cpui"""iu", auro.rheaiium+
3;i11;.""iil ,""T:1J:ililil"J?#," and
,024
have 40e6steps,
trace3l VAC.
s is 0.197.Th
-ou,d
'ilXii.* .isnrl fromrbecPU Loan oulputanalosdevice?
i"to";ii';ttoo..
,n. ser
I^*:;;;rynsnii!.ff'diy;
voltagethat is ".,,0,rt
r}.r:r$ltlil+,k
-ro
i5ffii,1iT:13-,j,JHJ'll'i,'lifil,"l;; v,
t"
ii:
+ro
v.
ffi'ti'l*rui:*::ll:i;'l:,"11"*'"I;il',:t"1,:1"1
"i
",'^"e"
*
:,;'"'".";* sumoftwo analoginputs'
shownin fieure19-6 ln outputmeteris to indicaieth
vatuesgo throughconversionand rhen !brouchthe i'put module
itre two in-puL
:*:l':lxuj:*"st'l,i:rufll:ffi
llx;lJJ":lT"J;il11
Ili
?1,!l:
i';:"J^,lll
l3i,'i"liui;#i"'1il
:l*tlru;f*t ""';l,ili
FIGURE 19-5
Analog Output Signal Path and
Lrvv*
S =ore.*:o= s _*
"
"1".",
271 A N A L O C P L C O P ER AT ION
-ErRo
lRor
\1 1 -f:l
r*, I I
,,',\l I mudule
I
.il"l' F " ' l" i
Ll U opr Lr''\-.1
I I opr | I lo .^ ' l I
5 v Dcllemifurs | 156 --
+,t I t lrD6r
r o r ll I l, L o ll I
I I
,r- loRorI iIl
't I
oFi rLE
= p1 1 3 ,5y = 1 .eye*
_11 56
= l) .s 1 8 " 5
V= 1 .6 ,r
v*
fr = o ;n* o n ,r o =
6lt
,r!!
fIGURE 19.6
Analog ADD Application
fic
iilustralion,17V and42 VAC ar addedandconvened,givingan outputof7.
to the merer.The neter full scalecouldbe serat 2limes78,or 156VAC, to
input and outpul scaies,
Figure i9-7 showsa block diagramof the conversionprocess,alongwj
rwo numerical xamples. Thir modulehasI0:r sreps.ourir couldhavehad5
4096,or someotherpower of 2. Theseare lypical valuesfor the module'sdl
sions,
I
I
FTGTJRE 19-7
AnalogInpurSysrem
f'
211
1 9 -5
+ 50v
,t
2SA
iI
l
-l I
tI
I
.10-
1 I
1"""i"5,13,;1',.,..
.;lt **:,ndltits$;'#
g an output of7
: 156VAC,to ,,""iffi H:i'?iHt[*
*"r*+:il;riiill*i:i"":;if
analog ol'lput tYslem
process,along_r
)r lhe modulgs
's4
ffi**t+***ffiff*
llt*iittllt*l'*"mt:"yltt'.';'mir
fd*{T{}}l;r
'#ill;i{}Tkft
:l{,+ff oF PLc ANALoG
our:::f
EXAMPLES
APPLTCATIoN
19-5
'^iffi
t-
rhenpu*and.'u.p'r'[s"o**"'st'":J*"#
i,i"illil;li'lil#:a;
n6 {\ALOC PLC OPER.]iIO\
fE-
:rI
I
I
FIGURtr 19-9
BCD(Multibir)InputandOurputSystem
ll^*"*'"''*'
i3-
T"o"YlE IN0033
Anps: o s
Amps: 0 8
Eoor
GE0112
G80112
dules.Furthe
I of ihese
i3-ll"'o"'ou'
H-."HS
Amps:0.5
/e multiPleI
examPlesare
AnPt :0 8
EQ OT
GEO 112
iete . Th figut
\ve !; output 99
i oulput on wn91 aP2
v
; use the input
Dveredin chapteri
r GE0112
]nd conditionhas
,rogram the
iate outputs
TA AN AL OC Pt_ COP Ek AT ' l O:1
BCO
I'IGURE 19-U
Example19-3:Aialog In/analogo. BCDOut.A. DalaFlowDiasram-
B . P LC
I9-5 APPLICATION EXA|V{PLESOF PLC ANALOC OUTPUT n9
h lR m06 vafik EXAMPLE ln this exalllple,19-4, a BCD input,0 to 9999,is receivedby an inpu! module,
19-11 whichplacesthe valuereceivedinto regislerlR 0004.A fixedvalueof 180is to be
BCD TN subrractedfrom the valuereceived,and th rcsultis to be sentout to a 0-9999
AND BCD BCD output dispiay.Addilionally,the outputvatueis to be placedin a 0- to 20'
OR milliampanalogoutput modul.Figure 19-11illust.atesthe PLC Progtamming
ANALOG necessary to accomplish$e transferofthe originalinput value,iess 180.Appro_
ue h), rhe CpU OUT priateBCD-to-binaryconvrsionsare includdin the program.
BCD/BIN
|l;;
I ollput I
I
-1ao
odrc6 I
I I
BIN/BCD
| ^sco I
l -*' l
BCOio ehary
tNo037
-l HF02o7
aP.2
1t8t
o80067
L m .B . P LC FICURX t9-13
E:(dple 19-4: BcD In/BCD or AnalocOut.A. DaraFlow Diaellm. B. PLC Program
2N ANALOG PLC OPERATION
oF0107
5U80208
tFor02
oR0106
nGUR.E 19-14
E)(asplel9-5r Two Ana-log
In, Add andSubtract,
Two AnalogOut.A. DataFlow
Diagam. B. PLC Prog.am
r
r_--:::::-'l
-Lla:l
irrr. They could
-@
I andsubtracted. I
ationsis also
M
A+e=c
C-155= 0 I
D90031
BCOlo Sina.Y
o80032
rN@72
BCOIoBLrary
(A t B )
80003.1
N0072
oc0001
AOO035
1N@72
A+B=C
sa0036
c-155 = 0
HF0093
8D0037
tN@72
HFOO93
oG0002
FIGUR.E 19-15
Examlle 19-6: Two BCD in, Multiplicaiioo,Additiod.Subtraction,Two AnalogOu!.
A. Data Flow Diagram.B. PLC Progmm
?al
uz ANALOC PLC OPERATION --.--'
EXERCISES
t. Drsw ad outpurgraphio. a l?'srepa5-bi0ourrur similarro thoseshosn in figlr 19-3.
144volts k 100%.The input connslFdon is rh sanc 4 nsure 19-i. Detemine thc.
voltageilanSc)ior dial jetines ol l-i. rJ..16. and ?E.si
ourpul digilal4lep-indicated
2, If the inputEraphcurvein frsurcl9-l *cl! noniined.6 shosn in ierre l9- l6. eould
th output be linarwith .espec!to dial scftin8: Er:_iain.
FTGURT$-16
Diagramfor Exercise2
ad of 2. The
7
NetworkingPLCs
"j iii'-"ifi'i''"'li"-"'-'"
i1'ji:i'""Jlf
lfitir*t*".*,1"ff::
::#::T':'..'"',.',*
:t'li:.]^l'"'"
l *a'
**,"*"
*;lliilfr:iit-ffiTll"'"'."",jj
"'"**'*"
"'}*'"***r''ra*'
it{i,ifft''I.,:tr,,t*t'-t'xftt}l
246 N EIw O R KIN G P L C s
20-l INTRODUCTION
This chapterdiscusses lhe .ole of lhe PLC in networksystemsA discussion
of indust.ialcontrol and whe.e the PLC fits is cove.dfirst. Next, compuler-l
integratedmanufacturing(CIM). a nelwo.k-basdmanulacturingsystem,is di$:
cussed.A generaldiscussionof network communication,includingpresently
availablelechnologies,iollows.A specificPLC conlrollris shownnex!.Finally,
industrialexamplesof networksystmswilh PLCs are iilustrated.
/ rocr racioryconro
\,/ producriodconFol
// *h.d\tinE
c o u p . o n r o L*o r k c . , ,
/
. / Manulrconsorl
*hilq d.vic.,codponcnr
/
FTGURE21L1
Control Syslen LeveLT.iangle
r
2 O-2 LE V E LS OF IN D U S TR IA LC ON T8!! u1
FIGURf, 2O-2
Tasksin a Plan!According
ofProcessing
Distributiod to Funcrion
?39
!F !!IwoB5]!!
:o-r rY-PE!
ffi*o*ffi
ri i o i a
:u_Yraw material
cvel 5.
or lntegratrng
lion. Although
1g tasks are
ved from the
ffi**ffi
*.ffi
lell controll$,
il ma
esponsiblefor
lowestlevel. Refer
I onecell.Then
Oniy whenthe
ntroller.Implemel'i
'"'J.
rft
fi*lt....;Itm**1il+;:x
290 NETWORKINC PLCs
the n{rl\hdrof
FIGURE 2O-3
OpenSystemlnlerconnection
(oSI) Model for Network
.als.Thcir'
n aDpli{lllons
x [l(lollect(
. '.Iiitlllfq sqo
doEc()rnfltibili
292 N E Il V O R KI!C Pt.C s
]U - 5 C E LL C ON TR OLB \ P LC N E TW OR K S 293
. : - " 8 *q 6 t d 6 a e : l
ffi
t-r
I
1
i'\
\ " i"
\\
\i
1-
o ff
flGUR.E
FTGIr'RE?O-{
CIII C.[ C...Friler]dd St*dlitoot (Coudesy of SquareD Compey)
r \
q-F ,31?Bl.
inI Hu
l|l I L tl
tfl llslt
fl tF
jn _t!-
rt-l -.4,
[HI
' d l lh ILIIL
sYEIco 4 3l - 4 5f r6F
'+
FIGURE20.5
Industial andTrainineWork CI](Courtesvof Amalrol'Inc )
7
t \ET]VORKINC PLCS
-4-4
"17'rt, '-llfrg]lration
r{q.z for Cltit
FrSo- 20
r
1s. Thre
ientral
ps are
This gives
I is that
I snaflng
e also involve'
vork cll is
s. The equipmer
ire .obotsha
overallcontrol
(cooritrued)
Figot.20-6
3 'jF-T'#ORK1NCPLCs E
FIGURE20.8
CIM fot Exercis
FIGURE 2O-7
,adustrialWork Cell (CounesyofABB Robotics,Inc.)
xERclss
t- ln your own words,desc.ibethe five ievelsof controland iheir intenelatio.ship.
Describewherethe PLC doesand doesdot fir inlo the five levels.
DefineCIM, plan!conrrouer,&ea conrolle., cetl conrrotler.and nicrocootro er.
DifferentiatebetweenWAN and LAN.
Skelchstd, seni-srd, andbusnerworksfor the work c! shownin ngure20-8. Robot1
hkes parrsfrom e inpu! corveyor and puts lhem in the lathe. Wher th lathe is
r
E XE R C IS E S
flGURE 2O-E
CIM ior Exercises
EI
A
c, K*
[-"J
| "*" l
FC-5n
J vi3ion
n the left
)nt modelsof
irurc20-8.Robot
/'
PID Controlof
ContinuousProcesses
OUTLINE
21-1 l.rroduction o 21-2 PID Principleso 21-3 TypicalProcessConrol Curves
21-.1TypicalPLC PID Functions
OBJECTTVES
Ar rhe end oi this chapler,you will be dbleto
o Briefly describeproPonional,int8ral,and derivalivecontrol.
o Describehow the abovethrecontrolsystemsare combinedfor etlectiveProcess
\
r
t0l
r:ls-**i*,*i:iii'l:'iffi
il;lii$ii.i;":.i
ut is a conti .*,[:*$p**r;it*[i*$],}t
ihil:';:*il*::;:il?i;lli^''illil'l...,...c.n,r.,F
LC on-off
roughby
ve or fast
PID (
dbyme
*$#p*[*m*$*
*ffi**ff
r this chapter,
re effctivene isulirized'Ihroushac
sometYPical
:ectivecontrol
. First, PID
, PID promptly
lo anotherset
of eachof the
304 I R D L OI L ON II:" JU OU SP R OC E S S T:
PID C O :.J
')a oillto|] |
l,-l,,
I Erdr.nhcodFlhl
FIGURT 21'2
GelealConrrol
S),stem Punp
Diagram-Hydraulic
the set point flow. lfthe dial is chanSedto a new stting,the functionofthe PID
systmis !o reachlhe new set poinl as quicklyand accuratelyas possible.
\ t
/
*nn ."*.",
ilf,uu,"X",ilnt",".
"to
I *""';?i#;i**;:l::i:,ri:l;l*liit'Ji
l";m;T:l1"lx"i'#"1
:ii,',,',#i:#:[TT",'*;ln:;:[:l::ll
;
;$*nkiilmi:tx*l",lm'r
{lt{[sh"';'$[1i*
i*=q*:t;*dH*:1"""*ffi
'.;'f.,*Th
..",{ti:;"'.";.m*x?f::i**fi
$^""'"""fl
trifu
*ffiii*l*n
*:,i'linfi
dft1i:tl'itt*i*":itffi
/. rssible. loer
FIGURI 21_{
Positon_
ConlroL
Idal_Posidon ro"n,on
LLrfte
'ng
D'9rses
n 6gure2l-3. 23456
ElapsedTime ln Seonds
!PID,
J06 P ID C ON T R OLO F C ON TIN U OU SP R OC E S S S
o'
23456
ElapsedTime in Seo.ds
2l-4
DesrdFnai
P""'* -:-- /*Yl- \-r'+-
Positton i /
't ---_-
/
Poshlon- 3 jec. rind +
Dsi.ed
Final
% sl on -:l -----
Posoni ,._- i
-l -i
posirion
- : sec. Time* 12 mn
D
-";;;;;--;--7-pcv\/\l
oesnedFinai , /\ /.\
^ ^
Positlon
I I /
,l /
Posion- s ic. rime *
1
: .r-_-r
r\ PrcAL!!q9!ql!!!ry!l
FICURE 21-6
ldal PID PosilionControl
FIGLRE ?]..7
Funclion
Typical LooP_ControL
-
30E PID C O N ' IR O LO F C O N TIN U OU SP R OC E S S E S
N G U R E 2 1 .8
Typical PID Function --t PY
INPLJT
--l
SETPT
oY
IOAIN
DCAIN
DB
CHOMX
F6,r6ncNumber----_l
LL
LT XXXX
9!.1i9!l9.tlL oiinos th. rirral
(LT) runcion as beinga l@p
consiantvalueor b6 storodln
ProcassVadab6.This s lh
indepndnlvanableinrc ved
To adival maFueuallofl arc n lh prccessundrdonvor'
ca$ade dodes,it is.eo$ary lhis n b sloredr a
ro do$ fie apprcpnab clnlacl
. Ho dinq Fsrer (HF)
. HoldinqR6gslr (HFl)
. OurputRosisrel(oR)
rd bYmput
FIGURE21-9
PIDPLCFunction
t
C E C56i!!d tr Froet r2 r1 10 9 43 21
t6 15 1413
TT-rn rrrn TTTT]
-TTI-I
ruodes ecled 1 = 0i!ariv6 0n PV scled
-F!F.drd
FOFCON
ESERVED
FESEAVEOFOR FUTUFELJSE
FOFFI]TUFEUSE
FESEBVEO
FESEBVEOFOF FL]TUFEI]SE
FOFFUTUFEUSE
FESEFVEO
FIGIRE:I-IO
PID rLC ]rsrrrctioo Se'