Hello my friends 2
With this chapter we're going to about the 3
Chapter 38 4
Object-oriented programming with simotion 5
So let's take a look 6
in Our utilization folder 7
When you click the examples link here you see the object-oriented programming 8
as version 4.5 structured text programming language provides option 9
with OOP programming 10
The following conditions must be met 11
And the device must be configured version of KERNEL 12
4.5 by correspondence version kernel must be installed in the device 13
OOP 14
When using this permit option there is an expanded list of 15
protected Identifiers and Reserved identifiers for structure text 16
list you can found the programmers manual 17
Yep. 18
So there's some example Library simotion and Library TO 19
Yours 20
First one 21
Contains some classes Drive axis pos axis at following axis 22
Maybe before you 23
read examine these examples 24
there is Another page related to this topic 25
Application example with entry ID 26
So 27
There's a book object-oriented programming in simotion that siemens released 28
You may order and examples is related with this book you can also download 29
And you install your program on 4.5 30
And step 7 5.5 is required in your computer 31
There are some article notes and MLFB order numbers for the 32
Related setups 33
There are some chapters in this book and may download the application 34
Example here 35
And 36
If you're interested there are some links related to this topic 37
Let's see 38
What's added the news on the siemens website about OOP 39
And there's a short video watch together 40
So if you're using a programming language 41
c # or JAVA that case you have already information about 42
OOP programming 43
It's trying to tell you what's the advantages of OOP 44
iw will reduce your time with you much more effective in your projects 45
simotion provides the OOP 46
Normally you should check your entire code to change something 47
Automation work and machine consist for several components 48
That means classses with variables and functions 49
for instance 5 different station example here 50
color conveyor filling and printing units and 51
Components and classes of our machine 52
and your benefits or existence of can combined of any configuration 53
we used for new machines also with 54
Less effort of course 55
code can be inherited to other machines to other system 56
Is really simple subjects 57
Attempt don't have to be retested modules interact 58
Together via interface 59
some Function equation communication takes place as 60
Automatic without any length of programming 61
so There are several advantages in this case 62
Advanced technology object models is supporting oop 63
Examples vai download related with 64
real automation task So 65
high end solution for performance and Modularity 66
Yep 67
on the other hand And you might use your tutorial 68
To get information via webinar 69
there are some short videos 70
and here 71
About easy projects and sizer and so on 72
Now let's download the first Library 73
simotion 74
Convert PDF 75
save as 76
LCmotion Library 77
And example project 78
Your application 79
in application about motion classes in OOP 80
You see here the table of contents C drive class pos class... 81
And maybe not all of the functionality of the 82
Current technology objects 83
But this way you set that remove access enable positioning 84
And superimpose positioning gearing and camming will be 85
Executed by OOP programming 86
Another way than the classical way 87
The constructure of the library you see 88
It looks like this 89
Initialization of the simple subject 90
Is looks like this 91
there are some methods 92
construct to class or deconstruct the class you see the example in the ST 93
Structure 94
and General properties of the methods 95
Global structures Global error constants and 96
next page the First Class C drive access 97
You see here as your notation 98
There are some interface section and implementation section methods mark 99
With a Plus public methods 100
Can be used in other application or classes 101
method mark with a sharp or protected 102
and For internal use 103
So 104
let extract our example here 105
And open with manager 106
I will change the default settings of the simatic manager 107
Options customize okay 108
I have to restart normally 109
Temporary folder 110
OOP Let's open the Scout project 111
Let's take a look into the programs 112
This is the classical ST structure definition 113
You see here the basic types of the class 114
And you can use your object browser to view your library and device and class... 115
Open the user motion following 116
There's a class definition interface 117
user in motion class 118
Extends 119
The axis type 120
you see here methods 121
public method and pos user 122
input variables 123
method starts 124
Some program code 125
Some position commands 126
System command once here 127
This is a class 128
There's another ST structure 129
Message archive 130
implements message archive 131
Inside this class that are some private label 132
it says you're boolea whatever and that is that other variable 133
new entry with public method 134
And other public methods and so on some private method 135
Classical message handling implemented 136
There's a structure text for 137
command history 138
Normally our library located here with LCmotion 139
You'll see here the 140
drive axis structure 141
class drive access public types 142
Protected override variables protected variables 143
Public methods 144
And another public methods 145
If you have some experience with pc world 146
Already written some kind of 147
You know 148
dot net programs with visual studio for instance you have already some information about object 149
OOP this calls should be familiar for you the notation is 150
Different but the logic is the same 151
inheritance And other things 152
Is a common 153
For example in our drive axis class some system function called 154
So that's way we're able to use our classes 155
With technology objects together to build up 156
system 157
and our program 158
So this is an example project for you 159
If you are using the visual studio 160
with C# or 161
C plus plus or JAVA 162
Let's create new project 163
Maybe Windows forms application 164
With c# 165
Let's say temp 166
Example Library shows 167
you Use of simotion system functions in classes and methods for different kind of axes 168
here the library demonstrates the simplifying uses of this functions 169
Library does not claim all over the system functions 170
please note this provides fundemental info 171
I assumed and so on and the other Library 172
LCADDTOs class 173
contains 174
Used is basic class 175
Extend 176
And adjust by you 177
The purpose are pointed out in the manual 178
So basically this is our simple application and program 179
Yeah that are some class that are some methods like static void main as one 180
The simpler way to copy and paste your program or your create classes here 181
What's on other page example 182
Counter class examples let's save as 183
Counter Class in OOP 184
so... 185
that is a little example project 186
Related to book 187
It's simotion C 188
Convert to new version yes 189
not write protected 190
A project opens there is a script than watch table 191
And empty script 192
Let's see the execution system 193
motion task are empty on the background task 194
Counter step 5 is called a program called counters ST 195
Okay 196
And you're able to work with 197
The same way and simosim or real system 198
Only your software side will be changed OOP 199
So this version doesn't support 200
simosim at this case 201
i will replace On the hardware with the new version 202
There's no Replacements unfortunately 203
with the same 204
MLFB number 205
firmware 5.1 206
Yes 207
save and compile 208
Let's go one step back 209
Reloading to project on Scout side 210
Let's just enter and leave the code 211
Function calls single counter uses class counter step5 212
There's a program and function this is the classical way 213
Now we have here 214
Another 215
Command called out equals 216
c dot up 217
output parameter is 218
up value reach 219
This is the simple use of calling a method with a class 220
cCounter class 221
And here is the definition of C1 C2 222
with step5 223
Counter 224
For the calling to call to c1 225
It looks like this 226
call single counter 227
class one counters and so on 228
in your structure text class counter you'll see here the global definition 229
At the class definition 230
Under class counter step5 that are some Global variables as classes also 231
And this is the first class counter 232
current value overrides the value method 233
return value integer public methods 234
There's a program 235
extended class counter looks like this 236
Public method as integer 237
And public method down extended 238
So 239
Here are the class definition and here are the simple function call to single counter 240
looks like this 241
So that way you are able to program 242
Are using the object-oriented programming 243
I just wanted to show you 244
Simple example how can you achieve that.