You are on page 1of 112

PLC Origin

- Developed to replace relays in the late 1960s

- Costs dropped and became popular by 1980s

- Now used in many industrial designs


Historical Background
The Hydromantic Division of the General Motors Corporation specified the
design criteria for the first programmable controller in 1968

Primary goal was


To eliminate the high costs associated with inflexible, relay-controlled systems.

The controller had to be designed in modular form, so that sub-assemblies could be


removed easily for replacement or repair.

The control system needed the capability to pass data collection to a central system.

The system had to be reusable.

The method used to program the controller had to be simple, so that it could be easily
understood by plant personnel.
Leading Brands Of PLC
AMERICAN 1. Allen Bradley
2. Gould Modicon
3. Texas Instruments
4. General Electric
5. Westinghouse
6. Cutter Hammer
7. Square D

EUROPEAN 1. Siemens
2. Klockner & Mouller
3. Festo
4. Telemechanique

JAPANESE 1. Toshiba
2. Omron
3. Fanuc
4. Mitsubishi
Areas of Application
Annunciators Injection Molding Cranes Slitting
Auto Insertion Assembly Crushing Sorting
Bagging Motor Winding Cutting Stackers
Baking Oil Fields Digesters Stitching
Blending Painting Drilling Stack Precipitators
Boring Palletizers Electronic Testing Threading
Brewing Pipelines Elevators Tire Building
Calendaring Polishing Engine Test Stands Traffic Control
Casting Reactors Extrusion Textile Machine
Chemical Drilling Robots Forging Turbines
Color Mixing Rolling Generators Turning
Compressors Security Systems Gluing Weaving
Conveyors Stretch Wrap Grinding Web Handling
Heat Treating Welding
PLCs
Widely Applied in Every Industry
Were Developed to Simplify the Implementation of
Control Automation Systems in Plants and Assembly
Lines
Designed to Minimize the Number of Control Relays in
a Process and Maximize the Ways Relays can be Used
First Applied to Automobile Industry in the Late 1960s
Flexible, Reliable and Low Cost
PLCs Are ...

Similar to a Microcontroller:
Microprocessor Based
Onboard Memory for Storing Programs
Special Programming Language: Ladder Logic
Input/Output Ports
1) on-off control,
2) sequential control,
3) feedback control, and
4) motion control.
PLCs Are...
Dissimilar to Microcontrollers:
Intended for Industrial Applications
I/O Designed to interface with Control Relays
Emphasis on Maximum Reliability
Advantages of PLC
A. Flexibility
v Universal Controller - can replace various independent/ standalone controller.
B. Implementing Changes and Correcting Errors
v Do not have to rewiring relay panel.
v Change program using keyboard.

C. Large Quantity of Contact


v Large number of' Soft Contact' available.

D. Lower Cost
v Advancement in technology and open architecture of PLC will reduce the
market price.

E. Pilot Running (Simulation Capability)


v A program can be simulated or run without actual input connection.
Advantages of PLC
F. Visual Observation.
Can observe the opening and closing of contact switch on CRT .
Operator message can be programmed for each possible malfunction.
G. Speed of Operation
Depends on scan time -millisecond.
Asynchronous operation.

H. Ladder or Boolean Programming Method.


Easy for 'Electrician ,

I. Reliability
In general -very reliable

J. Simplicity of Ordering Control Sys. Components


One package with Relay, Timers, Control Block, etc.
K. Documentation
Printout of ladder logic can be printed easily

L. Security
Software lock on a program (Password)

M. Ease of Changes by Programming


Ability to program and reprogram, loading and down loading
Disadvantages of PLC
A. New Technology
Change from ladder and relay to PLC concept

B. Fixed program Application


Not cost effective for single- function application

C. Environment Consideration
Not adapted for very high temperature, high humidity level, high vibration, etc.

D. Fail-safe operation
Does not start automatically when power failure ( can be programmed into )
Not "Fail-safe" -Fail-shorted rather than OPEN

