Sei sulla pagina 1di 171

Rayat Shikshan Sansthas

KARMAVEER
BHAURAO PATIL
POLYTECHNIC,
SATARA
PLC Hardware &
Programming
Department Of Electronics And
Telecommunication Engineering
Control System and
PLC
EJ5G Subject Code: 17536
Third Year Entc

Amit Nevase
Lecturer,
Department of Electronics & Telecommunication
Engineering,
Karmaveer Bhaurao Patil Polytechnic, Satara
Objectives
The student will be able to:

criteria.

parts of PLC.

Draw ladder diagrams to program PLC

3/12/17 Amit Nevase 3
Teaching & Examination Scheme

Teaching Scheme Examination Scheme

PAPER
TH TU PR TH PR OR TW TOTAL
HRS

Two tests each of 25 marks to be conducted as per

the schedule given by MSBTE.
Total of tests marks for all theory subjects are to be
converted out of 50 and to be entered in mark sheet
under the head Sessional Work (SW).

3/12/17 Amit Nevase 4

Module I Introduction to Control
System
Introduction to Control systems
(4 Marks)
Control System Definition and Practical Examples
Classification of Control System : Open Loop and Closed Loop
Systems Definitions, Block diagrams, practical examples, and
Comparison, Linear and Non-linear Control System, Time
Varying and Time In-varying Systems
Servo System : Definition, Block Diagram, Classification (AC and
DC Servo System), Block diagram of DC Servo System.
Laplace Transform and Transfer Function
(4 Marks)
Laplace Transform : Signifiance in Control System
Transfer Function : Definition, Derivation of transfer functions
for Closed loop Control System and Open Loop Control System,
Differential Equations and transfer functions of RC and RLC
Circuit
Block
3/12/17 Diagram Algebra
Amit Nevase 5
Module II Time Response
Analysis
Time Domain Analysis
(4 Marks)
Standard Test Inputs : Step, Ramp, Parabolic and Impulse, Need,
Significance and corresponding Laplace Representation
Poles and Zeros : Definition, S-plane representation
First and Second order Control System
(8 Marks)
First Order Control System : Analysis for step Input, Concept of
Time Constant
Second Order Control System : Analysis for step input, Concept,
Definition and effect of damping
Time Response Specifications
(8 Marks)
Time Response Specifications ( no derivations )
Tp, Ts, Tr, Td, Mp, ess
3/12/17 problems on time
Amit Nevase response
6
specifications
Module III Stability

Introduction to Stability
(4 Marks)
Definition of Stability, Analysis of stable, unstable,
critically stable and conditionally stable
Relative Stability
Root locations in S-plane for stable and unstable
system

Rouths Stability Criterion

(8 Marks)
Rouths Stability Criterion : Different cases and
conditions
Statement Method Amit Nevase
3/12/17 7
Module IV Control Actions

Process Control System

(4 Marks)
Process Control System Block diagram, explanation
of each block

Control Actions
(8 Marks)
Discontinuous Mode : On-Off Controller, Equation,
Neutral Zone
Continuous modes: Proportional Controller (offset,
proportional band), Integral Controllers, Derivative
Controllers output equations, corresponding
Laplace transforms, Response
3/12/17 Amit Nevase
of P, I, D controllers8

Module V PLC Fundamentals
Introduction
(4 Marks)
Evolution of PLC in automation, need and benefits of
PLC in automation
Block Diagram of PLC
(12 Marks)
Block diagram and description of different parts of
PLC -
CPU Function, Scanning cycle, speed of execution,
Power supply function,
Memory function , organization of ROM and RAM
Input modules function, different input devices
used with PLC and their uses
Output modules function,
3/12/17 Amit Nevase different output devices
9
Module VI PLC Hardware and
Programming
PLC Hardware
(8 Marks)
Discrete Input Modules Block diagram, typical wiring details,
Specifications of AC input modules and DC input modules.
Sinking and sourcing concept in DC input modules
Discrete Output Modules Block diagram, typical wiring details,
Specifications of AC output modules and DC output modules.
details and specifications
PLC Programming
(16 Marks)
PLC Instruction Set : Relay instructions, timer instructions,
counter instructions, data handling instructions, logical and
comparison instructions
PLC programming examples based on above instruction using
3/12/17 Amit Nevase 10
Module-VI
PLC Hardware &
Programming
Specific Objectives

of PLC.

PLC system.

3/12/17 Amit Nevase 12

Module VI PLC Hardware and
Programming
PLC Hardware
(8 Marks)
Discrete Input Modules Block diagram, typical wiring
details, Specifications of AC input modules and DC input
modules. Sinking and sourcing concept in DC input
modules
Discrete Output Modules Block diagram, typical wiring details,
Specifications of AC output modules and DC output modules.
details and specifications
PLC Programming
(16 Marks)
PLC Instruction Set : Relay instructions, timer instructions,
counter instructions, data handling instructions, logical and
comparison instructions
PLC programming examples
3/12/17 based on above instruction using
Amit Nevase 13
Input Modules
Input modules serve as the link between field devices
and the PLCs CPU.
Each input module has a terminal block for attaching
input wiring from each individual field input device.
Typically input modules have either 8, 16 or 32 input
terminals.
The main function of an input module is to take the field
device input signal, convert it to a signal level that the
CPU can work with, electrically isolate it, and send the
signal, by the way of the backplane board, to the CPU.

3/12/17 Amit Nevase 14

Discrete Input Modules

or DC.

3/12/17 Amit Nevase 15

Discrete Input Modules
The most common types are listed below:
AC Input Modules DC Input Modules
24 VAC 24 V dc

48 VAC 48 V dc

24 VAC/DC 5/12 V dc TTL

3/12/17 Amit Nevase 16
Typical Wiring Details

Input Input
Modul Modul
e e

24 Volts
Common Common
230 Volts

Common Common
120 Volts

3/12/17 Amit Nevase 17

Block diagram of AC input module

Input Bridge Noise & Threshold Input

