chapter 23 alarm & event programming

15
CHAPTER 23 Alarm & Event Programming Objectives After completing this chapter, you should have the knowledge to: Understand alarm programming. Apply the various techniques to capture alarm and event information. Many PLC applications require some form of alarming when abnormal conditions or events occur. PLCs are well suited for this task and in fact, many PLC manufacturers provide special instructions designed just for this purpose. Some of these special instructions will be covered later in this chapter. Alerting operating or maintenance personnel of abnormal conditions or problems saves time and increases machine or process uptime. When detailed alarming is provided, many problems can be resolved by operators themselves rather than calling a technician to find the problem saving time and increasing productivity. When a PLC system is connected to one of the many HMI interfaces available on the market today, the HMI can provide all of the alarming functions necessary with minimal additional PLC programming. Most HMI software packages provide some form of alarming and event recording. These HMI systems continually monitor the PLC’s internal data files or tags and based on how the HMI is programmed will alarm accordingly. When HMI interfaces with builtin alarming features are not part of the overall system or when events must be captured faster than an HMI system can monitor, the alarming and event recording must be programmed in the PLC. This chapter is dedicated to showing the reader some of the techniques and instructions used to program alarm and event information in PLCs. BASIC ALARM LOGIC Alarms and events can be triggered from digital information such as a motor failing to start or run. They can be triggered from process analog values such as a high temperature or low pressure. Whether monitoring a digital or analog value the end result is the same, a bit or tag is typically set to a 1 or ON indicating that a problem has been detected. Figure 231 illustrates an example of this basic logic.

Upload: duongdat

Post on 01-Jan-2017

238 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: CHAPTER 23 Alarm & Event Programming

CHAPTER 23   Alarm & Event Programming 

Objectives 

After completing this chapter, you should have the knowledge to: 

Understand alarm programming. 

Apply the various techniques to capture alarm and event information. 

Many PLC applications require some form of alarming when abnormal conditions or events occur. PLCs are 

well suited for this task and in fact, many PLC manufacturers provide special instructions designed just for 

this purpose.  Some of these special instructions will be covered later in this chapter.  

Alerting operating or maintenance personnel of abnormal conditions or problems saves time and increases 

machine or process up‐time. When detailed alarming is provided, many problems can be resolved by 

operators themselves rather than calling a technician to find the problem saving time and increasing 

productivity. 

When a PLC system is connected to one of the many HMI interfaces available on the market today, the HMI 

can provide all of the alarming functions necessary with minimal additional PLC programming. Most HMI 

software packages provide some form of alarming and event recording.  These HMI systems continually 

monitor the PLC’s internal data files or tags and based on how the HMI is programmed will alarm accordingly. 

When HMI interfaces with built‐in alarming features are not part of the overall system or when events must 

be captured faster than an HMI system can monitor, the alarming and event recording must be programmed 

in the PLC. This chapter is dedicated to showing the reader some of the techniques and instructions used to 

program alarm and event information in PLCs.  

BASIC ALARM LOGIC 

Alarms and events can be triggered from digital information such as a motor failing to start or run.  They can 

be triggered from process analog values such as a high temperature or low pressure.  Whether monitoring a 

digital or analog value the end result is the same, a bit or tag is typically set to a 1 or ON indicating that a 

problem has been detected.  Figure 23‐1 illustrates an example of this basic logic.     

Page 2: CHAPTER 23 Alarm & Event Programming

R

an

an

an

w

m

Af

sw

th

fr

ot

re

pr

Bo

be

ung 1 in Figur

n alarm if the

nalog temper

n internal bit 

with an actual 

monitored by a

fter studying 

witch is turne

herefore the m

raction of a se

ther PLC logic

similar probl

eached 101° f

rocess, the op

oth problems

elow in Figure

re 23‐1 monit

e motor is not

rature input (

or tag that, w

output that i

an HMI interf

Rung 1 in Fig

ed ON, the sta

motor alarm 

econd may no

c that uses th

lem can be se

for only a spli

perator may n

s described ab

e 23‐2. 

Figu

tors the moto

t running whe

N7:1) and ala

when ON, ind

illuminates a 

face system.  

gure 23‐1, you

atus input fro

will be ON fo

ot seem like m

is alarm infor

een in the sec

t second caus

not know wh

bove can be c

re 23‐1 Basic 

or on/off swit

en the switch 

arms if the te

icates an abn

light, sounds

 

u should see a

m the motor 

r a fraction o

much but it ca

rmation or fa

cond rung wit

sing the high 

at happened

corrected wit

Alarm Logic 

tch and corre

is in the ON 

mperature ex

normal condit