E. Fixed-circuit operation
Fixed control system -less costly
PLC Size
1. SMALL - it covers units with up to 128 I/Os and
memories up to 2 Kbytes.
- these PLCs are capable of providing simple to
advance levels or machine controls.
2. MEDIUM - have up to 2048 I/Os and memories up to 32
Kbytes.
3. LARGE - the most sophisticated units of the PLC family.
They have up to 8192 I/Os and memories up to 750 Kbytes.
- can control individual production processes or
entire plant.
PROGRAMMABLE LOGIC CONTROLLER
Invented in 1968 as a substitute for hardwired relay panels.

"A digitally operating electronic apparatus which uses a


programmable memory for the internal storage of instructions by
implementing specific functions such as logic sequencing,
timing, counting, and arithmetic to control, through digital or
analog input/output modules, various types of machines or
processes. The digital computer which is used to perform the
functions of a programmable controller is considered to be
within this scope. Excluded are drum and other similar
mechanical sequencing controllers."
Major Components of a Common PLC
POWER
SUPPLY

I M O M
N O
P D U O
U U PROCESSOR T D
T L P U
From E U L
To
SENSORS T E OUTPUT
Pushbuttons, Solenoids,
contacts, contactors,
limit switches, alarms
etc. etc.
PROGRAMMING
DEVICE
Programming Device
Types:

Hand held unit with LED / LCD display

Desktop type with a CRT display

Compatible computer terminal


I/O Module
The I/O interface section of a PLC connects it to external field devices.

The main purpose of the I/O interface is to condition the various signals received
from or sent to the external input and output devices.

Input modules converts signals from discrete or analog input devices to logic
levels acceptable to PLCs processor.

Output modules converts signal from the processor to levels capable of driving
the connected discrete or analog output devices.
I/O Module
DC INPUT MODULE

IS NEEDED TO:
USE TO Prevent voltage
DROP THE transients from
VOLTAGE damaging the
TO LOGIC processor.
LEVEL Helps reduce the
effects of electrical
noise

Current Buffer,
FROM Limiting Filter,
OPTO- TO
INPUT Resistor ISOLATOR hysteresis
PROCESSOR
DEVICE Circuits
I/O Module
AC INPUT MODULE

IS NEEDED TO:
CONVERTS THE AC Prevent voltage
INPUT TO DC AND transients from
DROPS THE damaging the
VOLTAGE TO LOGIC processor.
LEVEL Helps reduce the
effects of electrical
noise

Rectifier, Buffer,
FROM Resistor Filter,
OPTO- TO
INPUT Network ISOLATOR Hysteresis
PROCESSOR
DEVICE Circuits
24
25
27
OUTPUTS

INPUTS MOTOR

CONTACTOR
LAMP

PUSHBUTTONS
PLC
Allen-Bradley 1746-1A16

L2 I= Input
L1
Module
I:2 slot # in
rack

0
P. B SWITCH Module
Terminal #
Address I:2.0/0
LADDER PROGRAM

INPUT MODULE

WIRING DIAGRAM
CONTACTOR
L1 N.
L2 O

MOTOR

C SOLENOI
L2L1 D
FIELD VALVES
LAMP
WIRING
BUZZER

OUTPUT MODULE
WIRING
L1 O:4

L2

CONTACTOR 0

LADDER PROGRAM
Discrete Input
A discrete input also referred as digital input is an input that is either ON or
OFF are connected to the PLC digital input. In the ON condition it is referred to
as logic 1 or a logic high and in the OFF condition maybe referred to as logic o
or logic low.

Normally Open
Pushbutton
Normally Closed
Pushbutton
Normally Open switch

Normally Closed switch

Normally Open contact

Normally closed contact


IN

OFF PLC
Logic 0
Input
Module
24 V dc

IN

