SlideShare a Scribd company logo
1 of 346
Download to read offline
HIGHER
TECHNOLOGICAL
INSTITUTE
Prepared by
Dr. Mohiy Bahgat
Faculty of Engineering
Helwan University
Course Contents
1. Introduction and Review
2. Internal Construction of the PLC
3. Sequential Control Systems
4. Input / Output Devices
5. PLC Networks and Hardwiring
6. Programming of the PLC
7. Internal Relays
8. Timers
9. Counters
10. Shift Registers
Chapter 1
Introduction
and Review
Control System Task
• The main task of a control system is to
control a sequence of events or maintain
some variable constant or follow some
prescribed change.
• The inputs to such control systems
might come from switches or sensors,
however the outputs of the controller
might go to run a motor in order to move
an object, or to turn a valve, or perhaps
some heater on or off.
• In the traditional form of control systems,
the governing rules and the control actions
depend on the wiring of the control circuit.
• When changing the rules used for giving the
control actions, the wiring has to be
changed too. This leads to expensive cost
of replacing the controllers.
• Instead of hardwiring each control circuit
for each control rule or action, the basic
system for all situations can be used with a
microprocessor based controller.
• So, by changing the program instructions, the
same control circuit may be used with a wide
variety of control rules or actions, which
saves the cost.
• This was the main idea behind inventing the
programmable logic controllers (PLC).
• The PLC was invented in response to the
needs of the automotive manufacturing
industry where software revision replaced the
re-wiring of hard-wired control panels when
production models changed.
• Before the PLC, control, sequencing, and
safety interlock logic for manufacturing
automobiles was accomplished using
hundreds or thousands of relays, cam timers,
and drum sequencers and dedicated closed-
loop controllers.
• The process for updating such facilities for
the yearly model change-over was very time
consuming and expensive, as the relay
systems needed to be rewired by skilled
electricians.
• In the late 1960's PLCs were first introduced.
• The primary reason for designing such a
device, as mentioned before, was eliminating
the large cost involved in replacing the
complicated relay based machine control
systems.
• Bedford Associates proposed something
called a Modular Digital Controller (MODICON)
to a major car manufacturer.
• Other companies at the time proposed
computer based schemes, one of which was
based upon the PDP-8.
• The MODICON 084 brought the world's first
PLC into commercial production.
• These new controllers also had to be easily
programmed by maintenance and plant
engineers.
• The lifetime had to be long and programming
changes easily performed. They also had to
survive the harsh industrial environment
• In the mid 70's the dominant PLC technologies
were sequencer state-machines and the bit-
slice based CPU.
• The AMD 2901 and 2903 were quite popular in
MODICON and A-B PLCs.
• As conventional microprocessors evolved,
larger and larger PLCs were being based upon
them.
• Communications abilities began to appear in
approximately 1973. The first such system
was MODICON's MODBUS.
• The 80's saw an attempt to standardize
communications with General Motor's
manufacturing automation protocol (MAP).
• It was also a time for reducing the size of the
PLC and making them software programmable
through symbolic programming on personal
computers instead of dedicated programming
terminals or handheld programmers.
• Today the world's smallest PLC is about the
size of a single control relay.
• The 90's have seen a gradual reduction in
introducing new protocols, and modernization
of the physical layers of some of the more
popular protocols that survived the 1980's.
• The latest standard (IEC 1131-3) has tried to
merge PLC programming languages under one
international standard.
• We now have PLCs that are programmable in
function block diagrams, instruction lists, C
and structured text, at the same time PC's are
also being used to replace PLCs in some
applications.
Chapter 2
Internal
Construction
of a PLC
Power Supply
Module
Central
Processing
Unit
Outputs
Interfacing
and
Multiplexing
Inputs
Interfacing
and
Multiplexing
Memory devices
ROM – RAM – EEPROM
A.C main supply
D.C main supply
to other modules
Communication link to personal
computer or programmer
1. Rack or mounting part.
2. Processor or central processing
unit (CPU).
3. Input assembly.
4. Output assembly.
5. Power supply.
6. Programming unit.
Empty Rack
Mounting a module
Rack with modules
Large scale modular type PLC system
Large scale modular type PLC system
Bricks or shoebox PLCs
PLC main CPU unit
PLC physical internal architecture
Digital module
time
Digital signal
voltage
Analog modules
time
Analog signal
voltage
PLC handheld programming devices
Memory
Input Output
interface interface
CPU
input image output image
memory memory
Input Output
port s ports
Input/
output
unit
Data
RAM
System
ROM
CPU
User
program
RAM
Clock
Battery Address Bus
Control Bus
Data Bus
I/O system Bus
Buffer Latch
Opto-
coupler
Driver
interface
Drivers
PLC internal architecture
Input/Output Unit
• The input/output unit provides the interface
between the PLC system and the outside
world allowing the connections to be made
through input/output channels to input
devices such as sensors or output devices
such as motors and solenoids.
• The input/output provides isolation and
signal conditioning.
Electrical isolation from the external world is
usually done by means of optoisolators or
optocouplers whose circuitry is displayed :
Light emitting photo
diode transistor
Optoisolator
PLC Optocoupler
Input Signal
to PLC
to CPU
Protection
diode Voltage
divider
circuit
Basic D.C circuit for PLC
• The signal isolation enables supplying
the input channels of the PLCs with a
wide range of input signals.
• The range of input signals might be :
5 V , 24 V , 110 V and 240 V in the
form of ON/OFF or digital / discrete
signals.
Input
channel
5 V
24 V
110 V
240 V
To input/output unit
5 volt digital
signal level
Input signal level of a PLC
Output are often specified to be in
one of the following forms :
1. Relay type.
2. Transistor type.
3. Triac type.
Relay Type
• In such a type, the output signal from the
PLC operates a relay which switches
small current in the external circuit and
isolates the PLC from the external circuit
that having larger currents.
• Since the relay outputs are relatively
slow, thus it would be suitable for A.C
and D.C switching.
PLC
Relay
Relay type output
output
Transistor Type
• In such a type, a transistor is to be used to
switch current in the external circuit.
• This type of output gives faster switching and
being restricted to the D.C switching.
• It is destroyed by over currents or high
reverse voltages therefore; a protection is
used in the form of either a fuse or a built-in
electronic protection.
• Also, the optoisolators are used to provide the
essential isolation.
Optocoupler
Fuse Output
PLC
Basic form of transistor type output
Triac Type
• Such type can be used with optoisolators
to control the external loads which are
connected to an A.C power supply.
• So, such type is strictly being used with
A.C and must be protected by fuses
against over currents.
24 V, 100mA
240 V, 1A, A.C
240 V, 2A, A.C
Output
channel
110 V, 1A, A.C
from input/output unit
5 volt digital
PLC output levels
Chapter 3
Sequential
Control
Systems
Continuous Control
• In continuous control systems the inputs
are sending information into the system
all the time and the outputs of the
system are being controlled all the time.
• A change to the input leads directly to a
change in the output.
• An example of this kind of system is a
security floodlight that comes on in the
dark.
Sequential Control
In a sequential control system a
series of different events takes
place one after the other.
The finishing of one event in the
sequence provides the signal for the
next event to start.
Examples of sequential systems :
1. The timers that control
central heating systems.
2. Washing machines.
3. Traffic lights.
4. Lifts in buildings
Examples of sequential control systems
Sometimes one of the events in the
sequence is itself a continuous control
system. For example, filling a washing
machine with water uses a continuous
control system that monitors the water
level and controls the water input valves.
However this is only one event in the series of
events that makes up the complete sequential
control system for the washing machine. It
will be started by the event that comes before
it and, when the machine is full, it will start
the next event off.
Conventional sequential control systems
usually adopt a centralized control approach,
and usually being implemented using
programmable controllers (PLCs).
This results in a wiring layout that becomes
complex as the number of devices increases
where complex bundles of wires are always
seen in PLC control systems due to the point-
to-point connections from all the I/O devices
to the PLC.
Types of Sequential Systems
1. Asynchronous systems.
2. Synchronous systems.
3. Mixed systems.
Asynchronous Systems
Such systems are event-based, which
means that a control action begins only
after the previous control action is
successfully completed.
In an asynchronous control system all of
the events in the sequence take place as
a result either due to an external event or
because the previous event has finished,
regardless of the time taken.
Asynchronous systems require sensors to detect
the completion of an event or an outside event and
so must be closed loop.
The control system for a lift is asynchronous where
the sequence of events depends entirely on
external events (people pressing the call buttons
outside the lift, and the floor buttons inside it) or
the completion of lift movements (the lift stops
moving, and the doors are opened, when a switch
detects that a floor has been reached).
Lift as an asynchronous sequential system
Synchronous Systems
These systems are time-based, that
is, the system is driven by a clock
producing pulses at fixed intervals.
These pulses trigger the sequence of
control actions.
In a fully synchronous control system
all of the events in the sequence take
place at set points in time,
regardless of any external change.
Synchronous control systems are
used where the control of a
sequence of events must take place
at pre-set time intervals.
Such a system doesn’t take any
account of events outside it, only the
time between events is important.
Therefore it doesn’t need any
sensors; it is an open loop control
system.
Central heating timers are synchronous
controllers where the points at which the
heating and hot water systems are turned
on and off are fixed in time.
It should be noticed that, although once the
heating or hot water is turned on, that part
of the sequence is usually a continuous
system where temperature is continuously
monitored to control the heating system.
Central heating as a synchronous
sequential system
Mixed Systems
In most real sequential control systems
there is a mixture of synchronous and
asynchronous control. For example :
• Modern traffic light sets.
• A car burglar alarm.
• An automatic car park barrier.
• A microwave oven.
• A dishwasher
• A time lock on a bank’s safe.
• A robot arm welding parts of a car
together.
Implementation of Synchronous
Systems
The heart of a synchronous control
system is some kind of timer. This
timer can be mechanical or
electronic. The timer also needs :
1. A sequencing element that sets the
times at which outputs are switched
on and off. Remember that there are
no external inputs into a synchronous
timer.
2. An output stage that provides the
start and stop signals.
The timer may be :
1.Mechanical timer.
2.Electronic timer.
3.Microcontroller.
Mechanical Timer
All mechanical timers are
different kinds of cam timer, in
which a motor turning at a
constant speed is used to turn
lots of cams, as the cams turn
they push on switches to turn
them on or off.
Mechanical cam timers
Electronic Timer
• A dedicated circuit uses an oscillator
to give electronic clock pulses. Its
circuitry often involving the use of
logic gates which is then used to
control a sequence of switching.
• Programmable Logic Controllers
(PLCs) are commonly used in industry,
where a PLC contains the same kind
of microprocessor as a computer
PLC as an electronic timer
Microcontroller
• It is a computer on a chip with an integrated
circuit that has all of the main bits of a computer
system in it.
• The timing sequence is usually programmed from
a computer before the microcontroller is placed in
the device to be controlled.
• Microcontrollers are used in mass production
because they are very cheap, also, the modern
washing machines and central heating systems
often use microcontrollers.
Microcontroller as an electronic timer
Sequential Function Charts
(SFCs)
• Many systems have sequential operation
requirements and Sequential Function
Charts (SFC’s) have become a popular
method of accurately specifying sequential
control requirements.
• It has long been established as a means of
designing and implementing sequential
control systems utilizing PLCs.
Many manufacturers offer program-ming
environments that allow engineers to
program controllers using graphical
methods.
SFC’s have many advantages for software
development both in the design stage as
well as the implementation, testing,
maintaining and fault finding stages.
In design stage :
• Detailed clear graphical specification.
• Non software people can specify or
verify programs.
In implementation and testing :
• Straight forward conversion from
specification to code .
• Structured testing or debugging.
In maintenance of software :
•Readily understood by engineer
modifying software.
In machine maintenance :
•Allows quick accurate fault
diagnosis.
Sequential function charts break a
sequential task down into steps
called transitions and actions.
These are drawn graphically to
describe a sequence of interactions.
Convention states that flow through
an SFC is from top to bottom unless
indicated by an arrow.
The sequence is broken down into
steps (or states) where actions are
carried out.
The transition conditions define
logical conditions that cause the
process to move from the existing
step to the next step. Actions
contain three fields
An action consists of a qualifier
which defines what type of action,
for example S for set, R for reset and
N for continuous while in step.
As the design progresses more detail
can be added such as address
information as follows :
• Memory (%M)
• Input (%I)
• Output (%Q)
Example
To illustrate the use of SFCs and how
they may be implemented, consider
the following simple example where
two pistons have to be controlled
using a PLC.
The operation requirements are as
follows :
1. When a normally open switch (%I0.7) is
closed momentarily and both pistons are
home the following sequence should occur :
• Piston A has to be extended.
• When A is extended piston B is
extended.
• After B is extended for 3 seconds
piston B is retracted.
• When B is retracted piston A is
retracted.
2.The sequence does not operate
until the switch is closed again i.e.,
it operates every time the switch is
closed and if piston A is in its
home position.
In some cases, the PLC has to start
and follow two branches separately
and simultaneously as follows :
Chapter 4
Input / Output
Devices
Input / Output Devices
The input/output devices (I/O) used
with PLCs are different in type and
usage where it might be analog or
digital devices.
The I/O system provides the physical
connection between the equipment
and the PLC. Opening the doors on
an I/O card reveals a terminal strip
where the devices connect.
There are many different kinds of I/O
cards which serve to condition the type
of input or output so the CPU can use it
for it’s logic. It's simply a matter of
determining what inputs and outputs
are needed, filling the rack with the
appropriate cards and then addressing
them correctly in the CPUs program.
Typical input devices used with PLCs
include :
1. Mechanical switches for position
detection.
2. Proximity switches.
3. Photoelectric switches.
4. Encoders.
5. Temperature & pressure switches.
6. Potentiometers.
7. Linear variable differential Tr.
8. Strain gauges.
9. Thermistors.
10. Thermotransistors.
11. Thermocouples.
On the other hand, typical output
devices used with PLCs include :
1.Relays.
2.Contactors.
3.Solenoid valves.
4.Motors.
Input devices
• A digital input card handles
discrete devices which give a
signal that is either on or off such
as a pushbutton, limit switch,
sensors or selector switches.
• An analog input card converts a
voltage or current (e.g. a signal
that can be anywhere from 0 to
20mA) into a digitally equivalent
number that can be understood by
the CPU.
Digital or discrete sensors or on/off
sensors are considered input devices and
can easily be connected to the input
ports of the PLCs.
The input devices that give an analog
signal must be converted into digital
ones before inputting them to the PLC.
The following is a brief description for
each type of common input devices to be
used with PLCs.
Mechanical switches
• A mechanical switch generates an
on/off signal due to some mechanical
input causing the switch to be opened
or closed, e.g, a cam or an arm.
• The presence of the mechanical input
leads to closing the switch or giving
level 1 to the PLC.
• On the other hand, the absence of it
leads to opening the switch or giving
level 0 to the PLC.
Workpiece present 1
Workpiece absent 0
Supply
Voltage
Input
channel
PLC
Supply
Voltage
PLC
Input
channel
Workpiece present 0
Workpiece absent 1
The mechanical switches may take one
of the following forms :
1.Normally opened contact NOC :
such switch has its contacts opened
at the absence of the mechanical
input, however that input is used to
close the switch contacts.
2. Normally closed contact NCC:
such switch has its contacts closed
at the absence of the mechanical
input, however that input is used to
open the switch contacts.
3.Limit switches : these switches
are used to detect the presence
or passage of moving parts, e.g,
in case of lifts. It may be
actuated by a cam, roller or a
lever
Rotating cam
Lever pushed
down for contact
Button to operate the
switch
Roller pushed down
for contact
For example the limit switches are used to
detect the presence or passage of a movable
mechanical object such as :
• Rotary cam actuated type.
• Roller actuated type.
• Lever actuated type.
Proximity switches
The proximity switches are used to
detect the presence of an item without
making contact with it.
The forms of the proximity switches are :
1. Eddy current type.
2. Inductive type.
3. Reed type.
4. Capacitive type.
1.Eddy current proximity switch : this
type has a coil supplied with constant
A.C and produces constant magnetic
field.
When a metallic object is close to that
coil, an eddy current will be induced in it.
Due to the eddy current a back e.m.f will
be induced in the original coil which will
affect the amplitude of its voltage.
The voltage amplitude can then be used
as a measure to indicate the distance
between the coil and the metallic object.
The voltage variation is used to activate
an electronic circuit comprising a
transistor, i.e, making that circuit on or off
according to the distance of the metallic
object. This conduction distance ranges
between 0.5 and 20 mm.
Metal object
Alternating magnetic field
Eddy current
Constant
alternating
current
2. Inductive proximity switch : this type has
a coil wound on a ferrous core.
When one end of the core is being near a ferrous
object, there will be a change in the coil
inductance .
The inductance change can be monitored using a
resonant circuit, where the current in that circuit
may be used to activate an electronic switch
circuit to give an on/off device. The range of
detecting objects is from 2 to 15 mm.
3.Reed proximity switch : this type is
consisting of two overlapping non-
touching strips of springy ferromagnetic
material sealed in a glass or plastic
envelope
4.Capacitive type :
Features of Proximity Sensor
1. Stable operation, unsusceptible to water, oil,
dust, light, etc.. :
Be able to use for machine tools splashed
with cutting oil or food processing machine
washed with water (magnetic type).
2. Resistant to vibration and shock :
Anti-vibration/shock since the whole circuit
can be coated with resin.
3. Able to detect without any contact :
Detection distance is bout 0-30mm. No
damage on an object.
4. Higher speed/performance compared with
limit switch :
Long life and quick response.
5. Magnetic type is for metal detection,
capacitance is for everything except fluid :
Liquid in a paper cup can be also detectable.
6. Susceptible to magnet effect :
High possibility of malfunction in an area
where large amount of electric current flows
such as
welding or electro magnetism.
Photoelectric switches
Transmissive type
Reflective type
TLS 220 - Light to frequency converter
Encoders
Led
Incremental encoder
Incremental
Encoders
3-bit absolute encoder
Absolute encoders
Temperature and Pressure
switches
Temp- bimetallic strip
Resistive
temperature
detector
Thermo diodes and
thermotransistors
Thermmotransistor
sensor LM3911N
Thermocouple
Poteniometers
or Displacement sensors
Linear or rotary
poteniometers
Linear potentiometer
displacement sensor
Linear Variable Differential
Transformers
Linear Variable Differential Transformer
(LVDT) sensor
Strain gauges
Metal foil strain
gauges
Wheatstone bridge
circuit
Force sensing strain gauges
Pressure sensing strain gauges
Pressure Sensors
Piezoelectric
pressure sensor
MPX100AP
pressure sensor
Pressure switches
Liquid level detector
Fluid flow measurement
Orifice flow meter
Keypads
12-way keypad
Output devices
• Output devices can also consist
of digital or analog types.
• A digital output card either
turns a device on or off such as
lights, LEDs, small motors, and
relays.
• An analog output card will
convert a digital number sent by
the CPU to it’s real world
voltage or current.
• Typical outputs signals can
range from 0 - 10 V D.C or 4 - 20
m.A and are used to drive mass
flow controllers, pressure
regulators and position controls.
Types of Output Devices
1. Contactors .
2. Control Valves .
a. Types of valves .
b. Actuation of valves .
c. Cylinders : single and double acting .
3. Motors .
a. D.C motors .
b. Induction motors .
c. Stepper motors .
Contactors
Two position valve
The 4/2 valve
2/2 Valve : flow from P to A
switched to no flow
A
P
A
P T
3/2 Valve : flow from P to A and
from A to T switched to T being
closed and flow from P to A
Control
Valves
Directional control valves
A – Piston with no current
A current through the
solenoid pulls to the right,
with no current the spring
pulls back to the left
Directional control valves
A – Piston with current
Actuation
Solenoid
Push button
Spring
operated
Cylinders
Single acting
cylinder
Double acting
cylinder
(a) - Cylinder in retracted position
Control of a single–acting cylinder
(b) - Current to solenoid cylinder extends
(c) - Solenoid current switched off
Cylinder retracts
(a) - Cylinder in retracted position
Control of a double–acting cylinder
(b) - Solenoid A energized,
cylinder extends
(c) - Solenoid B energized,
cylinder retracts
Motors
Basic elements of D.C motors
On – Off control of D.C motors
Direction control of D.C motors
Brushless D.C motors
Induction motors
Stepper motors
Linear positioning using stepper motors
Variable reluctance stepper motors
Drive system for a four-phase
stepper motor
Input and outputs of the drive system
for a four-phase stepper motor
Drive circuit connections with an
integrated circuit for stepper motors
Examples
Conveyor system
Pneumatic door opening system
Chapter 5
PLC
Networking
PLC Networks
•Necessity
•Types :
1.Bus/single highway network
2.Star network
3.Ring network
•Standards :
Layer 1 … … … … Layer 7
•Protocol
•PLC operation and scans
•Addressing
Why communication networks
• Less Expensive
• Less Physical Space Required
• Simple Installation
• More Information Available at Lower Cost
• More Adaptable to Changes
• Future Expansion
• Easier Troubleshooting
• Easier PLC Programming
Automation & Control System Hierarchy
Data Networks
Data Networks extend the information capabilities
Control Networks
Control Networks require critical performance
Device / Field Bus
Device Buses incorporate intelligent devices.
Sensor / Actuator Bus
Sensor Actuator Buses are bit level oriented
Networking types
a. Bus/single highway network :
Terminals
Bus/single highway
b. Star network :
Host
Terminals
c. Ring network :
Terminals
Plant
computer
Supervisory
PLCPLCPLCComputer
I/OI/O
I/O
I/OI/O
Supervisory
Robot PLC
I/OI/O
PLC
I/O
Control hierarchy
Network Standards
Layer 7
Application
Layer 6
Presentation
Layer 5
Session
Layer 4
Transport
Layer 3
Network
Layer 2
Data Link
Layer 1
Physical medium
Layer 7
Application
Layer 6
Presentation
Layer 5
Session
Layer 4
Transport
Layer 3
Network
Layer 2
Data Link
Layer 1
Physical medium
Application
Program
Application
Program
Transmission
Path ISO/OSI
model
PLC Operation Scan
Scan all inputs
Updating all
outputs
Running the
program
Repeat
sequence
PLC Addressing
1. Mitsubishi PLC :
Inputs : X400 , X401 , X402 , … … etc
Outputs : Y430 , Y431 , Y432 , … … etc
2. Toshiba PLC :
Inputs : X000 , X001 , X002 , … … etc
Outputs : Y000 , Y001 , Y002 , … … etc
3. Allen Bradley :
I = input
O = output
Rack
number
Terminal
number
Module
number
x : xxx / xx
Examples : I : 03 4 / 12
O: 00 2 / 05
4. Siemens SISMATIC S5 :
I = input
Q = output
Byte
number
Bit number
X xx . x
Examples : I 1.4
Q2.1
PLC Hardwiring
There are three types of wiring associated with
a PLC namely :
 The PLC wiring.
 The device wiring.
 The common (or return) wiring.
