Object oriented Programming in Automation

silkthrilledΛογισμικό & κατασκευή λογ/κού

18 Νοε 2013 (πριν από 3 χρόνια και 10 μήνες)

210 εμφανίσεις

13.01.20121
Object oriented Programming in Automation
Object oriented Programming in Automation
Beckhoff -Facts
Control philosophy
Central or distributed control
The Software aspect
More and more know how in software
Software Engineering in Automation?
Object oriented programming
Unified modelling language UML
Object oriented programming –an introduction
IEC61131-3 3rd edition –new standard
Usageofthestandardbymeansofan example
Summary
Agenda
13.01.20122
Dr.-Ing. Josef Papenfort
TwinCATProduct Management
j.papenfort@beckhoff.com
Object oriented Programming in Automation
Agenda
13.01.20123
Beckhoff -Facts
Control philosophy
Central or distributed control
The Software aspect
More and more know how in software
Software Engineering in Automation?
Object oriented programming
Unified modelling language UML
Object oriented programming –an introduction
IEC61131-3 3rd edition –new standard
Usageofthestandardbymeansofan example
Summary
Object oriented Programming in AutomationFacts and figures
as of: 10/2011
Headquarters:Verl, Germany
Employees worldwide: 2,130
Number of engineers:660
Sales/technical offices in Germany: 11
Beckhoff subsidiaries:30 countries
Subsidiaries and distributors:more than 60 countries
Sales 2009:236 million €
Sales 2010:346 million €(+46 %, +24 % 2008)
Verl
13.01.20124
Object oriented Programming in AutomationTurnover worldwide
Million €
0
50
100
150
200
250
300
350
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
346
236
278
Sales 2010: 346 million (+46 %)
13.01.20125
Object oriented Programming in AutomationSales network Germany
Headquarters
Office
Development Center
Hanover
Verl
Lübeck
Balingen
Frankfurt
Moers
Nuremberg
Munich
Berlin
Münster
Marktheidenfeld
13.01.20126
Object oriented Programming in Automation Sales network Europe
Haarlem
Henley-on-Thames
Paris
Brno
Veszprem
Schaffhausen
Milano
Bürs
Verl
Piaseczno
Sofia
Athens
Aveiro
Malmö
Zagreb
Cluj-Napoca
Barcelona
Hasselt
Kaunas
Tønsberg
Istanbul
Ljubljana
Hyvinkää
Glostrup
Beckhoff subsidiary
New Beckhoff subsidiary
(in 2012)
Beckhoff distributor
Budapest
13.01.20127
Object oriented Programming in Automation Sales network worldwide
Guelph/Toronto
Minneapolis
Kuala Lumpur
Beijing
Seoul
Singapore
Verl
Bangkok
Surabaya
Moscow
Santiago
Shanghai
Guangzhou
Ekaterinburg
Taipei
São Paulo
Johannesburg
Melbourne
Dubai
Saint-Petersburg
Pune
Barcelona
Tel Aviv
Lisbon
Mexico City
Yokohama
Auckland
Budapest
Beckhoff subsidiary
New Beckhoff subsidiary
New Beckhoff subsidiary (in 2012)
Beckhoff distributor
Beckhoff (i. p.)
Samara
Krasnodar
13.01.20128
Object oriented Programming in AutomationMilestones
Foundation
CX1000
Embedded PC
EtherCAT
Fieldbus Box
S2000 PLC/NC/CNC
S1000 PLC/NC on PC
Bus Terminal:
universal I/O
TwinCAT: IEC 61131 PLC
real-time, Windows NT
TwinCAT CE
Drives:
AX5000
Lightbus
PC-compatible
machine control
Embedded
motherboards
Control Panel
and Box PC
All-in-one
PC motherboard
EtherCAT
TwinSAFE
TwinSAFE
Atom™ CPU
HD Bus
Terminal
TwinCAT 3
XFC
8083828184858687889089
91
92
93
94
9596979899
00
01
02
0304
05
0607
08
09
10
Drive Technology
IPC Technology
I/O Technology
Software Technology
13.01.20129
Object oriented Programming in Automation
Beckhoff -Facts
Control philosophy
Central or distributed control
The Software aspect
More and more know how in software
Software Engineering in Automation?
Object oriented programming
Unified modelling language UML
Object oriented programming –an introduction
IEC61131-3 3rd edition –new standard
Usageofthestandardbymeansofan example
Summary
Agenda
13.01.201210
Object oriented Programming in Automation
The Human Being!
The result of Evolutionary Genetic Engineering:
13.01.201211
Object oriented Programming in Automation
Human central CPU
Mostly centralised
point to point
data connection
Decentralised
sensory input
Decentralised
actor output
The result of Evolutionary Genetic Engineering:
13.01.201212
Object oriented Programming in Automation
Human central CPU
Mostly centralised
point to point
data connection
Decentralised
sensor input
Decentralised
actor output
Intelligence
and
Personality
Hear-
ing
Touch
Sight
Movement
Cerebellum
Brainstem
A centralised CPU with modular function blocks
13.01.201213
Modularity in
Software!
Object oriented Programming in Automation
Windows NT, 2000, XP
I/O
Digital, Analog,
Encoder, COM,
Special Functions
I/O
PTP
CAM

