You are on page 1of 69

PLC LADDER PROGRAM

CONCEPT

SAMEER S. PURAO
PLANT ENGG.(INST)

Automation

Increase in Productivity
Reduction in Running Cost
Precision in Control
Efficient Operation
Early/Predictive Fault Notification
Safety in Operation for both Man and
Machine

What is a PLC?
Level Control Application

PLC Components

Broadly classified into two types


Composite
Modular

A modular PLC range


typically offers the
following modules:
Chassis
Modular Central
Processors
Discrete Input/Output
Modules
Power Supplies
Memory Modules

Central Processing Unit (CPU):

Memory:
Communication Ports:
Programming Capabilities:
I/O Capacity:

Memory Organization
Program Area:
System Program
Main Ladder
Program
User Error Fault
Routine
Subroutine Ladder
Program

Data area:
Output
Input
Status
Bit
Timer
Counter
Control
Integer

Memory Organization
Processor File Overview:

PLC Operating Cycle

PLC Operating Cycle

Ladder Logic Fundamentals


Typical Electrical
Circuit

Typical Ladder
Diagram

Ladder Logic Fundamentals


Typical Electrical
Circuit

Typical Ladder
Diagram

Ladder Logic Fundamentals


Typical Electrical
Circuit

Typical Ladder
Diagram

Ladder Logic Fundamentals


Typical Electrical
Circuit

Typical Ladder
Diagram

To write ladder logic correctly.


If a functional statement requires multiple
output instructions, place them in parallel.

To write ladder logic correctly.


If a functional statement requires multiple
output instructions, but one output needs
slightly different input conditions, place the
outputs in parallel and place the input
conditions which differ on the lower
branch.

To write ladder logic correctly.


Do NOT exceed four nested input or four
nested output branches per rung.

To write ladder logic correctly.


Do NOT overlap branches. A branch
cannot start inside another branch and
end outside that branch.

To write ladder logic correctly.


Do NOT start a branch on ONE level and
end it on ANOTHER level.

To write ladder logic correctly.


If your rung contains parallel branches,
place the path that is most often true on
the top. The processor will not look at the
others unless the top path is false.

To write ladder logic correctly.


Sequence series instructions from the
most likely to be false (at left) to least likely
to be false (at right).

Basic Instructions
Examine if Closed (XIC):

Use the XIC instruction in your ladder


program to determine if a bit is On.

Basic Instructions
Examine if Open (XIO):

Use the XIO instruction in your ladder


program to determine if a bit is Off.

Basic Instructions
Output Energize (OTE)

Use an OTE instruction in your ladder


program to turn ON a bit when rung
conditions are evaluated as TRUE. The
status of the addressed bit will change
from 0 to 1

Basic Instructions
Output Latch (OTL) and Output Unlatch (OTU)

OTL and OTU are retentive output


instructions. OTL can only turn on a bit,
while OTU can only turn off a bit. These
instructions are usually used in pairs, with
both instructions addressing the same bit.

Basic Instructions
Timer Instructions:

Timer instructions are generally used to


introduce a delay in the process or to
perform time based operations. These are
a direct replica of the Hardware timers,
used in sequential relay circuits.
Timebase:
Preset Value (PRE):
Accumulator Value (ACC):

Basic Instructions
Timer On-Delay (TON):

Use the TON instruction to delay the


turning on or off of an output.

Basic Instructions
Timing Diagram for TON Instruction

Basic Instructions
The table below summarizes the
functioning of Status bits of the TON
instruction.

Basic Instructions
Timer Off-Delay (TOF):

Use the TOF instruction to delay turning


on or off an output.

Basic Instructions
Timing Diagram for TOF Instruction

Basic Instructions
The table below summarizes the
functioning of Status bits of the TOF
instruction.

Basic Instructions
Retentive Timer (RTO):

Use the RTO instruction to turn an output


on or off after its timer has been on for a
preset time interval.

Basic Instructions
Timing Diagram for RTO Instruction

Basic Instructions
The table below summarizes the
functioning of Status bits of the RTO
instruction.

Basic Instructions
Counters: Parameters associated with
counters:
Accumulator Value (ACC):This is the
number of false-to-true transitions that
have occurred since the counter was last
reset.
Preset Value (PRE):Specifies the value
which the counter must reach before the
controller sets the done bit.

Basic Instructions
The count value must remain in the range of
32,768 to +32,767. If the count value goes
above +32,767 or below 32,768, a counter
status overflow (OV) or underflow (UN) bit is set

Basic Instructions
Count Up (CTU):
The CTU is an instruction that counts false-totrue rung transitions.

Basic Instructions
The table below summarizes the functioning of
Status bits of the CTU instruction.

Basic Instructions
Count Down (CTD):
The CTD is a retentive output instruction that
counts false-to-true rung transitions.

Basic Instructions
The table below summarises the functioning of
Status bits of the CTU instruction.

Basic Instructions
Reset (RES):
Use a RES instruction to reset a timer or
counter. When the RES instruction is
executed, it resets the data having the
same address as the RES instruction

Comparison Instructions
Comparison instructions are used to test
pairs of values to condition the logical
continuity of a rung. As an example,
suppose a LES instruction is presented
with two values. If the first value is less
than the second, then the comparison
instruction is true.