Optical
Signal Rectifier Debounce Detector Isolation
Logic CPU Status
Filter Table

LED

3/12/17 Amit Nevase 18

AC Input Module Specifications

3/12/17 Amit Nevase 19

AC Input Module Specifications

Points per common: This is the number of

input points that share the same common
connection. As an example, one 16 point
input module could have all input points
sharing one common, and a different 16 point
input module might have two groups of 8
input points. Each group of 8 would have its
own separate common.

3/12/17 Amit Nevase 20

AC Input Module Specifications
Backplane Current Draw: Each module takes
power from the PLCs power supply to operate the
electronics on the module. This specification will
Maximum signal delay: Signal delay is the time
it takes for the PLC to pick up the field input
signal, digitize it, and store it in the memory. This
specification is usually listed for signal turning on
and for a signal turning off.

3/12/17 Amit Nevase 21

AC Input Module Specifications
Nominal input current: this is the current drawn
by an input point at nominal input voltage.
Maximum Inrush Current: this is the maximum
inrush current the module can handle.
Maximum off state current: this is the
maximum amount of current, typically from
leakage from a solid state input device, that a
module can accept while remaining in an OFF
state.

3/12/17 Amit Nevase 22

Block diagram of DC input module

+
Input Power Noise & Threshold Optical Input
SignalConversion Debounce Detector Isolation Logic CPU Status
- Filter Table

LED

3/12/17 Amit Nevase 23

DC Input Module Specifications
Maximum Off state current: This is the

OFF state.

Sinking/Sourcing

Input
Device
+ +

Input Input
Module Module

- -
Input
Device
(a) (b)

Sinking/Sourcing

Output Output
Module Module

- +

Output Output
(c) (d)

3/12/17 Amit Nevase 26

Module VI PLC Hardware and
Programming
PLC Hardware
(8 Marks)
Discrete Input Modules Block diagram, typical wiring details,
Specifications of AC input modules and DC input modules.
Sinking and sourcing concept in DC input modules
Discrete Output Modules Block diagram, typical wiring
details, Specifications of AC output modules and DC
output modules.
details and specifications
PLC Programming
(16 Marks)
PLC Instruction Set : Relay instructions, timer instructions,
counter instructions, data handling instructions, logical and
comparison instructions
PLC programming examples
3/12/17 based on above instruction using
Amit Nevase 27
Output Modules
Output modules serve as the link between the PLCs
microprocessor and hardware field devices.
Each output module has a terminal block for attaching
output wiring to go to each individual field output device.
Typical output modules have either 8, 16 or 32 output
terminals.
The output signal once received from the CPU, must be
stored before being sent to each output modules output
screw terminals.
The storage area for output signals is called the output
status file.
3/12/17 Amit Nevase 28
Discrete Output Modules
Much like discrete inputs, discrete outputs
are the most commonly used type.
Discrete output modules simply act as
switches to control output field devices.
They fall into two classifications: solid state
switching and relay output switching.

3/12/17 Amit Nevase 29

Common Discrete Output Modules
Discrete Output Modules

Solid State Outputs Relay Outputs

DC output Relay Output
AC output Modules
Modules modules
12, 24, 48 VAC TTL Level Relay Output
Isolated relay
120 VAC 12, 24, 48 V dc
output
230 VAC 120 V dc Relay output

230 V dc
24 V dc, sink
24 V dc, source
3/12/17 Amit Nevase 30
Typical Wiring Details of Output
Module

Output
Module
Output 2

Output 3

Output 4

Output 5
120 VAC
Signal From
CPU operates switch COM

User supplied
Power for
Field devices

3/12/17 Amit Nevase 31

Block diagram of AC output Module

Fuse
Signal Latch Triac Controlled
Optical Filter
From Logic Switching Device
Isolation
CPU Circuit Circuit

LED

3/12/17 Amit Nevase 32

Block diagram of AC output Module

3/12/17 Amit Nevase 33

Solid State Output Switching

In solid state AC output module, a triac is

used to switch the AC high voltage and
current controlling the ON or OFF state of
the field hardware device. A triac is a solid
state device used to switch AC.

3/12/17 Amit Nevase 34

Relay Output Switching
Relay output modules are also known as contact or

AC or DC loads, usually relay outputs are used to

switch small currents at low voltages, to multiplex
analog signals, and to interface control signals to
variable speed drives.

one for each output point, to switch the output signal

from the output status file.
3/12/17 Amit Nevase 35
Relay Output Switching
Commo
n to L-1 L-2
other Outpu
points t
Modul
e

ON or OFF
Signal from
Output status
table
Fuse

Relay
Switchi
ng
Device
3/12/17 Amit Nevase 36
Block diagram of DC output module

Power Fuse
Signal Latch Transistor Controlled
Optical Filter
From Logic Switching Device
Isolation
CPU Circuit Circuit

LED

3/12/17 Amit Nevase 37

Specifications of DC output module
Sourcing Output Module Specifications
Operating Voltage 10/50 V dc

Number of Outputs 16

Backplane Current draw 0.280 amp at 5 V dc

ON= 0.1 ms
Maximum Signal Delay
OFF= 1.0 ms

ON state voltage Drop 1.2 Volts at 10 amps

3/12/17 Amit Nevase 38
Module VI PLC Hardware and
Programming
PLC Hardware
(8 Marks)
Discrete Input Modules Block diagram, typical wiring details,
Specifications of AC input modules and DC input modules.
Sinking and sourcing concept in DC input modules
Discrete Output Modules Block diagram, typical wiring details,
Specifications of AC output modules and DC output modules.
typical wiring details and specifications
PLC Programming
(16 Marks)
PLC Instruction Set : Relay instructions, timer instructions,
counter instructions, data handling instructions, logical and
comparison instructions
PLC programming examples based on above instruction using
3/12/17 Amit Nevase 39

User
Connection
+

Input
A/D Opto Micro Backplan
Convert Isolation Process e CPU Status
er or Interface Table
VLSI

User
Connection
+

