100% found this document useful (2 votes)
1K views51 pages

PLC Ladder Progrmming

The document discusses PLC programming languages and ladder logic. The main PLC programming languages are ladder logic (LD), structured text (STL), functional block diagram (FBD), instruction list (IL), and sequential function charts (SFC). Ladder logic is the most common as it resembles relay logic used in earlier control systems. Ladder logic uses contacts, coils, and rungs to represent logic functions. Other languages include function block diagrams, sequential function charts, instruction lists, and structured text. The document provides examples of ladder logic programming for various logic functions and control applications.

Uploaded by

Joseph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
1K views51 pages

PLC Ladder Progrmming

The document discusses PLC programming languages and ladder logic. The main PLC programming languages are ladder logic (LD), structured text (STL), functional block diagram (FBD), instruction list (IL), and sequential function charts (SFC). Ladder logic is the most common as it resembles relay logic used in earlier control systems. Ladder logic uses contacts, coils, and rungs to represent logic functions. Other languages include function block diagrams, sequential function charts, instruction lists, and structured text. The document provides examples of ladder logic programming for various logic functions and control applications.

Uploaded by

Joseph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

PLC Programming

PLC generally support five programming language:


• LD (ladder language)
• STL (Structured Text Language)
• FBD (Functional Block diagram)
• IL (Instruction List)
• Sequential function charts (SFC)
PLC PROGRAMMING

Figure Standard IEC 61131 languages associated with PLC


programming.
• 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.
• Function Block Diagram (FBD) —a graphical depiction of process flow
using simple and complex interconnecting blocks.
• Sequential Function Chart (SFC) —a graphical depiction of
interconnecting steps, actions, and transitions.
• Instruction List (IL) —a low-level, text-based language that uses
mnemonic instructions.
• Structured Text (ST) —a high-level, text-based language such as
BASIC, C, or PASCAL specifically developed for industrial control
applications.
Comparison of ladder diagram and instruction list
programming.
PLC PROGRAMMING
LADDER LOGIC
• Ladder logic is the main programming method used for PLC's. Ladder logic has
been developed to mimic relay logic. By selecting ladder logic as the main
programming method, the amount of retraining needed for engineers and trades
people was greatly reduced.
• The first PLC was programmed with a technique that was based on relay logic
wiring schematics. This eliminated the need to teach the electricians, technicians
and engineers how to program - so this programming method has stuck and it is
the most common technique for programming in today's PLC.
PLC PROGRAMMING
INSTRUCTION LIST
• There are other methods to program PLCs. One of the earliest techniques
involved mnemonic instructions. These instructions can be derived directly from
the ladder logic diagrams and entered into the PLC through a simple programming
terminal.
SEQUENTIAL FUNCTION CHARTS (SFC)
• SFC have been developed to accommodate the programming of more advanced
systems. These are similar to flowcharts, but much more powerful. This method is
much different from flowcharts because it does not have to follow a single path
through the flowchart.
PLC PROGRAMMING
STRUCTURED TEXT (ST)
• Programming has been developed as a more modern programming language. It is quite
similar to languages such as BASIC and Pascal. • Structured Text (ST) is a high level textual
language that is a Pascal like language. It is very flexible and intuitive for writing control
algorithms.

FUNCTION BLOCK DIAGRAM (FBD)


FBD is another graphical programming language. The main concept is the data flow that
start from inputs and passes in block(s) and generate the output
LADDER DIAGRAM PROGRAMMING

Introduction to Ladder Logic


• Ladder logic uses graphic symbols similar to relay schematic circuit diagrams.
• Ladder diagram consists of two vertical lines representing the power rails.
• Circuits are connected as horizontal lines between these two verticals.

Ladder diagram features


