Вы находитесь на странице: 1из 52

Basics of PLC

INDEX
S. NO. TITLE PAGE NO.

1. INTRODUCTION 2

2. HISTORY 3-4

3. FUNCTIONALITY 5-7

4. DEFINITION OF PLC 8-9

5. PROGRAMMING 10-13

6. HOW PLC’S WORK 14-22

7. LADDER LOGIC 23-27

8. SYMBOLS IN LADDER LOGIC 28-34

9. PLC TOPICS 35-41

10. MODES IN PLC OPERATION 42-47

11. BASIC ADVANTAGES AND 48-50


DISADVANTAGES OF PLC
12. AREAS OF APPLICATION OF PLC 51-52

Department of Electrical Engineering, IGEC, Sagar (M.P.) 1


Basics of PLC

INTRODUCTION

A PLC is an industrial-grade digital computer designed to perform


control functions—especially for industrial applications.
PLCs can range from small modular devices with tens of inputs and
outputs (I/O), in a housing integral with the processor, to large rack-mounted
modular devices with a count of thousands of I/O, and which are often
networked to other PLC and SCADA systems.
They can be designed for multiple arrangements of digital and analog I/O,
extended temperature ranges, immunity to electrical noise, and resistance to
vibration and impact. Programs to control machine operation are typically
stored in battery-backed-up or non-volatile memory.
It was from the automotive industry in the USA that the PLC was born. Before
the PLC, control, sequencing, and safety interlock logic for manufacturing
automobiles was mainly composed of relays, cam timers, drum sequencers, and
dedicated closed-loop controllers. Since these could number in the hundreds or
even thousands, the process for updating such facilities for the yearly
model change-over was very time consuming and expensive,
as electricians needed to individually rewire the relays to change their
operational characteristics.
When digital computers became available, being general-purpose
programmable devices, they were soon applied to control sequential and
combinatorial logic in industrial processes. However these early computers
required specialist programmers and stringent operating environmental control
for temperature, cleanliness, and power quality. To meet these challenges the
PLC was developed with several key attributes. It would tolerate the shop-floor
environment, it would support discrete (bit-form) input and output in an easily
extensible manner, it would not require years of training to use, and it would
permit its operation to be monitored. Since many industrial processes have
timescales easily addressed by millisecond response times, modern (fast, small,
reliable) electronics greatly facilitate building reliable controllers, and
performance could be traded off for reliability.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 2


Basics of PLC

HISTORY

In 1968 G M Hydramatic (the automatic transmission division of General


Motors) issued a request for proposals for an electronic replacement for hard-
wired relay systems based on a white paper written by engineer Edward R.
Clark. The winning proposal came from Bedford Associates of Bedford,
Massachusetts. The first PLC, designated the 084 because it was Bedford
Associates' eighty-fourth project, was the result.[2] Bedford Associates started a
new company dedicated to developing, manufacturing, selling, and servicing
this new product: Modicon, which stood for modular digital controller. One of
the people who worked on that project was Dick Morley, who is considered to
be the "father" of the PLC.[3] The Modicon brand was sold in 1977 to Gould
Electronics, later acquired by German Company AEG, and then by
French Schneider Electric, the current owner.
One of the very first 084 models built is now on display at Schneider Electric's
facility in North Andover, Massachusetts. It was presented to Modicon by GM,
when the unit was retired after nearly twenty years of uninterrupted service.
Modicon used the 84 moniker at the end of its product range until the 984 made
its appearance.
The automotive industry is still one of the largest users of PLCs.
In a parallel development Odo Josef Struger is sometimes known as the "father
of the programmable logic controller" as well.[4][5] He was involved in the
invention of the Allen-Bradley programmable logic controller (PLC) during
1958 to 1960.[6][7][8] Struger is credited with creating the PLC acronym.[4] Allen-
Bradley (now a brand owned by Rockwell Automation), the manufacturer of the
controller, became a major programmable logic controller device manufacturer
in the United States during the tenure of Struger.[9]
Early PLCs were designed to replace relay logic systems. Relay systems were
large and bulky and had an assortment of issues. The hard-wired nature made it
difficult for design engineers to alter the process. Even small changes would
require rewiring and careful updating of the documentation. If even one wire
were out of place, or one relay failed, the whole system would become faulty.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 3


Basics of PLC

Often times technicians would spend hours troubleshooting by examining the


schematics and comparing them to existing wiring.[10] It was for this reason

PLCs were programmed in "ladder logic", which strongly resembles a


schematic diagram of relay logic. This program notation was chosen to reduce
training demands for the existing technicians. Other early PLCs used a form
of instruction list programming, based on a stack-based logic solver.
Modern PLCs can be programmed in a variety of ways, from the relay-derived
ladder logic to programming languages such as specially adapted dialects
of BASIC and C.
Another method is state logic, a very high-level programming
language designed to program PLCs based on state transition diagrams. The
majority of PLC systems today adhere to the IEC 61131/3 control systems
programming standard that defines 5 languages: Ladder Diagram (LD),
Structured Text (ST), Function Block Diagram (FBD), Instruction List (IL)
and sequential function chart (SFC).
Many early PLCs did not have accompanying programming terminals that were
capable of graphical representation of the logic, and so the logic was instead
represented as a series of logic expressions in some version of Boolean format,
similar to Boolean algebra.
As programming terminals evolved, it became more common for ladder logic
to be used, for the aforementioned reasons and because it was a familiar format
used for electro-mechanical control panels. Newer formats such as state logic
and Function Block (which is similar to the way logic is depicted when using
digital integrated logic circuits) exist, but they are still not as popular as ladder
logic.
A primary reason for this is that PLCs solve the logic in a predictable and
repeating sequence, and ladder logic allows the programmer (the person writing
the logic) to see any issues with the timing of the logic sequence more easily
than would be possible in other formats.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 4