a horn, or lef

a basic proble

starter does 

f a second as

an trigger fals

lsely turning 

th the over te

temperature

.   

h some simp

Example 

sponding mo

position.  The

xceeds 100° F

tion. This inte

ft as an intern

em with this a

not change s

s the motor co

se alarms tha

on an alarm o

emperature a

e alarm to tur

le changes to

otor starter st

e second rung

F. In both run

ernal bit or ta

nal memory a

alarm logic. W

state immedia

ontactor chan

t can cause p

output.  

larm. If the te

rn ON shuttin

o the alarm lo

 

tatus input to

g monitors an

gs the output

g can be repl

address that i

When the mo

ately and 

nges state. Th

problems with

emperature 

g down the 

ogic as shown

 set 

t is 

aced 

is 

otor 

his 

 

Page 3: CHAPTER 23 Alarm & Event Programming

In

al

Th

ex

th

ac

ab

C

Ca

ci

m

th

th

 

n the first run

larm is activa

he second run

xample we ha

he alarm set‐p

ction.  See Ch

bnormal mot

CAPTURING

apturing and 

rcuit as was s

meaning the a

he alarm rete

his chapter. 

g an On‐Dela

ted which is e

ng uses a sea

ave used the 

point before t

hapter 22 for 

or conditions

G ALARM E

retaining ala

shown in Figu

larm status w

ntive as show

Figur

y Timer (TON

enough time 

ling circuit to

start push bu

the alarm can

an example o

s. 

EVENTS 

rm informatio

ure 23‐2, Rung

will be lost if t

wn in Figure 2

re 23‐2 Enhan

N) has been ad

for the moto

o seal‐in the a

utton as the r

n be reset.  Th

of a motor fau

on can be do

g 2 and some

he processor

23‐3. Other m

nced Basic Ala

dded that allo

r contactor to

alarm until the

eset method.

he start butto

ult and monit

ne in multiple

e means to re

r loses power

methods, such

arm Logic 

ows for a sma

o change stat

e alarm is res

. Of course, t

on can be rep

toring logic th

e ways. A sim

est the alarm. 

.  Latching ins

 as moving da

all delay befo

te and preven

set by the ope

he temperatu

placed with al

hat can be use

mple method i

 This method

structions can

ata, will be d

ore the motor

nt a false alar

erator. In our

ure must be b

most any des

ed to alarm 

is to use a sea

d is non‐reten

n be used to m

iscussed later

 

rm. 

below 

sired 

aling 

ntive, 

make 

r in 

Page 4: CHAPTER 23 Alarm & Event Programming

Yo

Th

pu

A

So

ra

m

to

ch

an

ch

in

cu

ti

al

ou will notice

his is done to

ushed while t

ANALOG RA

ome applicati

apid rate of ch

move, and bit 

o the evaluati

hanging the t

nalog value (F

hange is store

nstruction and

urrent analog

mer is done. 

larm on a dec

e in Figure 23‐

o ensure that 

the alarm is s

ATE‐OF‐CH

ions require t

hange and ala

instructions t

ion period (30

imer preset v

F8:1) that wa

ed in F8:2 and

d requires a c

g value when 

This logic mo

creasing rate 

Fi

‐3 that the ala

the alarm rem

till active.   

HANGE ALA

that analog va

arm if such a 

to create a ra

0 seconds). Th

value. Rung 4 

s stored at th

d can be chan

corresponding

the PLC is firs

onitors for a p

of change or 

igure 23‐3 Lat

arm reset (un

mains set for 

ARM LOGI

alues such as

condition exi

te of change 

his evaluation

compares th

he end of the 

nged to any d

g unlatch inst

st started so t

positive (incre

both if desire

tching Alarm 

nlatch) rung is

the entire PL

 temperature

ists. The logic

alarm. Rung 

n period can 

e current ana

last evaluatio

esired value. 

truction to res

that a false al

easing) rate of

ed.  

Logic 

s located abo

LC program sc

e, pressure, le

c in Figure 23‐

2 in Figure 23

be set to any

alog value sto

on period. Th

 The alarm o

set the alarm

larm is not ge

f change, wh

ove the alarm

can if the star

evel, etc. be m

‐4 uses a time

3‐4 is a free r

y desired valu

ored in F8:0 w

e maximum a

output is latch

m. Rung 1 is us

enerated the 

ich can be ea

 set (latch) ru

rt button is 

monitored for

er, compare, 

unning timer

e by simply 

with the previ

allowable rat

hed using the 

sed to store t

first time the

asily changed 

 

ung. 

r a 

 set 

ious 

e of 

latch 

the 

to 

