You are on page 1of 25

PLC

Programming Languages

Liju G Chacko

Liju G Chacko PLC Programming Languages 1 / 25


Table of contents

1 Introduction

2 PLC programming languages


Instruction List Programming
Structured Text Programming
Functional Block Programming
Ladder Logic Programming
Sequential Function Chart

Liju G Chacko PLC Programming Languages 2 / 25


Introduction

Introduction
PLC(Programmable logic controller) is a multiple
inputs and output digital computer used for
automation of electromechanical processes.
These are the processes normally a PLC will carry
out during one cycle.
Step 1-: Self diagnosis.
Step 2-: Read inputs and store values.
Step 3-: Process logics/instructions.
Step 4-: Write outputs
(Above four steps are repeated again and again)
PLCs are programmed using application a software on personal
computers. From computer, binary or pseudocode will be
downloaded to PLC through Ethernet, RS-232, RS-485 or
RS-422 cable.
Liju G Chacko PLC Programming Languages 3 / 25
PLC programming languages

PLC programming languages

PLC Programming languages mentioned in IEC


61131-3
Instruction List Programming
Structured Text Programming
Functional Block Programming
Ladder Logic Programming
Sequential Function Charts

Liju G Chacko PLC Programming Languages 4 / 25


PLC programming languages Instruction List Programming

Instruction List(IL) Programming

Allen Bradley supports IL programming only on the


Micrologix 1000,
IL is similar to mnemonic programming languages
IL make use of an important concept – STACK
IL instructions(Allen Bradley version)
LD A- Store A to stack
LD A- Put A back to memory
ORB - ’OR’ the last two variables in stack
ANB - ’AND’ the last two variables in stack

Liju G Chacko PLC Programming Languages 5 / 25


PLC programming languages Instruction List Programming

Instruction List Programming

Liju G Chacko PLC Programming Languages 6 / 25


PLC programming languages Structured Text Programming

Structured Text Programming

Similar to high level language, such as Basic or C


Example-
Average of 5 numbers
F8:10 := 0;
WHILE (N7:0 < 5) DO
F8:10 := F8:10 + F8:[N7:0];
N7:0 := N7:0 + 1;
END_WHILE;

Liju G Chacko PLC Programming Languages 7 / 25


PLC programming languages Structured Text Programming

Structured Text(ST) Programming

Structures in ST Language

Structures Explanation
IF-THEN-ELSIF-ELSE-END IF normal if-then structure
CASE-value:-ELSE-END CASE a case switching function
FOR-TO-BY-DO-END FOR for-next loop
WHILE-DO-END WHILE while loop
TAN(A), COS(A), A**B,,. . . Basic math functions

Liju G Chacko PLC Programming Languages 8 / 25


PLC programming languages Functional Block Programming

Functional Block Programming

It is a graphical dataflow programming method

Liju G Chacko PLC Programming Languages 9 / 25


PLC programming languages Ladder Logic Programming

Ladder Logic Programming


It is a graphical programming language evolved from
electrical relay circuit

Each program statement is a line called the rung


with inputs to the left and the output to the
right.Execution starts from the top rung, down to
the last rung.
Liju G Chacko PLC Programming Languages 10 / 25
PLC programming languages Ladder Logic Programming

Ladder Logic Programming


Types of contact inputs

Examine if close Examine if open

Positive transition sense Negative transition sense

Liju G Chacko PLC Programming Languages 11 / 25


PLC programming languages Ladder Logic Programming

Ladder Logic Programming


Types of relay outputs

Output energized Negative output energized

Output latch/set Output unlatch/unset

Liju G Chacko PLC Programming Languages 12 / 25


PLC programming languages Ladder Logic Programming

Ladder Logic Programming

Function Blocks

On Delay Timer Off Delay Timer

Liju G Chacko PLC Programming Languages 13 / 25


PLC programming languages Sequential Function Chart

SEQUENTIAL FUNCTION CHART

Sequential Function Charts (SFCs) are a graphical


technique for writing concurrent control programs
SFC is based on GRAFCET (GRAphe Fonctionnel
de Commande Etapses/Transitions) [itself based on
binary petri nets]
Main components of SFC are:
Steps with associated actions
Transitions with associated logic conditions
Directed links between steps and transitions

Liju G Chacko PLC Programming Languages 14 / 25


PLC programming languages Sequential Function Chart

Sequencial Function Chart


SFC structure

Liju G Chacko PLC Programming Languages 15 / 25


PLC programming languages Sequential Function Chart

Sequencial Function Chart


WORKING

Liju G Chacko PLC Programming Languages 16 / 25


PLC programming languages Sequential Function Chart

Sequencial Function Chart


Macrostep(subroutines)

Liju G Chacko PLC Programming Languages 17 / 25


PLC programming languages Sequential Function Chart

Sequencial Function Chart


Concurrent control flow (two or more loops running in
parallel)

Liju G Chacko PLC Programming Languages 18 / 25


PLC programming languages Sequential Function Chart

Sequencial Function Chart


Action Block

Actions can be written in Ladder Logic, Instruction language or


structured text language. Action block is not a part of a Step. Step
just activates or deactivates the action block depending on the
qualifier, as long the step itself is active
eg;- Action 1

Liju G Chacko PLC Programming Languages 19 / 25


PLC programming languages Sequential Function Chart

Sequencial Function Chart


Action Qualifiers
Non-store(N)
Action is executed as long as the step is active

Set(S)
The action starts execution as soon as the step is active,
continues till R qualifier is executed .
Liju G Chacko PLC Programming Languages 20 / 25
PLC programming languages Sequential Function Chart

Sequencial Function Chart


Action Qualifiers(Continue...)
Overriding(R)
The action started by S, SD, DS, and SL qualifiers are
aborted by R qualifier.

Liju G Chacko PLC Programming Languages 21 / 25


PLC programming languages Sequential Function Chart

Sequencial Function Chart


Action Qualifiers(Continue...)
QUALIFIER EXPLANATION
-None- Non-stored(null qualifier)
N Non-stored
R Overriding reset
S Set(stored)
L time limited
D timer delayed
P pulse
SD stored and time delayed
DS delay and stored
SL stored andtime limited
P1 Pulse(rising edge)
P0 pulse(falling edge)
Liju G Chacko PLC Programming Languages 22 / 25
PLC programming languages Sequential Function Chart

Sequencial Function Chart

Important rules for SFC evolution[IEC 61131-3]


1 Evolution of active states of steps shall take place
along the directed links.(i.e, transition from one step
to another should take place along the connected
lines only )
2 The clearing time of transitions(transition condition)
should be as short as possible. Clear the transition
condition as soon as the next step is activated.

Liju G Chacko PLC Programming Languages 23 / 25


PLC programming languages Sequential Function Chart

References

[1] IEC 61131


[2] Automated Manufacturing Systems PLCs, by Hugh
Jack
[3] http://en.wikipedia.org/wiki/
Programmable logic controller

Liju G Chacko PLC Programming Languages 24 / 25


THANK YOU

You might also like