You are on page 1of 15

CHAPTER23 Alarm&EventProgramming

Objectives
Aftercompletingthischapter,youshouldhavetheknowledgeto:

Understandalarmprogramming.
Applythevarioustechniquestocapturealarmandeventinformation.

ManyPLCapplicationsrequiresomeformofalarmingwhenabnormalconditionsoreventsoccur.PLCsare
wellsuitedforthistaskandinfact,manyPLCmanufacturersprovidespecialinstructionsdesignedjustfor
thispurpose.Someofthesespecialinstructionswillbecoveredlaterinthischapter.
Alertingoperatingormaintenancepersonnelofabnormalconditionsorproblemssavestimeandincreases
machineorprocessuptime.Whendetailedalarmingisprovided,manyproblemscanberesolvedby
operatorsthemselvesratherthancallingatechniciantofindtheproblemsavingtimeandincreasing
productivity.
WhenaPLCsystemisconnectedtooneofthemanyHMIinterfacesavailableonthemarkettoday,theHMI
canprovideallofthealarmingfunctionsnecessarywithminimaladditionalPLCprogramming.MostHMI
softwarepackagesprovidesomeformofalarmingandeventrecording.TheseHMIsystemscontinually
monitorthePLCsinternaldatafilesortagsandbasedonhowtheHMIisprogrammedwillalarmaccordingly.
WhenHMIinterfaceswithbuiltinalarmingfeaturesarenotpartoftheoverallsystemorwheneventsmust
becapturedfasterthananHMIsystemcanmonitor,thealarmingandeventrecordingmustbeprogrammed
inthePLC.Thischapterisdedicatedtoshowingthereadersomeofthetechniquesandinstructionsusedto
programalarmandeventinformationinPLCs.

BASICALARMLOGIC
Alarmsandeventscanbetriggeredfromdigitalinformationsuchasamotorfailingtostartorrun.Theycan
betriggeredfromprocessanalogvaluessuchasahightemperatureorlowpressure.Whethermonitoringa
digitaloranalogvaluetheendresultisthesame,abitortagistypicallysettoa1orONindicatingthata
problemhasbeendetected.Figure231illustratesanexampleofthisbasiclogic.


Figure231BasicAlarmLogic Example
Rung1inFigurre231monittorsthemoto
oron/offswittchandcorre spondingmo
otorstartersttatusinputtoset
an
nalarmifthe
emotorisnottrunningwhe
entheswitchisintheON position.Theesecondrunggmonitorsan
n
an
nalogtemperratureinput(N7:1)andalaarmsifthetemperatureexxceeds100FF.Inbothrungstheoutputtis
an
ninternalbitortagthat,w
whenON,indicatesanabn
normalcondittion.Thisinteernalbitortagcanbereplaced
w
withanactualoutputthatiilluminatesalight,sounds ahorn,orlefftasanintern
nalmemoryaaddressthatiis
m
monitoredbyaanHMIinterffacesystem.
AffterstudyingRung1inFiggure231,you
ushouldseeaabasicprobleemwiththisaalarmlogic.W
Whenthemo
otor
sw
witchisturne
edON,thestaatusinputfromthemotorstarterdoes notchangesstateimmediaatelyand
th
hereforethem
motoralarmwillbeONforafractionofasecondassthemotorco
ontactorchan
ngesstate.Th
his
frractionofase
econdmayno
otseemlikem
muchbutitcaantriggerfalssealarmsthatcancausep
problemswith
h
ottherPLClogiccthatusesthisalarminforrmationorfalselyturning onanalarmo
output.
Asimilarprobllemcanbese
eenintheseccondrungwitththeoverteemperaturealarm.Iftheteemperature
reeached101fforonlyasplitsecondcaussingthehightemperatureealarmtoturrnONshuttingdownthe
prrocess,theop
peratormayn
notknowwhathappened.
Bo
othproblemssdescribedab
bovecanbeccorrectedwithsomesimp lechangesto
othealarmlo
ogicasshown
beelowinFigure
e232.


