Вы находитесь на странице: 1из 16

Programming a Programmable Logic Controler (PLC)

Jens Bathelt

Content of Module 3 Lesson 3.1, 1h: deepening Programmable Logic Controlers (PLC) and explaining Sequential Function Charts (SFC). Case 3.1, 2h: Programming SFC using SIMATIC S7-Graph Lesson 3.2, 1h: The remaining four IEC-1131 languages and State Transition Diagrams (STD) Case 3.2, 2h: Deepening SFC using SIMATC S7-Graph

Objectives Understand the principle setup and the properties of a PLC Distinguish between the different sequential control types and their characteristics Classification of the major programming languages (SFC, ST FBD, IL, LD) concerning their level of programming complexity Know the elements and properties of SFC Path step diagram and I/O list

Leadslide
requirements product

assurance of properties
sys tem

Control

Simulation

3D Visualization

domain-specific design
Control Actors Basic System

programming
Sensors

E-CAD M-CAD

modeling and model analysis

sys

tem

int e

gra tion

ig n d es

Overview of control typs

Electrical controls (Elektrische Steuerungen)

Logic control (VerknpfungsSteuerung) Time bounded (zeitgefhrt)

Sequential control (Ablaufsteuerung)

Sequential circuit (Schaltwerke)

Combinatorial circuit (Schaltnetze)

Process bounded (prozessgefhrt)

Cyclic signal processing (zyklische Signalverarbeitung)

Event oriented signal processing (ereignisorientierte Signalverarbeitung)

Time bounded

SIEMENS TIA Modul C1

Event oriented signal processing cut-off device


if (start-valve/START-Ventil 1.2 is activated) Cylinder 1.0 is extended if (limit switch/Grenztaster 1.3 is reached) Cylinder 1.0 will be retracted

SIEMENS TIA Modul C1

PLC (Programmable Logic Controller) PLC Online Tutorial: http://www.plcs.net/contents.shtml A PLC (i.e. Programmable Logic Controller) is a device that was invented to replace the necessary sequential relay circuits for machine control. The PLC works by looking at its inputs and depending upon their state, turning on/off its outputs.

http://www.plcs.net/

Examples of machines controlled by a PLC PLCs are used in many "real world" applications. If there is industry present, chances are good that there is a PLC present. If you are involved in machining, packaging, material handling, automated assembly or countless other industries you are probably already using them. Even machine tools have a PLC beside their NC.

Waterjet AB/ BTH, Sweden

SIG/Intelliact AG, Switzerland

PLC History
MODICON 084, the first practical programmable controller (1969).
Matsushita Electric Works Schweiz AG

Improved Communication: PLC PLC

Miniaturization Soft PLCs

Hardware 1960 1970 1980


Symbolic programming on PCs

1990
Five standardized programming languages IEC 1131-3

Software

Assembler on manufacturer specific hardware. 6-12 keys for each instruction

Analog I/Os like +/-10V in addition to the digital I/Os (Boolean variables)

http://www.plcs.net/ http://members.aol.com/rewellner/chatterx1/haupt.html

Mechatronic system
Control technology

PLC Actors Basic System


Mechanical design

Sensors

Electro mechanical Border

Material

Energy

Information

requirements

product

assurance of properties

Control

Simulation

3D Visualization

domain-specific design
Control Actors Basic System

programming
Sensors

E-CAD M-CAD

modeling and model analysis

Main components of a PLC

syst em

inte

grat ion

em syst desi gn

Input circuit CPU / Memory Output circuit

PLC program execution

Eingnge/Inputs:

Sensors

E0.0 E0.1 E0.2 .. 1 0 1 ..

1x

Check input status I/O-List


- Inputvariables - Outputvariables

Program
- Sequential logic

Ausgnge/Outputs:

Actors

1x

A0.0 A0.1 A0.2 .. 0 1 1 ..

Update output status

Overview of control types


Electrical Controls (Elektrische Steuerungen)

Logic control (VerknpfungsSteuerung) time bounded (zeitgefhrt)

Sequential control (Ablaufsteuerung)

Sequential circuit (Schaltwerke)

Combinatorial circuit (Schaltnetze)

? ?

process bounded (prozessgefhrt)

Cyclic signal processing (zyklische Signalverarbeitung)

Event oriented signal processing (ereignisorientierte Signalverarbeitung)

PLC Sequential Function Charts (SFC)

upload

Programming environment

PLC

The software development process for PLCs The five IEC 1131-3 (1993) languages arranged according to the software development process for PLCs: SFC, Sequential Function Chart (AS, Ablaufsprache) ST, Structured Text FBD, Function Block Diagram (FUP, Funktionsplan) IL, Instruction List (AWL, Anweisungsliste) LD, Ladder Diagram (KOP, Kontaktplan)
low
C:=A AND NOT B

level of language

SFC high

1 T1 2

N S

Fill Empty

ST

AND A B

FBD
C

LD A ANDN B ST C C

LD

A B

IL

- --/---------( )

analysis

design

coding

