Module4 Programmable Logic Controller
Module4 Programmable Logic Controller
Introduction
• Its input and output modules can be extended depending on the requirements
Programmable Logic Controller
allow users to easily trace and correct software and hardware problems.
• To find and fix problems, users can display the control program on a monitor
Advantages
• Less wiring: Wiring between devices and relay contacts are done in the PLC
program.
• Reliable components make these likely to operate for years before failure.
Programmable Logic Controller
Advantages
• Increased Reliability: Once a program has been written and tested it can be
downloaded to other PLCs.
• More Flexibility: OEMs can provide system updates for a process by simply
sending out a new program.
• Lower Costs: Originally PLCs were designed to replace relay control logic.
Expansion Module
Programmable Logic Controller
Basic Structure
Logic
• Solenoid valve
• Motors
Sensors & Transducers Actuators
• LED display
• Sounds / Alarm
Programmable Logic Controller
Basic Structure
1. Rack / Chassis
2. Power supply Module
3. Central processing unit (CPU)
4. Storage / Memory
5. Input/output interface circuit
6. The function module
7. The communication module
8. Programming unit
Programmable Logic Controller
Basic Structure
There are two ways in which I/Os (Inputs/Outputs) are incorporated into the PLC
1. Fixed
2. Modular
Basic Structure Programmable Logic Controller
Fixed I/O
• Typically small PLCs, comes in one package with no
separate, removable units.
• The processor and I/O are packaged together
• The I/O terminals will have a fixed number of connections
built in for i/p & o/p.
Advantage: Lower cost.
Disadvantage:
• Lack of flexibility: you are limited, the quantities and types
dictated by the packaging.
• If any part in the unit fails, the whole unit has to be replaced.
Basic Structure Programmable Logic Controller
Modular I/O
• Divided by compartments, in which separate modules can be plugged.
• The basic modular controller consists of a rack, power supply, processor module
(CPU), input/output (I/O modules), and an operator interface for programming and
monitoring.
• The modules plug into a rack.
• When a module is slid into the rack, it makes an electrical connection with a
series of contacts called the backplane, located at the rear of the rack.
• The PLC processor is also connected to the backplane and can communicate with
all the modules in the rack.
Basic Structure Programmable Logic Controller
Modular I/O
Rack / Chassis
• PLC power supply converts a line voltage, i.e. AC into a DC voltage, required by the
CPU and I/O module in the rack.
• In Modular PLC racks, the power supply is the part of rack.
• A battery backup, to provide energy to the memory of the PLC in case of a power supply
failure
Programmable Logic Controller
CPU Module
• Control centre of the PLC
• CPU module has CPU, ROM & RAM memory.
• Rom includes an OS, drivers and application programs.
• RAM for storing Programs and Data
• Performs the routine check
• It controls and processes all the operations within the PLC
Processor Module
• Microprocessor for implementing the logic and controlling the
communications among the modules.
Programmable Logic Controller
• To prevent the loss of these programs, when the supply is switched off, a
battery is provided in the PLC to maintain the RAM contents for a period of time.
Programmable Logic Controller
I/O circuitry
I/O circuitry
• This control problem can be solved by relay method for motor control, shown
in the relay ladder diagram (Fig.)
• The motor starter coil (M) is energized when both the pressure and
temperature switches are closed or when the manual pushbutton is pressed.
• The format / instruction is similar to the layout of the hardwired relay ladder circuit.
• The individual symbols represent instructions, the numbers represent the instruction
location addresses.
• To program the controller, enter these instructions one by one into the processor
• Each input and output device is given an address, which lets the PLC know where it
is physically connected.
• The I/O address format will differ, depending on the PLC model and manufacturer.
Principles of Operation
• Instructions are stored in the user program portion of the processor memory.
• During the program scan, the controller monitors the inputs, executes the control
• During each operating cycle, the controller examines the status of input devices,
• The coil O/1 is energized, when contacts I/1 and I/2 are
from left to right across the rung that includes the coil.
Principles of Operation
The RUN operation for the process control scheme is described by the following
sequence of events:
1. First, the pressure switch, temperature switch, and pushbutton inputs are
examined and their status is recorded in the controller’s memory.
2. A closed contact is recorded in memory as logic 1 and an open contact as logic 0.
3. The ladder diagram is evaluated, with each internal contact given an OPEN or
CLOSED status according to its recorded 1 or 0 state.
4. When the states of the input contacts provide logic continuity from left to right
across the rung, the output coil memory location is given a logic 1 value and the
output module interface contacts will close.
5. When there is no logic continuity of the program rung, the output coil memory
location is set to logic 0.
Principles of Operation
• The completion of one cycle of this sequence by the controller is called a scan.
• Scan time: the time required for one full cycle, provides a measure of the speed of
• Generally, the output memory location is updated during the scan but the actual output is
not updated until the end of the program scan during the I/O scan
Principles of Operation
• The term PLC programming language refers to the method by which the user
• The standard IEC 61131 was established to standardize the multiple languages
• Used to execute logical, sequential, counting, timing and arithmetic tasks in order
• Ladder logic programming is still used today because the core fundamental logic
principles for machine and process control are still the same.
Ladder Logic / Ladder Program
control.
applications.
• Hopper and Tank Level Control / Air / Liquid Flow and Pressure Control.
Ladder Logic / Ladder Program
What is a Ladder Diagram?
• A ladder diagram is a type of schematic diagram used in industrial automation that represents
• Ladder diagrams are composed of two vertical power rails and horizontal logic rungs to form what
looks like a ladder. The control logic in a ladder diagram is contained within the rungs.
• The reason is because the early control system designers were accustomed to
relay logic control circuits and ladder diagrams closely mimic these.
• The person / staff already knows how to read relay control circuits, so using
• Ladder diagram (LD): official name given in the international PLC programming
• Symbols represent opening and closing relays, counters, timers, shift registers,
etc.
1. Rails: Two rails (power rails) in a ladder diagram, represented by vertical lines.
•The power flows from the left hand side to the right hand side.
(a) Relay circuit (b) Drawing an electric circuit, (c) Rung in a ladder program.
5. Logic Expressions: The logic expressions are used in combination with the
operations.
6. Address Notation: Address notation describes the input, output, logic expression,
7. Comments:
• Used to describe the logical expressions and control operations of that rung.
‘Binary’: principle, is that the event/s can be thought of in one of two states.
The states can be defined as:
• 1 or 0
• True or False
• On or Off
• High or Low
• Yes or No
How to Read Ladder Logic
• Ladder logic uses symbolic expressions and a graphical editor for reading and
• If real world event is translated into ladder logic, it symbolically expressed in the
E.g. events like a button being pushed or a limit switch being activated.
How to Read Ladder Logic
Example
• Consider event ‘A’, has one of two states, TRUE or FALSE (1 or 0).
• Event is associated with the normally open (NO) contact can be TRUE or FALSE.
• A normally open (NO) contact alone cannot decide what action to take to
• Logic is the ability to decide what action needs to be taken depending on the
state of one or more events.
1. AND
2. OR
3. NOR
4. NAND
5. XOR
Logic functions
(a) AND, (b) OR, (c) NOR, (d) NAND, (e) XOR
Ladder Logic AND Functions
Ladder Logic OR Functions
Ladder Logic
1. Scan the inputs associated with one rung of the ladder program.
6. So on until the end of the program with each rung of the ladder program.
The PLC then goes back to the beginning of the program and starts again.
Ladder Logic
Timers
Example
• Timers count seconds or fractions of seconds using the internal CPU clock.
Timers
• The timers behave like relays with coils that when energized, result in the
closure or opening of contacts after some preset time.
a) The timer is treated as an output for a rung, with control being exercised over
pairs of contacts.
b) Timer as a delay block, inserted in a rung, delays signals in that rung from
reaching the output.
a b
Forms of Timers
With small PLCs, just one form of timers are used i.e. the on-delay timers
The Allen-Bradley timers have three Boolean bits for ladder logic control:
• A timer enable bit (EN), which goes on when the timer accumulator is Incrementing
• A timer done bit (DN), which goes on after the set time delay.
• A timer timing bit (TT) is on when the accumulator is incrementing and remains on
until the accumulator reaches the preset value.
Timers
Internal relays
• Internal Relays are elements, used to hold data, i.e. bits, and
behave like relays, being able to be switched on or off and switch
other devices on or off. Hence the term internal relay.
• The internal relays do not exist as real-world switching devices but
are bits in the storage memory, behave in the same way as relays.
• For programming, they can be treated as an external relay output
and input.
• Thus inputs to external switches can be used to give an output
from an internal relay.
• This results in the internal relay contacts being used, in
combination with other external input switches to give an output,
e.g. activate a motor.
Internal relays
• Counters are provided as built-in elements in PLCs and allow the number of
occurrences of input signals to be counted.
• Example: Items have to be counted as they pass along a conveyor belt / the
number of revolutions of a shaft / number of people passing through a door.
• A counter is set to some preset number value, when this value of input pulses has
been received, it will operate its contacts. Normally open (NO) contacts would be
closed, normally closed (NC) contacts opened.
Counters
Forms of Counters
2. Down-counters count down from the preset value to zero, i.e., events are
subtracted from the set value. When the counter reaches the zero value, its
contacts change state. Most PLCs offer down-counting.
3. Up-counters count from zero up to the preset value, i.e. events are added until
the number reaches the preset value. When the counter reaches the set value, its
contacts change state.
Counters
Forms of Counters
A function often provided with PLCs is the conditional jump, described as:
• JUMP facility enables programs to be designed such that if certain conditions are
met, certain events occur, and if they are not met, other events occur.
Example: we might need to design a system, if the temperature is above 60C, a fan is
• This results in the program jumping to the rung in which the jump
• Registers, used for storing data that originate from input sources.
• Each internal relay is either open or closed, these states being designated 0 and 1.
• If we have eight internal relays in the register, we can store eight 0/1 states.
8-bit register
Shift Register
If we receive the input signal 0. This is an input signal to the first internal relay
If we also receive the shift signal, the input signal enters the first location in the register, and all the bits shift
along one location. The last bit overflows and is lost.
The grouping together of internal relays to form a shift register is done automatically by a PLC when
the shift register function is selected.
Data Handling
Data Handling
Figure illustrates a common practice of using one rung of a ladder program for
When there is an input to | | in the rung, the move occurs from the designated source address to the
designated destination address.
Data Handling
Data Comparison
• The data comparison instruction gets the PLC to compare two data values.
• It might be to compare a digital value read from some input device with a
second value contained in a register.
An illustration, in structured text
Figure: IEC symbols: (a) selection, (b) maximum, and (c) minimum
Concept of Latching
• There are situations where it is necessary to hold a coil energized, even when the input which
energized it ceases.
• The term latch circuit is used for the circuit which carries out such an operation.
• It is a self-maintaining circuit, after being energized, it maintains that state until another input is
received.
Concept of Latching
• When Input 1 is energized and closes, there is an output. However, when there is an output, a
set of contacts associated with the output is energized and closes. The contacts is in OR the
Input 1 contacts.
• Even if Input 1 contacts open, the circuit will still maintain the output energized.
• The only way to release the output is by operating the normally closed contact Input 2
Concept of Latching
An example of a latch circuit: consider the requirement for a PLC to control a motor
• We require is a system that will still stop if a failure occurs in the stop switch.
• The program now has the stop switch as open contacts. However, because the hard-wired stop
switch has normally closed contacts, then the program receives the signal to close the program
contacts.
• Pressing the stop switch then opens the program contacts and stops the system
Selection criteria of PLC
1. Application requirements :
The task should be such that they can be split into simple understandable
elements
2. System requirements
4. Electrical requirements
This specifies the level of incoming power and the level of output voltage or
current
5. Communication requirements
7. Physical environment
This is specification regarding the environment in which PLC is to be placed.
Protection is to be given to the PLC if it is kept in harsh environments.
The covering should be such that there is provision for maintenance or
reprogramming.
8. Vendor selection
Depending upon the vendor (seller), the number of modules, special features,
scope for future development and cost effectiveness can change.