Basics of PLC

FUNCTIONALITY

The functionality of the PLC has evolved over the years to include sequential
relay control, motion control, process control, distributed control systems,
and networking. The data handling, storage, processing power, and
communication capabilities of some modern PLCs are approximately equivalent
to desktop computers. PLC-like programming combined with remote I/O
hardware, allow a general-purpose desktop computer to overlap some PLCs in
certain applications. Desktop computer controllers have not been generally
accepted in heavy industry because the desktop computers run on less stable
operating systems than PLCs, and because the desktop computer hardware is
typically not designed to the same levels of tolerance to temperature, humidity,
vibration, and longevity as the processors used in PLCs. Operating systems such
as Windows do not lend themselves to deterministic logic execution, with the
result that the controller may not always respond to changes of input status with
the consistency in timing expected from PLCs. Desktop logic applications find
use in less critical situations, such as laboratory automation and use in small
facilities where the application is less demanding and critical.

BASIC FUNCTIONS

The most basic function of a programmable controller is to emulate the


functions of electro-mechanical relays. Discrete inputs are given a unique
address, and a PLC instruction can test if the input state is on or off. Just as a
series of relay contacts perform a logical AND function, not allowing current to
pass unless all the contacts are closed, so a series of "examine if on" instructions
will energize its output storage bit if all the input bits are on. Similarly, a
parallel set of instructions will perform a logical OR. In an electro-mechanical
relay wiring diagram, a group of contacts controlling one coil is called a "rung"
of a "ladder diagram ", and this concept is also used to describe PLC logic.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 5


Basics of PLC

Some models of PLC limit the number of series and parallel instructions in one
"rung" of logic. The output of each rung sets or clears a storage bit, which may
be associated with a physical output address or which may be an "internal coil"
with no physical connection. Such internal coils can be used, for example, as a
common element in multiple separate rungs. Unlike physical relays, there is
usually no limit to the number of times an input, output or internal coil can be
referenced in a PLC program.
Some PLCs enforce a strict left-to-right, top-to-bottom execution order for
evaluating the rung logic. This is different from electro-mechanical relay
contacts, which in a sufficiently complex circuit may either pass current left-to-
right or right-to-left, depending on the configuration of surrounding contacts.
The elimination of these "sneak paths" is either a bug or a feature, depending on
programming style.
More advanced instructions of the PLC may be implemented as functional
blocks, which carry out some operation when enabled by a logical input and
which produce outputs to signal, for example, completion or errors, while
manipulating variable internally that may not correspond to discrete logic.

TIMERS AND COUNTERS

The main function of a timer is to keep an output on for a specific length of


time. A good example of this is a garage light, where you want power to be cut
off after 2 minutes so as to give someone time to go into the house. The three
different types of timers that are commonly used are a Delay-OFF, a Delay-ON,
and a Delay-ON-Retentive. A Delay-OFF timer activates immediately when
turned on, counts down from a programmed time before cutting off, and is
cleared when the enabling input is off. A Delay-ON timer is activated by input
and starts accumulating time, counts up to a programmed time before cutting
off, and is cleared when the enabling input is turned off. A Delay-ON-Retentive
timer is activated by input and starts accumulating time, retains the accumulated
value even if the (ladder-logic) rung goes false, and can be reset only by a
RESET contact.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 6


Basics of PLC

Counters are primarily used for counting items such as cans going into a box on
an assembly line. This is important because once something is filled to its max
the item needs to be moved on so something else can be filled. Many companies
use counters in PLC's to count boxes, count how many feet of something is
covered, or to count how many pallets are on a truck. There are three types of
counters, Up counters, Down counters, and Up/Down counters. Up counters
count up to the preset value, turn on the CTU (CounT Up output) when the
preset value is reached, and are cleared upon receiving a reset. Down counters
count down from a preset value, turns on the CTD (CounT Down output) when
0 is reached, and are cleared upon reset. Up/Down counters count up on CU,
count down on CD, turn on CTUD (CounT Up/Down output) when the preset
value is reached, and cleared on reset.

PROGRAMMABLE LOGIC RELAY

In more recent years, small products called PLRs (programmable logic relays),
and also by similar names, have become more common and accepted. These are
much like PLCs, and are used in light industry where only a few points
of I/O (i.e. a few signals coming in from the real world and a few going out) are
needed, and low cost is desired. These small devices are typically made in a
common physical size and shape by several manufacturers, and branded by the
makers of larger PLCs to fill out their low end product range. Popular names
include PICO Controller, NANO PLC, and other names implying very small
controllers. Most of these have 8 to 12 discrete inputs, 4 to 8 discrete outputs,
and up to 2 analog inputs. Size is usually about 4" wide, 3" high, and 3" deep.
Most such devices include a tiny postage-stamp-sized LCD screen for viewing
simplified ladder logic (only a very small portion of the program being visible
at a given time) and status of I/O points, and typically these screens are
accompanied by a 4-way rocker push-button plus four more separate push-
buttons, similar to the key buttons on a VCR remote control, and used to
navigate and edit the logic. Most have a small plug for connecting via RS-232
or RS-485 to a personal computer so that programmers can use simple Windows
applications for programming instead of being forced to use the tiny LCD and

Department of Electrical Engineering, IGEC, Sagar (M.P.) 7


Basics of PLC

push-button set for this purpose. Unlike regular PLCs that are usually modular
and greatly expandable, the PLRs are usually not modular or expandable, but
their price can be two orders of magnitude less than a PLC, and they still offer
robust design and deterministic execution of the logics.

DEFINITION OF PLC

It's always good to get an overview of where designs have been and were they
are going. To do this it's essential to get a bird's eye view of the concepts and
processes that make the PLC so valuable in industrial control. Pitting PLCs
against other control types will also serve to show the pros and cons for
different applications.