Figurre232Enhan
ncedBasicAlaarmLogic
In
nthefirstrunganOnDelayTimer(TON
N)hasbeenad
ddedthatalloowsforasmaalldelaybefo
orethemotorr
allarmisactivatedwhichise
enoughtimeforthemotorcontactortoochangestatteandpreven
ntafalsealarrm.
Th
hesecondrun
ngusesasealingcircuitto
osealintheaalarmuntiltheealarmisressetbytheopeerator.Inourr
exxamplewehaaveusedthestartpushbu
uttonastheresetmethod..Ofcourse,thetemperatu
uremustbeb
below
th
healarmsetp
pointbeforetthealarmcan
nbereset.Th
hestartbuttooncanberep
placedwithalmostanydessired
acction.SeeCh
hapter22foranexampleo
ofamotorfau
ultandmonittoringlogicth
hatcanbeuseedtoalarm
ab
bnormalmotorconditionss.

C
CAPTURING
GALARMEEVENTS
Caapturingandretainingalarminformatio
oncanbedoneinmultipleeways.Asim
mplemethodiistouseaseaaling
circuitaswassshowninFigu
ure232,Rungg2andsome
emeanstoreestthealarm.Thismethod
disnonreten
ntive,
m
meaningthealarmstatusw
willbelostiftheprocessorrlosespower .Latchinginsstructionscan
nbeusedtom
make
th
healarmretentiveasshow
wninFigure2
233.Otherm
methods,such asmovingdaata,willbediscussedlaterrin
th
hischapter.


Fiigure233LattchingAlarm Logic
Yo
ouwillnotice
einFigure233thatthealaarmreset(un
nlatch)rungisslocatedabo
ovethealarmset(latch)ru
ung.
Th
hisisdoneto
oensurethatthealarmrem
mainssetfortheentirePLLCprogramsccanifthestarrtbuttonis
pu
ushedwhiletthealarmisstillactive.

A
ANALOGRA
ATEOFCH
HANGEALA
ARMLOGIC
So
omeapplicatiionsrequiretthatanalogvaaluessuchastemperaturee,pressure,leevel,etc.bem
monitoredforra
raapidrateofch
hangeandalaarmifsuchaconditionexiists.ThelogiccinFigure234usesatimeer,compare,
m
move,andbitinstructionsttocreatearateofchangealarm.Rung 2inFigure2334isafreerunningtimerset
to
otheevaluatiionperiod(30
0seconds).Th
hisevaluation
nperiodcan besettoanyydesiredvaluebysimply
ch
hangingthetimerpresetvvalue.Rung4comparesthecurrentanaalogvaluesto
oredinF8:0w
withthepreviious
an
nalogvalue(FF8:1)thatwasstoredatth
heendofthelastevaluatioonperiod.Themaximumaallowablerateof
ch
hangeisstore
edinF8:2and
dcanbechan
ngedtoanydesiredvalue. Thealarmo
outputislatch
hedusingthelatch
in
nstructionand
drequiresaccorrespondinggunlatchinsttructiontoressetthealarm
m.Rung1isussedtostoretthe
cu
urrentanaloggvaluewhenthePLCisfirsststartedsotthatafalseallarmisnotgeeneratedthefirsttimethee
timerisdone.Thislogicmo
onitorsforap
positive(incre
easing)rateoffchange,whichcanbeeaasilychangedto
ed.
allarmonadeccreasingrateofchangeorbothifdesire

Figure234Rateo
ofChangeAlaarmLogic