PLC Wiring :
The PLC has built-in input interfaces in both
the 16 and 32 I/O models. Since the input
interface is already wired to the PLC, input
wiring is easy and quick.
Device Wiring :
Input devices can be wired to a 120
VAC input interface in one of two
ways:
•They can be wired directly to the
interface.
•They can be wired to a terminal block
that is wired to the interface.
•If an input device is wired directly
to a PLC input interface, then one
side of the device should be wired
to the L1 hot line of the incoming
AC power source. The other side
should be wired to an input
terminal on the PLC.
An input device wired directly to
a PLC input interface.
120 V AC line
L1
If an input device is wired to a terminal
block instead of directly to the PLC
interface, then the line going out of the
input device should be wired to the
terminal block. The block, in turn, should
be wired to the PLC. In PLC applications,
the wiring of devices through a terminal
block is more common than wiring them
directly to the PLC.
120 V AC line
L1
An input device wired to a PLC via a terminal
block.
Common Wiring :
Each input device connected to a PLC’s 120
VAC input interface must also be connected
to the AC return line, called the L2 common
line.
The device must have this common
connection for its electrical circuit to be
complete.
The input terminals on a 120 VAC interface
are arranged in two groups with each group
sharing a connection to the common line.
In a 10-input PLC, the first four input terminals
share one common connection, and the last six
share another.
In a 20-input model, the first four inputs
again share one common connection,
while the last sixteen share another
24 V DC
Output Card
V+
00
01
02
03
04
05
06
07
24 V lamp
Relay
+24 V DC
Power
120 V AC
Power
Motor
Supply
Supply
Neut.
COM
24VDC
OutputCard
V+
00
01
02
03
04
05
06
07
24Vlamp
Relay
+24VDC
Power
120VAC
Power
Motor
Supply
Supply
Neut.
COM
24-Volt DC input interfaces
Two types of DC input devices are used
with PLCs:
• Sourcing devices provide current
when they are ON.
• sinking devices receive current
when they are ON.
Sourcing devices
Sourcing devices
Sinking devices
AC wiring of a PLC
DC input unit
AC input unit
A/D converter
Multiplexer
D/A converter (DAC)
Relay output unit
Transistor output unit
Triac output unit
Signal Conditioning
• The potential divider can be used to reduce the
voltage from the sensor to the required level
such that :
in
21
2
V.
RR
R

