Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

PROGRAMMABLE LOGIC

CONTROLLER (PLC)-
PROGRAMMING LANGUAGES
LEARNING OBJECTIVE : AFTER END OF THE
SESSION TRAINEES ARE ABLE TO KNOW

 Various types of PLC programming languages


 Ladder logic
 Function Block diagram
 Instruction list
 Structured test
 Sequential flow chart
LO1 DESCRIBE THE DESIGN AND OPERATIONAL
CHARACTERISTICS OF A PLC SYSTEM

M1: Explain the different types


of PLC programming languages
available
PROGRAMMING OF PLC
 A program consists of one or more instructions that
accomplish a task.
 Provides international standard. IEC 61131-3

 Deals with programming languages and defines two


graphical and two textual PLC programming language
standards
 Different programming languages
 Ladder diagram (LD) - graphical

 Function block diagram (FBD) – graphical

 Structured text (ST) - textual

 Instruction list (IL) – textual

 Sequential function chart (SFC)


PROGRAMMING OF PLC
LADDER LOGIC -
 One of the basic and easy PLC programming language.
 Ladder Diagram was originally modeled from relay-
logic which used physical devices, such as switches and
mechanical relays to control processes.
 Ladder Diagram utilizes internal logic to replace all,
except the physical devices that need an electrical signal
to activate them
 You can program all the necessary input conditions to
affect the output conditions, whether logical or physical.
LADDER DIAGRAM FEATURES
 Ladder diagram consists of two vertical lines representing the
power rails.
 Circuits are connected as horizontal lines between these two
verticals.
 Power flows from left to right.

 Output on right side can not be connected directly with left side.

 Contact can not be placed on the right of output.

 Each rung contains one output at least.

 Each output can be used only once in the program.

 A particular output can appear in more than one rung of a ladder.

 The inputs and outputs are all identified by their addresses, the
notation used depending on the PLC manufacturer.
LADDER LOGIC –ADVANTAGES AND
DISADVANTAGES
 Advantages
 The rungs allow it to be organized and easy to follow.

 It supports online editing very successfully.

 Disadvantages

 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.
FUNCTION BLOCK DIAGRAM
 The primary concept behind a FBD is data flow. In these
types of programs the values flow from the inputs to the
outputs, through function blocks.
 Function Blocks were originally developed to create a
system that you could set up many of the common,
repeatable tasks, such as counters, timers, PID Loops.
 In this program the inputs A and B are used to calculate a
value sin(A) * ln(B).
 The result of this calculation is compared to C.

 If the calculated value is less than C then the output X is


turned on, otherwise it is turned off.
 Many readers will note the similarity of the program to
block diagrams for control systems
1. The Function Block Diagram does work well with motion controls.
2. The visual method is easier for some users.
3. The biggest advantage of Function Block Diagram is that you can take many
lines of programming and put it into one or several function blocks.
INSTRUCTION LIST
 This language consists of many lines of code, with each
line representing exactly one operation.
 Thus, it is very step-by-step in layout and format, which
makes the entry of a series of simple mathematical
functions easy.
 Difficult language

 The language look like assembly. But this language can


be very compatible with hardware of PLC which can
provide very high speed than other language and by that
it use in professional cases like fast calculation and fast
take action
Mnemonic Function Description Ladder Equivalent

 
LD/STR Load/start Starts a logic sequence with a NO
contact
 
LDN/STRN Load/start not Starts a logic sequence with a NC
contact
 
AND And point Makes a NO contact series
connection

ANDN And not point Makes a NC contact series  

connection
 
OR Or point Makes a NO contact parallel
connection
 
ORN Or not point Makes a NC contact parallel
connection

OUT/ST Energize coil Terminates a sequence with an  

output coil
SEQUENTIAL FUNCTION CHART (SFC)

 resembles the computer flowcharts


 An initial step ―action box‖ (the starting
point of a flowchart) is followed by a series of
transitions and additional action steps.
 The concept of SFC Is simple:
 an action box, with code inside written in any
language of the programmer‘s choice, is
active until the transition step below it
activates.
 The sequential flow chart use to make the
programing easier also to understand for other
and easy to find fault also.

 So it will work form firs block box ( step 1 )


and then if it is done it will go to next step
( step 2) and then if it is done it will go to next
step (step 3) to reach final step
Flowlines - connects steps and transitions (these basically
indicate sequence)
transition - causes a shift between steps, acts as a point of
coordination .Allows control to move to the next step when
conditions met (basically an if or wait instruction)

Initial step - the first step

step - basically a state of operation.


A state often has an associated action

Step
Action
STRUCTURED TEXT(ST)
 Structured Text is a high-level language that is like
Basic, Pascal and “C”.
 It is a very powerful tool that 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.
 You must write out each line of code and it uses
functions such as FOR, WHILE, IF, ELSE, ELSEIF
AND CASE.
ST –ADVANTAGES AND
DISADVANTAGES
 Advantages
 1.It is very organized and good at computing large
mathematical calculations.
 2. It will enable you to cover some instructions that are
not available in some other languages like the Ladder
Diagram.
 Disadvantages

 1. The syntax can be difficult.

 2. It is hard to debug.

 3. It is difficult to edit online.


THANK YOU..

You might also like