Download - PLC Programming Languages
PLCProgramming Languages
Liju G Chacko
Liju G Chacko PLC Programming Languages 1 / 25
Table of contents
1 Introduction
2 PLC programming languagesInstruction List ProgrammingStructured Text ProgrammingFunctional Block ProgrammingLadder Logic ProgrammingSequential Function Chart
Liju G Chacko PLC Programming Languages 2 / 25
Introduction
Introduction
PLC(Programmable logic controller) is a multipleinputs and output digital computer used forautomation of electromechanical processes.These are the processes normally a PLC will carryout 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 personalcomputers. From computer, binary or pseudocode will bedownloaded to PLC through Ethernet, RS-232, RS-485 orRS-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 theMicrologix 1000,
IL is similar to mnemonic programming languages
IL make use of an important concept – STACKIL instructions(Allen Bradley version)
LD A- Store A to stackLD A- Put A back to memoryORB - ’OR’ the last two variables in stackANB - ’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 ExplanationIF-THEN-ELSIF-ELSE-END IF normal if-then structureCASE-value:-ELSE-END CASE a case switching functionFOR-TO-BY-DO-END FOR for-next loopWHILE-DO-END WHILE while loopTAN(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 fromelectrical relay circuit
Each program statement is a line called the rungwith inputs to the left and the output to theright.Execution starts from the top rung, down tothe 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 graphicaltechnique for writing concurrent control programs
SFC is based on GRAFCET (GRAphe Fonctionnelde Commande Etapses/Transitions) [itself based onbinary petri nets]Main components of SFC are:
Steps with associated actionsTransitions with associated logic conditionsDirected links between steps and transitions
Liju G Chacko PLC Programming Languages 14 / 25
PLC programming languages Sequential Function Chart
Sequencial Function Chart
SFC structure
Figure : SFC structureLiju 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 inparallel)
Figure : Unlocking two doors with the same keypadLiju 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 orstructured text language. Action block is not a part of a Step. Stepjust activates or deactivates the action block depending on thequalifier, as long the step itself is activeeg;- Action 1
Liju G Chacko PLC Programming Languages 19 / 25
PLC programming languages Sequential Function Chart
Sequencial Function Chart
Action QualifiersNon-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 areaborted 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-storedR Overriding resetS Set(stored)L time limitedD timer delayedP pulse
SD stored and time delayedDS delay and storedSL stored andtime limitedP1 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 stepto another should take place along the connectedlines only )
2 The clearing time of transitions(transition condition)should be as short as possible. Clear the transitioncondition 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 HughJack
[3] http://en.wikipedia.org/wiki/Programmable logic controller
Liju G Chacko PLC Programming Languages 24 / 25
THANK YOU