• Power flows from left to right.
• Output on right side can not be connected directly with left side.
• Each rung contains one output at least.
• Each output can be used only once in the program.
• The inputs outputs are all identified by their addresses, the notation used depending on the PLC
manufacturer.
Ladder and functional
block programming
• Ladder diagrams
The Binary Concept
• The PLC, like all digital equipment, operates on the binary principle.
The term binary principle refers to the idea that many things can be
thought of as existing in only one of two states. These states are 1 and
0. The 1 and 0 can represent ON or OFF, open or closed, true or false,
high or low, or any other two conditions.
• A logic gate is a circuit with several inputs but only one output that is
activated by particular combinations of input conditions. The two-
state binary concept, applied to gates, can be the basis for making
decisions.
AND
OR
NOT
NAND
NOR
Exclusive OR (XOR)
Latching Multiple outputs
Ladder symbols
• For example,to enter a pair of contacts the key marked
Logic gates
RELAY CONTROLLERS AND LADDER DIAGRAMS
• A special schematic representation of the hardware and its
Connection has been developed that makes combination of the
hardware and event sequence description clear. This schematic is
called a ladder diagram.
• Background
Control Relays
Ladder Diagram Elements
• Relays
Motors and Solenoids
Hardwired Logic versus Programmed Logic
• The term hardwired logic refers to logic control functions that are determined by
the way devices are electrically interconnected.
• Hardwired logic can be implemented using relays and relay ladder schematics.
Relay ladder schematics are universally used and understood in industry.
• Hardwired logic is fixed; it is changeable only by altering the way devices are
electrically interconnected. In contrast, programmable control is based on the
basic logic functions, which are programmable and easily changed. These
functions (AND, OR, NOT) are used either singly or in combinations to form
instructions that will determine if a device is to be switched on or off. The form in
which these instructions are implemented to convey commands to the PLC is
called the language . The most common PLC language is ladder logic .
• Figure shows a typical relay ladder schematic of a motor top/start control station
with pilot lights. The control scheme is drawn between two vertical supply lines.
All the components are placed between these two lines, called rails or legs,
connecting the two power lines with what look like rungs of a ladder—thus the
name, relay ladder schematic

Figure Motor stop/start relay ladder schematic Figure Motor stop/start ladder logic program.
Lights and Switches
Program examples
Q. Draw ladder diagram for
a. When START push button is pressed, the output is energized
b. When push button gets released, the output still remains ON till STOP button is
pressed

Ladder Diagram:
• Input : Start (PB1)
Stop (PB1)
• Output: Coil Q1
Program examples
• Draw ladder diagram for
a. When push button ON After 5 sec motor M1 starts
b. After 5 sec, motor M2 starts and M1 stop.

Ladder Diagram:
Input: Start
Stop
Output: Motor M1
Motor M2
Flag bit: M1
Timer: T1(5sec)
T2(10sec)
Example of Process:
• Principles of Operation
• To get an idea of how a PLC operates, consider the simple process
control problem illustrated in Figure 1-17 . Here a mixer motor is to
be used to automatically stir the liquid in a vat when the temperature
and pressure reach preset values. In addition, direct manual
operation of the motor is provided by means of a separate
pushbutton station. The process is monitored with temperature and
pressure sensor switches that close their respective contacts when
conditions reach their preset values.
Fig Mixer process control problem. Figure Process control relay ladder diagram.
Figure 1-19 Typical wiring connections for a 120 VAC Figure 1-20 Typical wiring connections for a 120 VAC
modular configured input module. modular confi gured output module.
Source: Photo courtesy Automation Direct, Source: Photo courtesy Automation Direct,
www.automationdirect.com. www.automationdirect.com.
PLC Operation
• I/O Scan Mode During the I/O scan mode, the processor updates all outputs and inputs the state of all

inputs one channel at a time. The time required for this depends on the speed of the processor.

• Execution Mode During this mode, the processor evaluates each rung of the ladder diagram program that is

being executed sequentially, starting from the first rung and proceeding to the last rung.

• Scan Time An important characteristic of the programmable controller is how much time is required for one

complete cycle of I/O scan and execution. Of course, this depends on how many input and output channels

are involved and on the length of the ladder diagram program. A typical maximum scan/execution time is 5

to 20 ms

• The length of time for one scan consists of three parts: (1) input time, (2) execution time, and (3) output

