Identify the PLC programming languages
Function Block Diagram
Instruction list Ladder Diagram
Sequential Function Chart
Use a programming technique to produce, store and
P3 present a program that demonstrates the full range
.of instruction types
Justify the choice of a specific programming method
M2 and the methods used to produce, store and
.present the program
Lesson Objectives
Revisit quickly basics of Ladder diagram programming techniques
Develop ladder diagram for the given logic diagrams/expression
Develop ladder diagram for the given situations
:IEC 61131 is a standard for PLC. It defines the following standard languages for PLC
Sequential
Function chart
Ladder Diagram
• It is the most widely used programming language for PLC.
• It mimics the hard-wired relay logic.
• Ladder diagram consists of two vertical lines representing two power
rails between which the circuits are connected.
• The horizontal line is called rung and each rung represents an
operation in the control process.
• A ladder diagram is read from left to right and top to bottom as shown
in Fig 1.
Fig 1: Ladder
diagram
scanning
Relay Symbol
:Basic symbols in Ladder Diagram
Advantages of Ladder Diagram Programming
• It is a graphical language.
• It is one of the most widely used programming
languages for PLC.
• Easier to read (same like electrical diagram)
• Debugging is easy.
• It provides real time data and feedback.
• It provides “Live” or “Real Time” data.
• It contains/supports powerful instructions like
timer, counter, shift, mathematics and logic
etc.
Examine if closed (XIC) instruction
It is similar to Normally Open contact.
It checks whether the contact is closed.
Examine if Open (XIO)
• It is similar to normally closed contact.
• It checks whether the contact is open.
Output Latching (L)
• The term latching means the relay remains open or closed
even after the power has been removed.
• The output latches the input so that the output can
continue even if the input is removed.
PL
Fig 2: Hardwired logic circuit and its PLC ladder language implementation
Logic Functions
• There are many control situations requiring
action to be initiated when certain combination
of conditions are fulfilled.
• Basic logic functions are AND, OR and NOT
functions.
AND gate
It is a circuit that performs logical AND operation on inputs
and produces an output.
Description
Output Y is High only if ALL inputs are High.
Output will be Low even if one input is Low.
A
Logic Symbol AND Y
B
INPUTS OUTPUT
A B Y
0 0 0
Truth Table 0 1 0
1 0 0
1 1 1
AND Gate Truth Table
AND Symbol
Boolean Expression Y = A • B = AB
Fig :PLC ladder diagram for AND gate
OR gate
It is a circuit that performs logical OR operation on inputs
Description and produces an output.
Output Y is High if any one input is High.
Output will be Low if ALL inputs are Low.
A
Logic Symbol OR Y
B
INPUTS OUTPUT
A B Y
0 0 0
0 1 1
Truth Table
1 0 1
1 1 1
OR Gate Truth Table
OR Symbol
Boolean Expression Y=A+B
Fig: OR gate ladder diagram
NOT gate (inverter)
Description Output Y is High if input A is Low .
i.e. Y is the inverse of A.
Logic Symbol A NOT Y
INPUT OUTPUT
Truth Table A Y
0 1
1 0
NOT Gate Truth Table
_
Bar A
A
Boolean Expression Y=A
[Link]
NAND gate
NAND gate performs inverse action of AND gate.
Output of NAND gate will be High even if one input is High.
Output Y is Low if ALL inputs are High.
Description
A bubble is an inverter
A
NAND Y
B
Logic Symbol
INPUTS OUTPUT
A B Y
0 0 1
Truth Table 0 1 1
1 0 1
1 1 0
NAND Gate Truth Table
Boolean Expression Y = AB
Ladder Diagram for NAND Gate
Ex- OR gate
It is a circuit that performs logical Exclusive OR operation on inputs
Description and produces an output.
Output Y is High if both inputs are different. (one input is 0 and other
1 or vice versa)
Output will be Low if ALL inputs are Low or High.
Logic Symbol
INPUTS OUTPUT
A B Y
0 0 0
Truth Table 0 1 1
1 0 1
1 1 0
OR Gate Truth Table
Ex OR Symbol
Boolean Expression
Q = (A ⊕ B) = A. + B
Develop a ladder logic for Ex-OR gate
Ex-OR Ex-NOR
INPUTS OUTPUT INPUTS OUTPUT
A B Y A B Y
0 0 0 0 0 1
0 1 1 0 1 0
1 0 1 1 0 0
1 1 0 1 1 1
OR Gate Truth Table
OR Gate Truth Table
Ex-NOR output = + AB
Develop a ladder logic for Ex-NOR gate
Develop ladder logic for the following logic diagrams
B
A
C
Develop a
ladder logic
for this logic
circuit
:Draw the ladder rungs to represent
.Two switches are normally open and both have to be closed for a motor to operate )a(
(b) Either of two, normally open, switches have to be closed for a coil to be energized and
operate an actuator.
(c) A motor is switched on by pressing a spring-return push button start switch, and the motor
remains on until another spring-return push button stop switch is pressed.
(d) A lamp is to be switched on if there is an input from sensor A or sensor B.
(e) A light is to come on if there is no input to a sensor.
(f) A solenoid valve is to be activated if sensor A gives an input.
Ladder Program example
1. A signal lamp is required to be switched on if a
pump is running and the pressure is satisfactory, or
if the lamp test switch is closed.
2. consider a valve which is to be operated to lift a load
when a pump is running and either the lift switch is
operated or a switch operated indicating that the load
has not already been lifted and is at the bottom of its
lift channel.
3. As another example, consider a system where there has to
be no output when any one of four sensors gives an output,
otherwise there is to be an output.
Learning Objectives
• Understand the Door Control using PLC
completely
• Develop the ladder diagram logic to control the
door
• Test and Debug the ladder diagram logic to
control the door
Door Shutter Control
Objective:
To design a ladder diagram using examine on and examine off instructions to Control
forward /reverse motor.
• Design a ladder diagram to close and open the shutter.
• (I:1/00) opens the shutter until (I:1/03).
• (I:1/02) stops the shutter at any position.
• (I:1/01) closes the shutter until (I:1/04).
• Motors should not run at the both directions at a time, (inter-lock is required).
PLC Program to Control Level of a Single Tank
[Link]
Status
Limit Switch Door Fully Open Door Fully Closed
LS1
Devices:
Normally closed stop push button (I:1/02).
Normally open push button to open the shutter (I:1/00).
Normally open push button to close the shutter (I:1/01).
Limit switch to stop opening (I:1/03).
Limit switch to stop closing (I:1/04).
Motor, opening direction (O:2/00).
Motor, closing direction (O:2/01).