Sie sind auf Seite 1von 69

Programmable Logic Controllers

K. Kannan, M.E.,
Asst. Professor / Mechanical,
Kamaraj College of Engineering & Technology

Programmable Logic Controllers


A special form of microprocessor based
controller that uses a programmable memory to
store instructions and to implement functions
such as logic, sequencing, timing, counting and
arithmetic in order to control machines and
processes

PLC Vs Computers
PLCs are similar to computers but computers
are optimized for calculation and display tasks,
whereas PLCs are optimized for control tasks
and the industrial environment
PLCs are Rugged and designed to withstand
vibrations, temperature, humidity and noise.
PLCs have interfacing for inputs and outputs
already inside the controller.
PLCs are easily programmed and have an easily
understood programming language which is
primarily concerned with logic and switching
operations.

Structure of PLC

Architecture of PLC

Central Processing Unit


The CPU contains
ALU
Memory
Control Unit

Buses
The buses present in the PLCs are
grouped into
Data Bus
Address Bus
Control Bus
System Bus

Memory
Different memory elements in the PLCs
are
Read Only Memory
Random Access Memory for User Program
Random Access Memory for User Data
Erasable Programmable Read Only Memory

Input and Output Unit

Input Levels

Output Levels

Sourcing and Sinking

PLC System

Mitsubishi Compact PLC


MELSEC FX3U

Programming PLC Ladder


Diagram

Symbols Used

Ladder Rung

Logic Function - AND

Logic Function - OR

Logic Function - NOT

Logic Function - NAND

Logic Function - NOR

Logic Function - XOR

Programming Examples
A signal lamp is required to be switched on if a
pump is running and the pressure is satisfactory,
or if the lamp test switch is closed.

Programming Examples
A valve is to be operated to lift a load when a
pump is running and either the lift switch is
operated or a switch operated indicating that the
load has not already been lifted

Programming Examples
For a system where there has to be no output
when any one of four sensors gives an output,
otherwise there is to be an output.

LATCH
Latch is a circuit used to hold a
coil energized even when the
input which energized it ceases.

Internal Relays
In PLCs, there are elements called as
internal relay that are used to hold data,
i.e. bits, and being able to be switched on
or off and switch other devices on or off.
A variety of other terms are often used to
describe these elements, e.g. auxiliary
relays, markers, flags, coils, bit storage.

Internal Relays
On one rung of the program: Inputs to external
inputs activate the internal relay output.
On a later rung of the program: As a
consequence of the internal relay output, internal
relay contacts are activated and so control some
output.

Example Application of Internal


Relays

Use of two Internal Relays

Resetting Latch

Starting Multiple Outputs

Battery Backed Relays


If the power supply is cut off from a PLC while it is
being used, all the output relays and internal relays
will be turned off. Thus when the power is restored,
all the contacts associated with those relays will be
set differently from when the power was on.
To overcome this problem, some internal relays
have battery back-up. Such battery-backed relays
retain their state of activation, even when the power
supply is off. The relay is said to have been made
retentive.

Master Control Relay


When large numbers of outputs have to be
controlled, it is sometimes necessary for whole
sections of ladder diagrams to be turned on or
off when certain criteria are realized. This could
be achieved by including the contacts of the
same internal relay in each of the rungs so that
its operation affects all of them. An alternative is
to use a master control relay.

Master Control Relay

Example of Two Master Relay


Control

Sequencing

Jump and Call


A function often provided with PLCs is the
conditional jump. We can describe this as:
IF (some condition occurs), THEN perform
some instructions
ELSE perform some other instructions.

Jump

Jumps within Jumps

Subroutines
Subroutines are small programs to
perform specific tasks which can be called
for use in larger programs.

Subroutines

Timers
In many control tasks, there is a need to
control time. For example, a motor or a
pump might need to be controlled to
operate for a particular interval of time, or
perhaps be switched on after some time
interval. PLCs have timers as built-in
devices. Timers count fractions of seconds
or seconds using the internal CPU clock.

Timers
PLC manufacturers differ on how timers
should be programmed and hence how
they can be considered. A common
approach is to consider timers to behave
like relays with coils which when energised
result in the closure or opening of contacts
after some preset time. The timer is thus
treated as an output for a rung with control
being exercised over pairs of contacts
elsewhere

Types of Timers
There are a number of different forms of
timers that can be found with PLCs.
On-delay timers. These are timers which
come on after a particular time delay
Off-delay timers are on for a fixed period
of time before turning off
Pulse timer switches on or off for a fixed
period of time

Types of Timers

Programming Timer

Timers in Sequencing

Cascaded Timers

On Off Cycle Timer

Off Delay Timer

Pulse Timer

Counters
Counters are provided as built-in elements in
PLCs and allow the number of occurrences
of input signals to be counted.
A counter is set to some preset number value
and, when this value of input pulses has
been received, it will operate its contacts.
Thus normally open contacts would be
closed, normally closed contacts opened.

Types of Counters
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.
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.

Types of Counters

Programming Counters

Up Down Counting

Shift Registers
The term register is used for an electronic
device in which data can be stored. An
internal relay is such a device.
The shift register is a number of internal
relays grouped together which allow
stored bits to be shifted from one relay to
another.

Shift Registers
A register is a number of internal relays
grouped together, normally 8, 16 or 32.
Each internal relay is either effectively
open or closed, these states being
designated as 0 and 1.

Shift Registers
With the shift register it is possible to shift
stored bits. Shift registers require three inputs,
one to load data into the first location of the
register, one as the command to shift data
along by one location and one to reset or clear
the register of data.

Programming Shift Registers

Programming Shift Registers

Sequencing Applications

Data Handling Data Move

Data Handling Data Comparison

Applications Alarm Program

Code Conversion

Thanking You

Das könnte Ihnen auch gefallen