time
• The scan time may have an impact on the ability of the PLC to detect events that
occur on the inputs. For example, if some limit switch goes to the ON state for
less than a scan time, it may be missed by the PLC. The high speed of modern
PLCs makes this less of a problem than in the old days
PLC ladder programming
Areas where programmable logic controllers
are applied
• 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.
• A conveyor belt
• Paper industry
• Cement manufacturing
• A lift
• A robot control system
• Liquid level monitoring

42
Exercise
1. Draw a ladder for following logic gates and verify it
NOT, OR, AND, NAND, NOR, XOR
2. Develop ladder diagram to realize 4:1 Mux
3. Draw a ladder for
a. When Start Push Button (PB) is pressed, the output is energized.
b. When PB is released, the output still remains ON till STOP button is pressed.
4. Draw the ladder for
a. When Push Button(PB) ON, Motor M1 starts for 5sec
b. After 5sec, Motor M2 starts for 5sec and M1 stop
5. Develop ladder for conveyer & bottle filling station having following sequence
a. Start the sequence
b. After start motor rotates
c. Motor stops as soon as bottle detects
d. Valve opens for 5 second and closes
e. After closing valve motor starts
43
6. Develop Ladder following sequence(Considering Four Inputs)
a. Any One INPUT ON: Green Light ON
b. Any two INPUT ON: Red Light ON, Green Light Off
c. Any Three INPUT ON: Alarm ON, Green and Red Light Off
d. Any Four INPUT ON: Fire ON, Green and Red Light Off, Alarm OFF

7. 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.

12/30/2020 44
Implementation of Ladder programming for Bottle Filling Plant:
Problem Definition:
Draw a ladder diagram for bottle filling plant with following specifications.
1. The objective of the process is to fill bottles moving on a conveyor.
2. In the Initialization phase the tank is prefilled using level control system, till set point is reached
using sensors like timers.
3. In the running phase, start the bottle conveyor and check bottle position.
4. Fill the bottle using level control system, then close output valve stop level control system and
again go to the running phase.
5. Construct a narrative statement outline of the event sequence for the bottle filling system shown
in Figure . The objective is to fill bottles moving on a conveyor.
6. Construct the ladder diagram that will provide a solution to the discrete state control problem
defined by in Figure.

45
12/30/2020 46
Solution: Process Flow (Event Sequence of the System): Assume that when the level control system is a
command is given to stop the continuous control system, the input valve is driven to the closed position and
then the sequence would be
I) Initialization (Prefill of tank)
a) Conveyor stopped output valve is closed
b) Start level control system
1 Operate for a sufficient time (one minute) to reach set-point.
2 Add another sensor so that the system knows when set-point is reached
3 Here timer is used.
c) When level is reached stop level control
d) Go to running phase
II) Running Phase
a) Start bottle conveyor
b) When bottle is in position
1 Stop the conveyor
2 Open the output valve
3 Turn on level-control system to keep the level constant during bottle fill
c) When the bottle is full
1 Close the output valve
2 Stop the level-control system
12/30/2020 47
d) Go to step II (a) and repeat.
Ladder Diagram for Bottle Filling
Plant:

12/30/2020 48
Ladder Description:
1. Rung-1 is used START /STOP latch is provided to define the initial start-up of the system.

2. Rung-2 is used for initialization, is accomplished by a 60-sec timer that turns on the level-
control system for the 1-min following the start button. In is never energized again during
running.

3. Rung-3 drives the conveyor motor until a bottle is in position, as indicated by the bottle
position switch opening.

4. Rung-4 is used to detect the bottle-full condition by energizing CR2.

5. Rung-5 & Rung-6 are used for the contacts of CR2 turns on both, the solenoid valve and
the level-control system .Note the timer in Rung-6 for initialization.

6. Rung-7 is necessary to detect that the bottle is full and to start the conveyor until the
bottle is moved out of position and the bottle-present switch is opened. Continuous running
now occurs between rung 3 and rung 7.

12/30/2020 49
References:
1. Programmable Logic Controllers, Fourth Edition ,W. Bolton
2. PROGRAMMABLE LOGIC CONTROLLERS Fourth Edition, Frank D. Petruzella
3. Process Control Instrumentation Technology, Eighth Edition ,Curtis D. Johnson

12/30/2020 50
END

You might also like