COM

3/12/17 Amit Nevase 40

Module VI PLC Hardware and
Programming
PLC Hardware
(8 Marks)
Discrete Input Modules Block diagram, typical wiring details,
Specifications of AC input modules and DC input modules.
Sinking and sourcing concept in DC input modules
Discrete Output Modules Block diagram, typical wiring details,
Specifications of AC output modules and DC output modules.
details and specifications
PLC Programming
(16 Marks)
PLC Instruction Set : Relay instructions, timer instructions,
counter instructions, data handling instructions, logical and
comparison instructions
PLC programming examples based on above instruction using
3/12/17 Amit Nevase 41
The PLC has to be able to identify each
particular input and output. It does this by
allocating addresses to each input and
output.
With a small PLC this is likely to be just a
number, prefixed by a letter to indicate
whether it is an input or an output.

3/12/17 Amit Nevase 42

With larger PLCs that have several racks of input
and output channels, the racks are numbered.
With the Allen-Bradley PLC-5, the rack containing
the processor is given the number 0 and the
addresses of the other racks are numbered 1, 2, 3,
and so on, according to how setup switches are set.
Each rack can have a number of modules, and
each one deals with a number of inputs and/or
outputs.

I=Input Module
O=Output Number

X :X X X / X
X Terminal
Number

Rack
Number

3/12/17 Amit Nevase 44

Module VI PLC Hardware and
Programming
PLC Hardware
(8 Marks)
Discrete Input Modules Block diagram, typical wiring details,
Specifications of AC input modules and DC input modules.
Sinking and sourcing concept in DC input modules
Discrete Output Modules Block diagram, typical wiring details,
Specifications of AC output modules and DC output modules.
details and specifications
PLC Programming
(16 Marks)
PLC Instruction Set : Relay instructions, timer instructions,
counter instructions, data handling instructions, logical and
comparison instructions
PLC programming examples based on above instruction using
3/12/17 Amit Nevase 45
Programming Languages

Ladder Diagram (LD):a graphical depiction of a

process with rungs of logic, similar to the relay
ladder logic schemes that were replaced by PLCs.
Sequential Function Charts (SFC): a
graphical depiction of interconnecting steps,
actions, and transitions.
Instruction List (IL): assembler type, text
based language for building small applications or
optimizing complex systems.
3/12/17 Amit Nevase 46
Programming Languages

Function Block Diagram (FBD): a

graphical depiction of process flow using
simple and complex interconnecting blocks.
Structured Text (ST): a high-level, text-
based language such as BASIC, C, or
PASCAL specifically developed for industrial
control applications.

3/12/17 Amit Nevase 47

A very commonly used method of programming
PLCs is based on the use of ladder diagrams.
Writing a program is then equivalent to drawing
a switching circuit.
The ladder diagram consists of two vertical lines
representing the power rails.
Circuits are connected as horizontal lines, that
is, the rungs of the ladder, between these two
verticals.
3/12/17 Amit Nevase 48
In drawing a ladder diagram, certain conventions
The vertical lines of the diagram represent
the power rails between which circuits are
connected. The power flow is taken to be
from the left-hand vertical across a rung.
Each rung on the ladder defines one
operation in the control process

3/12/17 Amit Nevase 49

In drawing a ladder diagram, certain conventions
top to bottom.
Left Right
Power Flow
Power Power
Rail Rail
Rung
1
Rung
2
Rung
3
Rung
4

END End
Rung
The top rung is read from left to right.
Then the second rung down is read from left to right and so
on.
When the PLC is in its run mode, it goes through the entire
ladder program to the end, the end rung of the program
being clearly denoted,
3/12/17 and then promptly 50
Amit Nevase resumes at the

Right Read the status of all

Left Power Flow Power the inputs & store
Power Rail memory
Rail
Rung
1
Rung memory & implement
2 the program, storing
Rung in the outputs in
3 memory
Rung
4
Update all the
outputs
END End
Rung
3/12/17 Amit Nevase 51
In drawing a ladder diagram, certain conventions
must end with at least one output. The term input
is used for a control action, such as closing the
contacts of a switch. The term output is used for a
device connected to the output of a PLC, such as
a motor. As the program is scanned, the outputs
are not updated instantly, but the results stored in
memory and all the outputs are updated
simultaneously at the end of the program scan

3/12/17 Amit Nevase 52

In drawing a ladder diagram, certain conventions
Electrical devices are shown in their normal
condition. Thus a switch that is normally
open until some object closes it is shown as
open on the ladder diagram. A switch that is
normally closed is shown closed.

3/12/17 Amit Nevase 53

In drawing a ladder diagram, certain conventions
A particular device can appear in more than
one rung of a ladder. For example, we might
have a relay that switches on one or more
devices. The same letters and/or numbers
are used to label the device in each
situation.

3/12/17 Amit Nevase 54

In drawing a ladder diagram, certain conventions
The inputs and outputs are all identified by
depends on the PLC manufacturer. This is
the address of the input or output in the
memory of the PLC

3/12/17 Amit Nevase 55

Module VI PLC Hardware and
Programming
PLC Hardware
(8 Marks)
Discrete Input Modules Block diagram, typical wiring details,
Specifications of AC input modules and DC input modules.
Sinking and sourcing concept in DC input modules
Discrete Output Modules Block diagram, typical wiring details,
Specifications of AC output modules and DC output modules.
details and specifications
PLC Programming
(16 Marks)
PLC Instruction Set : Relay instructions, timer instructions,
counter instructions, data handling instructions, logical and
comparison instructions
PLC programming examples based on above instruction using
3/12/17 Amit Nevase 56
Relay Type Instructions

Sr. Instructi
Description
No. on

3/12/17 Amit Nevase 57

