You are on page 1of 119

Basic PLC

Ch. 4 PLC

Basic PLC

Description
This chapter introduces the basic hardware and software components of a Programmable Controller (PLC). It details the architecture and basic instruction set common to all PLCs. Basic programming techniques and logic designs are co ered. This unit describes the operating features of the PLC! the ad antages of the PLC o er hard"wired control s#stems! practical applications! troubleshooting and maintenance of PLCs.

Basic PLC

Objectives
$t the end of this chapter we should be able to% &escribe the ma'or components of a common PLC. Interpret PLC specifications. $ppl# troubleshooting techniques. Con ert con entional rela# logic to a PLC language. (perate and program a PLC for a gi en application.

Basic PLC

Contents
)istor# of Programmable Controllers *ela# Ladder Logic Central Processing +nit Input,output -#stem Programming and Peripheral &e ices Programming Concepts $pplications Troubleshooting and .aintenance

Basic PLC

IN !OD"C ION O PLC#


Advantages of PLCs 1. Less wiring. /. 0iring between de ices and rela# contacts are done in the PLC program. 1. 2asier and faster to ma3e changes. 4. Trouble shooting aids ma3e programming easier and reduce downtime. 5. *eliable components ma3e these li3el# to operate for #ears before failure.

Basic PLC

PLC Origin

" &e eloped to replace rela#s in the late 6789s " Costs dropped and became popular b# 67:9s " ;ow used in man# industrial designs

Basic PLC

%istorica& Bac'gro(nd

The %)dra*atic Division of the +enera& ,otors Corporation specified the design criteria for the first programmable controller in 1-./. Their primar# goal was to e&i*inate t0e 0ig0 costs associated 1it0 inf&e2ib&e3 re&a)4contro&&ed s)ste*s. The controller had to be designed in modular form! so that sub" assemblies could be remo ed easil# for replacement or repair. The control s#stem needed the capabilit# to pass data collection to a central s#stem. The s#stem had to be reusable. The method used to program the controller had to be simple! so that it could be easil# understood b# plant personnel.
$

Basic PLC

Progra**ab&e Contro&&er Deve&op*ent


678: 6787 67=4 Programmable concept de eloped )ardware CP+ controller! with logic instructions! 6 < of memor# and 6/: I,( points +se of se eral (multi) processors within a PLC " timers and counters> arithmetic operations> 6/ < of memor# and 69/4 I,( points *emote input,output s#stems introduced .icroprocessors " based PLC introduced

67=8 67==

Basic PLC

Progra**ab&e Contro&&er Deve&op*ent