What is a PLC?
A Programmable Logic Controller, or PLC for short, is simply a special
computer device used for industrial control systems. They are used in many
industries such as oil refineries, manufacturing lines, conveyor systems and so
on. Where ever there is a need to control devices the PLC provides a flexible
way to "software" the components together.

The basic units have a CPU (a computer processor) that is dedicated to run one
program that monitors a series of different inputs and logically manipulates the
outputs for the desired control. They are meant to be very flexible in how they
can be programmed while also providing the advantages of high reliability (no
program crashes or mechanical failures), compact and economical over
traditional control systems.

A Simple Example
Consider something as simple as a switch that turns on a light. In this system
with a flick of the switch the light would turn on or off. Beyond that though
there is no more control. If your boss came along and said I want that light to
turn on thirty seconds after the switch has been flipped, then you would need to
buy a timer and do some rewiring. So it is time, labor and money for any little
change.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 8


Basics of PLC

A PLC Saves the Day


Now consider the same device with a PLC in the middle. The switch is fed as
an input into the PLC and the light is controlled by a PLC
output. Implementing a delay in this system is easy since all that needs to be
changed is the program in the PLC to use a delay timer.

This is a rather simple example but in a larger system with many switchs and
lights (and a host of other devices) all interacting with each other this kind of
flexibility is not only nice but imperitive. Hopefully a light bulb has now turned
on over your head.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 9


Basics of PLC

PROGRAMMING

PLC programs are typically written in a special application on a personal


computer, then downloaded by a direct-connection cable or over a network to
the PLC. The program is stored in the PLC either in battery-backed-up RAM or
some other non-volatile flash memory. Often, a single PLC can be programmed
to replace thousands of relays.[11]
Early PLCs, up to the mid-1990s, were programmed using proprietary
programming panels or special-purpose programming terminals, which often
had dedicated function keys representing the various logical elements of PLC
programs.[2] Some proprietary programming terminals displayed the elements of
PLC programs as graphic symbols, but plain ASCII character representations of
contacts, coils, and wires were common. Programs were stored on cassette tape
cartridges. Facilities for printing and documentation were minimal due to lack
of memory capacity. The oldest PLCs used non-volatile magnetic core memory.
More recently, PLCs are programmed using application software on personal
computers, which now represent the logic in graphic form instead of character
symbols. The computer is connected to the PLC through USB, Ethernet, RS-
232, RS-485, or RS-422 cabling. The programming software allows entry and
editing of the ladder-style logic. In some software packages, it is also possible
to view and edit the program in function block diagrams, sequence flow charts
and structured text. Generally the software provides functions for debugging
and troubleshooting the PLC software, for example, by highlighting portions of
the logic to show current status during operation or via simulation. The software
will upload and download the PLC program, for backup and restoration
purposes. In some models of programmable controller, the program is
transferred from a personal computer to the PLC through a programming board
which writes the program into a removable chip such as an EPROM.
Under the IEC 61131-3 standard, PLCs can be programmed using standards-
based programming languages. The most commonly used programming
language is Ladder diagram (LD) also known as Ladder logic. It uses Contact-
Coil logic to make programs like an electrical control diagram. A graphical
programming notation called Sequential Function Charts is available on certain
programmable controllers. A model which emulated electromechanical control

Department of Electrical Engineering, IGEC, Sagar (M.P.) 10


Basics of PLC

panel devices (such as the contact and coils of relays) which PLCs replaced.
This model remains common today.
IEC 61131-3 currently defines five programming languages for programmable
control systems: function block diagram (FBD), ladder
diagram (LD), structured text (ST; similar to the Pascal programming
language), instruction list (IL; similar to assembly language), and sequential
function chart (SFC).[12] These techniques emphasize logical organization of
operations.[11]
While the fundamental concepts of PLC programming are common to all
manufacturers, differences in I/O addressing, memory organization, and
instruction sets mean that PLC programs are never perfectly interchangeable
between different makers. Even within the same product line of a single
manufacturer, different models may not be directly compatible.

A ladder diagram is a method of drawing control circuits which pre-dates


PLCs. The ladder diagram resembles the schematic diagram of a system built
with electromechanical relays.
As an example, say a facility needs to store water in a tank. The water is drawn
from the tank by another system, as needed, and our example system must
manage the water level in the tank by controlling the valve that refills the tank.
Shown are:

 Two inputs (from the low and high level switches) represented by contacts
of the float switches
 An output to the fill valve, labelled as the fill valve which it controls
 An "internal" contact, representing the output signal to the fill valve which is
created in the program.
 A logical control scheme created by the interconnection of these items in
software
In ladder diagram, the contact symbols represent the state of bits in processor
memory, which corresponds to the state of physical inputs to the system. If a
discrete input is energized, the memory bit is a 1, and a "normally open" contact
controlled by that bit will pass a logic "true" signal on to the next element of the
ladder. Therefore, the contacts in the PLC program that "read" or look at the
physical switch contacts in this case must be "opposite" or open in order to

Department of Electrical Engineering, IGEC, Sagar (M.P.) 11


Basics of PLC

return a TRUE for the closed physical switches. Internal status bits,
corresponding to the state of discrete outputs, are also available to the program.
In the example, the physical state of the float switch contacts must be
considered when choosing "normally open" or "normally closed" symbols in the
ladder diagram. The PLC has two discrete inputs from float switches (Low
Level and High Level). Both float switches (normally closed) open their
contacts when the water level in the tank is above the physical location of the
switch.
When the water level is below both switches, the float switch physical contacts
are both closed, and a true (logic 1) value is passed to the Fill Valve output.
Water begins to fill the tank. The internal "Fill Valve" contact latches the circuit
so that even when the "Low Level" contact opens (as the water passes the lower
switch), the fill valve remains on. Since the High Level is also normally closed,
water continues to flow as the water level remains between the two switch
levels. Once the water level rises enough so that the "High Level" switch is off
(opened), the PLC will shut the inlet to stop the water from overflowing; this is
an example of seal-in (latching) logic. The output is sealed in until a high level
condition breaks the circuit. After that the fill valve remains off until the level
drops so low that the Low Level switch is activated, and the process repeats
again.

