Professional Documents
Culture Documents
Outline
2
History and basic idea General structure of a PLC based system Programming a PLC - B i structure P i Basic t t Programming languages Real life Real-life examples
Control
l l Control-Signal
Actor
Process
Sensor
Situation: Hundred or thousands of relays, closed-loop controllers in cars Complete rewiring for new model creation needed
General Motors Hydramatic requests proposal for an alternative Winner Bedford Associates with 084 Foundation of M di F d ti f Modicon, MOd l DI it l CONt ll MOdular DIgital CONtroller Richard (Dick) Morley inventor of PLC 1969 invention of solid-state sequential logic solver solid state
A programmable logic controller (PLC) or programmable controller is a digital computer used for automation of electromechanical processes.
Severall SPS types available Hardware SPS Soft S ft SPS Slot SPS
PSU
CPU
RAM
ROM
Internal Bus
BI
BO
AI
AO
FB
External Bus
13
Programming a PLC
14
PLC Programming process: Creating a new ST project. Defining the labels to be used in an ST program. Creating an ST program. Converting (compiling) the created ST program into an executable sequence program. Correcting the program if a convert (compile) error occurs.
Programming a PLC
15
IEC 61131-3 international standard defines PLC programming languages and concepts
Graphical
Programming a PLC
16
PLC configuration structure Task Program Program Program FCs FBs FCs FBs FBs FCs FBs FBs FCs FBs FCs FBs Task Program Program Program FCs FBs FCs FBs FBs FCs FBs FBs FCs FBs FCs FBs
Programming a PLC
17 Input Output
Function
Programming a PLC
18 Input Output
Function-Block
Function blocks are reusable Accessable as instances with own state object orientation Various predefined functions blocks available
Function blocks TP, TON, TOF F_TRIG, R_TRIG SR, RS CTU, CTD, CTUD , ,
Programming a PLC
19
DATATYPE
:=INIT;
(**)
:Bool
:=false; (*Beispiel*)
Several variable types: yp VAR_INPUT VAR_OUTPUT VAR VAR_GLOBAL VAR_IN_OUT VAR_RETAIN VAR_PERSISTANT Input variables Output variables p Local variables Global variables Variable can be changed and returned Variable keeps value after power off Variable keeps value after software redeployment
23
Programming Languages
Programming a PLC - IL
24
Instruction list, assembler like programming language , p g g g g Very lightweight language Every line consists of command and operand Several commands defined, extract: , Description Load variable Store variable Jump Conditional jump Call of a function/program/block
Programming a PLC - IL
25
LD A AND (B OR (C ANDN (D ) ) ) ST E
Structured text, close to high languages like c, pascal , g g g ,p Every command ends with a semicolon Allows conditions like if/case and loops Assignments with := g
CASE f OF 1: a:=3; 2: a:=5; 3: a:=2; ELSE a:=0; END CASE;
IF (TEMP > 20) THEN HEATER := OFF; : COOLER := ON; ELSIF (TEMP < 19) HEATER := ON; COOLER := OFF; END_IF;
Ladder diagram, graphical p g programming language g ,g p g g g Close to circuit diagram Power flow from left to right Symbol --| |-|| --|/|---| NOT |---() --P---N-N Description Opener,if on state is transfered p , Closer,if off state is transfered Negation Output relais Detection of positive change 01 Detection of nefative change 10
a = I/0 b = I/1
Function block diagram, graphical p g programming language g ,g p g g g Based on function and function block composition
c d
ANDN
b a
OR AND
Sequencial Function Chart, graphical p g programming language q ,g p g g g Only used for sequencial data flows Consists of actions and transitions
34
Real-Life examples
Real-Life examples
35
Real-Life examples
36
Real-Life examples
37
Real-Life examples
38
References
39 Speicherprogrammierbare Steuerungen, Matthias Seitz, ISBN: 978-3-446-41431-0 http://www.software.rockwell.com/corporate/reference/Iec1131/st.cfm http://www.sps-lehrgang.de/kontaktplan-kop/ http://www.plcmanual.com/plc-programming http://www.plcsimulator.net/plc.php http://www.amci.com/tutorials/tutorials-what-is-programmable-logic-controller.asp http://www.scantime.co.uk/_docs/Mi/Structured%20Text%20Prog%20Manual.pdf
40