67:9 Intelligent I,( modules de eloped 2nhanced communications facilities 2nhanced software features (e.g. documentation) +se of personal microcomputers as programming aids 67:1 Low " cost small PLCs introduced 67:5 on ;etwor3ing of all le els of PLC! computer and machine using -C$&$ software.

Basic PLC

Comparison between PC and PLC


The main difference from other computers is that PLCs are armored for severe conditions (dust, moisture, heat, cold, etc) and have the facility for extensive input output (! ") arran#ements. Advantages over PC $ 1. Cost effective for controllin# complex systems. %. &lexi'le and can 'e reapplied to control other systems (uic)ly and easily. *. Computational a'ilities allo+ more sophisticated control. 4. Trou'le shootin# aids ma)e pro#rammin# easier and reduce do+ntime. ,. -elia'le components ma)e these li)ely to operate for years 'efore failure. Disadvantages over PC : .. Too much +or) re(uired in connectin# +ires. /. 0ifficulty +ith chan#es or replacements. 1. 0ifficulty in findin# errors2 re(uirin# s)illful +or) force.

Basic PLC

Progra**ab&e Logic Contro&&ers


5 Definition according to N6,A standard IC#341-$/7

$ digitall# operating electronic apparatus which uses a programming memor# for the internal storage of instructions for implementing specific functions such as logic! sequencing! timing! counting and arithmetic to control through digital or analog modules! arious t#pes of machines or process.

11

Basic PLC

Progra**ab&e Logic Contro&&er8 Definition


Definition: Formerly: Today: Function: Distinguish small computers, dedicated to automation tasks in an industrial environment" cabled relay control (hence 'logic'), analog (pneumatic, hydraulic) governors real-time (embedded) computer with extensive input/output Measure, Control, Protect Instrumentation flow meter, temperature, position,. but also actors (pump, ) Control programmable logic controllers with digital peripherals & field bus Visualization HMI3 in PLCs (when it exists) is limited to service help and control of operator displays
34uman 5achine !nterface

Basic PLC

Simple PLC
'inary inputs

net+or)

'inary outputs

analo# inputs outputs

Basic PLC

PLC in a cabinet
CPU1

PLC in a ca'inet

CPU2 serial connections inputs/outputs

redundant field bus connection

Basic PLC

e2a*p&e8 t(rbine contro& 5in t0e test &ab )

Basic PLC

PLC8 f(nctions

PLC 6 P5C$ Protection, 5easurement and Control


Measure Control (Command and Regulation) Protection

Event Logging Communication Human interface

Basic PLC

PLC8 C0aracteristics
large number of peripherals: 20..100 I/O per CPU, high density of wiring, easy assembly. binary and analog Input/output with standard levels operate under harsh conditions, require robust construction, protection against dirt, water and mechanical threats, electro-magnetic noise, vibration, extreme temperature range (-30C..85C), sometimes directly located in the field. programming: either very primitive with hand-held terminals on the target machine itself, or with a lap-top able to down-load programs. network connection allows programming on workstations and connection to SCADA field bus connection for remote I/Os primitive Human-Machine-Interface for maintenance, either through LCD-display or connection of a laptop over serial lines (RS232) or wireless. economical - 1000.- .. 15'000.- for a full crate. the value is in the application software (licenses 20'000 ..50'000)

Basic PLC

PLC8 Location in t0e contro& arc0itect(re


7n#ineer "perator station station
Control Bus (e.#. 7thernet)
large PLCs
Control Station wit$ "ield Bus
CO&( CO& '

9upervisor 9tation

7nterprise 8et+or) gatewa#

CO& '

CO&(

CPU I/O

CPU

I/O

I/O

I/O

I/O

I/O

I/O

I/O

I/O

"ield Bus
CO& CO& I/O CO& CPU CO&

I/O

PLC

CPU CO&(

PLC

gatewa#

"ield Bus
CO& I/O I/O

CPU

dire%t I/O

"ield Stations "B gatewa# "ield Devi%es small PLC data %on%entrators) not programmable) Sensor Bus (e g ASI! but %on*igurable

CPU

I/O

I/O

I/O

I/O

Basic PLC

+$# ',- / ,. - suppl# /


After the plant lost electric power, operators could read instruments only by plugging in temporary batteries [IEEE Spectrum Nov 2011 about Fukushima]

Basic PLC

Leading Brands Of PLC


$.2*IC$; 6. $llen Bradle# /. ?ould .odicon 1. Te@as Instruments 4. ?eneral 2lectric 5. 0estinghouse 8. Cutter )ammer =. -quare & 2+*(P2$; 6. -iemens /. <loc3ner A .ouller 1. Besto 4. Telemechanique
29

Basic PLC

Leading Brands Of PLC


C$P$;2-2 6. Toshiba /. (mron 1. Banuc 4. .itsubishi

21

Basic PLC

Areas of App&ication
.anufacturing , .achining Bood , Be erage .etals Power .ining Petrochemical , Chemical

22

Basic PLC

PLC #i:e
6. -.$LL " it co ers units with up to 6/: I,(s and memories up to / <b#tes. " these PLCs are capable of pro iding simple to ad ance le els or machine controls. /. .2&I+. " ha e up to /94: I,(s and memories up to 1/ <b#tes. 1. L$*?2 " the most sophisticated units of the PLC famil#. The# ha e up to :67/ I,(s and memories up to =59 <b#tes. " can control indi idual production processes or entire plant.
23

Basic PLC

)pes of PLC

(1)

Compact Monolithic construction Monoprocessor Fieldbus connection


Fixed casing Fixed number of I/O (most of them binary) No process computer capabilities (no MMC) Typical product: Mitsubishi MELSEC F, ABB AC31, SIMATIC S7

(2)

Modular PLC Modular construction (backplane) One- or multiprocessor system Fieldbus and LAN connection
3U or 6U rack, sometimes DIN-rail Large variety of input/output boards Connection to serial bus Small MMC function possible Typical products: SIMATIC S5-115, Hitachi H-Serie, ABB AC110

(3)

Soft-PLC Windows NT or CE-based automation products Direct use of CPU or co-processors

Basic PLC

Co*pact PLC

Monolithic (one-piece) construction Fixed casing Fixed number of I/O (most of them binary) No process computer capabilities (no MMC) Can be extended and networked by an extension (field) bus Sometimes LAN connection (Ethernet, Arcnet) Monoprocessor costs: 2000 Typical product: Mitsubishi MELSEC F, ABB AC31, SIMATIC S7

Basic PLC

,od(&ar PLC
RS232 development environment

tailored to the needs of an application housed in a 19" (42 cm) rack (height 6U ( = 233 mm) or 3U (=100mm) high processing power (several CPU) large choice of I/O boards concentration of a large number of I/O interface boards to field busses requires marshalling of signals primitive or no HMI cost effective if the rack can be filled
CPU CPU Analog I/O Binary I/O
courtesy ABB

LAN backplane parallel bus fieldbus Power Supply

fieldbus

supply 115-230V~ , 24V= or 48V= (redundant) cost ~ 10000 for a filled crate

Basic PLC

#*a&& *od(&ar PLC

mounted on &I;"rail! /4D suppl# cheaper (E5999) not water"proof! no entilator e@tensible b# a parallel bus (flat cable or rail)

Basic PLC

#oft4PLC 5PC as PLC7


PC as engineering workstation PC as human interface (Visual Basic, Intellution, Wonderware) PC as real-time processor (Soft-PLC) PC assisted by a Co-Processor (ISA- or PC104 board) PC as field bus gateway to a distributed I/O system

23 4 3 3

12 2

I/O modules

Basic PLC

PLC evo&(tion
Binary World relay controls, Relay control pneumatic sequencer
A B C

Analog World Pneumatic and electromechanical controllers


I1

P1 P2

combinatorial

sequential

Regulation, controllers continuous processes

discrete processes

Programmable Logic Controllers

Basic PLC

Contin(o(s P&ant

7xample$ traction motors, ovens, pressure vessel,... The state of continuous plants is descri'ed 'y continuous (analo#) state varia'les li)e temperature, volta#e, speed, etc. There exist a fixed relationship 'et+een input and output , descri'ed 'y a continuous model in form of a transfer function &. This transfer function can 'e expressed 'y a set of differential e(uations. !f e(uations are linear, the transfer function may expressed as Laplace or :;transform.
y x (1<Ts) &(s) 6 (1<T1s < T% s%) y

time

Continuous plants are normally reversi'le and monotone. This is the condition to allo+ their re#ulation. The time constant of the control system must 'e at least one order of ma#nitude smaller than the smallest time constant of the plant. t$e prin%ipal tas0 o* t$e %ontrol s#stem *or a %ontinuous plant is its regulation

Basic PLC

Discrete P&ant
init b a 1 7 6 5 2 c + d 3 e e c+d 4

Examples: Elevators, traffic signaling, warehouses, etc.

The plant is described by variables which take well-defined, non-overlapping values The transition from one state to another is abrupt, it is caused by an external event. Discrete plants are normally reversible, but not monotone, i.e. negating the event which caused a transition will not revert the plant to the previous state.

Example: an elevator doesn't return to the previous floor when the button is released. Discrete plants are described e.g. by finite state machines or Petri nets. t$e main tas0 o* a %ontrol s#stem wit$ dis%rete plants is its se1uential %ontrol

Basic PLC

62a*p&e of Discrete state s)ste*8 an' "sed to ,i2 1o Li;(ids


,O O!

A
<#

<LOA #=I C%

#OL6NOID#

#OL6NOID
I,6!

1 4,IN" 6

32

Basic PLC

an' "sed to ,i2 1o Li;(ids


$ tan3 is used to mi@ two liquids. The control circuit operates as follows% 6. 0hen the start button is pressed! solenoids $ and B energiFe. This permits the two liquids to begin filling the tan3. /. 0hen the tan3 is filled! the float switch trips. This de" energiFes solenoids $ and B and starts the motor used to mi@ the liquids together. 1. The motor is permitted to run for one minute. $fter one minute has elapsed! the motor turns off and solenoid C energiFes to drain the tan3.
33

Basic PLC

an' "sed to ,i2 1o Li;(ids


4. 0hen the tan3 is empt#! the float switch de"energiFes solenoid C. 5. $ stop button can be used to stop the process at an# point. 8. If the motor becomes o erloaded! the action of the entire circuit will stop. =. (nce the circuit has been energiFed it will continue to operate until it is manuall# stopped.

34

Basic PLC

B&oc' Diagra* of PLC


PO=6! #"PPL? I , N O P D " " L 6 O , " O D P " " L 6

<ro* #6N#O!# P(s0b(ttons3 contacts3 &i*it s1itc0es3 etc.

P!OC6##O! CP" AL" ,e*or)

P!O+!A,,IN+ D6@IC6

o O" P" #o&enoids3 contactors3 a&ar*s etc.

3>

Basic PLC

,ajor Co*ponents of a Co**on PLC


PO=6! #"PPL? Pro ides the oltage needed to run the primar# PLC components

3.

Basic PLC

,ajor Co*ponents of a Co**on PLC


IAO ,OD"L6# Pro ides signal con ersion and isolation between the internal logic le el signals inside the PLC and the fields high le el signal. Performs the following functions% 6. er*ination8 Pro ides terminals for connection to field de ices /. Iso&ation8 Pro ides isolation between the high power field de ices and low power controller generall# b# ma3ing use of optical couplers. 1. #igna& Conditioning% Performs signal con ersion li3e $ to & or & to $. 4. Indication% .a3es use of low power L2&s to indicate the absence (low state) or presence (high state) of the field de ices.

Basic PLC

,ajor Co*ponents of a Co**on PLC


P!OC6##O! Pro ides intelligence to command and go ern the acti ities of the entire PLC s#stems. Consists of % 6. CP+ /. $L+ 1. .emor#% *$.! *(. and Biles ( Program and &ata) P!O+!A,,IN+ D6@IC6 2@ternal de ice used to enter the desired program that will determine the sequence of operation and control of process equipment or dri en machine. &ifferent t#pes of programming de ices used with PLC are% 4. )and held terminals 5. &edicated terminals 8. .icrocomputer (PC) 3/

Basic PLC

Progra**ing Device
$lso 3nown as% Industrial Terminal ( $llen Bradle# ) Program &e elopment Terminal ( ?eneral 2lectric ) Programming Panel ( ?ould .odicon ) Programmer ( -quare & ) Program Loader ( Idec"IFumi ) Programming Console ( <e#ence , (mron )
3-

Basic PLC

Progra**ing Device

%and 0e&d (nit 1it0 L6D A LCD disp&a) % It is a small self contained unit in which the ladder diagram is displa#ed one rung at a time in a special liquid cr#stal displa#. The user can enter a program! perform diagnostic tests! run the program through the programmable controller and perform editing of the installed program. The installed program is stored in a temporar# memor# that will be lost without ac power or batter# bac3 up. The program can be permanentl# burned into a *(. for final installation.

49

Basic PLC

%. Dedicated ter*ina&s% These are used with onl# one t#pe and ma3e
of PLC and is used when programming has to be done in mass for the same t#pe of the controller. 1. ,icroco*p(ter 5PC7 % It is able to displa# man# rungs of the ladder &iagram. The ad antage of PC is that it can be used for programming &ifferent ma3es of PLC b# running their respecti e loaded software and when not on the networ3 can be used for other applications such as design or accounting.

Basic PLC

IAO ,od(&e
The I,( interface section of a PLC connects it to e@ternal field de ices. The main purpose of the I,( interface is to condition the arious signals recei ed from or sent to the e@ternal input and output de ices. Input modules con erts signals from discrete or analog input de ices to logic le els acceptable to PLCs processor. (utput modules con erts signal from the processor to le els capable of dri ing the connected discrete or analog output de ices.
42

Basic PLC

C&assification of IAO ,od(&e


17 #eria& IAO 27 Para&&e& IAO 37 Discrete IAO 8 $C ! &C &iscrete I,( 47 Ana&og IAO 8 $nalog Input (9"5 D!9"69 D!6"5 D!4"/9 m$) $nalog (utput (4"/9 m$! 9"69 D) >7 #pecia& p(rpose IAO 8 $-CII communication module! -tepper motor module! Thermocouple module! Bar code module! Dision s#stem module! PI& Controller module.

Basic PLC

Discrete Inp(t ,od(&e

.ost common input interface used with PLCs. DI#C!6 6 DC INP" ,OD"L6
+-2 T( &*(P T)2 D(LT$?2 T( L(?IC L2D2L I- ;22&2& T(% Pre ent oltage transients from damaging the processor. )elps reduce the effects of electrical noise

<!O, INP" D6@IC6

Current Limiting *esistor

OP O4 I#OLA O!

#igna& Conditioning Buffer! Bilter! h#steresis Circuits

O P!OC6##O!

44

Basic PLC

DI#C!6 6 AC INP" ,OD"L6


C(;D2*T- T)2 $C I;P+T T( &C $;& &*(P- T)2 D(LT$?2 T( L(?IC L2D2L I- ;22&2& T(% Pre ent oltage transients from damaging the processor. )elps reduce the effects of electrical noise

<!O, INP" D6@IC6

*ectifier! *esistor ;etwor3

OP O4 I#OLA O!

#igna& Conditioning Buffer! Bilter! h#steresis Circuits

O P!OC6##O!

4>

Basic PLC

Basic PLC

Basic PLC

Basic PLC

DI#C!6 6 O" P" ,OD"L6


The# are most widel# used and simpl# act as switches to control output field de ices. DI#C!6 6 DC O" P" ,OD"L6

Basic PLC

DI#C!6 6 AC O" P" ,OD"L6


I- ;22&2& T(% Pre ent oltage transients from damaging the processor. )elps reduce the effects of electrical noise

<!O, P!OC6##O!

TTL Circuits

OP O4 I#OLA O!

$mplifier *2L$G T*I$C H-I-T(*

O O" P" D6@IC6

>9

Basic PLC

Operation f&o1 of an O(tp(t ,od(&e

Basic PLC

Ana&og Inp(t ,od(&e


It is used to interface a PLC to analog input signals. The module con erts analog input signals to 68"bit binar# alues for storage in processors input image table. It accepts signals 9 to 69 D &C!"69 D to I69 D &C! 6 to 5 D &C! 4 to /9 m$! 9 to /9 m$! "/9 to I/9 m$.

Basic PLC

Ana&og O(tp(t ,od(&e


It accepts a 68 bit output status word which the# con ert into an analog alue through digital to analog con erter. T#pical analog signals 9 to 69 D &C!"69 D to I69 D &C! 6 to 5 D &C! 4 to /9 m$! 9 to /9 m$! "/9 to I/9 m$. $nalog output modules are selected to send out either a ar#ing current or oltage signal. Bor 2@% If the speed of the &C motor is to be aried o er a range of sa# 6999"1999 rpm! the oltage of an output module of range 9 J 6 D &C will represent a specific speed o er the range.

Basic PLC

Basic PLC

+enera& PLC arc0itect(re


-9 %*% -eal;Time Cloc) -"5 flash 7P-"5 serial port controller

7thernet

CP>

ethernet controller extension bus

parallel bus

'uffers

field 'us controller

analo#; di#ital converters


si#nal conditionin#

di#ital; analo# converters


po+er amplifiers

0i#ital "utput

0i#ital !nput
si#nal conditionin#

external ! "s

relays

field 'us

direct !nputs and "utputs

Basic PLC

0e signa& c0ain 1it0in a PLC


y(i) y(i)

time

time

time

analo# filterin# varia'le @ (e.#. 4..%0m?) scalin# 'inary varia'le filterin# (e.#. 0..%4A)

samplin#

analo#; di#ital converter


1

011011001111

di#ital; analo# converter

analo# amplifier varia'le e.#. ;10A..10A transistor or relay 'inary varia'le

processin#

samplin#
0001111

counter

non;volatile memory

time

Basic PLC

23ample: Signal %$ain in a prote%tion devi%e


!nput transformer ?nti aliasin# filter 9ample and hold ? 0 conversion 0i#ital Protection "utput filter al#orithm driver

U/I


f 6 %00 )4B f 6 1 54B

?0

CP>

4rip
reaction C 10 ms

f 6 *00 ;1%00 4B f 6 100 )4B

Basic PLC

IAO Circ(its
DI<<6!6N ?P6# O< IAO CI!C"I # 6. Pi&ot D(t) O(tp(ts (utputs of this t#pe t#picall# are used to dri e high"current electromagnetic loads such as solenoids! rela#s! al es! and motor starters. These loads are highl# inducti e and e@hibit a large inrush current. Pilot dut# outputs should be capable of withstanding an inrush current of 69 times the rated load for a short period of time without failure.
>/

Basic PLC

IAO Circ(its
/. +enera& 4 P(rpose O(tp(ts These are usuall# low" oltage and low"current and are used to dri e indicating lights and other non"inducti e loads. ;oise suppression ma# or ma# not be included on this t#pes of modules. 1. Discrete Inp(ts Circuits of this t#pe are used to sense the status of limit switches! push buttons! and other discrete sensors. ;oise suppression is of great importance in pre enting false indication of inputs turning on or off because of noise.

>-

Basic PLC

IAO Circ(its
4. Ana&og IAO Circuits of this t#pe sense or dri e analog signals. $nalog inputs come from de ices! such as thermocouples! strain gages! or pressure sensors! that pro ide a signal oltage or current that is deri ed from the process ariable. -tandard $nalog Input signals% 4"/9m$> 9"69D $nalog outputs can be used to dri e de ices such as oltmeters! H"G recorders! ser omotor dri es! and al es through the use of transducers. -tandard $nalog (utput signals% 4"/9m$> 9"5D> 9"69D
.9

Basic PLC

IAO Circ(its
5. #pecia& 4 P(rpose IAO Circuits of this t#pe are used to interface PLCs to er# specific t#pes of circuits such as ser omotors! stepping motors PI& (proportional plus integral plus deri ati e) loops! high"speed pulse counting! resol er and decoder inputs! multiple@ed displa#s! and 3e#boards. This module allows for limited access to timer and counter presets and other PLC ariables without requiring a program loader.

.1

Basic PLC

(+TP+TI;P+TC(;T$CT(* L$.P P+-)B+TT(;.(T(*

PLC

Basic PLC

?llen;Dradley 1/4.;1?1.
L6 L/

!6 !nput !$%
5odule 7lement slot G in rac)

P. D 9E!TC4

5odule Terminal G Dit Address I:' 5/5

L?007- P-"F-?5 !8P>T 5"0>L7 E!-!8F 0!?F-?5

Basic PLC

L%

L1

C"8T?CT"8."

L% L1 &!7L0 E!-!8F

5"T"K 9"L78"! 0 K A?LA79 K L?5P K D>::7-

">TP>T 5"0>L7 E!-!8F L1

"$4

L%

C"8T?CT"-

L?007- P-"F-?5

Basic PLC

Discrete Inp(t

$ discrete input also referred as digital input is an input that is either (; or (BB are connected to the PLC digital input. In the (; condition it is referred to as logic 6 or a logic high and in the (BB condition ma#be referred to as logic o or logic low.
;ormall# (pen Pushbutton ;ormall# Closed Pushbutton ;ormall# (pen switch ;ormall# Closed switch ;ormall# (pen contact ;ormall# closed contact

Basic PLC

IN

O<< Logic 9

PLC Inp(t ,od(&e


24 @ dc

IN

O<< Logic 1

PLC Inp(t ,od(&e


24 @ dc

Basic PLC

Ana&og Inp(t
$n analog input is an input signal that has a continuous signal. T#pical inputs ma# ar# from 9 to /9m$! 4 to /9m$ or 9 to69D. Below! a le el transmitter monitors the le el of liquid in the tan3. &epending on the le el T@! the signal to the PLC can either increase or decrease as the le el increases or decreases.
Le el Transmitter
IN

Tan3

PLC Ana&og Inp(t ,od(&e

Basic PLC

Digita& O(tp(t
$ discrete output is either in an (; or (BB condition. -olenoids! contactors coils! lamps are e@ample of de ices connected to the &iscrete or digital outputs. Below! the lamp can be turned (; or (BB b# the PLC output it is connected to.
O"

PLC Digita& O(tp(t ,od(&e

Lamp

Basic PLC

Ana&og O(tp(t
$n analog output is an output signal that has a continuous signal. T#pical outputs ma# ar# from 9 to /9m$! 4 to /9m$ or 9 to69D.
6&ectric to pne(*atic transd(cer
O" 6

PLC Ana&og O(tp(t ,od(&e

9 to 19@

#(pp&) air

Pne(*atic contro& va&ve

Basic PLC

Processor
The processor module contains the PLCs microprocessor! its supporting circuitr#! and its memor# s#stem. The main function of the microprocessor is to anal#Fe data coming from field sensors through input modules! ma3e decisions based on the users defined control program and return signal bac3 through output modules to the field de ices. Bield sensors% switches! flow! le el! pressure! temp. transmitters! etc. Bield output de ices% motors! al es! solenoids! lamps! or audible de ices. The memor# s#stem in the processor module has two parts% a system memory and an application memory.
$9

Basic PLC

,e*or) ,ap Organi:ation


-#stem memor# includes an area called the 2H2C+TID2! composed of permanentl#"stored programs that direct all s#stem acti ities! such as e@ecution of the users control program! communication with peripheral de ices! and other s#stem acti ities. The s#stem memor# also contains the routines that implement the PLCs instruction set! which is composed of specific control functions such as logic! sequencing! timing! counting! and arithmetic. -#stem memor# is generall# built from read"onl# memor# de ices.

#?# 6,

APPLICA ION K &ata Table K +ser Program


The application memor# is di ided into the data table area and user program area. The data table stores an# data associated with the users control program! such as s#stem input and output status data! and an# stored constants! ariables! or preset alues. The data table is where data is monitored! manipulated! and changed for control purposes. The user program area is where the programmed instructions entered b# the user are stored as an application control program.

$1

Basic PLC

,e*or) Designs
@OLA IL6. $ olatile memor# is one that loses its stored information when power is remo ed. 2 en momentar# losses of power will erase an# information stored or programmed on a olatile memor# chip. Common T#pe of Dolatile .emor# !A,. !andom Access ,emor#(*ead,0rite) *ead,write indicates that the information stored in the memor# can be retrie ed or read! while write indicates that the user can program or write information into the memor#.
$2

Basic PLC

,e*or) Designs
The words rando* access refer to the abilit# of an# location (address) in the memor# to be accessed or used. *am memor# is used for both the user memor# (ladder diagrams) and storage memor# in man# PLCs. *$. memor# must ha e batter# bac3up to retain or protect the stored program.

$3

Basic PLC

,e*or) Designs
-e eral T#pes of *$. .emor#% 6..(/.).(1.C.(The C.(-"*$. (Complimentar# ,etal O@ide #emiconductor) is probabl# one of the most popular. C.(-" *$. is popular because it has a er# low current drain when not being accessed (65microamps.)! and the information stored in memor# can be retained b# as little as /Ddc.

$4

Basic PLC

,e*or) Designs
NON4@OLA IL6 )as the abilit# to retain stored information when power is remo ed! accidentall# or intentionall#. These memories do not require batter# bac3"up. Common T#pe of ;on"Dolatile .emor# !O,3 !ead Onl# ,emor# *ead onl# indicates that the information stored in memor# can be read onl# and cannot be changed. Information in *(. is placed there b# the manufacturer for the internal use and operation of the PLC.

$>

Basic PLC

,e*or) Designs
(ther T#pes of ;on"Dolatile .emor# P!O,3 Programmable !ead Onl# ,emor# $llows initial and,or additional information to be written into the chip. P*(. ma# be written into onl# once after being recei ed from the PLC manufacturer> programming is accomplish b# pulses of current. The current melts the fusible lin3s in the de ice! pre enting it from being reprogrammed. This t#pe of memor# is used to pre ent unauthoriFed program changes.
$.

Basic PLC

,e*or) Designs
6P!O,3 6rasable Programmable !ead Onl# ,emor# Ideall# suited when program storage is to be semi" permanent or additional securit# is needed to pre ent unauthoriFed program changes. The 2P*(. chip has a quartF window o er a silicon material that contains the electronic integrated circuits. This window normall# is co ered b# an opaque material! but when the opaque material is remo ed and the circuitr# e@posed to ultra iolet light! the memor# content can be erased. The 2P*(. chip is also referred to as "@P!O,.
$$

Basic PLC

,e*or) Designs
66P!O,! 6lectricall# 6rasable Programmable !ead Onl# ,emor# $lso referred to as 2/P*(.! is a chip that can be programmed using a standard programming de ice and can be erased b# the proper signal being applied to the erase pin. 22P*(. is used primaril# as a non" olatile bac3up for the normal *$. memor#. If the program in *$. is lost or erased! a cop# of the program stored on an 22P*(. chip can be down loaded into the *$..
$/

Basic PLC

PLC Operation
Basic <(nction of a )pica& PLC *ead all field input de ices ia the input interfaces! e@ecute the user program stored in application memor#! then! based on whate er control scheme has been programmed b# the user! turn the field output de ices on or off! or perform whate er control is necessar# for the process application. This process of sequentiall# reading the inputs! e@ecuting the program in memor#! and updating the outputs is 3nown as scanning.
$-

Basic PLC

0hile the PLC is running! the scanning process includes the following four phases! which are repeated continuousl# as indi idual c#cles of operation%
P%A#6 1

!ead Inp(ts #can


P%A#6 2

Progra* 62ec(tion
P%A#6 3

DiagnosticsA Co**
P%A#6 4

O(tp(t #can
/9

Basic PLC

P%A#6 1 B Inp(t #tat(s scan

$ PLC scan c#cle begins with the CP+ reading the status of its inputs.

P%A#6 2B Logic #o&veAProgra* 62ec(tion

The application program is e@ecuted using the status of the inputs.

P%A#6 3B Logic #o&veAProgra* 62ec(tion

(nce the program is e@ecuted! the CP+ performs diagnostics and communication tas3s.
/1

Basic PLC

P%A#6 4 4 O(tp(t #tat(s #can

$n output status scan is then performed! whereb# the stored output alues are sent to actuators and other field output de ices. The c#cle ends b# updating the outputs.

/2

Basic PLC

$s soon as Phase 4 are completed! the entire c#cle begins again with Phase 6 input scan. The time it ta3es to implement a scan c#cle is called -C$; TI.2. The scan time composed of the program scan time! which is the time required for sol ing the control program! and the I,( update time! or time required to read inputs and update outputs. The program scan time generall# depends on the amount of memor# ta3en b# the control program! t#pe of instructions used in the program and the cloc3 frequenc# of the processor. The time to ma3e a single scan can ar# from 6 ms to 699 ms.
/3

Basic PLC

PLC Co**(nications
Co**on "ses of PLC Co**(nications Ports

Changing resident PLC programs " uploading,downloading from a super isor# controller (Laptop or des3top computer). Borcing I,( points and memor# elements from a remote terminal. Lin3ing a PLC into a control hierarch# containing se eral siFes of PLC and computer. .onitoring data and alarms! etc. ia printers Interface +nits ((I+s). or (perator
/4

Basic PLC

PLC Co**(nications
#eria& Co**(nications PLC communications facilities normall# pro ides serial transmission of information. Co**on #tandards !# 232

+sed in short"distance computer communications! with the ma'orit# of computer hardware and peripherals. )as a ma@imum effecti e distance of appro@. 19 m at 7899 baud.
/>

Basic PLC

PLC Co**(nications
Loca& Area Net1or' 5LAN7 Local $rea ;etwor3 pro ides a ph#sical lin3 between all de ices plus pro iding o erall data e@change management or protocol! ensuring that each de ice can Ltal3M to other machines and understand data recei ed from them. L$;s pro ide the common! high"speed data communications bus which interconnects an# or all de ices within the local area. L$;s are commonl# used in business applications to allow se eral users to share costl# software pac3ages and peripheral equipment such as printers and hard dis3 storage.
/.

Basic PLC

PLC Co**(nications
!# 422 A !# 4/> +sed for longer"distance lin3s! often between se eral PCs in a distributed s#stem. *- 4:5 can ha e a ma@imum distance of about 6999 meters.

/$

Basic PLC

PLC Co**(nications
Progra**ab&e Contro&&ers and Net1or's &edicated ;etwor3 -#stem of &ifferent .anufacturers
,an(fact(rer $llen"Bradle# ?ould .odicon ?eneral 2lectric .itsubishi -quare & Te@as Instruments Net1or' &ata )ighwa# .odbus ?2 ;et Bactor# L$; .elsec";2T -G,;2T TI0$G

//

Basic PLC

#pecifications
-e eral factors are used for e aluating the qualit# and performance of programmable controllers when selecting a unit for a particular application. These are listed below. ;+.B2* (B I ,( P(*TThis specifies the number of I,( de ices that can be connected to the controller. There should be sufficient I,( ports to meet present requirements with enough spares to pro ide for moderate future e@pansion.

/-

Basic PLC

#pecifications
O" P" 4PO! PO=6! !A IN+# 2ach output port should be capable of suppl#ing sufficient oltage and current to dri e the output peripheral connected to it. #CAN I,6 This is the speed at which the controller e@ecutes the rela#" ladder logic program. This ariable is usuall# specified as the scan time per 6999 logic nodes and t#picall# ranges from 6 to /99 milliseconds.
-9

Basic PLC

#pecifications
,6,O!? CAPACI ? The amount of memor# required for a particular application is related to the length of the program and the comple@it# of the control s#stem. -imple applications ha ing 'ust a few rela#s do not require significant amount of memor#. Program length tend to e@pand after the s#stem ha e been used for a while. It is ad antageous to a acquire a controller that has more memor# than is presentl# needed.

-1

Basic PLC

#e&ecting a PLC

Criteria C K K K K K ;umber of logical inputs and outputs. .emor# ;umber of special I,( modules -can Time Communications -oftware

Basic PLC

A Detai&ed Design Process


1. +nderstand the process /. )ardware,software selection 1. &e elop ladder logic 4. &etermine scan times and memor# requirements

Basic PLC

PLC #tat(s Indicators


K Power (n K *un .ode K Programming .ode K Bault

Basic PLC

ro(b&es0ooting

1. Loo3 at the process /. PLC status lights )$LT " something has stopped the CP+ *+; " the PLC thin3s it is (< (and probabl# is) 2**(* " a ph#sical problem has occurred with the PLC 1. Indicator lights on I,( cards and sensors 4. Consult the manuals! or use software if a ailable. 5. +se programming terminal , laptop.

Basic PLC

List of ite*s re;(ired 10en 1or'ing 1it0 PLCs8


1. Programming Terminal " laptop or des3top PC. /. PLC -oftware. PLC manufacturers ha e their own specific software and license 3e#. 1. Communication cable for connection from Laptop to PLC. 4. Bac3up cop# of the ladder program (on dis3ette! C&*(.! hard dis3! flash memor#). If none! upload it from the PLC. 5. &ocumentation" (PLC manual! -oftware manual! drawings! ladder program printout! and -eq. of (perations manual.)

Basic PLC

62a*p&es of PLC Progra**ing #oft1are8


1. $llen"Bradle# J *oc3well -oftware *-Logi@599 /. .odicon " .odsoft 1. (mron " -#swin 4. ?2"Banuc -eries 8 J Logic.aster8 5. -quare &" PowerLogic 8. Te@as Instruments J -imatic 8. Telemecanique J .odicon T-H .icro

Basic PLC

0e five t)pes of PLC Progra**ing &ang(ages


grap$i%al languages Se1uential "low C$art (S"C!
PU&P 89( &A67O6 DO # A! # 6P 1 # 6P A 2 N D N D 3 PU&P AC ION D1 AC ION D2 AC ION D3 AC ION D4 D1D!6AD? D2D!6AD? D3D!6AD? D4D!6AD? CALC( CALC I6( OU4 I6'

"un%tion Blo%0 Diagram ("BD!


AU4O DI AC4

Ladder Diagram (LD!


CALC( AU4O AC4 I6' &A67O6 CALC I6( OU4

# 6P B

te3tual languages Stru%tured 4e3t (S4!


VAR CONSTANT X : REAL := 53.8 ; Z : REAL; END_VAR VAR aFB, bFB : FB_type; END_VAR bFB A:=!, B:="O#$%; Z := X & 'NT_TO_REAL bFB.O(T!%; 'F Z)5*.+ T,EN aFB A:=+, B:=-ERR.%; ELSE aFB A:=!, B:=-Z /0 O#.%; END_'F

Instru%tion List (IL!


A: LD 1'X! ANDN 14X5 ST 15X6 2 3(S, B(TTON 2% 2 NOT 'N,'B'TED 2% 2 FAN ON 2%

Basic PLC

PLC Ladder diagram

The most +idely used lan#ua#e for PLC pro#rammin#. -ules for +ritin# PLC Ladder 1. The vertical lines called as rails represents the po+er lines. Ehere the left rail represents positive lead and the ri#ht rail represents ne#ative lead. %. The horiBontal lines are called as run#s and are la'eled in numerical order from left to ri#ht and top to 'ottom. *. The ladder is read li)e a 'oo) from left to ri#ht and from top to 'ottom. 4. Ehenever possi'le the components are la'eled in numerical order from left to ri#ht and from top to 'ottom. ,. The components are sho+n in their normal condition +hich means they are de;ener#iBed. 11. Contacts +ill have the same letter and num'er desi#nation as the device that controls them. These control devices include relay coils, timers or motor starters. 1%. ? normally open contact closes +hen the device that controls it is ener#iBed. ? normally closed contact opens +hen the devices that controls it is ener#iBed.

Basic PLC

Addressing
7ach instruction +ritten on the ladder dia#ram has to 'e #iven a specific addresses. "ne such simple scheme for addressin# is #iven in the follo+in# ta'le.

Basic PLC

4#pes o* PLC ladder instru%tions


1) -elay lo#ic instructions, %) Timer and counter, *) Pro#ram control instructions, 4) ?rithmetic instructions, ,) 0ata manipulation instructions, .) 0ata transfer instructions, and /) ?dvanced instructions such as se(uencer, su'routine, shift etc.

Basic PLC

Logi% states
"8 $ T->7, contact closure, ener#iBe, etc. "&&$ &?L97, contact open , de;ener#iBe, etc. &o not confuse the internal rela# and program with the e@ternal switch and rela#. Internal s#mbols are used for programming. 2@ternal de ices pro ide actual interface.

Basic PLC

:ela# logi% Instru%tions

!e&a) &ogic instr(ctions consists of t1o parts3 t0e coi& 5o(tp(t condition instr(ction7 and t0e contacts 5 inp(t condition instr(ction7. Contacts$ a. 8ormally open ;H H; ;H01 H; ;H57 H; '. 8ormally closed ;H H;

01 c. "ff;on transitional
d. "n;off transitional Coil$ a. 7ner#iBe Coil '. 0e;ener#iBe ;( ); c. Latch ;(L); d. >nlatch ;(>); ;( );

Basic PLC

A6D and O: Logi%


PB6 PB/ *6 *6 N PB6.$;&.PB/

AND

PB1

PB4

*/ */ N PB/.$;&.OPB4

PB6

*6 *6 N PB6 .(*. PB/

O!
PB/

Basic PLC

Combined A6D ; O:
!1 E PB1 .O!. 5PB2 .AND. PB37
PB6 *6

PB/

PB1

Basic PLC

NO
? *ung

Operation
C

In the rung abo e! it can be seen that if input $ is be true (6)! then the output C is true (9) or when $ is (9)! output C is 6.

Basic PLC

4imers

These are output condition instructions +hich are used to provide specific time delay. They also have their associated normally open and normally closed contacts +hich are used to control the outputs in other run#s. ?t the time of pro#rammin# the user needs to select time 'ase value and enter preset value. Ehen the accumulated value 6 preset value timer times out and the contacts chan#e their status.

Basic PLC

Counters
These are also output condition instructions and are used to count the no. of events. They also have associated normally open and normally closed contacts used to control the devices in other run#s. They also reset instruction associated +ith them used to reset the count accumulated 'y the counter.

Basic PLC

Programming 23amples
1. 0evelop a ladder dia#ram for the elevator system sho+n in the fi#ure. The o'Iective is to move the platform up and do+n. The #lo'al o'Iective is to move the platform up +hen the >P 'utton is pressed and to move it do+n +hen the do+n 'utton is pressed. The follo+in# hard+are is associated +ith the system. ">TP>T 7L7578T9$ 51$ 5otor for up movement 5%$ 5otor for do+n movement !8P>T 7L7578T9$ L91$ 8C Limit s+itch to indicate >P position L9%$ 8C Limit s+itch to indicate 0"E8 position 9T?-T$ 8" push 'utton for 9T?-T 9T"P $ 8" push 'utton for 9T"P >P $ 8" push 'utton for >P Command 0"E8$ 8" push 'utton for 0"E8 Command

Basic PLC

9olution $ 4ere first +e +ill have to develop narrative statements to descri'e se(uence of events 1. Ehen the 9T?-T 'utton is pushed the platform is driven to do+n position. %. Ehen the 9T"P 'utton is pushed the platform is halted at +hatever position it occupies at that time. *. Ehen >P 'utton is pushed the platform if not in the do+n+ard motion is driven >P. 4. Ehen the 0"E8 'utton is pushed the platform if not in the up+ard motion is driven 0"E8.

Basic PLC

The ladder lo#ic pro#ram for this system is as follo+s.

Basic PLC

%. &or the oven sho+n in the fi#ure all the inputs and outputs are t+o state varia'les and the relation of the states and the varia'les is indicated. Construct Doolean e(uations that implements the follo+in# events and then construct the ladder dia#ram from that. 1. The heater +ill 'e on +hen the s+itch is activated ,the door is closed and the temperature is 'elo+ the limit. %. The fans +ill 'e turned on +hen the heater is on or +hen the temperature is a'ove the limit and the door is closed. *. The li#ht +ill 'e turned on if the li#ht s+itch is on or +henever the door is opened.

Basic PLC

The Doolean e(uation for the a'ove description is #iven as follo+s from +hich +e can construct the ladder dia#ram.

Basic PLC

*. ? Didirectional mova'le arm is as sho+n 'elo+. 0evelop a ladder dia#ram to control it as per the conditions mentioned. Conditions: Doth start and stop s+itches are push 'uttons. Ehen the system is turned "8 the motor should rotate continuously alternatin# 'et+een the counter cloc)+ise and cloc)+ise directions as the mova'le arm touches t+o limit s+itches -L9 and LL9. Solution: Lets use the follo+in# addressin# scheme for the system Inputs: 9tart s+itch !$0 11 9top s+itch !$0 1% LL9 !$0 1* -L9 !$0 14 Outputs: CCE -otation "$0 % CE -otation "$0 * Dased on the a'ove addressin# scheme the ladder dia#ram is as constructed 'elo+.

Basic PLC

Basic PLC

4. Ehen the system of the follo+in# fi#ure is turned "8 the motor is to produce alternate rotation CE and then CCE, cyclin# as the shaft extension contacts the t+o limit s+itches -L9 and LL9. ?ll the four s+itches have only normally closed positions. Prepare a PLC Ladder pro#ram +ith the follo+in# re(uirements$ 1. Ehen the "8 'utton is pushed the system motor moves the arm to the ri#ht limit s+itch position and +aits *0 seconds. %. The system then cycles /, times 'et+een ri#ht and left limit s+itches and stops. *. The "&& 'utton stops the system at any time or after the /, cycles have 'een made resets the system.

Basic PLC

Basic PLC

,.Prepare the pro#ramma'le ladder dia#ram for the control pro'lem sho+n in the follo+in# fi#ure. The #lo'al o'Iective is to heat a li(uid to a specified temperature and )eep it there for *0 minutes. The hard+are has the follo+in# characteristics$ 1. 9T?-T push 'utton is 8", 9T"P is 8C. %. 8" and 8C are availa'le for the limit s+itches. The event se(uence is *. &ill the tan). 4. 4eat and stir the li(uid for *0 minutes. /. 7mpty the tan) 1. -epeat from step 1.

Basic PLC

You might also like