| (N.C. physical (N.C. physical |


| Switch) Switch) |
| Low Level High Level Fill Valve |
|------[ ]------|------[ ]----------------------(OUT)---------|
| | |
| | |
| | |
| Fill Valve | |
|------[ ]------| |
| |
| |

Department of Electrical Engineering, IGEC, Sagar (M.P.) 12


Basics of PLC

A complete program may contain thousands of rungs, evaluated in sequence.


Typically the PLC processor will alternately scan all its inputs and update
outputs, then evaluate the ladder logic; input changes during a program scan
will not be effective until the next I/O update. A complete program scan may
take only a few milliseconds, much faster than changes in the controlled
process.
Programmable controllers vary in their capabilities for a "rung" of a ladder
diagram. Some only allow a single output bit. There are typically limits to the
number of series contacts in line, and the number of branches that can be used.
Each element of the rung is evaluated sequentially. If elements change their
state during evaluation of a rung, hard-to-diagnose faults can be generated,
although sometimes (as above) the technique is useful. Some implementations
forced evaluation from left-to-right as displayed and did not allow reverse flow
of a logic signal (in multi-branched rungs) to affect the output.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 13


Basics of PLC

How PLCs Work


A programmable logic controller is a specialized computer used to control
machines and processes. It therefore shares common terms with typical PCs
like central processing unit, memory, software and communications. Unlike a
personal computer though the PLC is designed to survive in a rugged industrial
atmosphere and to be very flexible in how it interfaces with inputs and outputs
to the real world.

The components that make a PLC work can be divided into three core areas.

 The power supply and rack


 The central processing unit (CPU)
 The input/output (I/O) section

PLCs come in many shapes and sizes. They can be so small as to fit in your
shirt pocket while more involved controls systems require large PLC
racks. Smaller PLCs (a.k.a. “bricks”) are typically designed with fixed I/O
points. For our consideration, we’ll look at the more modular rack based
systems. It’s called “modular” because the rack can accept many different types
of I/O modules that simply slide into the rack and plug in.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 14


Basics of PLC

The Power Supply and Rack

So let’s start off by removing all our modules which leaves us with a naked
PLC with only the power supply and the rack.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 15


Basics of PLC

The rack is the component that holds everything together. Depending on the
needs of the control system it can be ordered in different sizes to hold more
modules. Like a human spine the rack has a backplane at the rear which allows
the cards to communicate with the CPU. The power supply plugs into the rack
as well and supplies a regulated DC power to other modules that plug into the
rack. The most popular power supplies work with 120 VAC or 24 VDC
sources.

The CPU
The brain of the whole PLC is the CPU module. This module typically lives in
the slot beside the power supply. Manufacturers offer different types of CPUs
based on the complexity needed for the system.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 16


Basics of PLC

The CPU consists of a microprocessor, memory chip and other integrated


circuits to control logic, monitoring and communications. The CPU has
different operating modes. In programming mode it accepts the downloaded
logic from a PC. The CPU is then placed in run mode so that it can execute the
program and operate the process.

Since a PLC is a dedicated controller it will only process this one program over
and over again. One cycle through the program is called a scan time and
involves reading the inputs from the other modules, executing the logic based

Department of Electrical Engineering, IGEC, Sagar (M.P.) 17


Basics of PLC

on these inputs and then updated the outputs accordingly. The scan time
happens very quickly (in the range of 1/1000th of a second). The memory in
the CPU stores the program while also holding the status of the I/O and
providing a means to store values.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 18


Basics of PLC

I/O System
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.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 19


Basics of PLC

Inputs
Input devices can consist of digital or analog 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. Examples of analog devices are pressure transducers, flow meters and
thermocouples for temperature readings.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 20


Basics of PLC

Outputs
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
VDC or 4-20mA and are used to drive mass flow controllers, pressure
regulators and position controls.

Programming a PLC
In these modern times a PC with specially dedicated software from the PLC
manufacturer is used to program a PLC. The most widely used form of
programming is called ladder logic. Ladder logic uses symbols, instead of
words, to emulate the real world relay logic control, which is a relic from
the PLC's history. These symbols are interconnected by lines to indicate the
flow of current through relay like contacts and coils. Over the years the number
of symbols has increased to provide a high level of functionality.

The completed program looks like a ladder but in actuality it represents an


electrical circuit. The left and right rails indicate the positive and ground of a
power supply. The rungs represent the wiring between the different
components which in the case of a PLC are all in the virtual world of the
CPU. So if you can understand how basic electrical circuits work then you can
understand ladder logic.

In this simplest of examples a digital input (like a button connected to the first
position on the card) when it is pressed turns on an output which energizes an
indicator light.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 21


Basics of PLC

The completed program is downloaded from the PC to the PLC using a special
cable that’s connected to the front of the CPU. The CPU is then put into run
mode so that it can start scanning the logic and controlling the outputs.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 22


Basics of PLC

LADDER LOGIC

Ladder diagram, better known as ladder logic, is a programming language used


to program PLCs (programmable logic controllers). Programmable logic
controllers or PLCs are digital computers used to perform control functions,
usually for industrial applications. Of the various languages one can use to
program a PLC, ladder logic is the only one directly modeled after
electromechanical relay systems.

Let’s take a look at an example of ladder logic programming:

Department of Electrical Engineering, IGEC, Sagar (M.P.) 23