Comparison Instructions
Equal (EQU):
Use the EQU instruction to test whether two
values are equal.

Comparison Instructions
Not Equal (NEQ):
Use the NEQ instruction to test whether two
values are not equal.

Comparison Instructions
Less Than (LES):
Use the LES instruction to test whether one
value (source A) is less than another (source B).

Comparison Instructions
Less Than (LES):
Use the LES instruction to test whether one
value (source A) is less than another (source B).

Comparison Instructions
Less Than or Equal (LEQ):
Use the LEQ instruction to test whether one
value (source A) is less than or equal to another
(source B).

Comparison Instructions
Less Than or Equal (LEQ):
Use the LEQ instruction to test whether one
value (source A) is less than or equal to another
(source B).

Comparison Instructions
Greater Than (GRT):
Use the GRT instruction to test whether one
value (source A) is greater than another (source
B).

Comparison Instructions
Greater Than or Equal (GEQ):
Use the GEQ instruction to test whether one
value (source A) is greater than or equal to
another (source B).

Comparison Instructions
Limit Test (LIM):
Use the LIM instruction to test for values within
or outside a specified range, depending on how
you set the limits.

Math Instructions
Add (ADD):
Use the ADD instruction to add one value
(source A) to another value (source B) and place
the result in the destination.

Math Instructions
Subtract (SUB):
Use the SUB instruction to subtract one value
(Source B) from another (source A) and place
the result in the destination.

Math Instructions
Multiply (MUL):
Use the MUL instruction to multiply one value
(source A) by another (source B) and place the
result in the destination.

Math Instructions
Divide (DIV):
Use the DIV instruction to divide one value
(source A) by another (source B), and place the
rounded quotient in the destination.

Math Instructions
Clear (CLR):
Use the CLR instruction to set the destination to
zero. All of the bits reset.

Math Instructions
Square Root (SQR):
When this instruction is evaluated as true, the
square root of the absolute value of the source is
calculated and the rounded integer result is
placed in the destination.

Program Flow Control Instructions


Jump (JMP) and Label (LBL):
Use these instructions in pairs to skip portions
of the ladder program. If the Rung Containing
the Jump Instruction is true then the program
skips from the rung containing the JMP
instruction to the rung containing the
designated LBL instruction and continues
executing.

Program Flow Control Instructions


Jump to Subroutine (JSR), Subroutine (SBR),
and Return (RET):
The JSR, SBR, and RET instructions are used to
direct the controller to execute a separate
subroutine file within the ladder program and return
to the instruction following the JSR instruction.

Program Flow Control Instructions


Nesting Subroutine Files:
Nesting subroutines allows you to direct program
flow from the main program to a subroutine and
then on to another subroutine.

INPUT/OUTPUT DETAILS
NO

TAG

DESCRIPTION

TYPE

XL-420

MP - 702 A RUNNING

DI

XL-421

MP - 702 B RUNNING

DI

PI-450-BYP

MP702 ON BYPASS

DI

XL-422

MP - 702A MTR STAND BY

DI

XL-423

MP - 702B MTR STAND BY

DI

MP-702A-START

(LOGIC 0/P) MP - 702A START

DO

MP-702B-START

(LOGIC 0/P) MP - 702B START

DO

PI-450

BFW TO E-301/302

AI

E-SW-P702A

EMERG SW P-702A

SOFT

10

E-SW-P702B

EMERG SW P-702B

SOFT

11

SEL-SW-1A

SELECTOR SWITCH

SOFT

12

SEL-SW-1B

SELECTOR SWITCH

SOFT

LOGIC DESCRIPTION
MP-702A-START RUN SIGNAL TO PUMP 702A IS GIVEN FROM THE SYSTEM IF ONE OF THE FOLLOWING IS
TRUE:
XL-422 (FEED BACK FRM MCC) IS RECEIVED AND SEL. SWITCH IS TO POSITION SEL-SW-1A BY
OPERATOR
EMERG. SWITCH E-SW-P702A IS
ACTIVATED
XL-423 (FEED BACK FRM MCC) IS NOT
RECEIVED
BYPASS SWITCH PI-450-BYP IS ON AND SEL-SW-1A IS SELECTED
PI-450 LOW ALARM EXISTS FOR MORE THAN 10 SECONDS AND XL-422 SIGNAL IS RECEIVED

MP-702B-START RUN SIGNAL TO PUMP 702B IS GIVEN FROM THE SYSTEM IF ONE OF THE FOLLOWING IS
TRUE:
XL-423 (FEED BACK FRM MCC) IS RECEIVED AND SEL. SWITCH IS TO POSITION SEL-SW-1B BY
OPERATOR
EMERG. SWITCH E-SW-P702B IS
ACTIVATED
XL-422 (FEED BACK FRM MCC) IS NOT
RECEIVED
BYPASS SWITCH PI-450-BYP IS OFF AND SEL-SW-1B IS SELECTED
PI-450 LOW ALARM EXISTS FOR MORE THAN 10 SECONDS AND XL-423 SIGNAL IS RECEIVED

THANK YOU!

You might also like