Representation of Contacts and Coils
The ladder diagram language is basically a
symbolic set of instructions used to create the
controller program.
These ladder instruction symbols are arranged
to obtain the desired control logic that is to be
entered into the memory of the PLC.
Because the instruction set is composed of
contact symbols, ladder diagram language is
also referred to as contact symbology.
3/12/17 Amit Nevase 58
Representation of Contacts and Coils
Representations of contacts and coils are the basic
symbols of the logic ladder diagram instruction set.
The three fundamental symbols that are used to
translate relay control logic to contact symbolic logic
are
- Examine If Closed (XIC),

- Output Energize (OTE).

Each of these instructions relates to a single bit of PLC
memory that is specified by the instructions address.

3/12/17 Amit Nevase 59

Fundamental Symbols

3/12/17 Amit Nevase 60

Examine If Closed (XIC) Instruction
17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 I:012

I:012

04
Instruction is TRUE

17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 I:012

I:012

04
Instruction is FALSE
3/12/17 Amit Nevase 61
Examine If Closed (XIC) Instruction

3/12/17 Amit Nevase 62

Examine If Open (XIO) Instructions
17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 I:012

I:012

04
Instruction is TRUE
17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 I:012

I:012

04
Instruction is FALSE
3/12/17 Amit Nevase 63
Examine If Open (XIO) Instructions

3/12/17 Amit Nevase 64

Output Energize (OTE) Instruction

17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 O:013

17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 1 I:012

01 04 01

3/12/17 Amit Nevase 65

Output Energize (OTE) Instruction

17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 O:013

17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 1 I:012

01 04 01

3/12/17 Amit Nevase 66

Output Energize (OTE) Instruction

3/12/17 Amit Nevase 67

OTL and OTU Instructions

Instruct
Name Symbol Description
ion
OTL sets the bit to
"1" when the rung
becomes true and
Output L retains its state
OTL
Latch when the rung
loses continuity or
a power cycle
occurs.
OTU resets the bit
Output U to "0" when the
OTU
Unlatch rung becomes true
and retains it.
3/12/17 Amit Nevase 68
Module VI PLC Hardware and
Programming
PLC Hardware
(8 Marks)
Discrete Input Modules Block diagram, typical wiring details,
Specifications of AC input modules and DC input modules.
Sinking and sourcing concept in DC input modules
Discrete Output Modules Block diagram, typical wiring details,
Specifications of AC output modules and DC output modules.
details and specifications
PLC Programming
(16 Marks)
PLC Instruction Set : Relay instructions, Timer instructions,
counter instructions, data handling instructions, logical and
comparison instructions
PLC programming examples based on above instruction using
3/12/17 Amit Nevase 69
Timer Instructions

Sr. Instructi
Name Description
No. on
Counts time-based intervals
1 TON On Delay Timer when the instruction is true.
Counts time-based intervals
2 TOF Off Delay Timer when the instruction is
false.
Counts time-based intervals
when the instruction is true
and retains the
3 RTO Retentive Timer accumulated value when
the instruction goes false or
when power cycle occurs.
Resets a retentive timers
4 RES Reset accumulated value to zero.

3/12/17 Amit Nevase 70

On Delay Timer Sequence
Input Timer

True

Time Period On Delay

Timed
Duration
True
On (Logic 1)
Timed Output Bit False
Off (Logic 0)
Preset Value= Accumulated Value

3/12/17 Amit Nevase 71

TON On Delay Timer Instruction

TON
TIMER ON DELAY
EN
Timer T4:0
Time Base 1:0 DN
Preset 15
Accumulated 0

The On delay timer operates such that when

the rung containing timer is true, the timer
timed out period commences.
At the end of the timer time out period, an
3/12/17 Amit Nevase 72
TON On Delay Timer Instruction
Timer number This number must come from the timer
file. In the example shown, the timer number is T4:0, which
represents timer file 4, timer 0 in that file. The timer address
must be unique for this timer and may not be used for any
other timer.
Time base The time base (which is always expressed in
seconds) may be either 1.0 s or 0.01 s. In the example
shown, the time base is 1.0 s.
Preset value In the example shown, the preset value is
15. The timer preset value can range from 0 through 32,767.
Accumulated value In the example shown, the
accumulated value is 0. The timers accumulated value
normally is entered as 0,Amit
3/12/17 although
Nevase it is possible to enter 73a
TON Instruction Control Word

Timer Element
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Word
EN TT DN Internal Use 0

3/12/17 Amit Nevase 74

TON Instruction Control Word
Enable (EN) bit The enable bit is true (has a status of 1)

timing bit is false.

Done (DN) bit The done bit changes state whenever the

depends on the type of timer being used.

3/12/17 Amit Nevase 75
Off Delay Timer Sequence
Input Timer

True

Timed
Duration
True

Off (Logic 0)

Preset Value= Accumulated Value

3/12/17 Amit Nevase 76
TOF Off Delay Timer Instruction
TOF
TIMER OFF DELAY
EN
Timer T4:0
Time Base 1:0 DN
Preset 15
Accumulated 0

The Off delay timer operation will keep the

output energized for a time period after the
rung containing the timer has gone false.

3/12/17 Amit Nevase 77

TOF Off Delay Timer Instruction
Timer number This number must come from the timer
file. In the example shown, the timer number is T4:0, which
represents timer file 4, timer 0 in that file. The timer address
must be unique for this timer and may not be used for any
other timer.
Time base The time base (which is always expressed in
seconds) may be either 1.0 s or 0.01 s. In the example
shown, the time base is 1.0 s.
Preset value In the example shown, the preset value is
15. The timer preset value can range from 0 through 32,767.
Accumulated value In the example shown, the
accumulated value is 0. The timers accumulated value
normally is entered as 0,Amit
3/12/17 although
Nevase it is possible to enter 78a
TOF Instruction Control Word

Timer Element
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Word
EN TT DN Internal Use 0

3/12/17 Amit Nevase 79

TOF Instruction Control Word
Enable (EN) bit The enable bit is true (has a status of 1)

timing bit is false.

Done (DN) bit The done bit changes state whenever the

depends on the type of timer being used.

3/12/17 Amit Nevase 80
RTO Retentive Timer
RTO
RETENTIVE TIMER ON
EN
Timer T4:0
Time Base 1:0 DN
Preset 15
Accumulated 0