OFF PLC
Logic 1
Input
Module
24 V dc
Analog Input
An analog input is an input signal that has a continuous
signal. Typical inputs may vary from 0 to 20mA, 4 to 20mA
or 0 to10V. Below, a level transmitter monitors the level of
liquid in the tank. Depending on the level Tx, the signal to the
PLC can either increase or decrease as the level increases
or decreases.

Level Transmitter IN

PLC
Analog
Tank Input
Module

35
Digital Output
A discrete output is either in an ON or OFF condition. Solenoids,
contactors coils, lamps are example of devices connected to the
Discrete or digital outputs. Below, the lamp can be turned ON or OFF by the PLC
output it is connected to.

OUT

PLC
Lamp
Digital
Output
Module

36
Analog Output
An analog output is an output signal that has a continuous
signal. Typical outputs may vary from 0 to 20mA, 4 to 20mA
or 0 to10V.

Electric to pneumatic transducer

OUT
E Supply air
PLC 0 to 10V P

Analog
Output
Module
Pneumatic control valve

37
Memory Map Organization
System memory includes an area called the EXECUTIVE,
composed of permanently-stored programs that direct all
system activities, such as execution of the users control
program, communication with peripheral devices, and other
SYSTEM system activities.
The system memory 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.
System memory is generally built from read-only memory
devices.

APPLICATION
The application memory is divided into the data table area
Data Table and user program area.
The data table stores any data associated with the users
User Program control program, such as system input and output status
data, and any stored constants, variables, or preset values.
The data table is where data is monitored, manipulated, and
changed for control purposes.
The user program area is where the programmed
instructions entered by the user are stored as an application
control program.
While the PLC is running, the scanning process includes the following four
phases, which are repeated continuously as individual cycles of operation:

PHASE 1
Read Inputs
Scan
PHASE 2
Program
Execution
PHASE 3
Diagnostics/
Comm
PHASE 4
Output
Scan
PHASE 1 Input Status scan

A PLC scan cycle begins with the CPU reading the status of its inputs.

PHASE 2 Logic Solve/Program Execution

The application program is executed using the status of the inputs

PHASE 3 Logic Solve/Program Execution


Once the program is executed, the CPU performs diagnostics and
communication tasks
PHASE 4 - Output Status Scan
An output status scan is then performed, whereby the stored output
values are sent to actuators and other field output devices. The cycle ends
by updating the outputs.
As soon as Phase 4 are completed, the entire cycle begins again with Phase
1 input scan.

The time it takes to implement a scan cycle is called SCAN TIME. The scan
time composed of the program scan time, which is the time required for
solving the control program, and the I/O update time, or time required to
read inputs and update outputs. The program scan time generally depends
on the amount of memory taken by the control program and type of
instructions used in the program. The time to make a single scan can vary
from 1 ms to 100 ms.
PLC Communications
Common Uses of PLC Communications Ports

Changing resident PLC programs - uploading/downloading from a


supervisory controller (Laptop or desktop computer).

Forcing I/O points and memory elements from a remote terminal.

Linking a PLC into a control hierarchy containing several sizes of PLC


and computer.

Monitoring data and alarms, etc. via printers or Operator Interface Units
(OIUs).
PLC Communications
Serial Communications

PLC communications facilities normally provides serial transmission of


information.

Common Standards

RS 232

Used in short-distance computer communications, with the majority of


computer hardware and peripherals.
Has a maximum effective distance of approx. 30 m at 9600 baud.
PLC Communications
Local Area Network (LAN)

Local Area Network provides a physical link between all devices plus
providing overall data exchange management or protocol, ensuring that each
device can talk to other machines and understand data received from them.

LANs provide the common, high-speed data communications bus which


interconnects any or all devices within the local area.

LANs are commonly used in business applications to allow several users to


share costly software packages and peripheral equipment such as printers
and hard disk storage.
PLC Communications
RS 422 / RS 485

Used for longer-distance links, often between several PCs in a distributed


system. RS 485 can have a maximum distance of about 1000 meters.
PLC Communications
Programmable Controllers and Networks

Dedicated Network System of Different Manufacturers