Basics of PLC

This ladder logic program is three rungs long. The program is “scanned” or
run by the CPU from left to right and top to bottom. The symbols placed
throughout the rungs are actually graphical instructions. The names for these
instructions are:

 XIC (Examine If Closed)


 XIO (Examine If Open)
 OTE (Output Energize).

First Rung
Looking at the first rung, notice the first two inputs I:1/1 and I:1/2. The
symbol is an XIC, and the I denotes that this is an input. This instruction
represents a physical input found on one of the discrete input cards.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 24


Basics of PLC

I:1 means that this input card has been placed in slot 1, directly adjacent to the
processor. The /1 indicates the bit of interest. Input cards have more than one
channel, and if the instruction specifies /1, the instruction accesses channel 1.

The second input represents channel 2 on the same card. An XIC instruction
really means true if closed. That is, this instruction will be true if the input
device it represents is closed. If an instruction is true it is highlighted in green.
The only way for an output to be energized is if a path of true instructions can
be traced from the left rail to the right rail. Therefore, the output on rung one
will be true because a path of true instructions, I:1/1 and I:1/2, exists. This is
effectively an AND operation.
The output in this case, B:0/1, is actually an internal bit stored in the PLC's
memory. That’s why it’s labeled B instead of O for “output.” These internal
bits work great when a certain state or set of inputs needs to be recorded
without actually turning on a physical output.

Second Rung
On the second rung, we have a third input labeled I:1/3 and our internal bit is
now used with an input instruction instead of an output.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 25


Basics of PLC

These two inputs are placed in parallel and represent an OR condition. O:2/1
is an output instruction that represents channel 1 on a physical discrete output
card placed in slot 2. This second rung could be rewritten without the internal
bit by replacing B:0/1 with the two inputs from rung one. Thus, output O:2/1
will be true if I:1/3 is true OR if both I:1/1 AND I:1/2 are true. This is the
basic structure of all ladder logic programs.

Third Rung
The third rung introduces the XIO instruction. An XIO instruction is best
described as true if open.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 26


Basics of PLC

The XIO will be true only if the input connected to it is open. In the case of
internal bits, this instruction is true if the internal bit is off. Therefore, because
I:1/1 and I:1/2 are both closed, the XIO instructions representing those inputs
are false. The XIO representing I:1/3 is true because the input device it
represents is open. Without a path of true instructions from left to right, the
output on rung three, O:2/2, is off.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 27


Basics of PLC

SYMBOLS IN LADDER LOGIC

Ladder logic symbols are the basic building blocks for ladder diagrams. Right
here you will find all the ladder diagram symbols which are described in IEC
61131-3. The symbols are available for download in all formats and in a PDF-
file.

It’s absolutely crucial to know about the symbols when you are working
with ladder logic. Each symbol represent a certain ladder instruction. In ladder
logic, these symbols are also known as bit logic instructions. The reason for this
is that the programming language ladder diagram is designed for boolean
signals.

Standard IEC Symbols for Ladder Diagrams

Ladder Logic Symbols

Department of Electrical Engineering, IGEC, Sagar (M.P.) 28


Basics of PLC

The ladder diagram graphical programming language is standardized by


the PLCopen organization, and thereby the symbols used in ladder diagrams.
Since ladder logic is a graphical programming language, the PLC programs
written in ladder logic are a combination of ladder logic symbols.

All the symbols can be found in the standard defining ladder diagram
programming: IEC 61131-3. But, those standards are quite expensive if you are
just looking for the symbols used in ladder diagrams.

Ladder Diagram Contact Symbols:

NO Contact | DWG | PNG

Department of Electrical Engineering, IGEC, Sagar (M.P.) 29


Basics of PLC

NC Contact |

Positive Transition-Sensing Contact

Department of Electrical Engineering, IGEC, Sagar (M.P.) 30


Basics of PLC

Negative Transition-Sensing Contact

Ladder Diagram Coil Symbols:

Coil

Department of Electrical Engineering, IGEC, Sagar (M.P.) 31


Basics of PLC

Negated Coil (NOT Coil)

SET Latch Coil

Department of Electrical Engineering, IGEC, Sagar (M.P.) 32


Basics of PLC

RESET Latch Coil

Positive Transition-Sensing Coil

Department of Electrical Engineering, IGEC, Sagar (M.P.) 33


Basics of PLC

Negative Transition-Sensing Coil

Variations in Ladder Logic Symbols


Although the ladder logic symbols are standardized in the IEC standard, the
symbols can vary. Depending on the PLC programming software you are using,
you will be presented with variations of the symbols.

But generally speaking the symbols are very similar, and the variations are
mostly superficial.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 34


Basics of PLC

PLC TOPICS

Features

Control panel with PLC (grey elements in the center). The unit consists of
separate elements, from left to right; power supply, controller, relay units for in-
and output.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 35


Basics of PLC

Control panel with a PLC user interface for thermal oxidizer regulation.

The main difference from most other computing devices is that PLCs are
intended-for and therefore tolerant-of more severe conditions (such as dust,
moisture, heat, cold), while offering extensive input/output (I/O) to connect the
PLC to sensors and actuators. PLC input can include simple digital elements
such as limit switches, analog variables from process sensors (such as
temperature and pressure), and more complex data such as that from positioning
or machine vision systems.[14] PLC output can include elements such as
indicator lamps, sirens, electric motors, pneumatic or hydraulic cylinders,
magnetic relays, solenoids, or analog outputs. The input/output arrangements
may be built into a simple PLC, or the PLC may have external I/O
modules attached to a fieldbus or computer network that plugs into the PLC.
Department of Electrical Engineering, IGEC, Sagar (M.P.) 36
Basics of PLC