A retentive timer accumulates time whenever the

device receives power, and it maintains the current
time should power be removed from the device.
Once the device accumulates time equal to its preset
value, the contacts of the device change state.

3/12/17 Amit Nevase 81

RTO Timer Programmed Logic

PB1 RTO
RETENTIVE TIMER ON
EN
Timer T4:0
Time Base 1:0 DN
Preset 7
Accumulated 0

T4:2 PL

DN

3/12/17 Amit Nevase 82

83
Acc Value = Pre Value

---------------------------------------------------------------------------------
--------------------------------------------------------------------------------
7
6
5
4

Amit Nevase
--------------------------------------------------------------------------------
RTO Timer Sequence

--------------------------------------------------------------------------------
3
2
When rung condition goes false

1
Accumulated Value retained

0
--------------------------------------------------------------------------------
True

False

Off

Off
Off

On

On
On

Accumulated

PL Output
Timer T4:2
Time Input

Timer T4:2
Enable Bit

Done Bit

3/12/17
Value
RES Reset Instruction
Reset T4:2

RES

Because the retentive timer does not reset to 0 when the

timer is de-energized, the reset instruction RES must be
used to reset the timer.
The RES instruction given the same address (T4:2) as the
RTO.
When reset pushbutton closes, RES resets the
accumulated time to 0 and DN bit to 0, turning output off.

3/12/17 Amit Nevase 84

Module VI PLC Hardware and
Programming
PLC Hardware
(8 Marks)
Discrete Input Modules Block diagram, typical wiring details,
Specifications of AC input modules and DC input modules.
Sinking and sourcing concept in DC input modules
Discrete Output Modules Block diagram, typical wiring details,
Specifications of AC output modules and DC output modules.
details and specifications
PLC Programming
(16 Marks)
PLC Instruction Set : Relay instructions, timer instructions,
Counter instructions, data handling instructions, logical and
comparison instructions
PLC programming examples based on above instruction using
3/12/17 Amit Nevase 85
Counter Instructions

Sr. Instructi
Name Description
No. on
Increments the accumulated
value at each false-to-true
1 CTU Up counter transition and retains the
accumulated value when an
off/on power cycle occurs.
Decrements the accumulated
value at each false-to-true
2 CTD Down counter transition and retains the
accumulated value when an
on/off power cycle occurs.
High Speed Counts high-speed pulses from
3 HSC
Counter a high-speed input.

Resets a counters
4 RES Reset accumulated value to zero.

3/12/17 Amit Nevase 86

UP Counter Counting Sequence

Limit Switch Counter UP

Counter
Value

+4

ON
Accumulated Value= preset = output
OFF

3/12/17 Amit Nevase 87

CTU Up Counter Instruction
CTU
COUNT UP COUNTER
CU
Counter C5:0
Preset 7 DN
Accumulated 0

C5:0/CU C5:0/OV
Counter Enable Bit Overflow Status Bit

C5:0/DN C5:0
Counter Reset
RES
Counter Done Bit Instruction

3/12/17 Amit Nevase 88

89

--------------------------------------------------------------------------------
---------------------------------------------------------------------------------
PRE Value =7
7

--------------------------------------------------------------------------------
7
CTU Up Counter Sequence
6

6
5

Amit Nevase
5
4

4
3

3
2

2
TRUE 1

--------------------------------------------------------------------------------
FALSE

1
Accumulated
Count Up

3/12/17
DN Bit of
Counter

Reset
Input

Value
CTU UP Counter Instruction
Counter Number This number must come from the counter

represents counter file 5, counter 0 in that file. The address for

this counter should not be used for any other count-up counter.

what value is entered, the reset instruction will reset the

accumulated value to 0.

3/12/17 Amit Nevase 90

CTU UP Counter Instruction Control
Word

1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
C5:N Bit 14
5 3 2 1 0 9 8 7 6 5 4 3 2 1 0
Wor
C5:N: D O U
d CU CD
N V N
0
0
Wor
C5:N:
d PRESET VALUE
1
1
Wor
C5:N:
d ACCUMULATED VALUE
2
2

3/12/17 Amit Nevase 91

CTU UP Counter Instruction Control
Word
Count-Up (CU) Enable Bit The count-up

the count-up or the count-down counter.

3/12/17 Amit Nevase 92
CTU UP Counter Instruction Control
Word
Overflow (OV) Bit The overflow bit is true
whenever the counter counts past its maximum
value, which is 32,767. On the next count, the
counter will wrap around to 32,768 and will
continue counting from there toward 0 on
successive false-to-true transitions of the count-up
counter.
Update Accumulator (UA) Bit The update
accumulator bit is used only in conjunction with an
external HSC (high-speed counter).
3/12/17 Amit Nevase 93
DOWN Counter Counting Sequence

Proximity Switch Counter Down

Counter
Value

-5

ON
Accumulated Value= Preset = output
OFF

3/12/17 Amit Nevase 94

CTD Down Counter Instruction
CTD
COUNT DOWN COUNTER
CD
Counter C5:0
Preset 7 DN
Accumulated 0

C5:0/CD C5:0/UN
Counter Enable Bit Underflow Status B

C5:0/DN C5:0
Counter Reset
RES
Counter Done Bit Instruction

3/12/17 Amit Nevase 95

96

--------------------------------------------------------------------------------
---------------------------------------------------------------------------------
CTD Down Counter Sequence

PRE Value
7

--------------------------------------------------------------------------------
1
6

2
5

Amit Nevase
3
4

4
3

5
2

6
TRUE 1

--------------------------------------------------------------------------------

7
FALSE
Count Down

Accumulated

3/12/17
DN Bit of
Counter

Reset
Input

Value
CTD Down Counter Instruction
Counter Number This number must come from the counter

represents counter file 5, counter 0 in that file. The address for

this counter should not be used for any other count-up counter.

what value is entered, the reset instruction will reset the