Page 5: CHAPTER 23 Alarm & Event Programming

 

Figur

 

e 23‐4 Rate‐oof‐Change Alaarm Logic 

Page 6: CHAPTER 23 Alarm & Event Programming

A

Ea

bo

en

an

ye

w

de

ha

Th

te

de

ex

Th

an

bo

ANNUNCIA

arly alarming 

oards used a 

ngraved on th

nnunciators w

et acknowled

was acknowled

epending on 

ad occurred (

he PLC ladder

emperature a

escribed abov

xample on ho

he over temp

n internal me

oard.   

ATOR LOGIC

methods use

light behind a

he window. W

would use thr

ged by the op

dged, the alar

the state of t

(flashing), wh

r logic to mim

alarm as was s

ve.  The “Flas

ow to program

perature alarm

emory addres

C  

ed an annunc

an opaque w

When the alar

ree modes to 

perator, the a

rm window w

the alarm. Op

ich are still ac

mic the early a

shown in Figu

sher” contact 

m this flasher

Figure

m could be a 

s monitored 

iator board to

indow. The o

rm was active

indicate an a

alarm window

would stop fla

perators could

ctive (illumin

annunciators 

ure 23‐2 and a

is a ½ second

r.  

e 23‐5 Basic A

hardwired ou

by an HMI th

o notify oper

paque windo

e the window

alarm conditio

w would flash

ashing and eit

d monitor the

ated), and wh

is shown Figu

added the ne

d On/Off inte

Annunciator T

utput to a ligh

at has been p

ators of prob

ow would hav

w would be illu

on.  If the ala

h indicating th

ther remain il

e annunciator

hich were not

ure 23‐5. Her

ecessary logic

rnal memory

Type Logic 

ht on an annu

programmed 

blems. These a

ve the name o

uminated.  Th

rm had been 

he problem. O

lluminated or

r board and te

t active (non‐

re we have us

c so that the a

y address. See

unciators boa

to mimic an 

annunciator 

of the alarm 

hese alarm 

triggered bu

Once the alar

r turn off 

ell which alar

‐illuminated).

sed the same 

alarm functio

e Chapter 22 f

rd or it could

annunciator 

t not 

rms 

over 

ns as 

for an 

 

 be 

Page 7: CHAPTER 23 Alarm & Event Programming

If 

B

be

w

yo

at

Ch

In

w

hu

w

Th

Th

sh

you only hav

ut if you have

ecome cumb

way to handle 

ou recall from

t the bit level

hapter 6 wou

n the example

words of data.

undreds of al

word, file, and

he first step i

Word 

Word 

unackn

Word 

Word 

still ac

he second ste

hown in Figur

ve a handful o

e more than a

ersome requi

a large numb

m Chapter 6 “

 to make logi

uld be strongl

e that follows

 Later in this 

arms at one t

 bitwise oper

s to create fo

1 (N7:0) Raw

2 (N7:1) Curr

nowledged. 

3 (N7:2) Ackn

4 (N7:3) Unac

tive. 

ep is to progr

re 23‐6. 

of alarms to p

a handful or e

iring addition

ber of alarms 

Digital Logic G

cal decisions

y recommend

s we will prog

chapter we w

time.  We wil

rators can be 

our (4) integer

Alarms – this

ent Alarms – 

nowledged Al

cknowledged

am each of yo

Figure 2

program, then

even a few hu

nal programm

is to use bitw

Gates” that d

. If you are no

ded before pr

gram the alarm

will show how

l use the Alle

used.  

r memory wo

s word contai

contains all c

arms – conta

d Alarms – con

our raw alarm

3‐6 Alarm Sta

n the method

undred alarm

ming time, me

wise logic alon

igital logic no

ot familiar wit

roceeding. 

m logic for 16

w you can take

en‐Bradley PLC

ords (16 bit) a

ins the actual

current alarm

ains the status

ntains the sta

m bits using o

atus Logic Usi

d shown in Fig

s to deal with

emory usage, 

ng with word

otations such 

th digital logi

6 alarms (one

e this basic a

C‐5 for this ex

and label as fo

l alarm bits se

ms that are eit

s of all ackno

atus of all una

one of the 16 

ing N7:0 Bits

gure 23‐5 will

h, then this m

and scan tim

 and file mov

as AND, OR, 

ic notations t

 16 bit word)

pproach and 

xample, but a

ollows: 

et in your use

ther acknowle

wledged alar

acknowledged

bits available

 work just fin

method may 

e. A much be

ve instruction

XOR, etc. ope

hen a review 

 by manipula

deal with 

any PLC with 

er program. 

edged or 

rms. 

d alarms that

e in word N7:0

 

ne. 

etter 

s.  If 

erate 

 of 

ating 

t are 

0 as 

Page 8: CHAPTER 23 Alarm & Event Programming

Th

w

us

un

To

23

sh

he third step 

we are using tw

sing logical op

nacknowledg

o better unde

3‐8a (unackn

hown for easy

is to program

wo Compute 

perators in th

ged alarm wo

Figure 2

erstand what 

owledged) an

y of understa

m the logic to 

(CPT) instruc

he expression

rds.  

23‐7 Logic to 

each express

nd Figure 23‐8

nding. 

Figure 2

find all unack

ctions to perfo

ns of each com

Find Unackno

sion is doing i

8b for acknow

23‐8a Unackn

knowledged a

orm this task.

mpute instruc

owledged and

in the two CP

wledged alarm

nowledged Al

and acknowle

. You will not

ction to updat

d Acknowled

PT instruction

ms. Only the f

arm Matrix 

edged alarms

ice in Figure 2

te the acknow

ged Alarms 

s refer to the

first five bits 

s. In Figure 23

23‐7 that we 

wledged and 

e matrix in Fig

of each word

 

3‐7 

are 

 

gure 

d are 

Page 9: CHAPTER 23 Alarm & Event Programming

In

in

n step four we

nto the ackno

e program the

wledged alar

Figure

e logic to clea

rm word whe

Figu

e 23‐8b Ackno

ar the unackn

n the acknow

ure 23‐9 Alarm

owledged Ala

nowledged ala

wledged push 

m Acknowledg

rm Matrix 

arms and mo

button is pre

ge Logic 

ve the curren

essed. See Fig

 

nt alarms (N7

gure 23‐9. 

 

7:1) 

Page 10: CHAPTER 23 Alarm & Event Programming

St

Re

in

tep five uses 

efer to the m

nstruction of F

another CPT 

atrix in Figure

Figure 23‐10.

instruction to

Figure

e 23‐11 to be

 

o update the 

e 23‐10 16‐Bi

etter understa

current alarm

t Alarm Logic

and the logica

m word (N7:1

c Example 

al operation b

). See Figure 

being perform

23‐10. 

med in the las

 

st CPT 

Page 11: CHAPTER 23 Alarm & Event Programming

R

al

st

bo

lo

on

M

To

ty

pr

m

ch

pl

un

N

co

co

ungs 3, 4 and

larm such as w

tate. This info

oards, or sou

ogic is that it o

ne scan.   

MULTIPLE A

o increase the

ype instructio

rogram in Fig

monitor the st

hanging the le

lan to increas

nacknowledg

7:0 through N

ontain the sta

ontains all ack

d 5 in Figure 2

whether the 

ormation can 

nding a horn 

operates in a 

ALARM & 

e number of a

ons that opera

gure 23‐12 rep

atus of 80 (16

ength or word

se the numbe

ged and ackno

N7:4 contain 

atus of all cur

knowledged a

Fig

23‐10 monitor

alarm has be

be used in m

if there are a

single scan a

EVENT CA

alarms (abov

ate on multip

places the CP

6x5) alarms. Y

ds to operate

er in the futur

owledged) as 

the raw alarm

rrent alarms, 

alarms and N

ure 23‐11 Cu

r all 16 alarm

en acknowled

any different

any unacknow

nd will trap t

PTURING L

e sixteen) is a

