Programmable Logic Controller(PLC) Seminar: Distributed Real-time - - PowerPoint PPT Presentation

programmable logic controller plc
SMART_READER_LITE
LIVE PREVIEW

Programmable Logic Controller(PLC) Seminar: Distributed Real-time - - PowerPoint PPT Presentation

Programmable Logic Controller(PLC) Seminar: Distributed Real-time Systems Outline Outline 2 History and basic idea General structure of a PLC based system Programming a PLC - Basic structure P i PLC B i t t Programming


slide-1
SLIDE 1

Programmable Logic Controller(PLC)

Seminar: Distributed Real-time Systems

slide-2
SLIDE 2

Outline Outline

2

  • History and basic idea
  • General structure of a PLC based system

P i PLC B i t t

  • Programming a PLC - Basic structure
  • Programming languages
  • Real-life examples
  • Real life examples

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-3
SLIDE 3

3

History and basic idea

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-4
SLIDE 4

History and basic idea History and basic idea

4

Si l l l

Control-Chain Closed-Loop Control Control Actor Process

Input-Signal Control-Signal

Sensor

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-5
SLIDE 5

History and basic idea History and basic idea

5

  • Situation:
  • Hundred or thousands of relays, closed-loop controllers in cars
  • Complete rewiring for new model creation needed

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-6
SLIDE 6

History and basic idea History and basic idea

6

  • General Motors Hydramatic requests proposal for an alternative
  • Winner “Bedford Associates” with 084

F d ti f M di MOd l DI it l CONt ll

  • Foundation of Modicon, MOdular DIgital CONtroller
  • Richard (Dick) Morley inventor of PLC
  • 1969 invention of solid-state sequential logic solver
  • 1969 invention of solid state sequential logic solver

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-7
SLIDE 7

History and basic idea History and basic idea

7

A programmable logic controller (PLC) or programmable controller is a digital computer used for automation of electromechanical processes.

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-8
SLIDE 8

8

Structure of PLC based systems

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-9
SLIDE 9

Structure of PLC based systems Structure of PLC based systems

9 BUS e.g. Ethercat, CAN Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-10
SLIDE 10

Structure of PLC based systems Structure of PLC based systems

10

  • Severall SPS types available
  • Hardware SPS

S ft SPS

  • Soft SPS
  • Slot SPS

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-11
SLIDE 11

Structure of PLC based systems Structure of PLC based systems

11

PSU CPU RAM ROM

Ethernet RS Internal Bus

BI BO AI AO FB

External Bus Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-12
SLIDE 12

Structure of PLC based systems Structure of PLC based systems

12

  • Two ways of working
  • Cyclic

E t b d

  • Event based

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-13
SLIDE 13

13

Programming a PLC system

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-14
SLIDE 14

Programming a PLC 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 Converting (compiling) the created ST program into an executable sequence program. Correcting the program if a convert (compile) Correcting the program if a convert (compile) error occurs.

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-15
SLIDE 15

Programming a PLC Programming a PLC

15

  • IEC 61131-3 international standard defines PLC programming

languages and concepts IEC 61131-3 Programming languages Text-based Graphical

Instruction-List Structured-Text Ladder-Diagram Sequential Function Chart Function Block Diagram Chart

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-16
SLIDE 16

Programming a PLC Programming a PLC

16

PLC configuration structure Task Task Program FBs FCs FBs FCs Program FBs FCs Program Program FBs FCs FBs FCs Program FBs FCs Program FBs FBs FCs FCs FBs FCs FBs FBs FCs FCs FBs FCs FBs FBs FCs FCs … FBs FBs FCs FCs FBs FCs FBs FBs FCs FCs FBs FCs FBs FBs FCs FCs

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-17
SLIDE 17

Programming a PLC Programming a PLC

17 Input Output

Function

  • Functions are reusable

Various predefined functions:

  • Various predefined functions:

Class Functions Bool AND, NOT, OR, XOR Bool AND, NOT, OR, XOR Mathematic ADD, SUB, NEG, DIV, MUL, MOD Casting BYTE_TO_WORD, INT_TO_REAL Numeric SIN, TAN, COS, LN, LOG Comparator EQ, LT, GT Bit-Operations SHL, SHR, ROL, ROR

Programmable Logic Controller | Stefan Reichel | 23.06.2010

Bit Operations SHL, SHR, ROL, ROR Selection LIMIT, MIN, MAX

slide-18
SLIDE 18

Programming a PLC Programming a PLC

18 Input Output

Function-Block

  • Function blocks are reusable
  • Accessable as instances with own state object orientation
  • Accessable as instances with own state object orientation
  • Various predefined functions blocks available

Class Function blocks Timer TP, TON, TOF Trigger F_TRIG, R_TRIG Flip-Flops SR, RS Counter CTU, CTD, CTUD

Programmable Logic Controller | Stefan Reichel | 23.06.2010

, ,

slide-19
SLIDE 19

Programming a PLC Programming a PLC

19

  • PLC resource addresssing

g