accumulated value to 0.

3/12/17 Amit Nevase 97

CTD Down Counter Instruction Control
Word

1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
C5:N Bit 14
5 3 2 1 0 9 8 7 6 5 4 3 2 1 0
Wor
C5:N: D O U
d CU CD
N V N
0
0
Wor
C5:N:
d PRESET VALUE
1
1
Wor
C5:N:
d ACCUMULATED VALUE
2
2

3/12/17 Amit Nevase 98

CTU UP Counter Instruction Control
Word
Count-Down (CD) Enable Bit The count-

the count-up or the count-down counter.

3/12/17 Amit Nevase 99
CTU UP Counter Instruction Control
Word
Underflow (UN) Bit The underflow bit
will go true when the counter counts below
32,768. The counter will wrap around to
132,767 and continue counting down
toward 0 on successive false-to-true rung
transitions of the count-down counter.
Update Accumulator (UA) Bit The
update accumulator bit is used only in
conjunction with an external HSC (high-
3/12/17 Amit Nevase 100
Module VI PLC Hardware and
Programming
PLC Hardware
(8 Marks)
Discrete Input Modules Block diagram, typical wiring details,
Specifications of AC input modules and DC input modules.
Sinking and sourcing concept in DC input modules
Discrete Output Modules Block diagram, typical wiring details,
Specifications of AC output modules and DC output modules.
details and specifications
PLC Programming
(16 Marks)
PLC Instruction Set : Relay instructions, timer instructions,
counter instructions, Data handling instructions, logical and
comparison instructions
PLC programming examples based on above instruction using
3/12/17 Amit Nevase 101
Data Handling Instructions

Sr. Instructi
Name Description
No. on

Moves the source value

1 MOV Move
to the destination.

Moves data from a

source location to a
selected portion of the
destination.

3/12/17 Amit Nevase 102

MOV Instruction

MOV
MOVE
Source N7:30

Destination N7:20

The MOV instruction is used to copy data

from source word to destination word.

3/12/17 Amit Nevase 103

MOV Instruction

PB1 MOV
MOVE N7:30

Source N7:30

Destination N7:20

N7:20
When the rung is true, input switch A closed, the value stored at the
When the rung goes false, input switch A opened, the destination
address will retain the value unless it is changed elsewhere in the
program.
The source value remains unchanged and no data conversion occurs.

3/12/17 Amit Nevase 104

MVM Instruction
The move with mask (MVM) instruction differs
slightly from the MOV instruction because a
mask word is involved in the move.
The data being moved must pass through the
Masking refers to the action of hiding a
portion of a binary word before transferring it

3/12/17 Amit Nevase 105

MVM Instruction
MVM
Source B3:0
1010101010101010
FF0F
Destination B3:4
1010101011001010
The pattern of characters in the mask determines which
source bits will be passed through to the destination address.
The bits in the mask that are set to zero (0) do not pass data.
Only the bits in the mask that are set to one (1) will pass the
source data through to the destination.
Bits in the destination are not affected when the
corresponding bits in the mask are zero.
The MVM instruction is used to copy the desired part of a 16-
bit word by masking the rest of the value.
3/12/17 Amit Nevase 106
MVM Instruction
PB1 MVM
Source B3:0
1010101010101010
FF0F
Destination B3:4
1010101011001010

1 0 1 0 1 0 1 0 1 0 1 0 1 Source
0 B3:0

1 1 1 1 1 1 0 0 0 0 1 1 1 Mask
1 FF0F

Destination B3:4 before instructi

0 0 1 1 0 0 1 1 0 0 1 1 0 0
went true

1 0 1 0 1 0 1 1 0 0 1 0 1Destination
0 B3:4 after instruction
went true
3/12/17 Amit Nevase 107
Module VI PLC Hardware and
Programming
PLC Hardware
(8 Marks)
Discrete Input Modules Block diagram, typical wiring details,
Specifications of AC input modules and DC input modules.
Sinking and sourcing concept in DC input modules
Discrete Output Modules Block diagram, typical wiring details,
Specifications of AC output modules and DC output modules.
details and specifications
PLC Programming
(16 Marks)
PLC Instruction Set : Relay instructions, timer instructions,
counter instructions, data handling instructions, Logical and
comparison instructions
PLC programming examples based on above instruction using
3/12/17 Amit Nevase 108
Logical Instructions
Sr. Instructi
Name Description
No. on

Perform Bitwise
1 AND Logical AND
AND operation

Perform Bitwise OR
2 OR Logical OR
operation

Perform Bitwise
3 XOR Logical XOR
XOR operation

3/12/17 Amit Nevase 109

Logical Instructions
Sr. Instructi
Name Description
No. on

Perform inversion of
4 NOT Inversion
given source

3/12/17 Amit Nevase 110

AND Logical AND Instruction
AND
BITWISE AND
Source A B3:0
Source B B3:1
Destination B3:2
The AND command is used to perform the logic AND
instruction on each bit of the value in source A with
each bit of the value of source B, storing the output
logic in the destination.

B3:0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0

B3:1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0

B3:2 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0

3/12/17 Amit Nevase 111

OR Logical OR Instruction
OR
BITWISE INCLUSIVE OR
Source A B3:0
Source B B3:1
Destination B3:2
The OR command is used to perform the logic OR
instruction on each bit of the value in source A with
each bit of the value of source B, storing the output
logic in the destination.

B3:0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0

B3:1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0

B3:2 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0

3/12/17 Amit Nevase 112

XOR Logical XOR Instruction
XOR
BITWISE EXCLUSIVE OR
Source A B3:0
Source B B3:1
Destination B3:2
The XOR command is used to perform the logic XOR
instruction on each bit of the value in source A with
each bit of the value of source B, storing the output
logic in the destination.

B3:0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0

B3:1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0

B3:2 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0

3/12/17 Amit Nevase 113

NOT Inversion Instruction
NOT
NOT

Source B3:0

Destination B3:1
The NOT instruction is used to perform the NOT logic
on the value in the source, bit by bit. The output logic
value returned in the destination is the one's
complement or opposite of the value in the source.

B3:0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0

B3:1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1

3/12/17 Amit Nevase 114

CLR Clear Instruction
CLR

CLEAR

Destination B3:1

The CLR instruction is used to set the destination value

of a word to zero.

B3:1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

3/12/17 Amit Nevase 115

Module VI PLC Hardware and
Programming
PLC Hardware
(8 Marks)
Discrete Input Modules Block diagram, typical wiring details,
Specifications of AC input modules and DC input modules.
Sinking and sourcing concept in DC input modules
Discrete Output Modules Block diagram, typical wiring details,
Specifications of AC output modules and DC output modules.
details and specifications
PLC Programming
(16 Marks)
PLC Instruction Set : Relay instructions, timer instructions,
counter instructions, data handling instructions, logical and
Comparison instructions
PLC programming examples based on above instruction using
3/12/17 Amit Nevase 116
Data Compare Instructions
Sr. Instructi
Name Description
No. on

Tests whether two

1 EQU Equal
values are equal.

Tests whether one

2 NEQ Not Equal value is not equal to a
second value.

Tests whether one

3 LES Less Than value is less than a
second value.

3/12/17 Amit Nevase 117

Data Compare Instructions
Sr. Instructi
Name Description
No. on
Tests whether one
value is
4 GRT Greater Than
greater than a second
value.
Tests whether one
Less Than or value is less than or
5 LEQ
Equal equal to a second
value.
Tests whether one
Greater Than or value is greater than or
6 GEQ
Equal equal to a second
value.
3/12/17 Amit Nevase 118
EQU Equal Instruction
EQU
EQUAL
Source A T4:0.ACC

Source B N7:40

The equal (EQU) instruction is an input

instruction that compares source A to
source B: when source A is equal to source
B, the instruction is logically true; otherwise
it is logically false.

3/12/17 Amit Nevase 119

NEQ Not Equal Instruction
NEQ
NOT EQUAL
Source A N7:5

Source B 25

The not equal (NEQ) instruction is an input

instruction that compares source A to
source B: when source A is not equal to
source B, the instruction is logically true;
otherwise it is logically false.

3/12/17 Amit Nevase 120

GRT Greater Than Instruction
GRT
GREATER THAN
Source A T4:0.ACC

Source B 200

The greater than (GRT) instruction is an

input instruction that compares source A to
source B: when source A is greater than
source B, the instruction is logically true;
otherwise it is logically false.

3/12/17 Amit Nevase 121

LES Less Than Instruction
LES
LESS THAN
Source A C5:10.ACC

Source B 350

The less than (LES) instruction is an input

instruction that compares source A to
source B: when source A is less than source
B, the instruction is logically true; otherwise
it is logically false.

3/12/17 Amit Nevase 122

GEQ Greater Than or Equal Instruction
GEQ
GREATER THAN OR EQUAL
Source A N7:55

Source B N7:12

The greater than or equal (GEQ) instruction

is an input instruction that compares source
A to source B: when source A is greater than
or equal to source B, the instruction is
logically true; otherwise it is logically false.

3/12/17 Amit Nevase 123

LEQ Less Than or Equal Instruction
LEQ
LESS THAN OR EQUAL
Source A C5:1.ACC

Source B 457

The less than or equal (LEQ) instruction is

an input instruction that compares source A
to source B: when source A is less than or
equal to source B, the instruction is logically
true; otherwise it is logically false.

3/12/17 Amit Nevase 124

Module VI PLC Hardware and
Programming
PLC Hardware
(8 Marks)
Discrete Input Modules Block diagram, typical wiring details,
Specifications of AC input modules and DC input modules.
Sinking and sourcing concept in DC input modules
Discrete Output Modules Block diagram, typical wiring details,
Specifications of AC output modules and DC output modules.
details and specifications
PLC Programming
(16 Marks)
PLC Instruction Set : Relay instructions, timer instructions,
counter instructions, data handling instructions, logical and
comparison instructions
PLC programming examples based on above instruction
3/12/17 Amit Nevase 125

Applied
Voltage
(a)
Input
A
Input Input Output
Input
A B
B

Output

(b)
(c)

3/12/17 Amit Nevase 126

Output
Input
A
B
Input
B

Applied
Voltage (c)

(a)
Input
Output A
Input
A Input
B
Input
B
Output

(b) (d)
3/12/17 Amit Nevase 127
A

Applied
Voltage
(a)
Input
A
Input
Output
A

Output

(b)
(c)
3/12/17 Amit Nevase 128

Output Input
Input A
A
Input
Input B
B
Output

(a) (b)

Input
A
Output Input
Input Input
A B B

Output

(a) (b)

Input
A
Output Input
Input Input
A B B

Output
Input Input
A B

(b)
(a)

Input
A
Output Input
Input Input
A B B

Output
Input Input
A B

(b)
(a)

Outputs

Output
A
Output B
Output
B

3/12/17 Amit Nevase 133

Ladder diagram with Multiple Inputs and
Outputs

Input
A
Input
Output A
A
Input
B

Output B Output
A

Input B Output
B

Example 1

A
Y
B C

A C Y

Example 2

C
D

A C Y

B D

Example 3

A
Y
B
C

A B Y

Example 4

A
B

C
D

A B Y

C D

Example 5

B
Y
A

A B Y

Example 6

A
Y
B

A C Y

Example 7

Y ABC D

A B C Y

Example 8

Y A( B CD )

C D A Y

Example 9

Y AB C

A B Y

Example 10

Y ( A B )CD

A C D Y

Example 11

Draw Ladder diagram for given Boolean Expression

Y ( ABC ) ( DEF )

A B C Y

D E F

Example 12

Draw Ladder diagram for given Boolean Expression

Y ( A B) ( A B C )

A B C Y

Example 13

Draw Ladder diagram for given Boolean Expression

Y ( ABC ) ( AB ) ( ABC )

A B C Y

A B C

A B

Example 14

Draw Ladder diagram for given Boolean Expression

Y A( B C ) B ( A C )
B A Y

A B

Example 15

1 1

0 0

SW Lamp

Example 16

0 1

1 0

SW Lamp

3/12/17 Amit Nevase 150

Example 17
w Ladder diagram for given Logic Table Lam Lam
SW1 SW2
p1 p2
0 0 1 0
0 1 0 0
1 0 0 0
SW1 SW2 Lamp 1 1 1 0 1

3/12/17 Amit Nevase 151

Example 18
w Ladder diagram for given Logic Table Lam Lam
SW1 SW2
p1 p2
0 0 0 0
0 1 1 0
1 0 0 1
SW1 SW2 Lamp 1 1 1 0 0

3/12/17 Amit Nevase 152

Example 19
w Ladder diagram for given Logic Table Lam Lam
SW1 SW2
p1 p2
0 0 0 0
0 1 1 1
1 0 1 1
SW1 SW2 Lamp 1 1 1 0 0

3/12/17 Amit Nevase 153

Example 20
aw Ladder diagram for given Logic Table La La La
SW SW Lam
mp mp mp
1 2 p4
SW1 SW2 1 2 3
Lamp 1
0 0 1 0 0 0

0 1 0 1 0 0
SW1 SW2 Lamp 2
1 0 0 0 1 0

1 1 0 0 0 1
SW1 SW2 Lamp 3

Example 21

Draw Ladder diagram to switch off three motors

sequentially at 5 seconds interval

3/12/17 Amit Nevase 155

SW TOF
EN
TIMER OFF DELAY
Timer T4:1
Time Base 1:0
Preset 5 DN
Accumulated 0

TOF
EN
TIMER OFF DELAY
Timer T4:2
Time Base 1:0

Example 21 Preset 10 DN
Accumulated 0

TOF
EN
TIMER OFF DELAY
Timer T4:3
Time Base 1:0
Preset 15 DN
Accumulated 0

T4:1/DN M1

T4:2/DN M2

T4:3/DN M3
3/12/17 Amit Nevase 156
Example 22

Draw Ladder diagram for 2 motor operations

for following conditions
1. Start push button starts motors M1 and M2

10 sec motor M2

Start Stop M1

I:0/0 I:0/1 O:0/0

TOF
TIMER OFF DELAY EN
Timer T4:1
Time Base 1:0
O:0/0 Preset 10 DN
Accumulated 0

T4:1/DN M2

O:0/1
Example 22

Example 23

counter.

3/12/17 Amit Nevase 159

Enter SW CTU
COUNT UP COUNTER CU
Counter C5:1
I:0/0 Preset 150
DN
Accumulated 0

Exit SW CTD
COUNT DOWN COUNTER CD
Counter C5:2
I:0/1 Preset 150
DN
Accumulated 0

C5:1/DN
Lot Full Light

O:0/0
Reset C5:1
RES
Example 23

Example 24

Three motors can be started automatically in

sequence with 20 sec time delay between
each motor startup when push button is
starts. Stops all motors when push button is
stops.

3/12/17 Amit Nevase 161

Start Stop M1

O:0/0
I:0/0 I:0/1
TON
TIMER ON DELAY EN
Timer T4:1
Time Base 1:0
O:0/0 Preset 20 DN
Accumulated 0

T4:1/DN
Example 24 M2

O:0/1
T4:1/DN TON
TIMER ON DELAY EN
Timer T4:2
Time Base 1:0
Preset 20 DN
Accumulated 0
T4:2/DN M3

3/12/17 Amit Nevase 162

O:0/2
Example 25
Draw Ladder diagram for 2 motors operation,

M2 starts

has stopped

d. Both M1 and M2 will stop when push

button is pressed.
3/12/17 Amit Nevase 163
Start Stop T4:1/DN M1

O:0/0
I:0/0 I:0/1
T4:2/DN M2

Example 25
TON
TIMER ON DELAY EN
Timer T4:1
Time Base 1:0
O:0/0 Preset 10 DN
Accumulated 0

T4:1/DN TON
TIMER ON DELAY EN
Timer T4:2
Time Base 1:0
Preset 15 DN
Accumulated 0

3/12/17 Amit Nevase 164

Example 26
Draw Ladder diagram for 2 motors system,

3/12/17 Amit Nevase 165

Start Stop M1

O:0/0
I:0/0 I:0/1
TON
TIMER ON DELAY EN
Timer T4:1
Time Base 1:0
O:0/0 Preset 10 DN
Accumulated 0

T4:1/DN T4:2/DN
M2

O:0/1
TOF
TIMER OFF DELAY EN
Timer T4:2
Time Base 1:0
O:0/0 Preset 15 DN
Accumulated 0
Example 26
3/12/17 Amit Nevase 166
Example 27
Draw Ladder diagram for 3 motors operation,

and M1 is OFF.

M2 is OFF.

d. When stop push button is pressed M3 is

OFF.
3/12/17 Amit Nevase 167
Start T4:1/DN M1

O:0/0
I:0/0 I:0/1
TON
TIMER ON DELAY EN
Timer T4:1
Time Base 1:0
O:0/0 Preset 300 DN
Accumulated 0

T4:1/DN T4:2/DN
M2

Example 27 O:0/1
TON
TIMER ON DELAY EN
Timer T4:2
Time Base 1:0
O:0/1 Preset 600 DN
Accumulated 0
T4:2/DN Stop M3

3/12/17 Amit Nevase 168

O:0/2
References
Programmable Logic
Controllers F. D. Petruzella

Introduction to
Programmable Logic
Controllers Gary Dunning

Programmable Logic
Controllers Jhon
Hackworth, Federic
Hackworth
3/12/17 Amit Nevase 169
Online Tutorials

https://
www.courses.psu.ed
u/e_met/e_met430_j
ar14/cgroup.html

3/12/17 Amit Nevase 170

Thank
You
Amit Nevase
3/12/17 Amit Nevase 171