Bonfatti F., Monari P. D. and Sampieri U.: IEC 1131-3 Programming Methodology, CJ International, France, 1997

Fields of application for the PLC languages LD: Derived from the pre-PLC relay based controls. For instance used for the tool handling in the FANUC machine control ST: Good for former C programmers FBD: Drawing functions blocks to express logics (like and/or/not) analog to signal flows observed in electronic circuit diagrams (Stromlaufplan). IL: Old language, many experienced users, a lot of generated code in use in industry, hard to maintain, hard to read for externals, hard to handle in larger projects, fast, minimal memory usage, no programming structure. SFC: chemistry

SFC basics

Initial step

0 1 S FILL
Action name

Transition 0
Step Transition condition Action: SFC, ST, FBD, IL or LD

Transition 1 2 Transition 2 3 R Empty


Action identifier: - S: Set output (1) - R: Reset output (0) - ...

SFC basics

loop

and

or

SFC properties Graphical language (not like C) Derived from Petri Nets Transition conditions do lead to a sensor
Petri Net example

Actions do lead to an actuator SIEMENS: GRAPH

http://www.ento.vt.edu/~sharov/PopEcol/lec1/petrinet.html

The IEC standard does support a language mix: SFC for the toplevel structure and for instance ST as an action inside of a SFC action box

Animated 3D Model of the cutting device

Cutting device (Abschervorrichtung)

Cyl. C Clamping Cyl. A Holding

Cyl. D Cutting

Cyl. B Feeding
Cylinder A extends and holds the bar material Cylinder B extends and feeds the material to the limit stop Cylinder C extends and clamps the bar material in the cutting device Cylinder A retracts (releases the hold) and cylinder D extends (cutting) Cylinder B retracts (the feeding unit moves back) and cylinder D retracts Cylinder C retracts and releases the clamping A:1 B:1 C:1 A:0 & D:1 B:0 & D:0 C:0

Path-step diagram for the cutting device Step State


AND connection of 2 signals

Current state Signal

Limit switch

Cylinder A extends and holds the bar material Cylinder B extends and feeds the material to the limit stop Cylinder C extends and clamps the bar material in the cutting device Cylinder A retracts (releases the hold) and cylinder D extends (cutting) Cylinder B retracts (the feeding unit moves back) and cylinder D retracts Cylinder C retracts and releases the clamping

A:1 B:1 C:1 A:0 & D:1 B:0 & D:0 C:0

Cyl. C Clamping Cyl. A Holding

Cyl. D Cutting

Cyl. B Feeding

path-step diagram: signal modeling Sensors are connected via input variables to the signal lines.

Ordinary signal line

Branching

Or condition

And condition

I/O list for the cutting device


The I/O list is listing all In- and Outputs used in the control:

Cyl. C Clamping Cyl. A Holding

Cyl. D Cutting

A/S S0 S1 S2 S3 S4 S5 S6 S7 S8 A0 A1 A2 A3

Variable Name di_start di_cylA_home di_cylA_work di_cylB_home di_cylB_work di_cylC_home di_cylC_work di_cylD_home di_cylD_work do_cylA_valve do_cylB_valve do_cylC_valve do_cylD_valve

Comment Start button Limit switch cyl. A home Limit switch cyl. A work Limit switch cyl. B home Limit switch cyl. B work Limit switch cyl. C home Limit switch cyl. C work Limit switch cyl. D home Limit switch cyl. D work Control valve for cylinder Control valve for cylinder Control valve for cylinder Control valve for cylinder

Cyl. B Feeding

A B C D
SIEMENS TIA Modul C1

FAQ: The terms analog and digital I/O in the PLC world
Digital outputs Analog I/Os

Q: Input or Output? A: Always from the controls point of view! Q: Analog or Digital? A: The signal from or to the control is binary (digital) or a floating point value like 3.12435 (analog)

I/O list: bits and bytes Naming convention(sample):


di_xxx do_xxx ai_xxx ao_xxx //digital input //digital output //analog input //analog output f.i. f.i. f.i. f.i. for for for for a limit switch simple pneumatic cylinder a temperature sensor a motor

PLC byte interface for the communication with actuators and sensors: 0.0 0.1 0.2 0.3 1 Byte 0.4 0.5 [4 Bytes (DoubleWord) o i 0.6 Analog I/O (float in C)] a d 0.7 1.0 1.1 1 Bit [Digital I/O (bool in C++)] ..

SFC in SIEMENS.. ..for the cutting device

Cyl. C Clamping Cyl. A Holding

Cyl. D Cutting

Cyl. B Feeding

SIEMENS TIA Modul C1

Objectives Understand the principle setup and the properties of a PLC Distinguish between the different sequential control types and their characteristics Classification of the major programming languages (SFC, ST FBD, IL, LD) concerning their level of programming complexity Know the elements and properties of SFC Path step diagram and I/O list

Introduction Case 3.1 SIMATIC video

English settings in SIMATIC ! SIMATIC Optionen Einstellungen Sprache ENGLISCH (BausteinBlock,..) Mnemonics ENGLISCH (IE, QA,..)

Вам также может понравиться