ple words at o

T, MOV, and 

You can incre

e on. It is reco

re that you cr

shown in Fig

ms that are pr

both acknow

12:0 through

rrent Alarms 

s and provide

dged, unackn

t ways such as

wledged alarm

he status of a

LOGIC 

a simple matt

one time such

CLR instructi

ease or decrea

ommended th

eate a separa

ure 23‐12. 

rogrammed i

ledged and u

h N12:4 the un

Matrix 

e the user wit

nowledged, or

s turning on w

ms. The real b

any alarm eve

ter of replacin

h as the Allen‐

ons with FAL

ase the numb

hat if you hav

ate file for ea

nto the user 

unacknowledg

nacknowledg

th status info

r currently in 

warning light

benefit to this

en if the alarm

ng the CPT ins

‐Bradley FAL 

, COP, and FL

ber of alarms 

ve a large num

ch alarm stat

PLC logic. N1

ged. N11:0 th

ged alarms. 

 

rmation on e

an active ala

s or annuncia

s type of alarm

m was only on

structions wit

instruction. T

LL instructions

by simply 

mber of alarm

tus (raw, curr

0:0 through N

hrough N11:4

each 

arm 

ator 

n for 

th file 

The 

s that 

ms or 

rent, 

N10:4 

Page 12: CHAPTER 23 Alarm & Event Programming

Figure 23‐12 Alarm Logic Example For Up To 80 Alarms 

Page 13: CHAPTER 23 Alarm & Event Programming

The reset output instruction that follows each FAL instruction ensures that the FAL is reset before the next 

program scan so that no alarms are lost.    

The examples shown so far in this chapter are only some of the many ways that alarming information can be 

handled in the PLC. Most HMI systems today have very extensive alarming and event recording capabilities 

that make programming alarm logic in the PLC almost obsolete. The questions you must ask yourself is, does 

the HMI update fast enough to capture your alarms without adding additional PLC logic. 

ALLEN‐BRADLEY LOGIX5000 ALMD & ALMA INSTRUCTIONS 

The Allen‐Bradley Logix family of PLC processors has two alarm/event instructions designed specifically for 

monitoring digital and analog data for abnormal conditions as programmed by the user.  These Logix‐based 

alarm instructions are available for use in relay ladder, structured text, and function block diagram programs. 

The advantage to using these two instructions is that when an alarm is detected, the controller will publish 

the event to FactoryTalk View Alarms and Events servers that propagate alarms to FactoryTalk View SE 

clients (HMIs) that subscribe to receive notifications.  

The Digital Alarm (ALMD) instruction detects digital alarms based on Boolean (true/false) conditions. The 

instruction is an output instruction that obtains its alarm condition from the rung condition. Some of the 

features of the ALMD instructions include alarm acknowledge, latch, minimum duration timer, alarm 

counter, time stamp, severity, etc..  Figure 23‐13 Rung 1 shows and example of the ALMD instruction.  

The Analog Alarm (ALMA) instruction detects analog alarms based on the level or rate of change of an analog 

value. The instruction is an output instruction and is typically placed on an unconditional rung. Some of the 

features of the ALMA instructions include alarm acknowledge, high and high/high limits, low and low/low 

limits, dead band, rate‐of‐change, minimum duration timer, alarm counter, time stamp, severity, etc..  Figure 

23‐13 Rung 2 shows an example of the ALMA instruction.  

Because of the many features of both of these instructions it is not practical to include a complete 

description here. Please refer to the manufacturer’s instruction manual for a complete description. 

Page 14: CHAPTER 23 Alarm & Event Programming

C

M

al

W

ca

pr

pr

al

un

al

M

th

an

 

Chapter Su

Many PLC app

larming is pro

When program

aptured, annu

rogrammed i

rogram is larg

larms at one t

ncommon to 

larms. 

Most HMI syst

he need for P

nd data files t

F

mmary 

lications requ

ovided, mach

mming alarm 

unciated, ack

n conjunction

ge with many

time which w

find PLC prog

tems today ha

LC programm

that contain t

Figure 23‐13 A

uire some for

ine or proces

logic, the pro

nowledged, a

n with the log

y alarms it ma

will save time,

grams that ha

ave extensive

med alarm log

the machine o

 

Allen‐Bradley

m of alarming

s down‐time 

ogrammer sho

and reset. In s

gic that contro

ay be easier to

 increase PLC

ave been crea

e alarming and

gic. These HM

or process inf

y ALMD and A

g when abno

can be minim

ould take into

small PLC pro

ols the machi

o create dedi

C scan time, a

ated with ded

d event captu

MI systems can

formation suc

ALMA Instruct

rmal conditio

mized which i

o consideratio

ogram applica

ine or proces

cated alarm l

and decrease 

dicated progr

uring features

n be program

ch as pressur

tions 

ons occur. Wh

n turn increa

on how alarm

ations the ala

ss. On the oth

logic to proce

memory usag

am files for ju

s that can red

mmed to moni

re, level, runn

hen adequate

ses productiv

ms will be 

rm logic can 

her hand, if th

ess and updat

ge. It is not 

ust handling 

duce or elimin

itor the PLC t

ning, fault, etc

 

vity. 

be 

he PLC 

te all 

nate 

ag 

c.                

Page 15: CHAPTER 23 Alarm & Event Programming

R

   

   

Review Que

1. What p

2. How d

3. Write 

100° F

4. In Figu

5. In the 

        

  

estions 

pair of PLC in

oes the logic

the alarm log

ure 23‐12 wha

PLC logic belo

structions ca

al XOR instru

gic that will al

at would you 

ow, when wil

n be used to 

ction work?

arm if a proc

change to inc

l the flow ala

capture and 

ess temperat

crease the nu

arm be active?

retain alarms

ture should ri

umber of alar

s? 

ise above 250

rms to 128?   

0° F or fall bellow