CNC
PTD
1
Task
PLC
Multi PLC
Motion
Multi Axis
Special Functions
Multi Channel
AX52xx
AM3xxx
AX52xx
AM3xxx
HMI
1
2
3
4
2
Task
1
2
3
4
3
Task
1
2
3
4
4
Task
1
2
3
4
Industrial PC
13.01.201214
Object oriented Programming in Automation
Nature also uses highly decentralised
constructions and control structures
13.01.201215
Object oriented Programming in Automation
ES2016
CX900x-x00x
CX900x-x00x
AX52xx
AX52xx
AM3xxx
AM3xxx
Embedded PC
Intgrated PLC/NC
Embedded PC
Intgrated PLC/NC
CX1000
CX1000
CX9000
CX9000
Switch
PC Control –Ideal for decentralisedcontrol!
13.01.201216
Modularity in
Hardware!
Object oriented Programming in Automation
Beckhoff -Facts
Control philosophy
Central or distributed control
The Software aspect
More and more know how in software
Software Engineering in Automation?
Object oriented programming
Unified modelling language UML
Object oriented programming –an introduction
IEC61131-3 3rd edition –new standard
Usageofthestandardbymeansofan example
Summary
Agenda
13.01.201217
Object oriented Programming in Automation
1990
19952000200520102020
5 GHz
4 GHz
3 GHz
2 GHz
1 GHz
0.5 GHz
0.25 GHz
2.8 GHz
0.7 GHz
133 MHz
33 MHz
Scientific Automation
HMI
Motion
PLC
10 vGHz
100 vGHz
CPU Virtual Clock
PC-Control –increasing CPU power
13.01.201218
Object oriented Programming in Automation
Software (and electric systems) grow versus mechanical systems
Percentage of Software development costs in
production systems (source: McKinsey)
0%
20%
40%
60%
80%
100%
1970198019902000
Mechanic
Electric
Software
But: Software grows versus mechanical systems
13.01.201219
2020
Object oriented Programming in Automation
Vision
Robotics
Simulation
Modeling &
Advanced Control
Instrumentation
& Measurement
Advanced Diagnostics
Scientific Automation –more than Standard Automation
TwinCAT extends
Automation into new
fields of application
Instrumentation &
Measurement
Advanced control
Rapid control prototyping
Simulation/real-time
Data Analysis
Test bench Automation
Scientific Automation
13.01.201220
Object oriented Programming in Automation
Goal: Application is based on Modules.
Modules can be combined and linked.
Hardware
Mechanics
Software
Connectivity
Technological Module
Application is the combination
of encapsulated technological modules
How to build up Software in the future…
13.01.201221
Necessary : object oriented programming!
Object oriented Programming in Automation
Object orientation
Abstraction
Instruction List
IEC61499
time
Holonic Systems
Software Agents
IEC61131
Modul 1
UML
Required programming paradigms
13.01.201222
IEC61131++
Object oriented Programming in Automation
Beckhoff -Facts
Control philosophy
Central or distributed control
The Software aspect
More and more know how in software
Software Engineering in Automation?
Object oriented programming
Unified modelling language UML
Object oriented programming –an introduction
IEC61131-3 3rd edition –new standard
Usageofthestandardbymeansofan example
Summary
Agenda
13.01.201224
Object oriented Programming in Automation
Main Program
Data
Procedure1
Procedure2
Procedure3
13.01.201225
Aprogram can be viewed as a sequence of procedure calls.
The main program is responsible to pass data to the individual calls, the
data is processed by the procedures and the resulting data is presented.
Thus, the flow of data can be illustrated as a hierarchical graph, a tree.
IEC61131-3 –procedural programming
Object oriented Programming in Automation
Object-Oriented Programming
Object is derived from abstract data type
Object-oriented programming has a web of interacting objects, each
house-keeping its own state.
Objects of a program interact by sending messages to each other.
TwinCAT3 PLC –Object oriented programming
13.01.201226
Object oriented Programming in Automation
Object1
Data1+Procedures1
Data
Object3
Data3
+Procedures
3
Object2
Data2 +Procedures
2
IEC61131 –Object oriented programming
13.01.201227
Object is derived from abstract data type
Object-oriented programming has a web of interacting objects, each
house-keeping its own state.
Objects of a program interact by sending messages to each other.
Object oriented Programming in Automation
Object-Orientation
It is a kind of thinking methodology
Everything in the world is an object;
Any system is composed of objects (certainly a system is also an
object);
The evolution and development of a system is caused by the
interactions among the objects inside or outside the system
In Automation:
In most case classes are easy to detect in machine applications!
13.01.201228
IEC61131 –Object oriented programming
Object oriented Programming in Automation
Beckhoff -Facts
Control philosophy
Central or distributed control
The Software aspect
More and more know how in software
Software Engineering in Automation?
Object oriented programming
Unified modelling language UML
Object oriented programming –an introduction
IEC61131-3 3rd edition –new standard
Usageofthestandardbymeansofan example
Summary
Agenda
13.01.201229
Object oriented Programming in Automation TwinCAT3 PLC –IEC61131 Standard
13.01.201230
Components of the IEC standard
Part 1: General information; current issue 3.2004
Part 2: Resouce-requirements and tests; current issue 2.2004
Part 3: Programming languages; current issue 12.2003
Part 4: User Guidelines
Part 5: Communication; current issue 11.2001
Part 7: Fuzzy-Control-Programming; current issue 11.2001
Part 8: Guidelines for the application and implementation of
programming languages
IEC61131-3 3
rd
Edition with object oriented extensions!
Will be released in 2012!
Object oriented Programming in Automation
Seven new keywords:
METHOD: Action on FB with own variables
PROPERTY: POE-Pair for Set/Get of attribute
THIS, SUPER: in Method/Property for the current FB-instance
EXTENDS: Inheritance between FBs
INTERFACE: defines abstract object-type (FB without implementation)
IMPLEMENTSin the FB: Instances over named interface callable
Call-syntax for methods:
Object.Methodname(…)
Special methods:
FB_Init, FB_Exit, FB_Reinit
Object-orientation with the IEC61131-3 3rd edition
13.01.201231
Object oriented Programming in Automation
Languageproperties
2ndEdition
IEC61131-3
3rdEdition
IEC61131-3
C++JavaC#
Multilanguage++---
OOP/proceduralmixed-++--
Classes~(FB)++++
Methods~(Actions)++++
Interfaces-+-++
Partialabstractclasses--+++
Polymorphy-++/-++
Referencesemantics-+(Interfaces)-++
Constructor/Destructor-++++
Properties-+--+
Visibility~(Variables)~(Variables)+++
Dyn. memory(„new“)--(inTC3)+++
Object-orientation with the IEC61131-3 3rd edition
13.01.201232
Object oriented Programming in Automation
Beckhoff -Facts
Control philosophy
Central or distributed control
The Software aspect
More and more know how in software
Software Engineering in Automation?
Object oriented programming
Unified modelling language UML
Object oriented programming –an introduction
IEC61131-3 3rd edition –new standard
Usageofthestandardbymeansofan example
Summary
Agenda
13.01.201233
Object oriented Programming in Automation
13.01.201234
Conveyor example
The problem:
The application consists of
•3 Conveyors,
•2 transfer stations and
•infeedand
•outfeedsystems
Product flows through the system
•from the infeed
•through conveyor 1, when it reaches the end of conveyor 1 it is
•transferred to conveyor 2 and from
•conveyor 2 transferred to conveyor 3.
This conveying system may consist of more or less conveyors
•of different lengths and speeds
•and more or less transfer stations.
To allow the most flexibility the Conveyors and transfer stations have been
implemented as Function blocks.
Object oriented Programming in Automation
Infeed
InfeedConveyor
13.01.201235
Conveyor 2
Transfer1
Conveyor 3
Transfer1
Outfeed
Part at Infeedstation
Moving via Infeedconveyor to Transfer station 1
Conveyor example: ConveyingSystem Documentation
Object oriented Programming in Automation
Infeed
InfeedConveyor
13.01.201236
Conveyor 2
Transfer1
Conveyor 3
Transfer1
Outfeed
Part at Transfer station 1
Transferred via Transfer Station 1 to conveyor 2
Conveyor example: ConveyingSystem Documentation
Object oriented Programming in Automation
Infeed
InfeedConveyor
13.01.201237
Conveyor 2
Transfer1
Conveyor 3
Transfer1
Outfeed
Part at Transfer Station
Moving via conveyor 2 to Transfer station 2
Conveyor example: ConveyingSystem Documentation
Object oriented Programming in Automation
Infeed
InfeedConveyor
13.01.201238
Conveyor 2
Transfer1
Conveyor 3
Transfer1
Outfeed
Part at Transfer station 2
Transferred via Transfer Station 2 to conveyor 3
Conveyor example: ConveyingSystem Documentation
Object oriented Programming in Automation
Infeed
InfeedConveyor
13.01.201239
Conveyor 2
Transfer1
Conveyor 3
Transfer1
Outfeed
Part at Transfer Station
Moving via conveyor 3 to Outfeed
Conveyor example: ConveyingSystem Documentation
Object oriented Programming in Automation
Infeed
fbTransfer1
fbTransfer2
fbInfeedConveyor
fbConveyor3
fbConveyor2
Outfeed1
Various conveyors will use various types of axis:
servo axis,
stepper axis and an
existing conveyor segment that accepts an Analog output for the command speed and
provides only an analog input for the current speed it is operating at.
The machine must have an
automatic mode where the conveyors will be different lengths. run at various velocities
and have different minimum spacing of the product.
To implement this it has been determined that Object Oriented programming methods
will provide the most flexibility and can be implemented in the shortest timeframe.
13.01.201240
Conveyor example: ConveyingSystem Documentation
Object oriented Programming in Automation
Motor
Infeed
Conveyor
Transfer
The first step is to determine the basic objects and their components
Multiple components of a similar type are ideal candidates to become objects
Objects will contain multiple sub objects.
Outfeed
Motor Type 1
Motor Type 2
Motor Type 3
13.01.201241
Conveyor example: Objectdefinitions
Object oriented Programming in Automation
Motor
Infeed
Conveyor
Transfer
Each object must communicate with other objects this method should be well defined.
The definition of object interaction is an interface.
An object can only be communicated to via its interface.
Outfeed
Motor Type 1
Motor Type 2
Motor Type 3
Interface
Interface
Interface
Interface
Interface
13.01.201242
Conveyor example: Interaction of objects
Object oriented Programming in Automation
Motor
Infeed
Conveyor
Transfer
The Infeed, Outfeedand Transfer Station will all interact with the Conveyor via the
same methods. M_AcceptPartand M_ReleasePart.
Outfeed
Motor Type 1
Motor Type 2
Motor Type 3
M_AcceptPart
M_ReleasePart
M_AcceptPart
M_ReleasePart
M_AcceptPart
M_ReleasePart
13.01.201243
Conveyor example: Interaction of objects
Object oriented Programming in Automation
Motor
Infeed
Conveyor
Transfer
The transfer system and conveyor system will have to interact with Axis. There will be
many more methods and properties so it is more efficient to create an interface that
contains all the methods and properties.
Outfeed
Motor Type 1
Motor Type 2
Motor Type 3
M_AcceptPart
M_ReleasePart
M_AcceptPart
M_ReleasePart
M_AcceptPart
M_ReleasePart
IAxis
IAxis
13.01.201244
Conveyor example: Interaction of objects
Object oriented Programming in Automation
Motor
There will be multiple types of motors that can drive conveyors, however as far as the
conveyor is concerned they all have identical functions although each motor type might
implement the functions in a different way. To minimize the amount of code to be
written and to re-use common functions a motor block can be built. Then the motor
block can be extended, each minor variation is an extension of the motor block. (Servo
or Stepper or AC/DC motor)
Motor Type 1
Motor Type 2
Motor Type 3
Extend
Extend
Extend
Conveyor example: Extension of objects
13.01.201245
Object oriented Programming in Automation
<<IAxis>>
+M_Speed
+M_Reset
+M_Enable
+M_Disable
+M_Jog
+M_HardwareReset
Ready:BOOL
Error: BOOL
ErrorID:UDINT
CurrentSpeed: LREAL
FB_AX5000
+M_Hardware
Reset
Axis block
extended to
include AX5000
specific
functions
FB_Stepper
+M_Hardware
Reset
Axis block
extended to
include Stepper
specific functions
FB_Axis
Controls Axis
Via AXIS_REF
NCPTP Axis
Implements
Extends
Extends
FB_BasicAxis
Extremely basic
motion control
intended to
control an axis
with analog
output and
analog input but
supports IAxis
functions
Implements
1
AXIS_REF
Conveyors will utilize the IAxisinterface to control their motion. Various Axis Control blocks can be created that implement
and extend the IAxisinterface
Conveyor example: Class Diagram Axis
13.01.201246
Object oriented Programming in Automation
FB_Conveyor
+M_AcceptPart
+M_ReleasePart
-Length
-Minimum
Spacing
-Parts
Uses FB_Axis
FB_Transfer
+M_PlacePart
+M_PickPart
Main
FB_Station
+M_InspectPart
+M_ModifyPart
Conveyor example: Machine Mode Handling
13.01.201249
Object oriented Programming in Automation
Beckhoff -Facts
Control philosophy
Central or distributed control
The Software aspect
More and more know how in software
Software Engineering in Automation?
Object oriented programming
Unified modelling language UML
Object oriented programming –an introduction
IEC61131-3 3rd edition –new standard
Usageofthestandardbymeansofan example
Summary
Agenda
13.01.201251
Object oriented Programming in Automation Summary
13.01.201252
Evolution, not Revolution
Software is driving automation –means more and more software for modern
automation!
Modern Software development tools needed to increase productivity and lower
engineering costs.
Software Engineering is needed also in Automation business.
But: Tools for Automation are used by conservative people. Evolution instead of
revolution!
In future: Recent engineering graduatesentering the industry are coming equipped
with knowledge and experience of modern software development methods that
would make current industry veterans blush.
For modern Softwaredevelopment Tools are needed to support Object Orientation and
Software Engineering!
Object oriented Programming in Automation Summary
13.01.201253
TwinCAT3 is the platform to develop object oriented Software in the best Engineering
Frame for Software development:
Microsoft Visual Studio
-Worldwide known
-Intuitive: used since many years in different areas
-Efficient: including source code control interfaces, can be extended with a lot of plug-ins
-Including all: configuration, programming, debugging
-Supporting different languages: IEC61131, C/C++, C#, .Net...
-Easy debugging interfaces
Thank you!
13.01.201254