Scan time
A PLC program generally loops i.e. executes repeatedly, as long as the
controlled system is running. At the start of each execution loop, the status of all
physical inputs are copied to an area of memory, sometimes called the "I/O
Image Table", which is accessible to the processor. The program then runs from
its first instruction rung down to the last rung. It takes some time for the
processor of the PLC to evaluate all the rungs and update the I/O image table
with the status of outputs.[15] Scan times of a few milliseconds may be
encountered for small programs and fast processors, but for older processors
and very large programs much longer scan times (on the order of 100 ms) may
be encountered. Excessively long scan times may mean the response of the PLC
to changing inputs or process conditions is too slow to be useful.
As PLCs became more advanced, methods were developed to change the
sequence of ladder execution, and subroutines were implemented.[16] This
enhanced programming could be used to save scan time for high-speed
processes; for example, parts of the program used only for setting up the
machine could be segregated from those parts required to operate at higher
speed. Newer PLCs now have the option to run the logic program
synchronously with the IO scanning. This means that IO is updated in the
background and the logic reads and writes values as required during the logic
scanning.
Special-purpose I/O modules may be used where the scan time of the PLC is too
long to allow predictable performance. Precision timing modules, or counter
modules for use with shaft encoders, are used where the scan time would be too
long to reliably count pulses or detect the sense of rotation of an encoder. This
allows even a relatively slow PLC to still interpret the counted values to control
a machine, as the accumulation of pulses is done by a dedicated module that is
unaffected by the speed of program execution on the PLC.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 37


Basics of PLC

Process of a scan cycle


There are 5 main steps in a scan cycle:

1. Reading inputs
2. Executing the program
3. Processing communication requests
4. Executing CPU diagnostics
5. Writing outputs

System scale
A small PLC will have a fixed number of connections built in for inputs and
outputs. Typically, expansions are available if the base model has insufficient
I/O.
Modular PLCs have a chassis (also called a rack) into which are placed modules
with different functions. The processor and selection of I/O modules are
customized for the particular application. Several racks can be administered by
a single processor, and may have thousands of inputs and outputs. Either a
special high speed serial I/O link or comparable communication method is used
so that racks can be distributed away from the processor, reducing the wiring
costs for large plants. Options are also available to mount I/O points directly to
the machine and utilize quick disconnecting cables to sensors and valves, saving
time for wiring and replacing components.

User interface
PLCs may need to interact with people for the purpose of configuration, alarm
reporting, or everyday control. A human-machine interface (HMI) is employed
for this purpose. HMIs are also referred to as man-machine interfaces (MMIs)
and graphical user interfaces (GUIs). A simple system may use buttons and
lights to interact with the user. Text displays are available as well as graphical
touch screens. More complex systems use programming and monitoring
software installed on a computer, with the PLC connected via a communication
interface.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 38


Basics of PLC

Communications
Many models of PLCs have built-in communications ports, using RS-232, RS-
422, RS-485, or Ethernet. Various protocols are usually included. Many of these
protocols are vendor specific.
Most modern PLCs can communicate over a network to some other system,
such as a computer running a SCADA (Supervisory Control And Data
Acquisition) system or web browser.
PLCs used in larger I/O systems may have peer-to-peer (P2P) communication
between processors. This allows separate parts of a complex process to have
individual control while allowing the subsystems to co-ordinate over the
communication link. These communication links are also often used
for HMI devices such as keypads or PC-type workstations.
Formerly, some manufacturers offered dedicated communication modules as an
add-on function where the processor had no network connection built-in.

Security
Prior to the discovery of the Stuxnet computer worm in June 2010, security of
PLCs received little attention. Modern PLCs generally contain a real-time
operating system such as OS-9 or VxWorks, and exploits for these systems exist
much as they do for desktop computer operating systems such as Microsoft
Windows. PLCs can also be attacked by gaining control of a computer they
communicate with.

Simulation
In order to properly understand the operation of a PLC, it is necessary to spend
considerable time programming, testing, and debugging PLC programs. PLC
systems are inherently expensive, and down-time is often very costly. In
addition, if a PLC is programmed incorrectly it can result in lost productivity
and dangerous conditions. PLC simulation software such as PLCLogix can save
time in the design of automated control applications and can also increase the
level of safety associated with equipment since many "what if" scenarios can be
tried and tested before the system is activated.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 39


Basics of PLC

Redundancy
Some special processes need to work permanently with minimum unwanted
down time. Therefore, it is necessary to design a system which is fault-tolerant
and capable of handling the process with faulty modules. In such cases to
increase the system availability in the event of hardware component failure,
redundant CPU or I/O modules with the same functionality can be added to
hardware configuration for preventing total or partial process shutdown due to
hardware failure.
The majority of PLCs include timer, counter, latching, and advanced logic
instructions.
The figure shows a slightly more complicated level-control program.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 40


Basics of PLC

This program uses two level switches, attached to a tank, to activate two
pumps that must begin operation one after the other rather than
simultaneously. Notice the same two XIC inputs control both pump A and B.
However, an internal bit is used with an XIC to control pump A and with an
XIO to control pump B. If rung 0000 is true, pump A gets latched using a
latch instruction.
If rung 0001 is true, pump B gets latched. Once a latch instruction goes true,
the output remains on until a complementary unlatch instruction is activated.
The last rung controls the pump toggle, using a one-shot and an XOR
instruction.
The one-shot, when activated, stays true for a single program scan, while the
XOR behaves as usual. This is an easy way to toggle a bit with a single input.

The instructions used here are still only a fraction of what's available. Ladder
logic can be used to build state machines, manipulate analog values, and even
perform PID control.