outV
Vin
Vout
R1
R2
• Amplifiers can be used to increase the voltage
level using the Op Amps in one of three forms :
in
1
2
V.
R
R
outV
A : inverting
amplifier
in
1
21
V.
R
RR 
outV
B : non-inverting
amplifier
)V-(V.
R
R
12
1
2
outV
C : differential
amplifier
Signal conditioning with
a strain gauge sensor
Use of remote
input/output modules
Use of remote
input/output PLC systems
Chapter 6
PLC
Programming
Programming Rules
• Programs for microprocessor-based
controllers usually being loaded in
machine code as binary numbers and
representing the instructions.
• Assembly language can be used in
the form of mnemonics to indicate
the operations, e.g : LD , OUT , OR , …
… etc.
PLC Programming Methods
1. IL (Instruction List Programming) :
This is effectively mnemonic
programming.
2. ST (Structured Text) - A BASIC like
programming language.
3. LD (Ladder Diagram) - Relay logic
diagram based programming.
4. FBD (Function Block Diagram) - A
graphical dataflow programming
method
5. SFC (Sequential Function Charts) -
A graphical method for structuring
programs
Relay Ladder Logics (RLL)
• Ladder logic is a drawing of
electrical logic schematics which
results from the usage of relays.
• It is now a graphical language very
popular for programming PLCs,
where sequential control of a
process or manufacturing operation
is simulated.
Motor stop – start circuit
L1 L2
1
2
M
Holding switch
• Its name is based on the observation that
programs are resembled by ladders, with
two vertical rails and a series of horizontal
rungs between them.
• Generally, manufacturers of programmable
logic controllers provide associated ladder
logic programming systems. However, the
ladder logic languages from two
manufacturers will not be completely
compatible.
• Even different models of programmable
controller within the same family may
have different ladder notation such that
programs cannot be interchanged
between models.
• Ladder logic can be thought of as a
rule-based language, rather than a
procedural language. A rung in the
ladder represents a rule.
• When implemented in a program-
mable logic controller, the rules are
typically executed sequentially by
software, in a continuous loop
(scan).
• However, proper use of programma-
ble controllers requires understand-
ing the limitations of the execution
order of rungs.
Scanning the ladder program
END
RELAY LADDER LOGIC
PROGRAMS & PROGRAMMING
The LD language itself can be considered
as a set of connections between logical
checkers (contacts) and actuators (coils)
such that :
 If a path can be traced between the left
side of the rung and the output, through
asserted (true or closed) contacts, the
rung is true and the output coil storage
bit is asserted (1) or true.
 If no path can be traced, then the
output is false (0) and the coil by
analogy to electromechanical relays is
considered de-energized
 So, one can say that, ladder logic has
contacts that make or break circuits to
control coils. Each coil or contact
corresponds to the status of a single
bit in the programmable controller's
memory.
The contacts may refer to physical hard
inputs to the programmable controller
from physical devices such as
pushbuttons and limit switches via an
integrated or external input module, or
may represent the status of internal
storage bits which may be generated
elsewhere in the program.
 The coil (output of a rung) may represent a
physical output which operates some device
connected to the programmable controller, or
may represent an internal storage bit for use
elsewhere in the program.
 Each rung of ladder language typically has one
coil at the far right. Some manufacturers may
allow more than one output coil on a rung. On
the other hand, several contacts may be used
in different logic arrangements may be used at
the beginning of the rung to represent the
inputs.
115 VAC
w a l l p l u g
r e l a y
i n p u t A
( n o r m a l l y c l o s e d )
i n p u t B
( n o r m a l l y o p e n
o u t p u t C
( n o r m a l l
l a d d e r l o
A B C
l a d d e r
p o w e r
s u p p l y
+ 2 4 V
c o m .
i n p u t s
o u t p u t s
p u s h b u t t o n s
l o g i c
P L C
A C p o w e r
115 Vac
n e u t .
A B C
l i g h t
Each program is a set of rungs that
reveals the sequence of the
operations in the controlled process.
H O T N E U T R
I N P U T S O U T P U T S
A B X
C D
E F
G
H
Y
N o t e : P o w e r n e e d s t o f l o
( A , B , C , D , E , F, G , H ) t o t u r n o n o u t
LD contacts & their types
As mentioned before, the contacts may
refer to physical hard inputs to the
programmable controller from physical
devices such as pushbutton switches,
selector switches and limit switches via an
integrated or external input module, or may
represent the status of internal storage
bits which may be generated elsewhere in
the program
disconnect circuit interrupter
breaker (3 phase AC)
normally open
limit switch
normally closed
limit switch
normally open
push-button
normally closed
push-button double pole
push-button
mushroom head
push-button
(3 phase AC) (3 phase AC)
Normally Open Contact (NOC)
This can be used to represent any input to
the control logic such as : a switch or
sensor, a contact from an output, or an
internal output. When solved, the
referenced input is examined for an ON
(logical 1) condition :
• If it is ON, the contact will close
and allow power (logic) to flow
from left to right.
• If the status is OFF (logical 0), the
contact is Open, power (logic)
will NOT flow from left to right.
Normally Closed Contact (NCC)
When solved, the referenced input is
examined for an OFF condition :
• If the status is OFF (logical 0) power
(logic) will flow from left to right.
• If the status is ON, power will not
flow.
LD coils & their types
Also, the coils (output of a rung) may
represent a physical output which
operates some device connected to the
programmable controller such as solenoid
valves, lights, motor starters and servo
motors, or may represent an internal
storage bit for use elsewhere in the
program.
Normally Open Coil
This can be used to represent any discrete
output from the control logic. When solved :
• If the logic to the left of the coil is
TRUE, the referenced output is ON
(logical 1).
• If the logic to the left of the coil is
FALSE, the referenced output is OFF
(logical 0).
Normally Closed Coil
This can be used to represent any discrete
output from the control logic. When solved :
• If the logic to the left of the coil is TRUE,
the referenced output is OFF (logical 0).
• If the logic to the left of the coil is FALSE,
the referenced output is ON (logical 1)
To identify an input or an output in a
program, a numbering system is used. This
numbering system has three purposes :
• To tell contacts apart in the program.
• Serves as an address for the location
of the input module in the real world.
• Serves as a memory address for the
contact in the processor memory.
Solving a Single Rung
Suppose a switch is wired to Input1, and a light
bulb is wired through Output1 in such a way that
the light is OFF when Output1 is OFF, and ON when
Output1 is ON.
• When Input1 is OFF (logical 0) the contact
remains open and power cannot flow from left to
right. Therefore, Output1 remains OFF (logical 0).
• When Input1 is ON (logical 1) then the contact
closes, power flows from left to right, and
Output1 becomes ON (the light turns ON).
Output1
Input1
controller
Load
Examples
The AND rung
The AND is a logic condition where an
output is not energized unless two NOC are
closed.
x400 x401
Y430
Mitsubishi PLC
x000 x001
Y000
Toshiba PLC notation
I0.1 I0.2
Q2.0
Siemens PLC
Logic gate
control
output
inputs
A
B
Inputs
Output
A B
0 0 0
0 1 0
1 0 0
1 1 1
Address Instruction Data
0 LOAD IN1
1 AND IN2
2 OUT OUT1
3 END
The OR rung
The OR is a logic condition where an
output is energized when one or both of
two NOC are closed.
Logic gate
control
output
inputs
A
B
Inputs
Output
A B
0 0 0
0 1 1
1 0 1
1 1 1
Address Instruction Data
0 LOAD IN1
1 OR IN2
2 OUT OUT1
3 END
x400
x401
Y430
Mitsubishi PLC
x000
x001
Y000
Toshiba PLC
I0.1
I0.2
Q2.0
Siemens PLC
The NOT rung
The NOT is a logic condition where an
output is de-energized when a NCC is
opened.
Output1
Input1
controller
Load
Logic gate
control
output
inputs
A
Inputs
Output
A
0 1
1 0
Address Instruction Data
0 LOAD IN1
1 NOT IN1
2 OUT OUT1
3 END
x400
Y430
Mitsubishi PLC
I0,1
O0,0
Telemecanique PLC
I0.1
Q2.0
Siemens PLC
The NAND rung
The NAND is a logic condition where an
AND gate is followed by a NOT gate or
putting a NOT gate on each input of an OR
gate as follows :
AND
A
B
NOT
NOT
NOT
OR
A
B
Inputs
Output
A B
0 0 1
0 1 1
1 0 1
1 1 0
Address Instruction Data
0 LOAD IN1
1 AND IN2
2 NOT
3 OUT OUT1
4 END
x400
x401
Y430
Mitsubishi PLC
x000
x001
Y000
Toshiba PLC
I0.1
I0.2
Q2.0
Siemens PLC
The NOR rung
The NOR is a logic condition where an OR
gate is followed by a NOT gate or putting a
NOT gate on each input of an AND gate as
follows :
OR
A
B
NOT
NOT
NOT
AND
A
B
Inputs
Output
A B
0 0 1
0 1 0
1 0 0
1 1 0
x400 x401
Y430
Mitsubishi PLC
x000 x001
Y000
Toshiba PLC notation
I0.1 I0.2
Q2.0
Siemens PLC
Address Instruction Data
0 LOAD IN1
1 OR IN2
2 NOT
3 OUT OUT1
4 END
The XOR rung
The XOR is a logic condition where an
output exists when either of the two inputs
is on but not when both are on follows :
OR
AND
NOT
NOTA
B
AND
Inputs
Output
A B
0 0 0
0 1 1
1 0 1
1 1 0
Address Instruction Data
0 LOAD IN1
1 AND NOT IN2
2 LOAD NOT IN1
3 AND IN2
4 OR
5 OUT OUT1
x400 x401
Y430
Mitsubishi PLCx400 x401
x000 x001
Y000
Toshiba PLCx000 x001
I0.1 I0.2
Q2.0
Siemens PLCI0.1 I0.2
Latching
• Sometimes it is necessary to hold an
output energizes even when the input
is ended.
• An example is a motor starting and
stopping using push button, where
the latch circuit is used to keep the
motor running after the contacts of
the starting switch being opened.
In 1
out
out
In 2
X400
Y430
Y430
X401
X400
Y430
Y430
Motor output
X401
Y430
Y430
Y431
Y432
Lamp for No power
Motor On-off
with signal
lamps
Ladder circuit
Lamp for power ON
Multiple Outputs Ladder Circuits
X400
Y430
X401
Y431
X402
Y432
Ladder Programming Symbols
Several symbols are used to enter a ladder
program either using a the keypad of a
programming device with symbols or using a PC
software. The following are samples of such
symbols :
input output Start of a
junction
End of a
junction
Horizontal circuit link
Instruction Lists
• The instruction list programming for a
PLC differs according to the type of
the used PLC.
• The following table shows the
different types of PLCs and the
corresponding instructions to be used
with them.
Command
PLCs Types
IEC11
31-3
Mitsub
ishi
Omro
n
Sieme
ns
Telemec
anique
Sphere+
Schuh
Start a rung with
a NOC
LD LD LD A L STR
Start a rung with
a NCC
LDN LDI
LD
NOT
AN LN
STR
NOT
Series element
with a NOC
AND AND AND A A AND
Series element
with a NCC
ANDN ANI
AND
NOT
AN AN
AND
NOT
Parallel element
with a NOC
O OR OR O O OR
Parallel element
with a NCC
ORN ORI
OR
NOT
ON ON OR NOT
An Output ST OUT OUT = = OUT
twoANDblocks
Step Instruction
0 LD X400
1 OR X402
2 LD X401
3 OR X403
4 ANB
5 OUT Y430
Step Instruction
0 A(
1 A I0.0
2 O I0.1
3 )
4 A(
5 A I0.2
6 O I0.3
7 )
8 = Q2.0
Mitsubishi PLC
Siemens PLC
x400 x401
Y430
x402 x403
I0.0 I0.1
Q2.0
I0.2 I0.3
Step Instruction
0 A I0.0
1 = Q2.0
2 AN I0.0
3 = Q2.1
Step Instruction
0 LD X400
1 OUT Y430
2 LDI X400
3 OUT Y431
Mitsubishi PLC
Siemens PLC
Togglecircuit
x400
Y430
x400
Y431
I0.0
Q2.0
I0.0
Q2.1
Boolean Algebra
• The instruction lists and ladder
diagrams can also been used to
represent mathematical operations
as follows :
• A . B = Q represents an AND circuit.
• A + B = Q represents an OR circuit.
• A = Q represents a NOT operation.
Example
Consider the following expression :
A + B . C = Q
this tells that there is the term A or the
term B and C will give the output Q, the
corresponding ladder diagram is :
A
Q
Siemens PLC
B C
XOR Example
Considering the XOR gate below :
• the input to the upper AND is : A and B
and its output is : A . B
OR
AND
NOT
NOTA
B
AND
Q
• the input to the lower AND is : A and B
and its output is : A . B
• Finally, the boolean expression for the
OR gate will be : Q = A . B + A . B
• The corresponding ladder diagram is :
A B
A B
Q
More Example
Considering the logic circuit shown below :
• the boolean expression for the circuit is :
(A . B + C) . D . E . F = Q
AND
A
B
OR
NOT
QANDNOT
C
D
E
F
• The corresponding ladder diagram is :
C
DA B
QE F
Programming Examples
1. A signal lamp is required to be on if :
A pump is running.
And
 The pressure is satisfactory.
Or
 The test lamp is closed.
Pump
X400
Presu.
X401
Lamp
Y430
Test
X402
Step Instruction
0 LD X400
1 AND X401
2 LD X402
3 ORB
4 OUT Y430
5 END
2. A machine has 4 sensors to detect the
safety and is required to be off if :
 Any of the sensors gives input.
 when the machine is stop, an alarm is sound.
Step Instruction
0 LDI X400
1 ANI X401
2 ANI X402
3 ANI X403
4 OUT Y430
5 LD X400
6 OR X401
7 OR X402
8 OR X403
9 OUT Y431
10 END
X400
X401 Mamchine
Y430
X400
X402
X403
X401
X402
X403
Alarm
Y431
Chapter 7
Internal
Relays
Definition
INTERNAL UTILITY RELAYS (contacts) : These do
not receive signals from the outside world nor do
they physically exist. They are simulated relays
and are what enables a PLC to eliminate external
relays. There are also some special relays that
are dedicated to performing only one task. Some
are always on while some are always off. Some
are on only once during power-on and are
typically used for initializing data that was stored.
They are built-in functions in the PLCs
Input
Circuit
Output
Circuit
CPU
Memory
Input
Relays
Output
Relays
Internal
Utility
Relays
CountersTimers
Data
Storage
A PLC might have hundreds of internal
relays where some of them are battery
backed to ensure safe operation in case of
power failure.
Internal relays some times take different
names such as : auxiliary relays, markers,
flags, coils and bit storage .
To distinguish internal relays outputs from
physical relays outputs, they are given
different addresses such as :
a.Markers : M100 , M101 , … etc for
Mitsubishi PLC.
b.Flags : F0.0 , F0.1 , … etc for Siemens
PLC.
c.Coils : C001 , C002 , … etc for
Sprecher+ PLC.
d.Bits : B0 , B1 , … etc for
Telemecanique PLC.
e.Internal relays : R000 , R001 , … etc
for Allen Bradley PLC.
In ladder programming, internal relays
take the same symbols as the physical
outputs but with different addresses.
The most commonly usage of internal
relays is for latching circuits or for
checking purposes when energizing an
output under some conditions.
Examples
1.Checking an output : Consider a system
whose output is activated when two
different sets of input conditions are
satisfied, the ladder describing such
case is : X400 X401 M100
X402
M100 X403 Y430
Step Instruction
0 LD X400
1 OR X402
2 AND X401
3 OUT M100
4 LD M100
5 AND X403
6 OUT Y430
7 END
Step Instruction
0 LD X400
1 OR X401
2 OUT M100
3 LD X402
4 AND X403
5 OUT M101
6 LD M100
7 OR M101
8 OUT Y430
9 END
X400 M100
X401
X402 X403 M101
M100
Y430
M101
2.Latching Circuit : the second use of
internal relays is to reset a latch circuit
as shown in the next example :
X400 M100
Y430
X401
M100
Y430
I0.0 F0.0
Q2.0
I0.1
F0.0
Q2.0
3.Starting Multiple Outputs : the third
use of internal relays is to start a
circuit with multiple outputs as follows :
X400 X401
M100
M100 Y430
M100
X402 Y431
X403 Y432
4.Battery-backed relays : for the latch
circuits, the internal battery-backed
relays are used to maintain the
operation of the output even when the
power is cut off.
X400
M300
M300
Y430
M300
5.Setting and resting relays : the
internal relays are used also to set and
reset the operation of the output cycle
as follows :
X400
X401
Y430S
Y430R
X400
X401
Y430
LD X400
S Y430
LD X401
R Y430
The set and reset circuit can be done in
several ways as follows :
I0.0
I0.1
S
Q2.0
R
X000
X001
S
Y020
R
Q
FF
R110
Siemens PLC Toshiba PLC
Master Control Relay
The master control relay is used in the
ladder programming when a large number
of outputs are used or when it is needed to
divide the whole program into sections
M100
X402
X400
X401
M100
Y430
Y431
M100MCR
Step Instruction
0 LD X400
1 OUT M100
2 MC M100
3 LD X401
4 OUT Y430
5 LD X402
6 OUT Y431
7 MC M100
8 END
More than one master control relay :
Step Instruction
0 LD X400
1 AND X401
2 OUT M100
3 LD X402
4 AND X403
5 OUT M101
6 MC M100
7 LD X404
8 OUT Y430
9 MC M101
10 LD X405
11 OUT Y431
12 MCR M100
13 MCR M101
14 ..
15 ..
16 END
M100
M100X400
X404 Y430
X405 Y431
M101MCR
M101X402
X401
X403
M101
Jump (program flow control )
The conditional jump instruction is used
to control the execution of the ladder
program such that :
1. When an input enables the jump, the
program will proceed starting from the
rung after the jump end and the rungs
that lie between the start of the jump and
its end will be ignored.
2. When there is no input to the jump, the
program will proceed in its original form
without ignoring any rungs.
Examples
1. The following ladder shows a conditional jump
for a process such that a fan operates when
temp exceeds a some level , however, no
action takes place if temp is blow that level.
CJP 700
X402
X400
X401 Y430
Y431
EJP 700
X401 Y430
X403 Y431
EJP 700
CJP 700
X400
CJP 701
X402
X404 Y432
EJP 701
X405 Y433
If X400If X402
Jump
within
jump
Example (Central Heating)
Consider a central heating system with the
following features :
 The boiler is thermostatically controlled and
supplies the radiator system in addition to a hot
water tank.
 Pumps are used to supply hot water to either or
both the radiator and the tank according to the
desired sensors.
 The whole system is controlled by a clock to
operate a certain time a day.
Boiler Temp.
sensor
Motorized
Pump
M1
M2
Boiler
Motorized
Pump
Radiator
System
Room
Timers
Hot water tank
Temp. sensor
Hot water
tank
The power circuit for the central heating
system is :
Stop
Run
Clock
Boiler sensor
Room sensor
Tank sensor
Power
Outputs
Boiler
M1
M2
Inputs
The ladder & IL program for the central heating
system using Mitsubishi PLC is :
Inputs :
X400 Clock
X401 Boiler sensor
X402 Room sensor
X403 Tank sensor
Outputs :
Y430 Boiler
Y431 Pump M1
Y432 Pump M2
X403
X402
X402 Y431
Y432
END
X400 X401
X403
Y430
Y430
Y430
Step Instruction
0 LD X402
1 OR X403
2 AND X400
3 AND X401
4 OUT Y430
5 LD Y430
6 AND X402
7 OUT Y431
8 LD Y430
9 AND X403
10 OUT Y432
11 END
The ladder & IL program for the central heating
system using Siemens PLC is :
Inputs :
I0.0 Clock
I0.1 Boiler sensor
I0.2 Room sensor
I0.3 Tank sensor
Outputs :
Q2.0 Boiler
Q2.1 Pump M1
Q2.2 Pump M2
I0.3
I0.2
I0.2 Q2.1
Q2.2
END
I0.0 I0.1
I0.3
Q2.0
Q2.0
Q2.0
Step Instruction
0 A I0.2
1 O I0.3
2 A I0.0
3 A I0.1
4 = Q2.0
5 A Q2.0
6 A I0.2
7 = Q2.1
8 A Q2.0
9 A I0.3
10 = Q2.2
11 END
Chapter 8
Timers
Simple Timers
A timer is simply a control built-in block
that takes an input and changes an output
based on time.
Timers count fractions of seconds or
seconds using internal CPU clock.
Timers act like relays with coils which when
energized result in closing or opening
contacts after some specified time interval.
In PLC programming a timer is simply
being treated as an output for a rung
while its control is represented by
contacts in somewhere else.
There are three basic timer types :
i. On-Delay timer TON or T-O
ii. Off-Delay timer TOF or O-T
iii. Pulse timers TP
Timer Types
•On-Delay Timer : this timer takes an
input, waits a specific amount of time,
then turns ON an output (or allows logic
to flow after the delay).
time
Output
Off
On
time
Output
Off
On
TP with
+ve going
output
•Off-Delay Timer : this timer takes turns
ON an output (or allows logic to flow) and
keeps that output ON until the set
amount of time has passed, then turns it
OFF (hence off-delay)
time
Output
Off
On
time
Output
Off
On
TP with
-ve going
output
Timer Memory
• EN - timer enabled bit
• TT - timer timing bit
• DN - timer done bit
• FS - timer first scan
• LS - timer last scan
• OV - timer value overflowed
• ER - timer error
• PRE - preset word
• ACC - accumulated time word
Timer Format
• Timer : timer No. T1
• Time Base : 0.01 or 0.1 or 1.0 sec
• Preset : 100
• Accum. : 0
Txxx
Preset value
Time Base
xxx
Register where
Accumulative
value stored
Timer Function
Block
10
T1.0
4003
I0.1
I0.2
Q0.3
10
T1.0
4003
10
T1.0
4003
Ten-second On
Delay Timer
Automatic
Resetting Timer
Q0.3
Q0.3
I0.1
I0.1
I0.2
Q0.3
Ten-second Off
Delay Timer
10
T1.0
4003
Retentive Timer
Non-retentive
Timer
10
T1.0
4003
I0.1 Q0.3
I0.1
I0.2
Q0.3
Timer Programming
The on delay timer is used to delay the
operation of the output for some time
interval as follows :
Input
Timer
Output
Timer
time
time
Input
Output
Time
delay
X400
T450 Y430
T450 K5
I0.0
KT5.2
Q2.0
T0
T 0
Step Instruction
0 A I0.0
1 LKT 5.2
2 SR T0
3 A T0
4 = Q2.0
5 END
Step Instruction
0 LD X400
1 OUT T450
2 K 5
3 LD T450
4 OUT Y430
5 END
Sequencing
The timers can be used to energize more
than one output sequentially with a
specified time delay .
Q2.0
KT5.2
Q2.1
T0
T 0
Y430 T450 K5
X400
T450 Y431
I0.0
Q2.0Y430
T1 Motor 2
IR 1
T2 Motor 3
IR 1
IR 1
start stop IR 1
Motor 1
T2
T1
END
T1 Motor 2
IR 1
T2 Motor 3
IR 1
IR 1
start stop IR 1
Motor 1
IR 3
IR 2
END
TON T1
TON T2
Motor
Sequence
Cascaded Timers
Timers can be linked together to give longer
time delay than that for a single timer.
I0.2
Q0.3
10
T1.0
4001
10
T2.0
4002
Cascaded Timers
I0.1
Q0.1
Q0.1
T450 T451 K100
X400
T451 Y430
T450 K999
Step Instruction
0 LD X400
1 OUT T450
2 K 999
3 LD T450
4 OUT T451
5 K 100
6 LD T451
7 OUT Y430
8 END
Cascaded timers
Example (Timer Application)
 Automatic mixing processes of liquids and other
compounds in the chemical and food industries are very
common.
 The mixing station goal is to mix two liquids for a
specified time and then output the final product to a
storage tank.
 The system consists of :
1. Two level sensors to monitor the flowing of the
liquids into the tank.
2. Three solenoid valves to control the flow of liquids.
3. A motor connected to an agitator to mix the liquids
into the tank.
Mixing
Station
LS1
LS2
Level Sensors
VA1
VA2
Input Valves
MS1
Motor & Agitator
Mixing Tank
VA3 Output to Storage Tank
The sequence of events for this automatic mixing process will
be as follows :
1. Open valve 1 until level 1 is reached for the first liquid .
2. Then close valve 1 .
3. Open valve 2 until level 2 is reached for the second
liquid .
4. Then close valve 2 .
5. Start the motor and agitate to mix the liquids into the
tank for a specified time .
6. Then stop the motor .
7. Open valve 3 up to a specified time to empty the mixed
product to a storage tank .
8. Then close valve 3 .
9. Repeat or end the mixing process as required .
The automatic mixing station will require the following
components using Mitsubishi PLC :
1. Inputs to the PLC :
 Start push button X400
 Stop push button X401
 Level sensor LS1 X402
 Level sensor LS2 X403
1. Outputs from the PLC :
 Valve # 1 (VA1) Y430
 Valve # 2 (VA2) Y431
 Motor starter (MS1) Y432
 Valve # 3 (VA3) Y433
Y432
X403
T450 K1200
M 100
Y430
M 100
M100
M100
M100
M 100
X400
X401
M 100
END
X402 X403 Y432 Y433
X402 X403 Y432 Y433
Y431
T450X403
Y433
T451 K180
M100 T450
M100 T451 T450
Y433
Step Instruction
12 ANI X403
13 ANI Y432
14 ANI Y433
15 OUT Y431
16 LD M100
17 AND X403
18 OUT T450
19 K 1200
20 LD M100
21 AND X403
22 LD M100
23 ANI Y433
Step Instruction
0 LD X400
1 OR M100
2 ANI X401
3 OUT M100
4 LD M100
5 ANI X402
6 ANI X403
7 ANI Y432
8 ANI Y433
9 OUT Y430
10 LD M100
11 AND X402
Step Instruction
24 ORB
25 ANI T450
26 OUT Y432
27 LD M100
28 ANI T450
29 OUT T451
30 K 180
31 LD M100
32 ANI T451
33 AND T450
34 OUT Y433
35 END
Q2.2
I0.3
F0.2
F0.1
Q2.0
F0.1
F0.1
F0.1
F0.1
F0.1
I0.0
I0.1
F0.1
END
I0.2 I0.3 Q2.2 Q2.3
I0.2 I0.3 Q2.2 Q2.3
Q2.1
F0.2I0.3
Q2.3
F0.3
F0.1 F0.2
F0.1 F0.3 F0.2
Q2.3
T0
KT1200
KT180
T1
Step Instruction
12 AN I0.3
13 AN Q2.2
14 AN Q2.3
15 = Q2.1
16 A F0.1
17 A I0.3
18 LKT 1200
19 SR T0
20 A T0
21 = F0.2
22 A(
23 A F0.1
Step Instruction
0 A I0.0
1 O F0.1
2 AN I0.1
3 = F0.1
4 A F0.1
5 AN I0.2
6 AN I0.3
7 AN Q2.2
8 AN Q2.3
9 = Q2.0
10 A F0.1
11 A I0.2
Step Instruction
36 A T1
37 = F0.3
38 A F0.1
39 AN F0.3
40 A F0.2
41 = Q2.3
46 END
Step Instruction
24 A I0.3
25 )
26 O(
27 A F0.1
28 AN Q2.3
29 )
30 AN F0.2
31 = Q2.2
32 A F0.1
33 AN F0.2
34 LKT 180
35 SR T1
Chapter 9
Counters
Simple Counter
 A counter is simply a control built-in block that
takes counts the occurrence of an input signal.
 This might happen in a conveyor system, when
counting persons passing through a door,
counting cars in a parking lot or counting the
revolutions of a shaft.
 There are two basic types of counters - Up
counter and a Down counter :
•Up Counter : as its name implies, whenever a
triggering event occurs, an up counter increments
the counter.
•Down Counter : whenever a triggering event
occurs, a down counter decrements the
counter.
Counter Memory
• CU - count up bit
• CD - count down bit
• DN - counter done bit
• OV - overflow bit
• UN - underflow bit
• PRE - preset word
• ACC - accumulated count word
Counter Format
•Counter : counter No. CTR1
•Preset value : 5
•Accum. : 0
Preset
value
CTR
Storage
Register
Counter Function
Block
5
CTR1
4003
I001 O003
5
CTR1
4003
5
CTR1
4003
Automatic Resetting Counter
Down Counter
Up Counter
I001
I001
I002
I002
O003
O003
O003
I001
20
CTR1
4001
999
CTR2
4002
O001
I002
Cascaded Counters
O001
O002
Counter Programming
The counter is used to count the events of
occurrence of an input signal and then
operates its contacts as follows :
Input
Counter
Output
Counter
CTD
counter
CV
RST
Counter Output
In 1
In 2 Counter
Counter
RST
time
In 1
time
In 2
time
Output
Step Instruction
0 LD X400
1 RST C460
2 LD X401
3 OUT C460
4 K 10
5 LD C460
6 OUT Y430
7 END
X400
X401
Y430
RESET
C460
K 10
Out
C460
Mitsubishi PLC counter programming
Step Instruction
0 A I0.0
1 CU C0
2 A I0.1
3 R C0
4 = Q2.0
5 END
I0.0
I0.1
Q2.0
CU
CV
R
C0
Siemens PLC counter programming
Counter Application
Consider the following packing machine,
where it is required to pack 6 objects in a
box and then pack 12 objects in another
box in another path as shown :
6 in box
12 in box
Step Instruction
0 LD X400
1 OR C461
2 RST C460
3 K 6
4 LD X401
5 OUT C460
6 LD C460
7 OUT Y430
8 LD X400
9 OR C461
10 RST C461
11 K 12
12 LD X401
13 AND C460
14 OUT C461
15 LD C461
16 OUT Y431
17 END
Mitsubishi PLC program
C460
C461
X400
X401
Y430
RESET
C460
K 6
Out
C460
X400
X401
Y431
RESET
C461
K 12
Out
C461
C461
Step Instruction
0 A I0.0
1 O C1
2 CU C0
3 LCK 6
4 A I0.1
5 R C0
6 = Q2.0
7 A I0.0
8 O C1
9 CU C1
10 LCK 12
11 A I0.1
12 R C1
13 A C0
14 = Q2.1
15 END
Siemens PLC program
I0.0
I0.1 Q2.0
I0.0
I0.1 Q2.1C0
CU
CV
R
CU
CV
R
C1
6
12
C1
C1
C0
In 3 Reset
In 1
In 2 Down-Counter
Up-Counter
Counter Output
Using up
and down
counters
Step Instruction
0 A I0.0
1 CU C0
2 A I0.1
3 CD C0
4 AN F0.0
5 LKC 50
6 S C0
7 A I0.2
8 R C0
9 A C0
10 = Q2.0
I0.0
I0.1
Q2.0
CU
CD
S
KCV50
Up and down counters
with a Siemens PLC
F0.0
I0.2
CV
R
C0
Chapter 10
Shift
Registers
Definition
• The shift registers are electronic internal
devices used for storing data.
• They represent a number of internal relays
grouped together and allowing stored bits
to be shifted from one relay to another.
• Their main usage is to keep tracking of
particular items or where a sequence of
operations is required.
Shift Registers Operation
Suppose that we have 8 internal relays
grouped together :
And each relay may store an on or off
state as follows :
1 2 3 4 5 6 7 8
1 0 1 1 0 0 1 0
If a signal is received from an input
devices sets the 1st internal relay to the
state 0, by then the grouped set of relays
in the register will be shifted as follows :
before the update
after the update
0 1 0 1 1 0 0 1
1 0 1 1 0 0 1 0
Shift Registers Programming
Consider a 4-bit shift register, it can be
represented in ladder diagram by three inputs
such that :
• The 1st input is used to reset the register
(RST).
• The 2nd input is used to energize the first
internal relay of the register (OUT).
• The 3rd input is used to shift the states of the
internal relays of the register along by one
(SFT).
In 3
RST
IR 1 Out 1
In 2
SFT
In 1
OUT
IR 2 Out 2
IR 3 Out 3
IR 4 Out 4
Shift register internal relays
IR 1 , IR 2 , IR 3 , IR 4
Output controlled by 1st relay
in the register
Output controlled by 2nd relay
in the register
Output controlled by 3rd relay
in the register
Output controlled by 4th relay
in the register
X402
RST
M140 Y430
X401
SFT
X400
OUT
M141 Y431
M142 Y432
M143 Y433
M140
Step Instruction
0 LD X400
1 OUT M140
2 LD X401
3 SFT M140
4 LD X402
5 RST M140
6 LD M140
7 OUT Y430
8 LD M141
9 OUT Y431
10 LD M142
11 OUT Y432
12 LD M143
13 OUT Y433
14 END
Mitsubishi PLC

More Related Content

What's hot

Plc example presentation
Plc example presentationPlc example presentation
Plc example presentation
Roshit Kadiru
 
Plc presentation
Plc presentationPlc presentation
Plc presentation
Akshay Modi
 

What's hot (20)

Plc example presentation
Plc example presentationPlc example presentation
Plc example presentation
 
Plc (PROGRAMMABLE LOGIC CONTROLLER)
Plc (PROGRAMMABLE LOGIC CONTROLLER)Plc (PROGRAMMABLE LOGIC CONTROLLER)
Plc (PROGRAMMABLE LOGIC CONTROLLER)
 
Omron plc training
Omron plc trainingOmron plc training
Omron plc training
 
Plc 101
Plc 101Plc 101
Plc 101
 
Programmable Logic Controller(PLC)
Programmable Logic Controller(PLC)Programmable Logic Controller(PLC)
Programmable Logic Controller(PLC)
 
PLC Basic
PLC BasicPLC Basic
PLC Basic
 
INDUSTRIAL AUTOMATION USING PLC
INDUSTRIAL AUTOMATION USING PLCINDUSTRIAL AUTOMATION USING PLC
INDUSTRIAL AUTOMATION USING PLC
 
Vt training plc_1
Vt training plc_1Vt training plc_1
Vt training plc_1
 
Programmable Logic Controller and ladder logic programming
Programmable Logic Controller and ladder logic programmingProgrammable Logic Controller and ladder logic programming
Programmable Logic Controller and ladder logic programming
 
PLC LADDER DIAGRAM
PLC LADDER DIAGRAMPLC LADDER DIAGRAM
PLC LADDER DIAGRAM
 
Plc presentation
Plc presentationPlc presentation
Plc presentation
 
Plc
PlcPlc
Plc
 
Industrial Automation
Industrial AutomationIndustrial Automation
Industrial Automation
 
Basic PLC
Basic PLCBasic PLC
Basic PLC
 
ppt on PLC automation
ppt on PLC automationppt on PLC automation
ppt on PLC automation
 
Plc presentation
Plc presentationPlc presentation
Plc presentation
 
ppt on PLC automation
ppt on PLC automationppt on PLC automation
ppt on PLC automation
 
ppt on PLC
ppt on PLCppt on PLC
ppt on PLC
 
automation slides,plc,scada,HMI
automation slides,plc,scada,HMIautomation slides,plc,scada,HMI
automation slides,plc,scada,HMI
 
Plc basics
Plc basicsPlc basics
Plc basics
 

Viewers also liked

PLC and SCADA training.
PLC and SCADA training.PLC and SCADA training.
PLC and SCADA training.
Ishank Ranjan
 
Simatic s7 200-introduction
Simatic s7 200-introductionSimatic s7 200-introduction
Simatic s7 200-introduction
Phan van Tan
 

Viewers also liked (14)

PLC Troubleshooting & Maintenance
PLC Troubleshooting & MaintenancePLC Troubleshooting & Maintenance
PLC Troubleshooting & Maintenance
 
PLC and SCADA training.
PLC and SCADA training.PLC and SCADA training.
PLC and SCADA training.
 
Simatic s7 200-introduction
Simatic s7 200-introductionSimatic s7 200-introduction
Simatic s7 200-introduction
 
Scada
ScadaScada
Scada
 
Maquette meef plc_lm_s3_et_s4
Maquette meef plc_lm_s3_et_s4Maquette meef plc_lm_s3_et_s4
Maquette meef plc_lm_s3_et_s4
 
PLC SCADA DCS
PLC SCADA DCSPLC SCADA DCS
PLC SCADA DCS
 
Expert Advice on Resume Making & Interview Preparation
Expert Advice on Resume Making & Interview PreparationExpert Advice on Resume Making & Interview Preparation
Expert Advice on Resume Making & Interview Preparation
 
Allen Bradley- Micrologix PLC Instructions
Allen Bradley- Micrologix PLC InstructionsAllen Bradley- Micrologix PLC Instructions
Allen Bradley- Micrologix PLC Instructions
 
HMI- Human Machine Interface
HMI-  Human Machine InterfaceHMI-  Human Machine Interface
HMI- Human Machine Interface
 
Industrial hydraulics
Industrial hydraulicsIndustrial hydraulics
Industrial hydraulics
 
Top Ten Siemens S7 Tips and Tricks
Top Ten Siemens S7 Tips and TricksTop Ten Siemens S7 Tips and Tricks
Top Ten Siemens S7 Tips and Tricks
 
Plc Siemens Training Notes
Plc Siemens Training NotesPlc Siemens Training Notes
Plc Siemens Training Notes
 
PLC - Programmable Logic Controller
PLC - Programmable Logic ControllerPLC - Programmable Logic Controller
PLC - Programmable Logic Controller
 
Basics of Automation, PLC and SCADA
Basics of Automation, PLC and SCADABasics of Automation, PLC and SCADA
Basics of Automation, PLC and SCADA
 

Similar to Plc course presentation

329292817-PLC-Training for new person pptx
329292817-PLC-Training for new person pptx329292817-PLC-Training for new person pptx
329292817-PLC-Training for new person pptx
viveksingh2418
 

Similar to Plc course presentation (20)

Programmable Logic Controller
Programmable Logic ControllerProgrammable Logic Controller
Programmable Logic Controller
 
UNIT-IV.ppt
UNIT-IV.pptUNIT-IV.ppt
UNIT-IV.ppt
 
Basic plc
Basic plcBasic plc
Basic plc
 
Basic PLC.ppt
Basic PLC.pptBasic PLC.ppt
Basic PLC.ppt
 
Basic plc
Basic plcBasic plc
Basic plc
 
Basic plc 1
Basic plc 1Basic plc 1
Basic plc 1
 
Programmable Logic Controller Training Day 1 to 3.pptx
Programmable Logic Controller  Training Day 1 to 3.pptxProgrammable Logic Controller  Training Day 1 to 3.pptx
Programmable Logic Controller Training Day 1 to 3.pptx
 
PLC basic concepts
PLC  basic conceptsPLC  basic concepts
PLC basic concepts
 
Basic plc
Basic plcBasic plc
Basic plc
 
Basic plc
Basic plcBasic plc
Basic plc
 
Basic plc
Basic plcBasic plc
Basic plc
 
Basic plc
Basic plcBasic plc
Basic plc
 
Basic plc
Basic plcBasic plc
Basic plc
 
Basic plc
Basic plcBasic plc
Basic plc
 
Basic plc
Basic plcBasic plc
Basic plc
 
Basic plc
Basic plcBasic plc
Basic plc
 
329292817-PLC-Training for new person pptx
329292817-PLC-Training for new person pptx329292817-PLC-Training for new person pptx
329292817-PLC-Training for new person pptx
 
Presentaton on Plc & Scada
Presentaton on Plc & ScadaPresentaton on Plc & Scada
Presentaton on Plc & Scada
 
I012455457
I012455457I012455457
I012455457
 
Basics and applications of programmable logic controller (plc)
Basics and applications of programmable logic controller (plc)Basics and applications of programmable logic controller (plc)
Basics and applications of programmable logic controller (plc)
 

Recently uploaded

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 

Recently uploaded (20)

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 

Plc course presentation

  • 1.
  • 3.
  • 4. Prepared by Dr. Mohiy Bahgat Faculty of Engineering Helwan University
  • 5. Course Contents 1. Introduction and Review 2. Internal Construction of the PLC 3. Sequential Control Systems 4. Input / Output Devices 5. PLC Networks and Hardwiring
  • 6. 6. Programming of the PLC 7. Internal Relays 8. Timers 9. Counters 10. Shift Registers
  • 8. Control System Task • The main task of a control system is to control a sequence of events or maintain some variable constant or follow some prescribed change. • The inputs to such control systems might come from switches or sensors, however the outputs of the controller might go to run a motor in order to move an object, or to turn a valve, or perhaps some heater on or off.
  • 9. • In the traditional form of control systems, the governing rules and the control actions depend on the wiring of the control circuit. • When changing the rules used for giving the control actions, the wiring has to be changed too. This leads to expensive cost of replacing the controllers. • Instead of hardwiring each control circuit for each control rule or action, the basic system for all situations can be used with a microprocessor based controller.
  • 10. • So, by changing the program instructions, the same control circuit may be used with a wide variety of control rules or actions, which saves the cost. • This was the main idea behind inventing the programmable logic controllers (PLC). • The PLC was invented in response to the needs of the automotive manufacturing industry where software revision replaced the re-wiring of hard-wired control panels when production models changed.
  • 11. • Before the PLC, control, sequencing, and safety interlock logic for manufacturing automobiles was accomplished using hundreds or thousands of relays, cam timers, and drum sequencers and dedicated closed- loop controllers. • The process for updating such facilities for the yearly model change-over was very time consuming and expensive, as the relay systems needed to be rewired by skilled electricians.
  • 12. • In the late 1960's PLCs were first introduced. • The primary reason for designing such a device, as mentioned before, was eliminating the large cost involved in replacing the complicated relay based machine control systems. • Bedford Associates proposed something called a Modular Digital Controller (MODICON) to a major car manufacturer.
  • 13. • Other companies at the time proposed computer based schemes, one of which was based upon the PDP-8. • The MODICON 084 brought the world's first PLC into commercial production. • These new controllers also had to be easily programmed by maintenance and plant engineers. • The lifetime had to be long and programming changes easily performed. They also had to survive the harsh industrial environment
  • 14. • In the mid 70's the dominant PLC technologies were sequencer state-machines and the bit- slice based CPU. • The AMD 2901 and 2903 were quite popular in MODICON and A-B PLCs. • As conventional microprocessors evolved, larger and larger PLCs were being based upon them. • Communications abilities began to appear in approximately 1973. The first such system was MODICON's MODBUS.
  • 15. • The 80's saw an attempt to standardize communications with General Motor's manufacturing automation protocol (MAP). • It was also a time for reducing the size of the PLC and making them software programmable through symbolic programming on personal computers instead of dedicated programming terminals or handheld programmers. • Today the world's smallest PLC is about the size of a single control relay.
  • 16. • The 90's have seen a gradual reduction in introducing new protocols, and modernization of the physical layers of some of the more popular protocols that survived the 1980's. • The latest standard (IEC 1131-3) has tried to merge PLC programming languages under one international standard. • We now have PLCs that are programmable in function block diagrams, instruction lists, C and structured text, at the same time PC's are also being used to replace PLCs in some applications.
  • 18. Power Supply Module Central Processing Unit Outputs Interfacing and Multiplexing Inputs Interfacing and Multiplexing Memory devices ROM – RAM – EEPROM A.C main supply D.C main supply to other modules Communication link to personal computer or programmer
  • 19.
  • 20. 1. Rack or mounting part. 2. Processor or central processing unit (CPU). 3. Input assembly. 4. Output assembly. 5. Power supply. 6. Programming unit.
  • 24. Large scale modular type PLC system
  • 25. Large scale modular type PLC system
  • 27. PLC main CPU unit
  • 28. PLC physical internal architecture
  • 34. Memory Input Output interface interface CPU input image output image memory memory Input Output port s ports
  • 35.
  • 36. Input/ output unit Data RAM System ROM CPU User program RAM Clock Battery Address Bus Control Bus Data Bus I/O system Bus Buffer Latch Opto- coupler Driver interface Drivers PLC internal architecture
  • 37. Input/Output Unit • The input/output unit provides the interface between the PLC system and the outside world allowing the connections to be made through input/output channels to input devices such as sensors or output devices such as motors and solenoids. • The input/output provides isolation and signal conditioning.
  • 38. Electrical isolation from the external world is usually done by means of optoisolators or optocouplers whose circuitry is displayed : Light emitting photo diode transistor Optoisolator
  • 39. PLC Optocoupler Input Signal to PLC to CPU Protection diode Voltage divider circuit Basic D.C circuit for PLC
  • 40. • The signal isolation enables supplying the input channels of the PLCs with a wide range of input signals. • The range of input signals might be : 5 V , 24 V , 110 V and 240 V in the form of ON/OFF or digital / discrete signals.
  • 41. Input channel 5 V 24 V 110 V 240 V To input/output unit 5 volt digital signal level Input signal level of a PLC
  • 42. Output are often specified to be in one of the following forms : 1. Relay type. 2. Transistor type. 3. Triac type.
  • 43. Relay Type • In such a type, the output signal from the PLC operates a relay which switches small current in the external circuit and isolates the PLC from the external circuit that having larger currents. • Since the relay outputs are relatively slow, thus it would be suitable for A.C and D.C switching.
  • 45. Transistor Type • In such a type, a transistor is to be used to switch current in the external circuit. • This type of output gives faster switching and being restricted to the D.C switching. • It is destroyed by over currents or high reverse voltages therefore; a protection is used in the form of either a fuse or a built-in electronic protection. • Also, the optoisolators are used to provide the essential isolation.
  • 46. Optocoupler Fuse Output PLC Basic form of transistor type output
  • 47.
  • 48. Triac Type • Such type can be used with optoisolators to control the external loads which are connected to an A.C power supply. • So, such type is strictly being used with A.C and must be protected by fuses against over currents.
  • 49.
  • 50. 24 V, 100mA 240 V, 1A, A.C 240 V, 2A, A.C Output channel 110 V, 1A, A.C from input/output unit 5 volt digital PLC output levels
  • 52. Continuous Control • In continuous control systems the inputs are sending information into the system all the time and the outputs of the system are being controlled all the time. • A change to the input leads directly to a change in the output. • An example of this kind of system is a security floodlight that comes on in the dark.
  • 53.
  • 54. Sequential Control In a sequential control system a series of different events takes place one after the other. The finishing of one event in the sequence provides the signal for the next event to start.
  • 55. Examples of sequential systems : 1. The timers that control central heating systems. 2. Washing machines. 3. Traffic lights. 4. Lifts in buildings
  • 56. Examples of sequential control systems
  • 57. Sometimes one of the events in the sequence is itself a continuous control system. For example, filling a washing machine with water uses a continuous control system that monitors the water level and controls the water input valves.
  • 58. However this is only one event in the series of events that makes up the complete sequential control system for the washing machine. It will be started by the event that comes before it and, when the machine is full, it will start the next event off.
  • 59. Conventional sequential control systems usually adopt a centralized control approach, and usually being implemented using programmable controllers (PLCs). This results in a wiring layout that becomes complex as the number of devices increases where complex bundles of wires are always seen in PLC control systems due to the point- to-point connections from all the I/O devices to the PLC.
  • 60. Types of Sequential Systems 1. Asynchronous systems. 2. Synchronous systems. 3. Mixed systems.
  • 61. Asynchronous Systems Such systems are event-based, which means that a control action begins only after the previous control action is successfully completed. In an asynchronous control system all of the events in the sequence take place as a result either due to an external event or because the previous event has finished, regardless of the time taken.
  • 62. Asynchronous systems require sensors to detect the completion of an event or an outside event and so must be closed loop. The control system for a lift is asynchronous where the sequence of events depends entirely on external events (people pressing the call buttons outside the lift, and the floor buttons inside it) or the completion of lift movements (the lift stops moving, and the doors are opened, when a switch detects that a floor has been reached).
  • 63. Lift as an asynchronous sequential system
  • 64. Synchronous Systems These systems are time-based, that is, the system is driven by a clock producing pulses at fixed intervals. These pulses trigger the sequence of control actions. In a fully synchronous control system all of the events in the sequence take place at set points in time, regardless of any external change.
  • 65. Synchronous control systems are used where the control of a sequence of events must take place at pre-set time intervals. Such a system doesn’t take any account of events outside it, only the time between events is important. Therefore it doesn’t need any sensors; it is an open loop control system.
  • 66. Central heating timers are synchronous controllers where the points at which the heating and hot water systems are turned on and off are fixed in time. It should be noticed that, although once the heating or hot water is turned on, that part of the sequence is usually a continuous system where temperature is continuously monitored to control the heating system.
  • 67. Central heating as a synchronous sequential system
  • 68. Mixed Systems In most real sequential control systems there is a mixture of synchronous and asynchronous control. For example : • Modern traffic light sets. • A car burglar alarm. • An automatic car park barrier. • A microwave oven. • A dishwasher • A time lock on a bank’s safe. • A robot arm welding parts of a car together.
  • 69. Implementation of Synchronous Systems The heart of a synchronous control system is some kind of timer. This timer can be mechanical or electronic. The timer also needs : 1. A sequencing element that sets the times at which outputs are switched on and off. Remember that there are no external inputs into a synchronous timer. 2. An output stage that provides the start and stop signals.
  • 70. The timer may be : 1.Mechanical timer. 2.Electronic timer. 3.Microcontroller.
  • 71. Mechanical Timer All mechanical timers are different kinds of cam timer, in which a motor turning at a constant speed is used to turn lots of cams, as the cams turn they push on switches to turn them on or off.
  • 73. Electronic Timer • A dedicated circuit uses an oscillator to give electronic clock pulses. Its circuitry often involving the use of logic gates which is then used to control a sequence of switching. • Programmable Logic Controllers (PLCs) are commonly used in industry, where a PLC contains the same kind of microprocessor as a computer
  • 74. PLC as an electronic timer
  • 75. Microcontroller • It is a computer on a chip with an integrated circuit that has all of the main bits of a computer system in it. • The timing sequence is usually programmed from a computer before the microcontroller is placed in the device to be controlled. • Microcontrollers are used in mass production because they are very cheap, also, the modern washing machines and central heating systems often use microcontrollers.
  • 76. Microcontroller as an electronic timer
  • 77. Sequential Function Charts (SFCs) • Many systems have sequential operation requirements and Sequential Function Charts (SFC’s) have become a popular method of accurately specifying sequential control requirements. • It has long been established as a means of designing and implementing sequential control systems utilizing PLCs.
  • 78. Many manufacturers offer program-ming environments that allow engineers to program controllers using graphical methods. SFC’s have many advantages for software development both in the design stage as well as the implementation, testing, maintaining and fault finding stages.
  • 79. In design stage : • Detailed clear graphical specification. • Non software people can specify or verify programs. In implementation and testing : • Straight forward conversion from specification to code . • Structured testing or debugging.
  • 80. In maintenance of software : •Readily understood by engineer modifying software. In machine maintenance : •Allows quick accurate fault diagnosis.
  • 81. Sequential function charts break a sequential task down into steps called transitions and actions. These are drawn graphically to describe a sequence of interactions. Convention states that flow through an SFC is from top to bottom unless indicated by an arrow.
  • 82.
  • 83. The sequence is broken down into steps (or states) where actions are carried out. The transition conditions define logical conditions that cause the process to move from the existing step to the next step. Actions contain three fields
  • 84. An action consists of a qualifier which defines what type of action, for example S for set, R for reset and N for continuous while in step. As the design progresses more detail can be added such as address information as follows : • Memory (%M) • Input (%I) • Output (%Q)
  • 85.
  • 86. Example To illustrate the use of SFCs and how they may be implemented, consider the following simple example where two pistons have to be controlled using a PLC. The operation requirements are as follows :
  • 87. 1. When a normally open switch (%I0.7) is closed momentarily and both pistons are home the following sequence should occur : • Piston A has to be extended. • When A is extended piston B is extended. • After B is extended for 3 seconds piston B is retracted. • When B is retracted piston A is retracted.
  • 88. 2.The sequence does not operate until the switch is closed again i.e., it operates every time the switch is closed and if piston A is in its home position.
  • 89.
  • 90.
  • 91. In some cases, the PLC has to start and follow two branches separately and simultaneously as follows :
  • 92. Chapter 4 Input / Output Devices
  • 93. Input / Output Devices The input/output devices (I/O) used with PLCs are different in type and usage where it might be analog or digital devices. The I/O system provides the physical connection between the equipment and the PLC. Opening the doors on an I/O card reveals a terminal strip where the devices connect.
  • 94.
  • 95. There are many different kinds of I/O cards which serve to condition the type of input or output so the CPU can use it for it’s logic. It's simply a matter of determining what inputs and outputs are needed, filling the rack with the appropriate cards and then addressing them correctly in the CPUs program.
  • 96. Typical input devices used with PLCs include : 1. Mechanical switches for position detection. 2. Proximity switches. 3. Photoelectric switches. 4. Encoders. 5. Temperature & pressure switches.
  • 97. 6. Potentiometers. 7. Linear variable differential Tr. 8. Strain gauges. 9. Thermistors. 10. Thermotransistors. 11. Thermocouples.
  • 98. On the other hand, typical output devices used with PLCs include : 1.Relays. 2.Contactors. 3.Solenoid valves. 4.Motors.
  • 99. Input devices • A digital input card handles discrete devices which give a signal that is either on or off such as a pushbutton, limit switch, sensors or selector switches. • An analog input card converts a voltage or current (e.g. a signal that can be anywhere from 0 to 20mA) into a digitally equivalent number that can be understood by the CPU.
  • 100. Digital or discrete sensors or on/off sensors are considered input devices and can easily be connected to the input ports of the PLCs. The input devices that give an analog signal must be converted into digital ones before inputting them to the PLC. The following is a brief description for each type of common input devices to be used with PLCs.
  • 101.
  • 102. Mechanical switches • A mechanical switch generates an on/off signal due to some mechanical input causing the switch to be opened or closed, e.g, a cam or an arm. • The presence of the mechanical input leads to closing the switch or giving level 1 to the PLC. • On the other hand, the absence of it leads to opening the switch or giving level 0 to the PLC.
  • 103. Workpiece present 1 Workpiece absent 0 Supply Voltage Input channel PLC Supply Voltage PLC Input channel Workpiece present 0 Workpiece absent 1
  • 104. The mechanical switches may take one of the following forms : 1.Normally opened contact NOC : such switch has its contacts opened at the absence of the mechanical input, however that input is used to close the switch contacts. 2. Normally closed contact NCC: such switch has its contacts closed at the absence of the mechanical input, however that input is used to open the switch contacts.
  • 105. 3.Limit switches : these switches are used to detect the presence or passage of moving parts, e.g, in case of lifts. It may be actuated by a cam, roller or a lever Rotating cam
  • 106. Lever pushed down for contact Button to operate the switch
  • 108. For example the limit switches are used to detect the presence or passage of a movable mechanical object such as : • Rotary cam actuated type. • Roller actuated type. • Lever actuated type.
  • 109. Proximity switches The proximity switches are used to detect the presence of an item without making contact with it. The forms of the proximity switches are : 1. Eddy current type. 2. Inductive type. 3. Reed type. 4. Capacitive type.
  • 110. 1.Eddy current proximity switch : this type has a coil supplied with constant A.C and produces constant magnetic field. When a metallic object is close to that coil, an eddy current will be induced in it. Due to the eddy current a back e.m.f will be induced in the original coil which will affect the amplitude of its voltage. The voltage amplitude can then be used as a measure to indicate the distance between the coil and the metallic object.
  • 111. The voltage variation is used to activate an electronic circuit comprising a transistor, i.e, making that circuit on or off according to the distance of the metallic object. This conduction distance ranges between 0.5 and 20 mm. Metal object Alternating magnetic field Eddy current Constant alternating current
  • 112. 2. Inductive proximity switch : this type has a coil wound on a ferrous core. When one end of the core is being near a ferrous object, there will be a change in the coil inductance . The inductance change can be monitored using a resonant circuit, where the current in that circuit may be used to activate an electronic switch circuit to give an on/off device. The range of detecting objects is from 2 to 15 mm.
  • 113. 3.Reed proximity switch : this type is consisting of two overlapping non- touching strips of springy ferromagnetic material sealed in a glass or plastic envelope
  • 115.
  • 116. Features of Proximity Sensor 1. Stable operation, unsusceptible to water, oil, dust, light, etc.. : Be able to use for machine tools splashed with cutting oil or food processing machine washed with water (magnetic type). 2. Resistant to vibration and shock : Anti-vibration/shock since the whole circuit can be coated with resin.
  • 117. 3. Able to detect without any contact : Detection distance is bout 0-30mm. No damage on an object. 4. Higher speed/performance compared with limit switch : Long life and quick response. 5. Magnetic type is for metal detection, capacitance is for everything except fluid : Liquid in a paper cup can be also detectable.
  • 118. 6. Susceptible to magnet effect : High possibility of malfunction in an area where large amount of electric current flows such as welding or electro magnetism.
  • 120.
  • 121. TLS 220 - Light to frequency converter
  • 130. Poteniometers or Displacement sensors Linear or rotary poteniometers Linear potentiometer displacement sensor
  • 132. Linear Variable Differential Transformer (LVDT) sensor
  • 133. Strain gauges Metal foil strain gauges Wheatstone bridge circuit
  • 134.
  • 135.
  • 143. Output devices • Output devices can also consist of digital or analog types. • A digital output card either turns a device on or off such as lights, LEDs, small motors, and relays.
  • 144. • An analog output card will convert a digital number sent by the CPU to it’s real world voltage or current. • Typical outputs signals can range from 0 - 10 V D.C or 4 - 20 m.A and are used to drive mass flow controllers, pressure regulators and position controls.
  • 145. Types of Output Devices 1. Contactors . 2. Control Valves . a. Types of valves . b. Actuation of valves . c. Cylinders : single and double acting . 3. Motors . a. D.C motors . b. Induction motors . c. Stepper motors .
  • 147. Two position valve The 4/2 valve 2/2 Valve : flow from P to A switched to no flow A P A P T 3/2 Valve : flow from P to A and from A to T switched to T being closed and flow from P to A Control Valves
  • 148. Directional control valves A – Piston with no current A current through the solenoid pulls to the right, with no current the spring pulls back to the left
  • 149. Directional control valves A – Piston with current
  • 152. (a) - Cylinder in retracted position Control of a single–acting cylinder
  • 153. (b) - Current to solenoid cylinder extends
  • 154. (c) - Solenoid current switched off Cylinder retracts
  • 155. (a) - Cylinder in retracted position Control of a double–acting cylinder
  • 156. (b) - Solenoid A energized, cylinder extends
  • 157. (c) - Solenoid B energized, cylinder retracts
  • 159. On – Off control of D.C motors
  • 160. Direction control of D.C motors
  • 164. Linear positioning using stepper motors
  • 166. Drive system for a four-phase stepper motor
  • 167. Input and outputs of the drive system for a four-phase stepper motor
  • 168. Drive circuit connections with an integrated circuit for stepper motors
  • 172. PLC Networks •Necessity •Types : 1.Bus/single highway network 2.Star network 3.Ring network •Standards : Layer 1 … … … … Layer 7 •Protocol •PLC operation and scans •Addressing
  • 173. Why communication networks • Less Expensive • Less Physical Space Required • Simple Installation • More Information Available at Lower Cost • More Adaptable to Changes • Future Expansion • Easier Troubleshooting • Easier PLC Programming
  • 174. Automation & Control System Hierarchy
  • 175. Data Networks Data Networks extend the information capabilities
  • 176. Control Networks Control Networks require critical performance
  • 177. Device / Field Bus Device Buses incorporate intelligent devices.
  • 178. Sensor / Actuator Bus Sensor Actuator Buses are bit level oriented
  • 179. Networking types a. Bus/single highway network : Terminals Bus/single highway
  • 180. b. Star network : Host Terminals
  • 181. c. Ring network : Terminals
  • 183. Network Standards Layer 7 Application Layer 6 Presentation Layer 5 Session Layer 4 Transport Layer 3 Network Layer 2 Data Link Layer 1 Physical medium Layer 7 Application Layer 6 Presentation Layer 5 Session Layer 4 Transport Layer 3 Network Layer 2 Data Link Layer 1 Physical medium Application Program Application Program Transmission Path ISO/OSI model
  • 184. PLC Operation Scan Scan all inputs Updating all outputs Running the program Repeat sequence
  • 185.
  • 186. PLC Addressing 1. Mitsubishi PLC : Inputs : X400 , X401 , X402 , … … etc Outputs : Y430 , Y431 , Y432 , … … etc 2. Toshiba PLC : Inputs : X000 , X001 , X002 , … … etc Outputs : Y000 , Y001 , Y002 , … … etc
  • 187. 3. Allen Bradley : I = input O = output Rack number Terminal number Module number x : xxx / xx Examples : I : 03 4 / 12 O: 00 2 / 05
  • 188. 4. Siemens SISMATIC S5 : I = input Q = output Byte number Bit number X xx . x Examples : I 1.4 Q2.1
  • 189. PLC Hardwiring There are three types of wiring associated with a PLC namely :  The PLC wiring.  The device wiring.  The common (or return) wiring. PLC Wiring : The PLC has built-in input interfaces in both the 16 and 32 I/O models. Since the input interface is already wired to the PLC, input wiring is easy and quick.
  • 190. Device Wiring : Input devices can be wired to a 120 VAC input interface in one of two ways: •They can be wired directly to the interface. •They can be wired to a terminal block that is wired to the interface.
  • 191. •If an input device is wired directly to a PLC input interface, then one side of the device should be wired to the L1 hot line of the incoming AC power source. The other side should be wired to an input terminal on the PLC.
  • 192. An input device wired directly to a PLC input interface. 120 V AC line L1
  • 193. If an input device is wired to a terminal block instead of directly to the PLC interface, then the line going out of the input device should be wired to the terminal block. The block, in turn, should be wired to the PLC. In PLC applications, the wiring of devices through a terminal block is more common than wiring them directly to the PLC.
  • 194. 120 V AC line L1 An input device wired to a PLC via a terminal block.
  • 195. Common Wiring : Each input device connected to a PLC’s 120 VAC input interface must also be connected to the AC return line, called the L2 common line. The device must have this common connection for its electrical circuit to be complete. The input terminals on a 120 VAC interface are arranged in two groups with each group sharing a connection to the common line.
  • 196. In a 10-input PLC, the first four input terminals share one common connection, and the last six share another.
  • 197. In a 20-input model, the first four inputs again share one common connection, while the last sixteen share another
  • 198.
  • 199.
  • 200. 24 V DC Output Card V+ 00 01 02 03 04 05 06 07 24 V lamp Relay +24 V DC Power 120 V AC Power Motor Supply Supply Neut. COM
  • 202. 24-Volt DC input interfaces Two types of DC input devices are used with PLCs: • Sourcing devices provide current when they are ON. • sinking devices receive current when they are ON.
  • 206. AC wiring of a PLC
  • 213. Signal Conditioning • The potential divider can be used to reduce the voltage from the sensor to the required level such that : in 21 2 V. RR R  outV Vin Vout R1 R2
  • 214. • Amplifiers can be used to increase the voltage level using the Op Amps in one of three forms : in 1 2 V. R R outV A : inverting amplifier
  • 215. in 1 21 V. R RR  outV B : non-inverting amplifier
  • 217. Signal conditioning with a strain gauge sensor
  • 221. Programming Rules • Programs for microprocessor-based controllers usually being loaded in machine code as binary numbers and representing the instructions. • Assembly language can be used in the form of mnemonics to indicate the operations, e.g : LD , OUT , OR , … … etc.
  • 222. PLC Programming Methods 1. IL (Instruction List Programming) : This is effectively mnemonic programming. 2. ST (Structured Text) - A BASIC like programming language. 3. LD (Ladder Diagram) - Relay logic diagram based programming.
  • 223. 4. FBD (Function Block Diagram) - A graphical dataflow programming method 5. SFC (Sequential Function Charts) - A graphical method for structuring programs
  • 224. Relay Ladder Logics (RLL) • Ladder logic is a drawing of electrical logic schematics which results from the usage of relays. • It is now a graphical language very popular for programming PLCs, where sequential control of a process or manufacturing operation is simulated.
  • 225. Motor stop – start circuit L1 L2 1 2 M Holding switch
  • 226. • Its name is based on the observation that programs are resembled by ladders, with two vertical rails and a series of horizontal rungs between them. • Generally, manufacturers of programmable logic controllers provide associated ladder logic programming systems. However, the ladder logic languages from two manufacturers will not be completely compatible.
  • 227. • Even different models of programmable controller within the same family may have different ladder notation such that programs cannot be interchanged between models. • Ladder logic can be thought of as a rule-based language, rather than a procedural language. A rung in the ladder represents a rule.
  • 228. • When implemented in a program- mable logic controller, the rules are typically executed sequentially by software, in a continuous loop (scan). • However, proper use of programma- ble controllers requires understand- ing the limitations of the execution order of rungs.
  • 229.
  • 230. Scanning the ladder program END
  • 231. RELAY LADDER LOGIC PROGRAMS & PROGRAMMING The LD language itself can be considered as a set of connections between logical checkers (contacts) and actuators (coils) such that :  If a path can be traced between the left side of the rung and the output, through asserted (true or closed) contacts, the rung is true and the output coil storage bit is asserted (1) or true.
  • 232.  If no path can be traced, then the output is false (0) and the coil by analogy to electromechanical relays is considered de-energized  So, one can say that, ladder logic has contacts that make or break circuits to control coils. Each coil or contact corresponds to the status of a single bit in the programmable controller's memory.
  • 233. The contacts may refer to physical hard inputs to the programmable controller from physical devices such as pushbuttons and limit switches via an integrated or external input module, or may represent the status of internal storage bits which may be generated elsewhere in the program.
  • 234.  The coil (output of a rung) may represent a physical output which operates some device connected to the programmable controller, or may represent an internal storage bit for use elsewhere in the program.  Each rung of ladder language typically has one coil at the far right. Some manufacturers may allow more than one output coil on a rung. On the other hand, several contacts may be used in different logic arrangements may be used at the beginning of the rung to represent the inputs.
  • 235. 115 VAC w a l l p l u g r e l a y i n p u t A ( n o r m a l l y c l o s e d ) i n p u t B ( n o r m a l l y o p e n o u t p u t C ( n o r m a l l l a d d e r l o A B C
  • 236. l a d d e r p o w e r s u p p l y + 2 4 V c o m . i n p u t s o u t p u t s p u s h b u t t o n s l o g i c P L C A C p o w e r 115 Vac n e u t . A B C l i g h t
  • 237. Each program is a set of rungs that reveals the sequence of the operations in the controlled process. H O T N E U T R I N P U T S O U T P U T S A B X C D E F G H Y N o t e : P o w e r n e e d s t o f l o ( A , B , C , D , E , F, G , H ) t o t u r n o n o u t
  • 238. LD contacts & their types As mentioned before, the contacts may refer to physical hard inputs to the programmable controller from physical devices such as pushbutton switches, selector switches and limit switches via an integrated or external input module, or may represent the status of internal storage bits which may be generated elsewhere in the program
  • 239. disconnect circuit interrupter breaker (3 phase AC) normally open limit switch normally closed limit switch normally open push-button normally closed push-button double pole push-button mushroom head push-button (3 phase AC) (3 phase AC)
  • 240. Normally Open Contact (NOC) This can be used to represent any input to the control logic such as : a switch or sensor, a contact from an output, or an internal output. When solved, the referenced input is examined for an ON (logical 1) condition :
  • 241. • If it is ON, the contact will close and allow power (logic) to flow from left to right. • If the status is OFF (logical 0), the contact is Open, power (logic) will NOT flow from left to right.
  • 242. Normally Closed Contact (NCC) When solved, the referenced input is examined for an OFF condition : • If the status is OFF (logical 0) power (logic) will flow from left to right. • If the status is ON, power will not flow.
  • 243. LD coils & their types Also, the coils (output of a rung) may represent a physical output which operates some device connected to the programmable controller such as solenoid valves, lights, motor starters and servo motors, or may represent an internal storage bit for use elsewhere in the program.
  • 244. Normally Open Coil This can be used to represent any discrete output from the control logic. When solved : • If the logic to the left of the coil is TRUE, the referenced output is ON (logical 1). • If the logic to the left of the coil is FALSE, the referenced output is OFF (logical 0).
  • 245. Normally Closed Coil This can be used to represent any discrete output from the control logic. When solved : • If the logic to the left of the coil is TRUE, the referenced output is OFF (logical 0). • If the logic to the left of the coil is FALSE, the referenced output is ON (logical 1)
  • 246. To identify an input or an output in a program, a numbering system is used. This numbering system has three purposes : • To tell contacts apart in the program. • Serves as an address for the location of the input module in the real world. • Serves as a memory address for the contact in the processor memory.
  • 247. Solving a Single Rung Suppose a switch is wired to Input1, and a light bulb is wired through Output1 in such a way that the light is OFF when Output1 is OFF, and ON when Output1 is ON. • When Input1 is OFF (logical 0) the contact remains open and power cannot flow from left to right. Therefore, Output1 remains OFF (logical 0). • When Input1 is ON (logical 1) then the contact closes, power flows from left to right, and Output1 becomes ON (the light turns ON).
  • 249. Examples The AND rung The AND is a logic condition where an output is not energized unless two NOC are closed.
  • 250. x400 x401 Y430 Mitsubishi PLC x000 x001 Y000 Toshiba PLC notation I0.1 I0.2 Q2.0 Siemens PLC Logic gate control output inputs A B Inputs Output A B 0 0 0 0 1 0 1 0 0 1 1 1 Address Instruction Data 0 LOAD IN1 1 AND IN2 2 OUT OUT1 3 END
  • 251. The OR rung The OR is a logic condition where an output is energized when one or both of two NOC are closed.
  • 252. Logic gate control output inputs A B Inputs Output A B 0 0 0 0 1 1 1 0 1 1 1 1 Address Instruction Data 0 LOAD IN1 1 OR IN2 2 OUT OUT1 3 END x400 x401 Y430 Mitsubishi PLC x000 x001 Y000 Toshiba PLC I0.1 I0.2 Q2.0 Siemens PLC
  • 253. The NOT rung The NOT is a logic condition where an output is de-energized when a NCC is opened. Output1 Input1 controller Load
  • 254. Logic gate control output inputs A Inputs Output A 0 1 1 0 Address Instruction Data 0 LOAD IN1 1 NOT IN1 2 OUT OUT1 3 END x400 Y430 Mitsubishi PLC I0,1 O0,0 Telemecanique PLC I0.1 Q2.0 Siemens PLC
  • 255. The NAND rung The NAND is a logic condition where an AND gate is followed by a NOT gate or putting a NOT gate on each input of an OR gate as follows : AND A B NOT NOT NOT OR A B
  • 256. Inputs Output A B 0 0 1 0 1 1 1 0 1 1 1 0 Address Instruction Data 0 LOAD IN1 1 AND IN2 2 NOT 3 OUT OUT1 4 END x400 x401 Y430 Mitsubishi PLC x000 x001 Y000 Toshiba PLC I0.1 I0.2 Q2.0 Siemens PLC
  • 257. The NOR rung The NOR is a logic condition where an OR gate is followed by a NOT gate or putting a NOT gate on each input of an AND gate as follows : OR A B NOT NOT NOT AND A B
  • 258. Inputs Output A B 0 0 1 0 1 0 1 0 0 1 1 0 x400 x401 Y430 Mitsubishi PLC x000 x001 Y000 Toshiba PLC notation I0.1 I0.2 Q2.0 Siemens PLC Address Instruction Data 0 LOAD IN1 1 OR IN2 2 NOT 3 OUT OUT1 4 END
  • 259. The XOR rung The XOR is a logic condition where an output exists when either of the two inputs is on but not when both are on follows : OR AND NOT NOTA B AND
  • 260. Inputs Output A B 0 0 0 0 1 1 1 0 1 1 1 0 Address Instruction Data 0 LOAD IN1 1 AND NOT IN2 2 LOAD NOT IN1 3 AND IN2 4 OR 5 OUT OUT1 x400 x401 Y430 Mitsubishi PLCx400 x401 x000 x001 Y000 Toshiba PLCx000 x001 I0.1 I0.2 Q2.0 Siemens PLCI0.1 I0.2
  • 261. Latching • Sometimes it is necessary to hold an output energizes even when the input is ended. • An example is a motor starting and stopping using push button, where the latch circuit is used to keep the motor running after the contacts of the starting switch being opened.
  • 262. In 1 out out In 2 X400 Y430 Y430 X401 X400 Y430 Y430 Motor output X401 Y430 Y430 Y431 Y432 Lamp for No power Motor On-off with signal lamps Ladder circuit Lamp for power ON
  • 263. Multiple Outputs Ladder Circuits X400 Y430 X401 Y431 X402 Y432
  • 264. Ladder Programming Symbols Several symbols are used to enter a ladder program either using a the keypad of a programming device with symbols or using a PC software. The following are samples of such symbols : input output Start of a junction End of a junction Horizontal circuit link
  • 265. Instruction Lists • The instruction list programming for a PLC differs according to the type of the used PLC. • The following table shows the different types of PLCs and the corresponding instructions to be used with them.
  • 266. Command PLCs Types IEC11 31-3 Mitsub ishi Omro n Sieme ns Telemec anique Sphere+ Schuh Start a rung with a NOC LD LD LD A L STR Start a rung with a NCC LDN LDI LD NOT AN LN STR NOT Series element with a NOC AND AND AND A A AND Series element with a NCC ANDN ANI AND NOT AN AN AND NOT Parallel element with a NOC O OR OR O O OR Parallel element with a NCC ORN ORI OR NOT ON ON OR NOT An Output ST OUT OUT = = OUT
  • 267. twoANDblocks Step Instruction 0 LD X400 1 OR X402 2 LD X401 3 OR X403 4 ANB 5 OUT Y430 Step Instruction 0 A( 1 A I0.0 2 O I0.1 3 ) 4 A( 5 A I0.2 6 O I0.3 7 ) 8 = Q2.0 Mitsubishi PLC Siemens PLC x400 x401 Y430 x402 x403 I0.0 I0.1 Q2.0 I0.2 I0.3
  • 268. Step Instruction 0 A I0.0 1 = Q2.0 2 AN I0.0 3 = Q2.1 Step Instruction 0 LD X400 1 OUT Y430 2 LDI X400 3 OUT Y431 Mitsubishi PLC Siemens PLC Togglecircuit x400 Y430 x400 Y431 I0.0 Q2.0 I0.0 Q2.1
  • 269. Boolean Algebra • The instruction lists and ladder diagrams can also been used to represent mathematical operations as follows : • A . B = Q represents an AND circuit. • A + B = Q represents an OR circuit. • A = Q represents a NOT operation.
  • 270. Example Consider the following expression : A + B . C = Q this tells that there is the term A or the term B and C will give the output Q, the corresponding ladder diagram is : A Q Siemens PLC B C
  • 271. XOR Example Considering the XOR gate below : • the input to the upper AND is : A and B and its output is : A . B OR AND NOT NOTA B AND Q
  • 272. • the input to the lower AND is : A and B and its output is : A . B • Finally, the boolean expression for the OR gate will be : Q = A . B + A . B • The corresponding ladder diagram is : A B A B Q
  • 273. More Example Considering the logic circuit shown below : • the boolean expression for the circuit is : (A . B + C) . D . E . F = Q AND A B OR NOT QANDNOT C D E F
  • 274. • The corresponding ladder diagram is : C DA B QE F
  • 275. Programming Examples 1. A signal lamp is required to be on if : A pump is running. And  The pressure is satisfactory. Or  The test lamp is closed. Pump X400 Presu. X401 Lamp Y430 Test X402 Step Instruction 0 LD X400 1 AND X401 2 LD X402 3 ORB 4 OUT Y430 5 END
  • 276. 2. A machine has 4 sensors to detect the safety and is required to be off if :  Any of the sensors gives input.  when the machine is stop, an alarm is sound. Step Instruction 0 LDI X400 1 ANI X401 2 ANI X402 3 ANI X403 4 OUT Y430 5 LD X400 6 OR X401 7 OR X402 8 OR X403 9 OUT Y431 10 END X400 X401 Mamchine Y430 X400 X402 X403 X401 X402 X403 Alarm Y431
  • 278. Definition INTERNAL UTILITY RELAYS (contacts) : These do not receive signals from the outside world nor do they physically exist. They are simulated relays and are what enables a PLC to eliminate external relays. There are also some special relays that are dedicated to performing only one task. Some are always on while some are always off. Some are on only once during power-on and are typically used for initializing data that was stored. They are built-in functions in the PLCs
  • 280. A PLC might have hundreds of internal relays where some of them are battery backed to ensure safe operation in case of power failure. Internal relays some times take different names such as : auxiliary relays, markers, flags, coils and bit storage . To distinguish internal relays outputs from physical relays outputs, they are given different addresses such as :
  • 281. a.Markers : M100 , M101 , … etc for Mitsubishi PLC. b.Flags : F0.0 , F0.1 , … etc for Siemens PLC. c.Coils : C001 , C002 , … etc for Sprecher+ PLC. d.Bits : B0 , B1 , … etc for Telemecanique PLC. e.Internal relays : R000 , R001 , … etc for Allen Bradley PLC.
  • 282. In ladder programming, internal relays take the same symbols as the physical outputs but with different addresses. The most commonly usage of internal relays is for latching circuits or for checking purposes when energizing an output under some conditions.
  • 283. Examples 1.Checking an output : Consider a system whose output is activated when two different sets of input conditions are satisfied, the ladder describing such case is : X400 X401 M100 X402 M100 X403 Y430 Step Instruction 0 LD X400 1 OR X402 2 AND X401 3 OUT M100 4 LD M100 5 AND X403 6 OUT Y430 7 END
  • 284. Step Instruction 0 LD X400 1 OR X401 2 OUT M100 3 LD X402 4 AND X403 5 OUT M101 6 LD M100 7 OR M101 8 OUT Y430 9 END X400 M100 X401 X402 X403 M101 M100 Y430 M101
  • 285. 2.Latching Circuit : the second use of internal relays is to reset a latch circuit as shown in the next example : X400 M100 Y430 X401 M100 Y430 I0.0 F0.0 Q2.0 I0.1 F0.0 Q2.0
  • 286. 3.Starting Multiple Outputs : the third use of internal relays is to start a circuit with multiple outputs as follows : X400 X401 M100 M100 Y430 M100 X402 Y431 X403 Y432
  • 287. 4.Battery-backed relays : for the latch circuits, the internal battery-backed relays are used to maintain the operation of the output even when the power is cut off. X400 M300 M300 Y430 M300
  • 288. 5.Setting and resting relays : the internal relays are used also to set and reset the operation of the output cycle as follows : X400 X401 Y430S Y430R X400 X401 Y430 LD X400 S Y430 LD X401 R Y430
  • 289. The set and reset circuit can be done in several ways as follows : I0.0 I0.1 S Q2.0 R X000 X001 S Y020 R Q FF R110 Siemens PLC Toshiba PLC
  • 290. Master Control Relay The master control relay is used in the ladder programming when a large number of outputs are used or when it is needed to divide the whole program into sections M100 X402 X400 X401 M100 Y430 Y431 M100MCR Step Instruction 0 LD X400 1 OUT M100 2 MC M100 3 LD X401 4 OUT Y430 5 LD X402 6 OUT Y431 7 MC M100 8 END
  • 291. More than one master control relay : Step Instruction 0 LD X400 1 AND X401 2 OUT M100 3 LD X402 4 AND X403 5 OUT M101 6 MC M100 7 LD X404 8 OUT Y430 9 MC M101 10 LD X405 11 OUT Y431 12 MCR M100 13 MCR M101 14 .. 15 .. 16 END M100 M100X400 X404 Y430 X405 Y431 M101MCR M101X402 X401 X403 M101
  • 292. Jump (program flow control ) The conditional jump instruction is used to control the execution of the ladder program such that : 1. When an input enables the jump, the program will proceed starting from the rung after the jump end and the rungs that lie between the start of the jump and its end will be ignored. 2. When there is no input to the jump, the program will proceed in its original form without ignoring any rungs.
  • 293. Examples 1. The following ladder shows a conditional jump for a process such that a fan operates when temp exceeds a some level , however, no action takes place if temp is blow that level. CJP 700 X402 X400 X401 Y430 Y431 EJP 700
  • 294. X401 Y430 X403 Y431 EJP 700 CJP 700 X400 CJP 701 X402 X404 Y432 EJP 701 X405 Y433 If X400If X402 Jump within jump
  • 295. Example (Central Heating) Consider a central heating system with the following features :  The boiler is thermostatically controlled and supplies the radiator system in addition to a hot water tank.  Pumps are used to supply hot water to either or both the radiator and the tank according to the desired sensors.  The whole system is controlled by a clock to operate a certain time a day.
  • 297. The power circuit for the central heating system is : Stop Run Clock Boiler sensor Room sensor Tank sensor Power Outputs Boiler M1 M2 Inputs
  • 298. The ladder & IL program for the central heating system using Mitsubishi PLC is : Inputs : X400 Clock X401 Boiler sensor X402 Room sensor X403 Tank sensor Outputs : Y430 Boiler Y431 Pump M1 Y432 Pump M2
  • 299. X403 X402 X402 Y431 Y432 END X400 X401 X403 Y430 Y430 Y430 Step Instruction 0 LD X402 1 OR X403 2 AND X400 3 AND X401 4 OUT Y430 5 LD Y430 6 AND X402 7 OUT Y431 8 LD Y430 9 AND X403 10 OUT Y432 11 END
  • 300. The ladder & IL program for the central heating system using Siemens PLC is : Inputs : I0.0 Clock I0.1 Boiler sensor I0.2 Room sensor I0.3 Tank sensor Outputs : Q2.0 Boiler Q2.1 Pump M1 Q2.2 Pump M2
  • 301. I0.3 I0.2 I0.2 Q2.1 Q2.2 END I0.0 I0.1 I0.3 Q2.0 Q2.0 Q2.0 Step Instruction 0 A I0.2 1 O I0.3 2 A I0.0 3 A I0.1 4 = Q2.0 5 A Q2.0 6 A I0.2 7 = Q2.1 8 A Q2.0 9 A I0.3 10 = Q2.2 11 END
  • 303. Simple Timers A timer is simply a control built-in block that takes an input and changes an output based on time. Timers count fractions of seconds or seconds using internal CPU clock. Timers act like relays with coils which when energized result in closing or opening contacts after some specified time interval.
  • 304. In PLC programming a timer is simply being treated as an output for a rung while its control is represented by contacts in somewhere else. There are three basic timer types : i. On-Delay timer TON or T-O ii. Off-Delay timer TOF or O-T iii. Pulse timers TP
  • 305. Timer Types •On-Delay Timer : this timer takes an input, waits a specific amount of time, then turns ON an output (or allows logic to flow after the delay). time Output Off On time Output Off On TP with +ve going output
  • 306. •Off-Delay Timer : this timer takes turns ON an output (or allows logic to flow) and keeps that output ON until the set amount of time has passed, then turns it OFF (hence off-delay) time Output Off On time Output Off On TP with -ve going output
  • 307. Timer Memory • EN - timer enabled bit • TT - timer timing bit • DN - timer done bit • FS - timer first scan • LS - timer last scan • OV - timer value overflowed • ER - timer error • PRE - preset word • ACC - accumulated time word
  • 308. Timer Format • Timer : timer No. T1 • Time Base : 0.01 or 0.1 or 1.0 sec • Preset : 100 • Accum. : 0 Txxx Preset value Time Base xxx Register where Accumulative value stored Timer Function Block
  • 309. 10 T1.0 4003 I0.1 I0.2 Q0.3 10 T1.0 4003 10 T1.0 4003 Ten-second On Delay Timer Automatic Resetting Timer Q0.3 Q0.3 I0.1 I0.1 I0.2 Q0.3 Ten-second Off Delay Timer
  • 311. Timer Programming The on delay timer is used to delay the operation of the output for some time interval as follows : Input Timer Output Timer time time Input Output Time delay
  • 312. X400 T450 Y430 T450 K5 I0.0 KT5.2 Q2.0 T0 T 0 Step Instruction 0 A I0.0 1 LKT 5.2 2 SR T0 3 A T0 4 = Q2.0 5 END Step Instruction 0 LD X400 1 OUT T450 2 K 5 3 LD T450 4 OUT Y430 5 END
  • 313. Sequencing The timers can be used to energize more than one output sequentially with a specified time delay . Q2.0 KT5.2 Q2.1 T0 T 0 Y430 T450 K5 X400 T450 Y431 I0.0 Q2.0Y430
  • 314. T1 Motor 2 IR 1 T2 Motor 3 IR 1 IR 1 start stop IR 1 Motor 1 T2 T1 END T1 Motor 2 IR 1 T2 Motor 3 IR 1 IR 1 start stop IR 1 Motor 1 IR 3 IR 2 END TON T1 TON T2 Motor Sequence
  • 315. Cascaded Timers Timers can be linked together to give longer time delay than that for a single timer. I0.2 Q0.3 10 T1.0 4001 10 T2.0 4002 Cascaded Timers I0.1 Q0.1 Q0.1
  • 316. T450 T451 K100 X400 T451 Y430 T450 K999 Step Instruction 0 LD X400 1 OUT T450 2 K 999 3 LD T450 4 OUT T451 5 K 100 6 LD T451 7 OUT Y430 8 END Cascaded timers
  • 317. Example (Timer Application)  Automatic mixing processes of liquids and other compounds in the chemical and food industries are very common.  The mixing station goal is to mix two liquids for a specified time and then output the final product to a storage tank.  The system consists of : 1. Two level sensors to monitor the flowing of the liquids into the tank. 2. Three solenoid valves to control the flow of liquids. 3. A motor connected to an agitator to mix the liquids into the tank.
  • 318. Mixing Station LS1 LS2 Level Sensors VA1 VA2 Input Valves MS1 Motor & Agitator Mixing Tank VA3 Output to Storage Tank
  • 319. The sequence of events for this automatic mixing process will be as follows : 1. Open valve 1 until level 1 is reached for the first liquid . 2. Then close valve 1 . 3. Open valve 2 until level 2 is reached for the second liquid . 4. Then close valve 2 . 5. Start the motor and agitate to mix the liquids into the tank for a specified time . 6. Then stop the motor . 7. Open valve 3 up to a specified time to empty the mixed product to a storage tank . 8. Then close valve 3 . 9. Repeat or end the mixing process as required .
  • 320. The automatic mixing station will require the following components using Mitsubishi PLC : 1. Inputs to the PLC :  Start push button X400  Stop push button X401  Level sensor LS1 X402  Level sensor LS2 X403 1. Outputs from the PLC :  Valve # 1 (VA1) Y430  Valve # 2 (VA2) Y431  Motor starter (MS1) Y432  Valve # 3 (VA3) Y433
  • 321. Y432 X403 T450 K1200 M 100 Y430 M 100 M100 M100 M100 M 100 X400 X401 M 100 END X402 X403 Y432 Y433 X402 X403 Y432 Y433 Y431 T450X403 Y433 T451 K180 M100 T450 M100 T451 T450 Y433
  • 322. Step Instruction 12 ANI X403 13 ANI Y432 14 ANI Y433 15 OUT Y431 16 LD M100 17 AND X403 18 OUT T450 19 K 1200 20 LD M100 21 AND X403 22 LD M100 23 ANI Y433 Step Instruction 0 LD X400 1 OR M100 2 ANI X401 3 OUT M100 4 LD M100 5 ANI X402 6 ANI X403 7 ANI Y432 8 ANI Y433 9 OUT Y430 10 LD M100 11 AND X402 Step Instruction 24 ORB 25 ANI T450 26 OUT Y432 27 LD M100 28 ANI T450 29 OUT T451 30 K 180 31 LD M100 32 ANI T451 33 AND T450 34 OUT Y433 35 END
  • 323. Q2.2 I0.3 F0.2 F0.1 Q2.0 F0.1 F0.1 F0.1 F0.1 F0.1 I0.0 I0.1 F0.1 END I0.2 I0.3 Q2.2 Q2.3 I0.2 I0.3 Q2.2 Q2.3 Q2.1 F0.2I0.3 Q2.3 F0.3 F0.1 F0.2 F0.1 F0.3 F0.2 Q2.3 T0 KT1200 KT180 T1
  • 324. Step Instruction 12 AN I0.3 13 AN Q2.2 14 AN Q2.3 15 = Q2.1 16 A F0.1 17 A I0.3 18 LKT 1200 19 SR T0 20 A T0 21 = F0.2 22 A( 23 A F0.1 Step Instruction 0 A I0.0 1 O F0.1 2 AN I0.1 3 = F0.1 4 A F0.1 5 AN I0.2 6 AN I0.3 7 AN Q2.2 8 AN Q2.3 9 = Q2.0 10 A F0.1 11 A I0.2 Step Instruction 36 A T1 37 = F0.3 38 A F0.1 39 AN F0.3 40 A F0.2 41 = Q2.3 46 END Step Instruction 24 A I0.3 25 ) 26 O( 27 A F0.1 28 AN Q2.3 29 ) 30 AN F0.2 31 = Q2.2 32 A F0.1 33 AN F0.2 34 LKT 180 35 SR T1
  • 326. Simple Counter  A counter is simply a control built-in block that takes counts the occurrence of an input signal.  This might happen in a conveyor system, when counting persons passing through a door, counting cars in a parking lot or counting the revolutions of a shaft.  There are two basic types of counters - Up counter and a Down counter : •Up Counter : as its name implies, whenever a triggering event occurs, an up counter increments the counter. •Down Counter : whenever a triggering event occurs, a down counter decrements the counter.
  • 327. Counter Memory • CU - count up bit • CD - count down bit • DN - counter done bit • OV - overflow bit • UN - underflow bit • PRE - preset word • ACC - accumulated count word
  • 328. Counter Format •Counter : counter No. CTR1 •Preset value : 5 •Accum. : 0 Preset value CTR Storage Register Counter Function Block
  • 329. 5 CTR1 4003 I001 O003 5 CTR1 4003 5 CTR1 4003 Automatic Resetting Counter Down Counter Up Counter I001 I001 I002 I002 O003 O003 O003
  • 331. Counter Programming The counter is used to count the events of occurrence of an input signal and then operates its contacts as follows : Input Counter Output Counter CTD counter CV RST
  • 332. Counter Output In 1 In 2 Counter Counter RST time In 1 time In 2 time Output
  • 333. Step Instruction 0 LD X400 1 RST C460 2 LD X401 3 OUT C460 4 K 10 5 LD C460 6 OUT Y430 7 END X400 X401 Y430 RESET C460 K 10 Out C460 Mitsubishi PLC counter programming
  • 334. Step Instruction 0 A I0.0 1 CU C0 2 A I0.1 3 R C0 4 = Q2.0 5 END I0.0 I0.1 Q2.0 CU CV R C0 Siemens PLC counter programming
  • 335. Counter Application Consider the following packing machine, where it is required to pack 6 objects in a box and then pack 12 objects in another box in another path as shown : 6 in box 12 in box
  • 336. Step Instruction 0 LD X400 1 OR C461 2 RST C460 3 K 6 4 LD X401 5 OUT C460 6 LD C460 7 OUT Y430 8 LD X400 9 OR C461 10 RST C461 11 K 12 12 LD X401 13 AND C460 14 OUT C461 15 LD C461 16 OUT Y431 17 END Mitsubishi PLC program C460 C461 X400 X401 Y430 RESET C460 K 6 Out C460 X400 X401 Y431 RESET C461 K 12 Out C461 C461
  • 337. Step Instruction 0 A I0.0 1 O C1 2 CU C0 3 LCK 6 4 A I0.1 5 R C0 6 = Q2.0 7 A I0.0 8 O C1 9 CU C1 10 LCK 12 11 A I0.1 12 R C1 13 A C0 14 = Q2.1 15 END Siemens PLC program I0.0 I0.1 Q2.0 I0.0 I0.1 Q2.1C0 CU CV R CU CV R C1 6 12 C1 C1 C0
  • 338. In 3 Reset In 1 In 2 Down-Counter Up-Counter Counter Output Using up and down counters
  • 339. Step Instruction 0 A I0.0 1 CU C0 2 A I0.1 3 CD C0 4 AN F0.0 5 LKC 50 6 S C0 7 A I0.2 8 R C0 9 A C0 10 = Q2.0 I0.0 I0.1 Q2.0 CU CD S KCV50 Up and down counters with a Siemens PLC F0.0 I0.2 CV R C0
  • 341. Definition • The shift registers are electronic internal devices used for storing data. • They represent a number of internal relays grouped together and allowing stored bits to be shifted from one relay to another. • Their main usage is to keep tracking of particular items or where a sequence of operations is required.
  • 342. Shift Registers Operation Suppose that we have 8 internal relays grouped together : And each relay may store an on or off state as follows : 1 2 3 4 5 6 7 8 1 0 1 1 0 0 1 0
  • 343. If a signal is received from an input devices sets the 1st internal relay to the state 0, by then the grouped set of relays in the register will be shifted as follows : before the update after the update 0 1 0 1 1 0 0 1 1 0 1 1 0 0 1 0
  • 344. Shift Registers Programming Consider a 4-bit shift register, it can be represented in ladder diagram by three inputs such that : • The 1st input is used to reset the register (RST). • The 2nd input is used to energize the first internal relay of the register (OUT). • The 3rd input is used to shift the states of the internal relays of the register along by one (SFT).
  • 345. In 3 RST IR 1 Out 1 In 2 SFT In 1 OUT IR 2 Out 2 IR 3 Out 3 IR 4 Out 4 Shift register internal relays IR 1 , IR 2 , IR 3 , IR 4 Output controlled by 1st relay in the register Output controlled by 2nd relay in the register Output controlled by 3rd relay in the register Output controlled by 4th relay in the register
  • 346. X402 RST M140 Y430 X401 SFT X400 OUT M141 Y431 M142 Y432 M143 Y433 M140 Step Instruction 0 LD X400 1 OUT M140 2 LD X401 3 SFT M140 4 LD X402 5 RST M140 6 LD M140 7 OUT Y430 8 LD M141 9 OUT Y431 10 LD M142 11 OUT Y432 12 LD M143 13 OUT Y433 14 END Mitsubishi PLC