Академический Документы
Профессиональный Документы
Культура Документы
CHAPTER 1
INTRODUCTION TO P.L.C
Automation
The word Automation is drived from greek words Auto (self) and Matos (moving).
Types of Automation
Two common types of automation are feedback control, which is usually continuous
and involves taking measurement using sensors and making calculated adjustments to
keep the measured variables within a set range, and sequence control, in which a
Feedback control is called closed loop while non-feedback control is called open
loop.
Manual Control
Pneumatic control
Industrial automation with it machines and process control, had its orign in 1920 with
1
Software Training
The contactor and relays together with hard wire timer and counters were used to
In 1960s the advent of electronics, logics gates started replacing relays and auxiliary
contactor in control circuit. The hardware timer and counters are replaced by electronics
timer counters.
In 1970s with the coming microprocessor and associated peripheral chips, the whole
process control and automation underwent a radical change. Instead of achieving the
by PLC through a program or software. The PLC in recent year experienced in an under
Advantages of Automation
2
Software Training
Disadvantages of Automation
of automating a process may exceed the cost saved by the automation itself.
solid-state members of the computer family, using integrated circuits instead of electro
These advances not only affect programmable controller design, but also the
(physical components) and software (control program) upgrades. The following list
3
Software Training
Faster scan times are being achieved using new, advanced microprocessor and
electronic technology.
Small, low-cost PLCs, which can replace four to ten relays, now have more
cost.
processing.
fastresponse inputs.
These families consist of a product line that ranges from very small microcontrollers,
with as few as 10 I/O points, to very large and sophisticated PLCs, with as many as
4
Software Training
their own failures and those of the machine or process. These enhancements have made
quality and productivity. Despite the fact that programmable controllers have become
much more sophisticated, they still retain the simplicity and ease of operation that was
PRINCIPLES OF OPERATION
The central processing unit (CPU) governs all PLC activities. The following three
The processor
5
Software Training
The operation of a programmable controller is relatively simple. The input/ output (I/O)
system is physically connected to the field devices that are encountered in the machine
or that are used in the control of a process. These field devices may be discrete or analog
input/output devices, such as limit switches, pressure transducers, push buttons, motor
Since its inception, the PLC has been successfully applied in virtually every segment of
industry, including steel mills, paper plants, food-processing plants, chemical plants,
and power plants. PLCs perform a great variety of control tasks, from repetitive
control.
This chart is not definitive, but for practical purposes, it is valid. The PLC market can
1. micro PLCs
6
Software Training
2. small PLCs
3. medium PLCs
4. large PLCs
CHAPTER 2
HARDWARE INTRODUCTION
HARDWARE INTRODUCTION
Chassis or backplane
Power supply
Programming software that runs in a PC In addition to these 5, most PLCs also have:
A network interface
7
Software Training
The central processing unit, or CPU, is the most important element of a PLC. The CPU
forms what can be considered to be the brain of the system. The three components of
the processor
Fig. illustrates a simplified block diagram of a CPU. CPU architecture may differ from
one manufacturer to another, but in general, most CPUs follow this typical
threecomponent organization. Although this diagram shows the power supply inside the
CPU block enclosure, the power supply may be a separate unit that is mounted next to
8
Software Training
PROCESSORS
The system power supply plays a major role in the total system operation. In fact, it can
responsibility is not only to provide internal DC voltages to the system components (i.e.,
processor, memory, and input/output interfaces), but also to monitor and regulate the
supplied voltages and warn the CPU if something is wrong. The power supply, then, has
9
Software Training
the function of supplying well-regulated power and protection for other system
components.
Usually, PLC power supplies require input from an AC power source however, some
PLCs will accept a DC power source. Those that will accept a DC source are quite
appealing for applications such as offshore drilling operations, where DC sources are
commonly used. Most PLCs, however, require a 120 VAC or 220 VAC power source,
This section consists of limit switches, photoelectric sensors, push buttons etc. These
incoming hardware devices provides input signal to the PLC. These devices are also
called as field input devices. The term field input" is used because this device provides
incoming signals that are tangible items that you physically connect to PLC.
Input section
First, the physical screw terminals, where incoming signal (i.e. input), from the
field input devices (e.g. limit switch) are connected to the PLC.
The second portion of the input section is the PLC's internal conversion
electronics. This section converts and isolates the high-voltage input level from
field input devices. High-voltage signals from field input devices are converted
to +5 volts direct current (VDC) for a valid ON input signal, and a 0 VDC for a
valid OFF input signal. Incoming signal conversion and isolation is necessary
10
Software Training
signal may be of 24 VDC, 120 volts alternating current (VAC), or 220 VDC. If
120 VAC signal is inputted, for example, into 5 VDC, circuit will quickly
Programmer
Output section
The ON or OFF status of the inputs are read and the information is used to solve
the user ladder program and the updated signals is sent to the output section. The
output section is simply a series of switches, one for each output point, that are
controlled by CPU and are used to turn output field devices ON or OFF.
The devices that are controlled by the PLC's output section screw terminals are the
In a fixed PLC, all of its components like, the input section, power supply, CPU
and associated memory and output section - is built into one self - contained unit.
11
Software Training
All the input and output screw terminals are built into the PLC package and are
fixed, which cannot be moved i.e. not removable. This type of PLC is also called
as a packaged controller.
The modular PLC comes as separate pieces. All the parts of modular PLC are
purchased separately i.e. piece by piece. Its like customizing , we may have 2
many separate input modules , many separate output modules and a selection of
PLC inputs
The term sourcesink refers to the direction of current flow into or out of the input
Source input
When the PLC is connected for source inputs, then the input signal current flows into
the X inputs
12
Software Training
Sink input
When the PLC is connected for source inputs, then the input signal current flows into
the X inputs
PLC outputs
There are three different types of output for PLCs, these are:
1. Relay.
3. Transistor.
13
Software Training
Relay
This is the most commonly used type of output. The coils and the contacts of the output
relays enable electrical isolation to be obtained between the internal PLC circuitry and
the external output circuitry. Dependent on a number of factors, i.e. the supply voltage,
the type of load, i.e. resistive, inductive or lamp, the contact life, the maximum-switched
current per individual output is 2 A. The PLC will provide groups of 4, 8 or 16 outputs
each with a common. The commons are logically numbered COM1, COM2, etc. and
Triac
The TRIAC is an AC switch, which basically consists of two thyristors connected back
to back. Since the TRIAC output is solid state, the lifetime of a TRIAC output is far
longer than that of the relay output. The voltage range of these devices is 85240V AC
and each output can switch up to a maximum of 0.35 A. As with all other output
configurations, the physical output is isolated by a photo coupler. The response of the
TRIAC when turning ON is faster than the Relay, i.e. 1 msec but the OFF times are
Transistor
The transistor outputs are used, where a very fast switching time is required. The
switching time of the transistor outputs, whether they are Sink or Source outputs, is <0:2
14
Software Training
CHAPTER 3
PROGRAMMING INTRODUCTION
15
Software Training
Ladder logic is the main programming method used for PLCs. As mentioned before,
ladder logic has been developed to mimic relay logic. The decision to use the relay logic
diagrams was a strategic one. By selecting ladder logic as the main programming
method, the amount of retraining needed for engineers and tradespeople was greatly
reduced.
The ladder diagram has and continues to be the traditional way of representing electrical
in such a way that the activation, or turning ON, of one device will turn ON another
16
Software Training
The original ladder diagrams were established to represent hardwired logic circuits used
to control machines or equipment. Due to wide industry use, they became a standard
way of communicating control information from the designers to the users of equipment.
it was easy to use and interpret and was widely accepted in industry. Note that the real
connected to input and output interfaces, while the ladder program is implemented in a
mentioned.
IN PLCS
similar fashion. For example, lets take relay which has two sets of contacts, one
normally open contact (A-1) and one normally closed contact (A-2). If relay coil A is
17
Software Training
not energized (i.e., it is OFF), contact A-1 will remain open and contact A-2 will remain
closed. Conversely, if coil A is energized, or turned ON, contact A-1 ill close and contact
A-2 will open. The blue lines highlighting the coil and contacts denote an ON, or closed,
condition.
Standard configuration for relay coil A with normally open contact A-1 and normally closed contact A-2.
Remember that when a set of contacts closes, it provides power flow, or continuity, in
the circuit where it is used. Each set of available coils and its respective contacts in the
18
Software Training
reference address by which they are identified. For instance, coil 10 will have normally
open and normally closed contacts with the same address (10) as the coil. Note that a
PLC can have as many normally open and normally closed contacts as desired; whereas
Represents any input to the control logic. An input can be a connected switch closure or
sensor, a contact from a connected output, or a contact from an internal output. When
interpreted, the referenced input or output is examined for an ON condition. If its status
is 1, the contact will close and allow current to flow through the contact. If the status of
the referenced input/output is 0, the contact will remain open, prohibiting current from
Represents any input to the control logic. An input can be a connected switch closure or
sensor, a contact from a connected output, or a contact from an internal output. When
interpreted, the referenced input/output is examined for an OFF condition. If its status
is 0, the contact will remain closed, thus allowing current to flow through the contact. If
the status of the referenced input/output is 1, the contact will open, prohibiting current
19
Software Training
Output
Represents any output that is driven by some combination of input logic. An output can
is TRUE (all contacts closed), the referenced output is energized (turned ON).
NOT output.
Represents any output that is driven by some combination of input logic. An output can
is TRUE (all contacts closed), the referenced output is de-energized (turned OFF).
LOGIC FUNCTIONS
The binary concept shows how physical quantities (binary variables) that can exist in
one of two states can be represented as 1 or 0. Now, you will see how statements that
combine two or more of these binary variables can result in either a TRUE or FALSE
and NOT. Each function has a rule that determines the statement outcome (TRUE or
20
Software Training
Figure shows a symbol called an AND gate, which is used to graphically represent the
AND function. The AND output is TRUE (1) only if all inputs are TRUE (1).
THE OR FUNCTION
Figure shows the OR gate symbol used to graphically represent the OR function. The
21
Software Training
Figure illustrates the NOT symbol, which is used to graphically represent the NOT
function. The NOT output is TRUE (1) if the input is FALSE (0). Conversely, if the
output is FALSE (0), the input is TRUE (1). The result of the NOT operation is always
22
Software Training
(a) NOT circuit (b) NOT logic with a ladder rung (c) high output when no input to A
There are often situations where it is necessary to hold an output energized, even when
the input ceases. A simple example of such a situation is a motor, which is started by
pressing a push button switch. Though the switch contacts do not remain closed, the
motor is required to continue running until a stop push button switch is pressed. The
term latch circuit is used for the circuit used to carry out such an operation. It is a self-
maintaining circuit in that, after being energized, it maintains that state until another
input is received.
23
Software Training
An example of a latch circuit is shown in Figure. When the input A contacts close, there
Latched circuit
with the output closes. These contacts form an OR logic gate system with the input
contacts. Thus, even if the input A opens, the circuit will stillmaintain the output
energized.
The only way to release the output is by operating the normally closed contact B. As an
and start push button switches and for which one signal light must be illuminated when
the power is applied to the motor and another when it is not applied. shows the ladder
24
Software Training
Note that the stop contacts X401 are shown as being programmed as open. If the stop
switch used is normally closed then X401 receives a start-up signal to close. This gives
internal memory locations that are not inputs or outputs. These are sometimes referred
to these as bit memory. These have the same properties as outputs but they only exist
Triggers in PLC
In electronics, a signal edge is a transition in a digital signal either from low to high (1
to 0).
25
Software Training
It is called an edge because the square wave which represents a signal has edges at
those points. It is used to generate a pulse. It generate a pulse of 1/10*6 (0.000001) usec.
A rising edge is the transition from low to high. It is also named positive edge. When a
circuit is rising edge triggered, it becomes active when its clock signal goes from low to
A falling edge is a high to low transition.it is also known as negative edge. When a
circuit is falling edge triggered, it becomes active when clock signal goes from high to
26
Software Training
Timers in PLC
Timers are used in applications to add a specific amount of delay to an output in the
program. Applications of PLC timers are innumerable, since they have completely
used to introduce a 0.01 second delay in a control program. The program may require
such a delay because the PLC turns ON its outputs very quickly as compared to the
hardwired relay system it is replacing. This small delay will slow down the response of
The time base is the resolution, or accuracy, of the timer. For instance, if a timer must
time a 10 second event, the user must choose the number of times the time base must be
10 sec 10 1
1000 0.01
An ON-delay energize timer (TON) output instruction either provides time delayed
action or measures the duration for which some event occurs. Once the rung has
27
Software Training
continuity, the timer begins counting time-based intervals (ticks) and counts down until
the accumulated time equals the preset time. When these two values are equal, the timer
energizes the output and closes the timed out contact associated with the output. The
timed contact can be used throughout the program as either a normally open or normally
closed contact. If logic continuity is lost before the timer times out, the timer resets the
ON-delay energize timer instruction, except that the timers output is already ON. This
instruction de-energizes the output once the rung has continuity and the time interval
has elapsed (accumulated register value = preset register value). PLC manufacturers
program one from the other. Fig, illustrates a timing diagram for both types of ON-delay
timer instructions.
28
Software Training
Timing diagram for (a) an ON-delay energize timer and (b) an ON-delay de-energize timer.
An OFF-delay energize timer (TOF) output instruction provides time delayed action. If
the control line rung does not have continuity, the timer begins counting time-based
intervals until the accumulated time value equals the programmed preset value. When
these values are equal, the timer energizes the output and closes the timed-out contact
associated with the output. The timed contact can be used throughout the program as
either a normally open or normally closed contact. If logic continuity occurs before the
29
Software Training
counterpart; however, this timers output is ON and will be de-energized once the rung
loses continuity and the time interval has elapsed (accumulated register value = preset
register value). Like ON-delay timers, PLC manufacturers usually provide either
OFFdelay energize or de-energize timers. Fig, shows timing diagrams for both types of
OFFdelay timers.
Timing diagram for (a) an OFF-delay energize timer and an OFF-delay de-energize timer.
A retentive ON-delay timer (RTO) output instruction is used if the timers accumulated
value must be retained even if logic continuity or system power is lost. If any rung path
30
Software Training
has logic continuity, the timer begins counting time based intervals until the
accumulated time equals the preset value. The accumulated register retains this
accumulated value, even if power or logic continuity is lost before the timer has timed
out. When the accumulated time equals the preset time, the timer energizes the output
and turns ON (closes) the timed-out contact associated with the output. Again, these
timer contacts can be used throughout the program as normally open or normally closed
contacts. A retentive timer reset instruction resets a retentive timers accumulated value.
A retentive timer reset (RTR) output instruction is the only way to automatically reset
the accumulated value of a retentive timer. If any rung path has logic continuity, then
this instruction resets the accumulated value of its referenced retentive timer to zero.
Note that the retentive timer reset address will be the same as the retentive timer output
instruction it is resetting.
Example:-Lets write a ladder logic program to control a card operated door lock. The
using two switches: (a) from outside the room door, the signal to activate the solenoid
comes from the Number-Pad, if the correct sequence of code numbers is pressed; (b)
From inside the room door, there is just a simple push button, which can be used to
disengage the lock. Upon activation, the door stays unlocked for 5 seconds, and then
locks again.
31
Software Training
I:0/1 Number Pad Signal to open door from outside the room
I:0/2 Push Button signal to open door from inside the room
O:0/1 Solenoid to unlock door
COUNTER IN PLC
Counter instructions are used to count events, such as parts passing on a conveyor, the
number of times a solenoid is turned ON, etc. Counters, along with timers, must have
two values, a preset value and an accumulated value. These values are stored in register
or word locations in the data table. The preset value is the target number of ticks or
counting numbers that must be achieved before the timer or counter turns its output ON.
The accumulated value is the current number of ticks (timer) or counts (counter) that
have elapsed during the timer or counter operation. The preset value is stored in a preset
UP COUNTER (CTU)
An up counter (CTU) output instruction adds a count, in increments of one, every time
its referenced event occurs. In a control application, this counter turns a device ON or
OFF after reaching a certain count (i.e., the p in the preset register). Also, this counter
32
Software Training
can keep track of the number of parts (e.g., filled bottles, machined parts, etc.) that pass
a certain point. An up counter increases its accumulated value (the count value in its
accumulated register) each time the up-count event makes an OFF-to-ON transition.
When the accumulated value reaches the preset value, the counter turns ON the output,
finishes the count, and closes the contact associated with the referenced output. After
the counter reaches the preset value, it either resets its accumulated register to zero or
continues its count for each OFF-to-ON transition, depending on the controller. In the
A down counter (CTD) output instruction decreases the count value in its accumulated
register by one every time a certain event occurs. In practical use, a down counter is
used in conjunction with an up counter to form an up/down counter, given that both
counters have the same reference registers. In an up/down counter, the down counter
33
Software Training
COUNTER RESET
A counter reset (CTR) output instruction resets up counter and down counter
accumulated values to zero. When programmed, a counter reset coil has the same
reference address as the corresponding up/down counter coils. If the counter reset rung
condition is TRUE, the reset instruction will clear the referenced address. The reset line
in a block format counter instruction sets the accumulated count to zero (accumulated
register = 0).
I:0/0 Conveyor ON,I:0/1 Photo switch,I:0/2 Operator controlled Push Button to restart conveyor
,O:0/1 Conveyor belt,O:0/2 Light Indicator
ARITHMETIC INSTRUCTIONS
subtraction, multiplication, and division. In addition to these four math functions, large
34
Software Training
PLCs may also include square root operations. Like other instructions, arithmetic
instructions may be in either the basic ladder format or the functional block format;
however, operation in either format is essentially the same. Most arithmetic instructions
require three reference registers, which define the two operand registers and the
ADDITION IN PLC
An addition (ADD) functional block adds two values stored within the controller and
places the sum in a specified register. The operand values can be fixed constants, values
If A closes, the contents of register X and register Y are added and stored in register Z.
If A does not close, no addition is performed. If contact A was omitted, the addition
35
Software Training
SUBTRACTION IN PLC
finds the difference between two values and stores the result in a register.
The control input in a subtraction block operates the same way as in an addition block.
When the rung condition is logic 1, the controller performs the block operation. Three
registers hold the data during the operation. The values that these registers can hold vary
MULTIPLICATION IN PLC
A multiplication (MUL) ladder instruction multiplies the values from two operand
registers. It then uses two other registers to hold the result of the multiplication. The
reason why the result is held in two registers is that, normally, the product of two 4-digit
numbers is an 8-digit number. Some controllers provide two adjacent registers in which
to store the result. One or two output coils reference the two result registers in a
multiplication instruction, depending on the PLC. GET instructions access the operand
registers
36
Software Training
DIVISION IN PLC
A division (DIV) functional block finds the quotient of two numbers, storing the result
in one or more registers. Fig:-illustrates this type of functional block. The division
calculation begins after the control rung has continuity. Register 1000 (the dividend) is
divided by the contents of register 1001 (the divisor), and the result is stored in two
Division functional
A move (MOV) functional block instruction transfers information from one location to
37
Software Training
PLC automatically converts the copied data to the proper numerical format for the
destination location.
CHAPTER 4
SOME PROGRAMS
I0 I1 Q0 Q1
0 0 1 1
0 1 0 1
1 0 0 1
1 1 1 0
38
Software Training
I0 I1 I2 Q0 Q1 Q2
1 1 0 1 0 1
1 0 1 1 1 1
39
Software Training
40
Software Training
4: Door simulator
Parameters
41
Software Training
Make this program with the help of memory bit, latch and Timer on
42
Software Training
43
Software Training
44
Software Training
45