A
ANNUNCIA
ATORLOGIC
C
Eaarlyalarmingmethodsuse
edanannunciatorboardto
onotifyoper atorsofprob
blems.Theseaannunciator
bo
oardsusedalightbehindaanopaquewindow.Theopaquewindoowwouldhavvethenameo
ofthealarm
en
ngravedonth
hewindow.W
Whenthealarrmwasactive
ethewindow
wwouldbeillu
uminated.Th
hesealarm
an
nnunciatorsw
wouldusethrreemodestoindicateanaalarmconditioon.Ifthealarmhadbeentriggeredbutnot
yeetacknowledgedbytheop
perator,theaalarmwindow
wwouldflashhindicatingth
heproblem.O
Oncethealarm
w
wasacknowled
dged,thealarrmwindoww
wouldstopflaashingandeittherremainillluminatedorrturnoff
deependingonthestateoftthealarm.Op
peratorscould
dmonitortheeannunciatorrboardandteellwhichalarrms
haadoccurred((flashing),whicharestillacctive(illuminated),andwhhichwerenottactive(nonilluminated)..
Th
hePLCladderrlogictomim
mictheearlyaannunciatorsisshownFiguure235.Herrewehaveussedthesameover
teemperatureaalarmaswassshowninFigu
ure232andaaddedtheneecessarylogiccsothattheaalarmfunctionsas
deescribedabovve.TheFlasshercontactisasecond
dOn/Offinte rnalmemoryyaddress.SeeeChapter22fforan
exxampleonho
owtoprogram
mthisflasherr.

Figure
e235BasicA
AnnunciatorTTypeLogic
Th
heovertemp
peraturealarm
mcouldbeahardwiredou
utputtoalighhtonanannu
unciatorsboardoritcouldbe
an
ninternalme
emoryaddressmonitoredbyanHMIthathasbeenpprogrammedtomimicanannunciator
bo
oard.

Ifyouonlyhavveahandfulo
ofalarmstop
program,then
nthemethoddshowninFiggure235willworkjustfin
ne.
emorethanaahandfulore
evenafewhu
undredalarm stodealwith
h,thenthism
methodmay
Butifyouhave
beecomecumbersomerequiiringaddition
nalprogramm
mingtime,meemoryusage,andscantime.Amuchbeetter
w
waytohandlealargenumb
berofalarmsistousebitw
wiselogicalonngwithwordandfilemovveinstructions.If
yo
ourecallfrom
mChapter6DigitalLogicG
GatesthatdigitallogicnootationssuchasAND,OR,XOR,etc.opeerate
attthebitleveltomakelogicaldecisions.Ifyouareno
otfamiliarwitthdigitallogiicnotationsthenareviewof
Ch
uldbestronglyrecommend
dedbeforeprroceeding.
hapter6wou
In
ntheexample
ethatfollowsswewillproggramthealarm
mlogicfor166alarms(one16bitword)bymanipulaating
w
wordsofdata.Laterinthischapterwew
willshowhow
wyoucantakeethisbasicapproachanddealwith
hu
undredsofalarmsatonettime.WewillusetheAlle
enBradleyPLCC5forthisexxample,butaanyPLCwith
w
word,file,andbitwiseoperratorscanbeused.
Th
hefirststepistocreatefo
our(4)integerrmemorywo
ords(16bit)aandlabelasfo
ollows:

Word1(N7:0)Raw Alarmsthisswordcontaiinstheactuallalarmbitsseetinyouruseerprogram.
Word2(N7:1)CurrentAlarmscontainsallccurrentalarm
msthatareeittheracknowleedgedor
unackn
nowledged.
Word3(N7:2)Ackn
nowledgedAlarmscontaainsthestatussofallacknowledgedalarrms.
Word4(N7:3)Unaccknowledged
dAlarmscon
ntainsthestaatusofallunaacknowledged
dalarmsthattare
stillactive.

Th
hesecondste
epistoprogrameachofyo
ourrawalarm
mbitsusingooneofthe16bitsavailableeinwordN7:0
0as
sh
howninFigurre236.

Figure236AlarmStaatusLogicUsiingN7:0Bits

Th
hethirdstepistoprogram
mthelogictofindallunackknowledgedaandacknowleedgedalarmss.InFigure23
37
w
weareusingtw
woCompute(CPT)instrucctionstoperfo
ormthistask..YouwillnoticeinFigure2
237thatweare
ussinglogicalop
peratorsinth
heexpression
nsofeachcom
mputeinstrucctiontoupdattetheacknow
wledgedand
un
nacknowledggedalarmwords.

237LogictoFindUnackno
owledgedanddAcknowledgedAlarms
Figure2
To
obetterunde
erstandwhateachexpresssionisdoingiinthetwoCPPTinstructionsrefertotheematrixinFiggure
23
38a(unacknowledged)an
ndFigure238
8bforacknow
wledgedalarm
ms.Onlytheffirstfivebitsofeachword
dare
sh
hownforeasyyofunderstanding.

Figure2
238aUnackn
nowledgedAl armMatrix


Figure
e238bAckno
owledgedAla rmMatrix
In
nstepfourwe
eprogramthe
elogictocleaartheunackn
nowledgedalaarmsandmovethecurren
ntalarms(N7
7:1)
in
ntotheacknowledgedalarrmwordwhentheacknow
wledgedpush buttonispreessed.SeeFiggure239.

ure239Alarm
mAcknowledggeLogic
Figu

SttepfiveusesanotherCPTinstructionto
oupdatethecurrentalarm
mword(N7:1).SeeFigure2310.

Figure
e231016BitAlarmLogiccExample
ReefertothematrixinFigure
e2311tobe
etterunderstaandthelogicaaloperationb
beingperform
medinthelasstCPT
in
nstructionofFFigure2310.


Figure2311CurrentAlarms Matrix
Rungs3,4and
d5inFigure2
2310monitorrall16alarmsandprovideetheuserwitthstatusinformationoneeach
allarmsuchasw
whetherthealarmhasbeenacknowled
dged,unacknnowledged,orrcurrentlyinanactivealaarm
sttate.Thisinfo
ormationcanbeusedinmanydifferenttwayssuchassturningonw
warninglightsorannunciaator
bo
oards,orsoundingahornifthereareaanyunacknow
wledgedalarm
ms.Therealb
benefittothisstypeofalarm
m
lo
ogicisthatito
operatesinasinglescanandwilltrapthestatusofaanyalarmeveenifthealarm
mwasonlyon
nfor
on
nescan.

M
MULTIPLEA
ALARM&EVENTCAPTURINGLLOGIC
To
oincreasethe
enumberofaalarms(abovesixteen)isaasimplemattterofreplacin
ngtheCPTinsstructionswitthfile
tyypeinstructio
onsthatoperaateonmultip
plewordsato
onetimesuchhastheAllenBradleyFALinstruction.TThe
prrograminFiggure2312rep
placestheCPT,MOV,andCLRinstructi onswithFAL,COP,andFLLLinstructionssthat
m
monitorthestatusof80(16
6x5)alarms.YYoucanincre
easeordecreaasethenumb
berofalarmsbysimply
ch
hangingthele
engthorword
dstooperate
eon.Itisreco
ommendedthhatifyouhavvealargenum
mberofalarm
msor
pllantoincreassethenumbe
erinthefuturrethatyoucreateaseparaatefileforeachalarmstattus(raw,currrent,
un
nacknowledggedandackno
owledged)asshowninFigure2312.
N7:0throughN
N7:4containtherawalarm
msthatareprrogrammedi ntotheuserPLClogic.N10:0throughN
N10:4
ontainthestaatusofallcurrrentalarms,bothacknowledgedanduunacknowledgged.N11:0th
hroughN11:4
co
co
ontainsallackknowledgedaalarmsandN12:0through
hN12:4theunnacknowledggedalarms.

Figure2312AlarmLogicExampleForUpTo80Alarms

TheresetoutputinstructionthatfollowseachFALinstructionensuresthattheFALisresetbeforethenext
programscansothatnoalarmsarelost.
Theexamplesshownsofarinthischapterareonlysomeofthemanywaysthatalarminginformationcanbe
handledinthePLC.MostHMIsystemstodayhaveveryextensivealarmingandeventrecordingcapabilities
thatmakeprogrammingalarmlogicinthePLCalmostobsolete.Thequestionsyoumustaskyourselfis,does
theHMIupdatefastenoughtocaptureyouralarmswithoutaddingadditionalPLClogic.

ALLENBRADLEYLOGIX5000ALMD&ALMAINSTRUCTIONS
TheAllenBradleyLogixfamilyofPLCprocessorshastwoalarm/eventinstructionsdesignedspecificallyfor
monitoringdigitalandanalogdataforabnormalconditionsasprogrammedbytheuser.TheseLogixbased
alarminstructionsareavailableforuseinrelayladder,structuredtext,andfunctionblockdiagramprograms.
Theadvantagetousingthesetwoinstructionsisthatwhenanalarmisdetected,thecontrollerwillpublish
theeventtoFactoryTalkViewAlarmsandEventsserversthatpropagatealarmstoFactoryTalkViewSE
clients(HMIs)thatsubscribetoreceivenotifications.
TheDigitalAlarm(ALMD)instructiondetectsdigitalalarmsbasedonBoolean(true/false)conditions.The
instructionisanoutputinstructionthatobtainsitsalarmconditionfromtherungcondition.Someofthe
featuresoftheALMDinstructionsincludealarmacknowledge,latch,minimumdurationtimer,alarm
counter,timestamp,severity,etc..Figure2313Rung1showsandexampleoftheALMDinstruction.
TheAnalogAlarm(ALMA)instructiondetectsanalogalarmsbasedonthelevelorrateofchangeofananalog
value.Theinstructionisanoutputinstructionandistypicallyplacedonanunconditionalrung.Someofthe
featuresoftheALMAinstructionsincludealarmacknowledge,highandhigh/highlimits,lowandlow/low
limits,deadband,rateofchange,minimumdurationtimer,alarmcounter,timestamp,severity,etc..Figure
2313Rung2showsanexampleoftheALMAinstruction.
Becauseofthemanyfeaturesofbothoftheseinstructionsitisnotpracticaltoincludeacomplete
descriptionhere.Pleaserefertothemanufacturersinstructionmanualforacompletedescription.


Figure2313A
F
AllenBradleyyALMDandA
ALMAInstructtions

C
ChapterSummary
M
ManyPLCapplicationsrequ
uiresomeformofalarminggwhenabno rmalconditio
onsoccur.Wh
henadequatee
allarmingispro
ovided,machineorprocessdowntimecanbeminim
mizedwhichinturnincreasesproductivvity.
W
Whenprogram
mmingalarmlogic,thepro
ogrammersho
ouldtakeintooconsideratio
onhowalarm
mswillbe
caaptured,annu
unciated,acknowledged,aandreset.InssmallPLCproogramapplicaationsthealarmlogiccanbe
prrogrammedinconjunction
nwiththeloggicthatcontro
olsthemachiineorprocesss.Ontheoth
herhand,ifth
hePLC
prrogramislarggewithmanyyalarmsitmaaybeeasierto
ocreatededi catedalarmllogictoproceessandupdatteall
allarmsatonettimewhichw
willsavetime,increasePLC
Cscantime,aanddecreasememoryusagge.Itisnot
un
ncommontofindPLCproggramsthathaavebeencreaatedwithdeddicatedprogramfilesforju
usthandling
allarms.
M
MostHMIsysttemstodayhaaveextensive
ealarmingand
deventcaptuuringfeaturessthatcanred
duceorelimin
nate
th
heneedforPLCprogramm
medalarmloggic.TheseHM
MIsystemscannbeprogram
mmedtomoniitorthePLCtag
an
nddatafilestthatcontaintthemachineo
orprocessinfformationsucchaspressurre,level,runn
ning,fault,etcc.

R
ReviewQue
estions
1. Whatp
pairofPLCinstructionscanbeusedtocaptureand retainalarmss?
2. HowdoesthelogicalXORinstructionwork?
3. Writethealarmloggicthatwillalarmifaprocesstemperattureshouldriiseabove250
0Forfallbellow
100F.
4. InFigu
ure2312whaatwouldyouchangetoinccreasethenuumberofalarrmsto128?
5. InthePLClogicbelo
ow,whenwilltheflowalaarmbeactive??

You might also like