Manufacturer Network
Allen-Bradley Data Highway
Gould Modicon Modbus
General Electric GE Net Factory LAN
Mitsubishi Melsec-NET
Square D SY/NET
Texas Instruments TIWAY
Specifications
OUTPUT-PORT POWER RATINGS

Each output port should be capable of supplying sufficient voltage and


current to drive the output peripheral connected to it.

SCAN TIME

This is the speed at which the controller executes the relay-ladder logic
program. This variable is usually specified as the scan time per 1000 logic
nodes and typically ranges from 1 to 200 milliseconds.
Specifications
MEMORY CAPACITY

The amount of memory required for a particular application is related to the


length of the program and the complexity of the control system. Simple
applications having just a few relays do not require significant amount of
memory. Program length tend to expand after the system have been used
for a while. It is advantageous to a acquire a controller that has more
memory than is presently needed.
PLC Status Indicators
Power On
Run Mode
Programming Mode
Fault
Troubleshooting
1. Look at the process
2. PLC status lights
HALT - something has stopped the CPU
RUN - the PLC thinks it is OK (and probably is)
ERROR - a physical problem has occurred with the PLC
3. Indicator lights on I/O cards and sensors
4. Consult the manuals, or use software if available.
5. Use programming terminal / laptop.
List of items required when working with PLCs:
1. Programming Terminal - laptop or desktop PC.
2. PLC Software. PLC manufacturers have
their own specific software and license key.
3. Communication cable for connection from Laptop
to PLC.
4. Backup copy of the ladder program (on diskette, CDROM,
hard disk, flash memory). If none, upload it from the PLC.
5. Documentation- (PLC manual, Software manual, drawings,
ladder program printout, and Seq. of Operations manual.)
Examples of PLC Programming Software:
1. Allen-Bradley Rockwell Software RSLogix500
2. Modicon - Modsoft
3. Omron - Syswin
4. GE-Fanuc Series 6 LogicMaster6
5. Square D- PowerLogic
6. Texas Instruments Simatic
6. Telemecanique Modicon TSX Micro
PROGRAMMING

Normally Open Normally Closed


(NO) (NC)

Power flows through these contacts when they are closed. The
normally open (NO) is true when the input or output status bit
controlling the contact is 1. The normally closed (NC) is true
when the input or output status bit controlling the contact is 0.
Coils

Coils represent relays that are energized when power flows to


them. When a coil is energized it causes a corresponding
output to turn on by changing the state of the status bit controlling
the output to 1. That same output status bit maybe used to control
normally open or normally closed contact anywhere in the program.
AND OPERATION

A B C

Rung

Each rung or network on a ladder program represents


a logic operation. In the rung above, both inputs A and B
must be true (1) in order for the output C to be true (1).
OR OPERATION

A C

Rung

In the rung above, it can be seen that either input A or B


is be true (1), or both are true, then the output C is true (1).
NOT OPERATION

A C

Rung

In the rung above, it can be seen that if input A is be true (1),


then the output C is true (0) or when A is (0), output C is 1.
PLC Operation
Basic Function of a Typical PLC

Read all field input devices via the input interfaces, execute the user
program stored in application memory, then, based on whatever control
scheme has been programmed by the user, turn the field output devices on
or off, or perform whatever control is necessary for the process application.

This process of sequentially reading the inputs, executing the program in


memory, and updating the outputs is known as scanning.
Examples of I/O Signals
Inputs:
Pushbutton (Energizing or Grounding an Input)
Relay Contact Output
DC Voltage Level
Digital Logic Signal (+5V or 0 V, etc)
Outputs:
24 V ac
120 V ac
120 Vdc
etcetera
Why 24V / 48 V supply ?
Aftertheplantlostelectricpower,operatorscouldreadinstrumentsonlybypluggingin
temporarybatteries
[IEEESpectrumNov2011aboutFukushima]

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 (I/O) arrangements

