Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

Topic 3_1

PLC Programming

Dr. Mahesh S. Narkhede


Electrical Engineering Department
Government Polytechnic, Mumbai
msnarkhede@ymail.com
https://drmaheshsnarkhede.wordpress.com/
Course Outcome
2
After studying this topic you will be able to
• List PLC programming languages
• Develop PLC ladder diagrams
• Explain basic concept of ladder
• Apply rules of ladder
PLC Programming Languages
 IEC 61131-3 standard 3
 IEC 61131-3 is the international standard for
programmable controller programming
languages.
 The following is a list of programming
languages specified by this standard:
 Ladder diagram (LD)
 Sequential Function Charts (SFC)
 Function Block Diagram (FBD)
 Structured Text (ST)
 Instruction List (IL)
PLC Programming Languages
4
 One of the primary benefits of the standard
is that it allows multiple languages to be
used within the same programmable
controller.
 This allows the program developer to select
the language best suited to each particular
task.
PLC Programming Languages
5
 Ladder Logic
 Ladder logic is the main programming
method used for PLC’s. Ladder logic is
developed to mimic relay logic.
Advantages :
 The rungs allow it to be organized and easy
to follow.
 It also lets you document comments that
are readily visible.
 It supports online editing very successfully.
PLC Programming Languages
Disadvantages 6
 The main disadvantage is that there are
some instructions that are not available,
which might make it more difficult for
programming such as motion or batching.

Ladder Program
PLC Programming Languages
7
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.
 Here steps and transitions are used to
achieve end results.
 Steps act as a major function in program.
These steps house the actions that occur
when we program them to happen. This
decision can be based on timing, a certain
phase of the process, or a physical state of
an equipment.
PLC Programming Languages
8
 Transitions are the instructions that you use
to move from one step to another step by
setting conditions of true or false.
 Unlike traditional flowcharts, the Sequential
Function Charts can have multiple paths.
 We can use branches to initiate multiple
steps at one time.
PLC Programming Languages
9
Advantages
 Processes can be broken into major steps
that can make troubleshooting faster and
easier.
 We have direct access in the logic to see
where a piece of equipment faulted.
 It can be faster to design and write the logic
due to the ability to use repeated
executions of individual pieces of logic.
Disadvantages
 It does not always fit every application.
PLC Programming Languages
10

Sequential Function Chart


PLC Programming Languages
11
 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.
 Function Blocks are developed to create a
system that could set up many of the
common, repeatable tasks, such as
counters, timers, PID Loops, etc.
 Then blocks are programmed onto sheets
and then the PLC constantly scans the
sheets in numerical order or is determined
by connections programmed between the
blocks.
PLC Programming Languages
12

Different Function Blocks


PLC Programming Languages
13

Function Block Diagram


PLC Programming Languages
Advantages 14
 The FBD does work well with motion controls.
 The visual method is easier for some users.
 The biggest advantage of FBD that you can
take many lines of programming and put it
into one or several function blocks.
Disadvantages
 The code can get disorganized using this
PLC Programming Language because you
can place the function blocks anywhere on
the sheet. This can also make it more difficult
to troubleshoot.
PLC Programming Languages
 Structured Text (ST) 15
 Structured Text (ST) is a high level textual
language that is similar to Pascal , Basic and
C
 It is very flexible and intuitive for writing control
algorithms. It can execute complex tasks
utilizing algorithms and mathematical
functions along with repetitive tasks.
 The code uses statements that are separated
by semicolons and then either inputs, outputs,
or variables are changed by these
statements.
 It uses functions such as FOR, WHILE, IF, ELSE,
ELSEIF AND CASE.
PLC Programming Languages
16
Advantages
 It is very organized and good at computing
large mathematical calculations.
 It will enable you to cover some instructions
that are not available in some other
languages like the Ladder Diagram.
Disadvantages
 The syntax can be difficult.
 It is hard to debug.
 It is difficult to edit online.
PLC Programming Languages
17

Structured Text
PLC Programming Languages
18
 Instruction List
 The Instruction List language resembles
Assembly Language. We use mnemonic
codes such as LD (Load), AND, OR, etc.
Advantages
 The Instruction List language is valuable for
applications that need code that is
compact and time critical.
PLC Programming Languages
19
Disadvantages
 There are few structuring possibilities with the
“Goto” command being one of them.
 There can also be many errors that are more
difficult to deal with in comparison to many
of the other languages.
PLC Programming Languages
20

Instruction List
Development of PLC Ladder Diagram
21
 Ladder diagrams are specialized schematics
commonly used to document industrial
control logic systems.
 They are called "ladder" diagrams because
they resemble a ladder
 The two vertical rails are called as power
rails
 Horizontal lines are called as Rungs
Development of PLC Ladder Diagram
22
Development of PLC Ladder Diagram
23
 A rung of ladder diagram code can contain
both input and output instructions
 Input instructions perform a comparison or
test and set the rung state based on the
outcome
 Input Instructions are normally left justified on
the rung
 Output instructions examine the rung state
and execute some operation or function
 Output Instructions are normally right justified
on the rung Input Instruction Output Instruction
Development of PLC Ladder Diagram
24

B F
AND
C D
E
A
Branches
OR

IF ((A OR B) AND (NOT C) AND D) THEN E=1; F=1 END_IF

 Ladder Diagram input instructions perform


logical AND and OR operations in and
easy to understand format as shown.
Rules of Ladder Diagram
25
Ladder Logic Execution
 Rungs of Ladder diagram are solved from
Left to right and top to bottom
 Branches within rungs are solved top left to
bottom right
Ladder Rung

A D E
Left Power Rail Right Power Rail
B G
Branch
F H
J
S
K
R
I P
References
 https://realpars.com/plc-programming-
26
languages/
27

HAPPY LEARNING!
Dr.Mahesh S. Narkhede
Electrical Engineering Department
Government Polytechnic, Mumbai
msnarkhede@ymail.com
https://drmaheshsnarkhede.wordpress.com/

You might also like