It uses long rungs laid out between two vertical bars representing system
power. Along the rungs are contacts and coils, modeled after the contacts and
coils found on mechanical relays. The contacts act as inputs and often
represent switches or push-buttons; the coils behave as outputs such as a light
or a motor.
Outputs don't have to be physical, though, and can represent a single bit in the
PLC's memory. This bit can then be used later on in the code as another input.
Contacts are placed in series to represent AND logic and in parallel when
using OR logic. As with real relays, there are normally open contacts and
normally closed contacts.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 41


Basics of PLC

MODES IN PLC PROGRAMMING

There are basically two modes of operation for plc processors program mode
and variations of run mode. Number of modes changes with the manufacturer.

There are key switches shown above that allow selecting the modes.

Program Mode:
The mode in which new programs are entered. The program mode also used to
edit or update existing program and used to upload, download files, document
program (print out). When the PLC is switched into the program mode, all
outputs from the PLC are forced off regardless of their rung logic status, and the
ladder I/O scan sequence is halted.

Run Mode:
The run mode is used to execute the user program. Input devices are monitored
and output devices are energized accordingly.
After entering all instruction to a PLC program, the processor is put into run
mode.

Test Mode:
This feature is often used after developing or editing a program to test the
program execution before allowing the PLC to operate real-world outputs.
Without energizing any output a new or modified program is tested with the
inputs.
There are different types of the test mode can include the single-step test mode,
which directs the processor to execute a selected single rung or group of rungs;
the single-scan test mode. which executes a single processor operating scan or

Department of Electrical Engineering, IGEC, Sagar (M.P.) 42


Basics of PLC

cycle; and the continuous-scan test mode, which directs the processor to
continuously run the program for checking or troubleshooting.

Remote Mode:
The Remote position gives remote access to a PLC to select the program and
run mode by a personal computer connected to the PLC processor. The remote
mode may be benefi cial when the controller is in a location that is not easily
accessible.

Operating Modes

Operating modes describe the behavior of the CPU at a particular point in time.
Knowing the operating modes of CPUs is useful when programming the startup,
testing the controller, and for troubleshooting.
The S7-300 and S7-400 CPUs can adopt the following operating modes:
 STOP
 STARTUP
 RUN
 HOLD

In STOP mode, the CPU checks whether all the configured modules or modules
set by the default addressing actually exist and sets the I/Os to a predefined
initial status. The user program is not executed in STOP mode.

In STARTUP mode, a distinction is made between the startup types "warm


restart," "cold restart," and "hot restart:"

Department of Electrical Engineering, IGEC, Sagar (M.P.) 43


Basics of PLC

 In a warm restart, program processing starts at the beginning of the


program with initial settings for the system data and user address areas (the
non-retentive timers, counters, and bit memory are reset).
 In a cold restart, the process-image input table is read in and the STEP 7
user program is processed starting at the first command in OB1 (also applies
to warm restart).
o Any data blocks created by SFC in the work memory are
deleted; the remaining data blocks have the preset value from the load
memory.
o The process image and all timers, counters, and bit memory
are reset, regardless of whether they were assigned as retentive or not.
 In a hot restart, the program is resumed at the point at which it was
interrupted (timers, counters, and bit memory are not reset). A hot restart is
only possible on S7-400 CPUs.

In RUN mode, the CPU executes the user program, updates the inputs and
outputs, services interrupts, and process error messages.
In HOLD mode, processing of the user program is halted and you can test the
user program step by step. The HOLD mode is only possible when you are
testing using the programming device.
In all these modes, the CPU can communicate via the multipoint interface
(MPI).

Other Operating Modes

If the CPU is not ready for operation, it is in one of the following modes:
 Off, in other words, the power supply is turned off.
 Defective, in other words, a fault has occurred.
To check whether the CPU is really defective, switch the CPU to STOP and
turn the power switch off and then on again. If the CPU starts up, display the
diagnostic buffer to analyze the problem. If the CPU does not start up it must
be replaced.
Department of Electrical Engineering, IGEC, Sagar (M.P.) 44
Basics of PLC

Operating Mode Transitions

The following figure shows the operating modes and mode transitions for S7-
300 and S7-400 CPUs:

The table shows the conditions under which the operating modes can change.

Transition Description
1. After you turn on the power supply, the CPU is in STOP
mode.
2.
The CPU changes to STARTUP mode:
After the CPU is changed to RUN using the key switch or by
the programming device.
After a startup triggered automatically by turning on the
power.
If the RESUME or START communication function is
executed.
In both cases the key switch must be set to RUN.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 45


Basics of PLC

3.
The CPU changes back to STOP mode when:
An error is detected during the startup.
The CPU is changed to STOP by the key switch or on the
programming device.
A stop command is executed in the startup OB.
The STOP communication function is executed.
4.
The CPU changes to HOLD mode
when a breakpoint is reached in the startup program.
5.
The CPU changes to STARTUP mode when the breakpoint in
a startup program was set and the
"EXIT HOLD" command was executed (test functions).
6.
The CPU changes back to STOP mode when:
The CPU is changed to STOP with the key switch or by the
programming device.
The STOP communication command is executed.
7.
If the startup is successful, the CPU changes to RUN.
8.
The CPU changes back to STOP mode when:
An error is detected in RUN mode and the corresponding OB
is not loaded.
The CPU is changed to STOP by the key switch or on the
programming device.
A stop command is edited in the user program.
The STOP communication function is executed.
9.
The CPU changes to HOLD mode when a breakpoint is
reached in the user program.
10.
The CPU changes to RUN mode when a breakpoint was set
and the "EXIT HOLD" command is executed.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 46


Basics of PLC

Operating Mode Priority


If a number of operating mode transitions are requested simultaneously, the
operating mode with the highest priority is selected. If, for example, the mode
selector is set to RUN and you attempt to set the CPU to STOP at the
programming device, the CPU will change to STOP because this mode has the
highest priority.

Priority
Highest STOP
HOLD
STARTUP
Lowest RUN