I/O Identification Source Type AT % I for Input X Bit AT % I for Input Q for Output X Bit B Byte W Word D DoubleWord

  • Addresssing example:
  • AT %IX1.2
  • AT %IW6

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-20
SLIDE 20

Programming a PLC - Variables Programming a PLC - Variables

20

  • Variable declaration:
  • NAME

ADDRESS: DATATYPE :=INIT; (**)

VAR VAR Sensor AT%IX0.1 :Bool :=false; (*Beispiel*) END_VAR; VAR INPUT X: REAL; Y: REAl; END VAR; VAR_OUTPUT ERGEBNIS: INT; END VAR;

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-21
SLIDE 21

Programming a PLC - Variables Programming a PLC - Variables

21

  • Several variable types:

yp

  • VAR_INPUT

Input variables

  • VAR_OUTPUT

Output variables p

  • VAR

Local variables

  • VAR_GLOBAL

Global variables

  • VAR_IN_OUT

Variable can be changed and returned

  • VAR_RETAIN

Variable keeps value after power off

  • VAR_PERSISTANT Variable keeps value after software

redeployment

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-22
SLIDE 22

Programming a PLC - Datatypes Programming a PLC - Datatypes

22 Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-23
SLIDE 23

23

Programming Languages

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-24
SLIDE 24

Programming a PLC - IL 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:

, Command Description LD Load variable LD Load variable ST Store variable JMP Jump JMPC Conditional jump CAL Call of a function/program/block

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-25
SLIDE 25

Programming a PLC - IL Programming a PLC - IL

25

  • Instruction list, example:

, p a ∧ (b ∨ (c ∧ -d)) = e

LD A AND (B AND (B OR (C ANDN (D ) ) ) ST E

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-26
SLIDE 26

Programming a PLC – Structured text Programming a PLC – Structured text

26

  • 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

IF (TEMP > 20) THEN HEATER : OFF; CASE f OF 1: a:=3; HEATER := OFF; COOLER := ON; ELSIF (TEMP < 19) HEATER := ON; 1: a:=3; 2: a:=5; 3: a:=2; ELSE a:=0; COOLER := OFF; END_IF; END CASE;

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-27
SLIDE 27

Programming a PLC – Structured text Programming a PLC – Structured text

27

  • Structured text support several loop types

pp p yp

FOR a:=0 TO 10 BY 1 DO c:=a + 4; WHILE b > 1 DO b:= b/2; REPEAT a:= b * c; UNTIL a > 1000; ; END_FOR; / ; END_WHILE; ; END_REPEAT;

  • Function and function block calls

MYFB(IN:=a, IN:=b); c:= MYFB Q; c:= MYFC(a,b); c:= MYFB.Q;

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-28
SLIDE 28

Programming a PLC – Structured text Programming a PLC – Structured text

28

  • Our example:

p a ∧ (b ∨ (c ∧ -d)) = e

e := a AND (b OR (C ANDN d));

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-29
SLIDE 29

Programming a PLC – Ladder diagram Programming a PLC – Ladder diagram

29

  • Ladder diagram, graphical programming language

g , g p p g g g g

  • Close to circuit diagram
  • Power flow from left to right

Symbol Description

  • -| |--

Opener,if on state is transfered | | p ,

  • -|/|--

Closer,if off state is transfered

  • -| NOT |--

Negation

  • -()

Output relais

  • -P--

Detection of positive change 01 N Detection of nefative change 10

  • -N--

Detection of nefative change 10

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-30
SLIDE 30

Programming a PLC – Structured text Programming a PLC – Structured text

30

  • Our example:

p a ∧ (b ∨ (c ∧ -d)) = e a = I/0 b = I/1 b = I/1 …

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-31
SLIDE 31

Programming a PLC – Function block Programming a PLC – Function block

31

  • Function block diagram, graphical programming language

g , g p p g g g g

  • Based on function and function block composition

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-32
SLIDE 32

Programming a PLC – Function Block Programming a PLC – Function Block

32

  • Our example:

p a ∧ (b ∨ (c ∧ -d)) = e

ANDN

c d

AND

a

OR

b e

AND

a e

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-33
SLIDE 33

Programming a PLC – SFC Programming a PLC – SFC

33

  • Sequencial Function Chart, graphical programming language

q , g p p g g g g

  • Only used for sequencial data flows
  • Consists of actions and transitions

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-34
SLIDE 34

34

Real-Life examples

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-35
SLIDE 35

Real-Life examples Real-Life examples

35 Folienmaster | Max Mustermann | 7. Oktober 2007

slide-36
SLIDE 36

Real-Life examples Real-Life examples

36 Folienmaster | Max Mustermann | 7. Oktober 2007

slide-37
SLIDE 37

Real-Life examples Real-Life examples

37 Folienmaster | Max Mustermann | 7. Oktober 2007

slide-38
SLIDE 38

Real-Life examples Real-Life examples

38 Folienmaster | Max Mustermann | 7. Oktober 2007

slide-39
SLIDE 39

References 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

Programmable Logic Controller | Stefan Reichel | 23.06.2010

slide-40
SLIDE 40

40

Thank you for your patience

Programmable Logic Controller | Stefan Reichel | 23.06.2010