Advantages Continued:
Cost effective for controlling complex systems.
Flexible and can be reapplied to control other systems quickly and easily.
Computational abilities allow more sophisticated control.
Trouble shooting aids make programming easier and reduce downtime.
Reliable components make these likely to operate for years before failure
AP = Automates Programmables industriels
PLC = Programmable Logic Controller: Definition
SPS=SpeicherprogrammierbareSteuerungen

Definition: small computers, dedicated to automation tasks in an industrial environme

Formerly: cabled relay control (hence 'logic'), analog (pneumatic, hydraulic) governo

Today: real-time (embedded) computer with extensive input/output

Function: Measure, Control, Protect

Distinguish Instrumentation
flow meter, temperature, position,. but also actors (pump, )
Control
programmable logic controllers with digital peripherals & field bus
Visualization
Human Machine Interface (HMI) in PLCs (when it exists) is limited
to service help and control of operator displays
PLC in a cabinet
CPU1 CPU2

serial connections
redundant
field bus
connection inputs/outputs
example: turbine control (in the test lab)
Global players
Types of PLC
(1) Compact
Monolithic construction
Monoprocessor
Fieldbus connection

(2) Modular PLC


Modular construction (backplane)
One- or multiprocessor system
Fieldbus and LAN connection
Small Micro Memory Card (MMC) function possible

(3) Soft-PLC
Linux or Windows NT or CE-based automation products
Direct use of CPU or co-processors
Compact PLC