Department of Electrical Engineering, IGEC, Sagar (M.P.) 47


Basics of PLC

ADVANTAGES AND DISADVANTAGES OF


PROGRAMMABLE LOGIC CONTROLLER

Proper application of a PLC begins with an economical justification analysis.


The batch process in chemical, cement, food and paper industries are sequential
in nature, requiring time or event based decisions. PLCs are being used more
and more as total solutions to a batch problem in these industries rather than just
a tool.

In batch process savings are developed principally from reduced cycle time and
scheduling. Cycle automation provides rigid control enforcement to eliminate
human errors and to minimize manual interventions. Increased efficiency in
scheduling is to be expected with maximum utilization of equipment and
reduction of fluctuating demands on critical equipment.
In large process plants PLCs are being increasingly used for automatic start up
and shutdown of critical equipments. A PLC ensures that an equipment can not
be started unless all the permissive conditions for safe start have been
established. It also monitors the conditions necessary for safe running of the
equipment and trip the equipment whenever any abnormality in the system is
detected.

The PLC can be programmed to function as an energy management system for


boiler control for maximum efficiency and safety. In the burner management
system it can be used to control the process of purging, pilot light off, flame
safety checks, main burner light off and valve switching for changeover of
fuels.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 48


Basics of PLC

Basic Advantages-
1. Very fast.
2. Easy to change logic i.e. flexibility.
3. Reliable due to absence of moving parts.
4. Low power consumption.
5. Easy maintenance due to modular assembly.
6. Facilities in fault finding and diagnostic.
7. Capable of handling of very complicated logic operations.
8. Good documentation facilities.
9. Easy to couple with the process computers.
10.Analog signal handling and close loop control programming.
11.Counter, timer and comparator can be programmed.
12.Ease operator interface due to colourographic and advisory system
introduction.

Basic Disadvantages-
A traditional PLC is basically no different than a "PC" running a script
interpreter. The only real distinguishing factor is in the type of I/O available and
the communications. Other "variables" include the amount of memory and
storage.

With this in mind, the question becomes really not so much "what are the
disadvantages of a PLC", but more "How do I determine how much computing
power and I/O do I need". With software based logic controllers (WinAC RTX,
Twincat) becoming more common, the lines are blurred even further. In this
instance you can not only have your "PC running a script interpreter" but also
other programs that access the I/O to control other parts of the process.

The lines blur even further with Twincat 3, where you not only have the "logic
interpreter" and traditional PLC languages, but can also put "C" code along side
it.

My personal feeling is that the only thing that really holds back 'soft controllers"
is their reliance on (unstable or insecure) Windows instead of Linux, but I
digress.
Department of Electrical Engineering, IGEC, Sagar (M.P.) 49
Basics of PLC

Keeping this in mind, it really is not a question of "disadvantages" but more


knowing what you need to do in your process and selecting the right "tool".

Let me give you an example. I am building a water filtration system with its
own pump and a UV sterilizer.

All I need to do is ensure that the sterilizer is on before the pump starts. This is
very basic logic. My inputs are verifying the lamp is working, and a switch to
turn it on. Outputs are pump and lamp.

For this a programmable relay (which "technically speaking IS a PLC) is plenty


of power for the job. On the other hand, I have had tire testing machines with
control and analysis jobs.

Here a soft controller is in order as the analysis portion can be running in a


separate program from the I/O controller.

There both systems communicate with each other to carry out the task at hand
in a single (hardware) "computer". Carried a step further, the only reason for the
two separate programs is the speed of the "interpreter".

Another manufacturer of the same type of machine does it all within one "soft
controller" (Twincat) because it is fast enough to carry out the computations and
data analysis in the same software package.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 50


Basics of PLC

AREAS OF APPLICATION OF PLC

PLCs are used in various applications in industries such as the steel industry,
automobile industry, chemical industry and the energy sector. The scope of
PLCs dramatically increases based on the development of all the various
technologies where it is applied.
In the Travel Industry, PLC has been used to monitor the safety control system
and to operate lifts and escalators.

 Glass industry
PRCs controllers have been in use in the glass industry for decades. They are
used largely to control the material ratio as well as to process flat glasses. The
technology has been advancing over the years and this has created an increased
demand for the PLC control mode for use in the glass industry.
The production of glass is an elaborate and sophisticated process so the
companies involved often use PLCs with the bus technology in its control
mode.
Overall, the PLC is applied in both analogue data recording in the glass
production, and in digital quality and position control.

 Paper industry
In the paper industry, PLCs are used in various processes. These include
controlling the machines that produce paper products at high speeds.
For instance, a PLC controls and monitors the production of book pages or
newspapers in offset web printing.

 Cement manufacturing
Manufacturing cement involves mixing various raw materials in a kiln. The
quality of these raw materials and their proportions significantly impact the
quality of the final product. To ensure the use of the right quality and quantities
of raw materials, the accuracy of data regarding such process variables is of the
essence.

A distributed control system comprised of PLC in its user mode and a


configuration software are used in the industry’s production and management
processes. The PLC in particular, controls ball milling, coal kiln and shaft kiln.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 51


Basics of PLC

Other examples of PLC programming applications that are in use in various


industries today include water tank quenching systems in the aerospace sector,
filling machine control system in the food industry, – industrial batch washing
machine control and closed loop textile shrinkage systems.

PLC is also used in the coal-fired boiler fan change-over system in hospitals,
corrugation machine control system and silo feeding as well as injection
moulding control systems in the plastic industry.

The programmable logic controllers at Mobile Automation includes a huge


variety from various top industry manufacturers such as Allen-Bradley and
Omron. All these can be put to various applications in key departments of your
business to standardise the production process and increase your return on
investment.

Department of Electrical Engineering, IGEC, Sagar (M.P.) 52

Вам также может понравиться