courtesy ABB courtesy ABB courtesy ABB

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
Typical product: Mitsubishi MELSEC F, ABB AC31, SIMATIC S7
costs: 2000
Modular PLC
can be tailored to needs of application developme
RS232 nt
housed in a 19" (42 cm) rack environmen
t
(height 6U ( = 233 mm) or 3U (=100mm)
high processing power (several CPUs) LAN
large choice of I/O boards
backplane
concentration of a large number of I/O parallel bus
courtesy ABB

interface boards to field busses fieldbus

requires marshalling of signals Power Supply

primitive or no HMI
CPU CPU Analog Binary I/O
cost effective if the rack can be filled I/O fieldbus

supply 115-230V~ , 24V= or 48V= (redundant)


cost ~ 10000 for a filled crate
Typical products: SIMATIC S5-115, Hitachi H-Serie, ABB AC110
Small modular PLC

courtesy ABB
courtesy Backmann

mounted on DIN-rail, 24V supply


cheaper (5000)
not water-proof,
no ventilator
extensible by a parallel bus (flat cable or rail)
General PLC architecture
RS 232 Ethernet

Real-Time flash serial port ethernet


CPU ROM
Clock EPROM controller controller
extension
bus
parallel bus buffers

fieldbus analog- digital- external


Digital
controller digital analog Digital Output I/Os
Input
converters converters

signal power signal


relays
conditioni amplifiers conditioning
ng

field bus direct Inputs and Outputs


Implementation
PLC operates periodically
Samples signals from sensors and converts them to
digital form with A/D converter
Computes control signal and converts it to analog form
for the actuators.

1. Wait for clock interrupt


2. Read input from sensor
3. Compute control signal
4. Send output to the actuator
5. Update controller variables
7. Communication
6. Repeat

Waiwera Organic Winery, Distillation Plan


Ladder Diagrams (1)

Ladder Diagrams is the oldest programming language


for PLC
- based on relay intuition of electricians.
- widely in use outside Europe.
- not recommended for large new projects.
Output (actions)
Input instructions (conditions)

Rung 0

Rung 1

Rung 2
Ladder Diagrams (2)
he contact plan or "ladder diagram" language allows an easy transition from the
aditional relay logic diagrams to the programming of binary functions.

It is well suited to express combinational logic

It is not suited for process control programming (there are no


analog elements).

The main Ladder Diagrams symbols represent the elements:

make contact contact travailArbeitskontakt

break contact contact repos Ruhekontakt

relay coil bobine Spule


Ladder Diagrams Example (3)

make contact
origin: (contact travail)
02
electrical 01 relay coil
circuit (bobine)

03 50
break contact
(contact repos)

01 02
corresponding 50 rung
03
ladder diagram

50 05 "coil" 50 is used to move


44 other contact(s)
Ladder Diagrams (4)
Binary combinations are expressed by series and parallel relay contact:

Ladder Diagrams representation logic" equivalent


Series + 01 02 01

50 50
02

Coil 50 is active (current flows) when 01 is active and 02 is not.

Parallel + 01
40 01

02 40
02

Coil 40 is active (current flows) when 01 is active or 02 is not.


Ladder Diagrams (5)
The Ladder Diagrams is more intuitive for complex binary expressions than literal
Languages
1 2 3 4
50 textual expression
5 6 !1&2&(3&!4 |!5&6)=
50
Or
N1 & 2 STR 3 & N4 STR N5 & 6
/ STR & STR = 50

0 1 4 5 12
50
2 3 6 7
N0 & 1 STR 2 & 3 / STR STR 4
10 11 & 5 STR N 6 & 7

/ STR & STR STR 10


& 11 / STR & 12 = 50
Ladder Diagrams (6)
Ladder Diagrams stems from the time of the relay technology.
As PLCs replaced relays, their new possibilities could not be expressed any
more in relay terms.
The contact plan language was extended to express functions:

00 01
literal expression:
FUN 02 200
!00 & 01 FUN 02 = 200

The intuition of contacts and coil gets lost.


The introduction of functions that influence the control flow itself, is problematic.
The contact plan is - mathematically - a functional representation.
The introduction of a more or less hidden control of the flow destroys the
freedom of side effects and makes programs difficult to read.
The five IEC 61131-3 Programming languages http://www.isagraf.com
unction Block Diagram (FBD)graphical languages Sequential Flow Chart (SF
CALC1
CALC PUMP START STEP

AUTO IN1 OUT >=1 DO


T1
MAN_ON V
N ACTION D1 D1_READY
IN2 STEP A
ACT
D ACTION D2D2_READY
T2
N ACTION D3 D3_READY
Ladder Diagram (LD) STEP B
D ACTION D4D4_READY
CALC1 T3
AUTO CALC PUMP
IN1 OUT
OUT
ACT textual languages
Structured Text (ST)
IN2
MAN_ON VAR CONSTANT X : REAL := 53.8 ;
Z : REAL; END_VAR
VAR aFB, bFB : FB_type; END_VAR

bFB(A:=1, B:=OK);
nstruction List (IL) Z := X - INT_TO_REAL (bFB.OUT1);
IF Z>57.0 THEN aFB(A:=0, B:=ERR);
ELSE aFB(A:=1, B:=Z is OK);
A: LD %IX1 (* PUSH BUTTON *) END_IF
ANDN %MX5 (* NOT INHIBITED *)
ST %QX2 (* FAN ON *)
PLC Modules
The modular nature of PLC components makes the
design, instillation and maintenance of the first
level of control much simpler.
Similar to the peripheral devices, which can be
obtained for a personal computer, there are
literally thousands of interface modules supported
by PLCs.
While these modules may be numerous they all
have the same function, obtaining or delivering
control signals and information between the
measurement level and the operator interface
level.
The modular nature is possibly the greatest
strength of PLCs and several common modules
will be described below.
Digital Inputs/Outputs (I/O)
By far the most common industrial signals used in PLCs are simple
digital control signals.
Referred to as Digital I/O (Digital input/output), they can be measured in
there thousands for substantial industrial plants.
They are used to measure an amazing verity of events.
The most common digital signal encountered is a simple switch, A
switch is nothing more than an electrical switch used to indicate some
physical
Digital I/O signals come in many forms from 12 Volt DC to
position.
240 Volt AC, but the most common industrial signals are
24Volt DC and 120V AC.
There are Digital I/O modules to measure all of these
signals, an extra variation is the number of signals per
module ranging from 8, 16 and 32 etc.
Most digital modules have electrical protection usually in the
form of optocoupling to prevent damage to the PLC from
standard electrical faults.
Analogue Inputs/Outputs (I/O)
Analogue signals enter and leave the PLC in voltage and
current form, The resolution of most analogue signals is
between 11 and 16 bits.
While voltage is commonly used in practice it can be
sensitive to noise (induced voltages in electrical equipment
rooms can be substantial) This makes current control the
superior choice.
The
Amost common analogue
signal of 4.0mA equatessignals
to zero,appear in the form of a
4-20mA current signal, i.e.
A signal of 20mA equates to 2048 for an 11 bit input,
The reason for the 4.0mA starting point is a fail-safe feature,
if the instrument fails or the signal cable is damaged the
current falls to zero and the PLC can alarm the operating
system of the failure immediately.
This fail-safe feature is not possible for voltage signals which
pass through zero volts.
Other interface modules
Digital I/O and Analogue I/O signals comprise the vast
majority of PLC signals.
However, not all devices can be controlled by these simple
signals and it is often required that PLCs communicate to
foreign instruments using many different communications
protocols,
Again in most instances there is simply a module
predesigned to make this interface possible.
Some examples include RS232, RS485, DH485, DH+,
Modbus, Ethernet etc.
Memory
(Addressing , Internal Registers)
The memory in PLCs needs to be predefined by the
programmer, similar to defining variables in standard
programming.
The memory is divided into data files, each data file has a
unique number and a character prefix which refers to the
type of data.
For example, in the Allen Bradley PLC-5 system, we
have;
The ASCII character (or characters) denotes the data area
type. Other types of defined words include T-timers, C-
counters and S-status registers etc.
Note that the Output and Input numbers are dropped from
file 0 and 1 respectively, this is because these files are not
programmable.
Status file 2 (S2:##) is also fixed within Allen Bradley PLCs.
(Status bits include such information as arithmetic overflow
The internal
warnings, data areas of status
communication Integers and
and Floating time
processor pointand
addresses simply point to a linear memory region.
dates etc)
However the Input and Output address actually correspond
to a physical address. For example I:12/03 has the format, I:
{Rack address}{slot number}/{Input number}.
Physically this is the 3rd input on the 2nd slot in the 1st
Rack.
This input is show below in figure,
Physical I/O Addressing

Note: PLCs usually start counting from zero and use the
octal counting system. ie an eight slot rack will have slots
numbered from 0 to 7.
This is the case for racks, slots and input numbers.
So the first possible input would be Rack 0, slot 1 input 0
(Slot 0 in Rack 0 is not available for inputs since it is always
reserved for the Central Processing Unit, CPU)
Addressing Format
The addressing format has been demonstrated here
because in writing a PLC program the address is used by the
PLC in the ladder logic.
For example, if in the Start /Stop logic of figure (6) the Start
PB = I:13/04 and Stop PB = I:13/05 and the output Coil =
O:12/03 then the ladder logic would look more like figure
below
PLC Programming Architecture
A PLC program can be divided into many small subroutines.
In this respect PLCs replace function and procedures with
subroutines.
Each subroutine is executed from top to bottom in a
predetermined order.
Once all the subroutines have been scanned it simply begins
again with the first subroutine.
The nature of subroutines makes a modular programming
structure possible, It is always beneficial to group segments
For example a program may be divided in the following way:
of code which serve similar purposes.
Subroutine U:20 Pumps sequencing logic file.
Subroutine U:21 Pump No.1 alarming and drive file.
Subroutine U:22 Pump No.2 alarming and drive file.
Subroutine U;23 Pump No.3 alarming and drive file.
Here subroutine 20 controls the sequencing of 21,22 and 23
while the drive files are virtually identical for each pump by
starting and stopping the pump while reporting alarms and
the healthy status to file 20.
Fault finding problems in the code is greatly simplified when
all the code for a faulty device is listed in a single
The development of a plant wide PLC standard is an
subroutine.
essential step in automating a large control system.
The benefits are twofold, if the programming standard is
well understood many code developers can work on the
code producing a uniform control system.
The second advantage is that for anyone not involved in the
code production only needs to learn one standard to have a
good understanding of the program structure of all the
plants PLCs.
Allen-Bradley PLCs

Below are AB Plcs


Note that AB is part of the
Rockwell Automation, a global
leading Automation giant.
Siemens Simatic PLCs
Siemens Simatic PLCs
Modicon TSX PLCs
Other PLC Terminology
On-line: Refers to the program code currently in the PLC
memory.
Off-line: Refers to the copy of the program code stored on the
programming computer.
Up-Load: Refers to the act of copying the current On-line code
from the PLC to the programming computer . (Note the previous
code on the programming computer is lost during this transfer if
a copy is not made)
Down-Load: Refers to the act of copying the code from the
programming computer into the PLCs memory. (note the
previous PLC code is lost during this transfer).
Note: It is important to realize that changing the On-line
program will not change the Off-line program on the
Runprogramming
Mode: The computer. Invariably
PLC actively scanningatthe
thecode
end of any
and edit there
driving
must follow an Up-load or Down-Load to make the Online and
outputs.
Off-line programs the same.
Program Mode: The PLC is not being scanned (All outputs
disabled)
Remote Mode: programming computer can change the PLC
between Run and Program.
Note: There is a physical key on the front of each PLC
AN EXAMPLE OF RELAY LOGIC
For process control, it is desired to have the process start (by
turning on a motor) five seconds after a part touches a limit switch.
The process is terminated automatically when the finished part
touches a second limit switch. An emergency switch will stop the
process any time when it is pushed.
L1
LS1 PB1 LS2 R1

R1

TIMER
R1 R2
PB1
LS1 LS2

PR=5

TIMER

5
Motor
R2

R1
Bar code reader
microswitch Stopper

Part Conveyor

Robot
Machine

id description state explanation


MSI microswitch 1 part arrive
R1 output to bar code reader 1 scan the part
C1 input from bar code reader 1 right part
R2 output robot 1 loading cycle
R3 output robot 1 unloading cycle
C2 input from robot 1 robot busy
R4 output to stopper 1 stopper up
C3 input from machine 1 machine busy
C4 input from machine 1 task complete
Input
Output
MS1 R1
01 11
C1 R2
02 12
C2 R3
03 13
C3 R4
04 14
Programmable
C4 05 15
Controller
PLC

14 11
01

Rung 1. If part arrives


02 14
and no part is stopped,
trigger the bar code
14 04 03 12 reader.
Rung 2. If it is a right
05 03 13 part, activate the
stopper.
Rung 3. If the stopper is
up, the machine is not
busy and the robot is
not busy, load the part
onto the machine.
Rung 4. If the task is
completed and the
EXAMPLE 2 TRAFFIC LIGHTS

Main street

VIT street

Cycle time

Street Red Yellow Green

Main 3 1 4
VIT 5 1 2
input output

64 VIT Red

65 VIT Yellow
Programmable
Controller
66 VIT Green

67 Main Red

70 Main Yellow

71 Main Green
901
RUNG1 RTO
80
901 901
RUNG2 RST
901 902
RUNG3 67 M. Red

902
RUNG4 67
RTO
30
RUNG5 901 902
RST
901 903
RUNG6 66 V. Green

903
RUNG7 66
RTO
901 903 20
RUNG8 RST
902 904 M. Green
RUNG9 71

904
71
RUNG10 RTO
901 904 40
RUNG11 RST
904 905
RUNG12 70 M. Yellow
905
70
RUNG13 RTO
901 905 10
RUNG14 RST
903 906
RUNG15 65 V. Yellow

906
65
RUNG16 RTO
901 906 10
RUNG17 RST
902 907
RUNG18 64 V. Red

907
RUNG19 64
RTO
901 907 50
RUNG 20 RST

You might also like