1

00:00:00,256  -->  00:00:02,304
Hello my friends

2

00:00:02,560  -->  00:00:07,168
With this chapter we're going to about the

3

00:00:07,680  -->  00:00:09,472
Chapter 38

4

00:00:10,496  -->  00:00:13,824
Object-oriented programming with simotion

5

00:00:14,848  -->  00:00:17,408
So let's take a look

6

00:00:18,432  -->  00:00:23,296
in Our utilization folder

7

00:00:23,552  -->  00:00:29,696
When you click the examples link here you see the object-oriented programming

8

00:00:29,952  -->  00:00:35,840
as version 4.5 structured text programming language provides option

9

00:00:36,096  -->  00:00:38,400
with OOP programming

10

00:00:38,656  -->  00:00:41,728
The following conditions must be met

11

00:00:42,240  -->  00:00:46,592
And the device must be configured version of KERNEL

12

00:00:47,360  -->  00:00:53,504
4.5 by correspondence version kernel must be installed in the device

13

00:00:58,624  -->  00:01:00,160
OOP

14

00:01:00,416  -->  00:01:06,560
When using this permit option there is an expanded list of 

15

00:01:06,816  -->  00:01:12,960
protected Identifiers and Reserved identifiers for structure text

16

00:01:13,216  -->  00:01:18,336
list you can found the programmers manual

17

00:01:21,152  -->  00:01:22,944
Yep.

18

00:01:25,760  -->  00:01:31,904
So there's some example Library simotion and Library TO

19

00:01:32,160  -->  00:01:34,208
Yours

20

00:01:34,464  -->  00:01:36,512
First one

21

00:01:36,768  -->  00:01:41,376
Contains some classes Drive axis pos axis at following axis

22

00:01:41,888  -->  00:01:44,192
Maybe before you

23

00:01:44,704  -->  00:01:50,336
read examine these examples

24

00:01:50,848  -->  00:01:53,664
there is Another page related to this topic

25

00:01:54,176  -->  00:01:58,784
Application example with entry ID

26

00:02:00,320  -->  00:02:01,856
So

27

00:02:02,624  -->  00:02:08,256
There's a book object-oriented programming in simotion that siemens released

28

00:02:08,768  -->  00:02:14,912
You may order and examples is related with this book you can also download

29

00:02:16,960  -->  00:02:23,104
And you install your program on 4.5

30

00:02:23,360  -->  00:02:28,224
And step 7 5.5 is required in your computer

31

00:02:28,736  -->  00:02:34,624
There are some article notes and MLFB order numbers for the

32

00:02:34,880  -->  00:02:37,184
Related setups

33

00:02:39,488  -->  00:02:45,632
There are some chapters in this book and may download the application

34

00:02:45,888  -->  00:02:47,680
Example here

35

00:02:48,448  -->  00:02:49,984
And

36

00:02:50,240  -->  00:02:56,384
If you're interested there are some links related to this topic

37

00:02:57,152  -->  00:02:59,200
Let's see

38

00:02:59,456  -->  00:03:03,808
What's added the news on the siemens website about OOP

39

00:03:06,368  -->  00:03:12,512
And there's a short video watch together

40

00:03:12,768  -->  00:03:18,912
So if you're using a programming language

41

00:03:19,168  -->  00:03:25,312
c # or JAVA that case you have already information about

42

00:03:25,568  -->  00:03:31,712
OOP programming

43

00:03:31,968  -->  00:03:38,112
It's trying to tell you what's the advantages of OOP

44

00:03:38,368  -->  00:03:44,512
iw will reduce your time with you much more effective in your projects

45

00:03:44,768  -->  00:03:50,912
simotion provides the OOP

46

00:03:51,168  -->  00:03:57,312
Normally you should check your entire code to change something

47

00:03:57,568  -->  00:04:03,712
Automation work and machine consist for several components

48

00:04:03,968  -->  00:04:10,112
That means classses with variables and functions

49

00:04:10,368  -->  00:04:16,512
for instance 5 different station example here

50

00:04:16,768  -->  00:04:22,911
color conveyor filling and printing units and

51

00:04:23,167  -->  00:04:29,311
Components and classes of our machine

52

00:04:29,567  -->  00:04:35,711
and your benefits or existence of can combined of any configuration

53

00:04:35,967  -->  00:04:42,111
we used for new machines also with

54

00:04:42,367  -->  00:04:48,511
Less effort of course

55

00:04:48,767  -->  00:04:54,911
code can be inherited to other machines to other system

56

00:05:01,567  -->  00:05:07,711
Is really simple subjects

57

00:05:07,967  -->  00:05:14,111
Attempt don't have to be retested modules interact

58

00:05:14,367  -->  00:05:20,511
Together via interface

59

00:05:20,767  -->  00:05:26,911
some Function equation communication takes place as

60

00:05:27,167  -->  00:05:33,311
Automatic without any length of programming

61

00:05:33,567  -->  00:05:39,711
so There are several advantages in this case

62

00:05:39,967  -->  00:05:46,111
Advanced technology object models is supporting oop

63

00:05:59,167  -->  00:06:05,311
Examples vai download related with

64

00:06:05,567  -->  00:06:11,711
real automation task So

65

00:06:11,967  -->  00:06:18,111
high end solution for performance and Modularity

66

00:06:22,207  -->  00:06:23,743
Yep

67

00:06:24,255  -->  00:06:29,887
on the other hand And you might use your tutorial

68

00:06:30,655  -->  00:06:33,471
To get information via webinar

69

00:06:33,983  -->  00:06:36,799
there are some short videos

70

00:06:38,335  -->  00:06:40,127
and here

71

00:06:40,383  -->  00:06:44,223
About easy projects and sizer and so on

72

00:06:54,463  -->  00:07:00,607
Now let's download the first Library

73

00:07:00,863  -->  00:07:02,143
simotion

74

00:07:03,167  -->  00:07:06,239
Convert PDF

75

00:07:08,799  -->  00:07:10,335
save as

76

00:07:22,879  -->  00:07:25,951
LCmotion Library

77

00:07:27,999  -->  00:07:31,839
And example project

78

00:07:47,199  -->  00:07:49,759
Your application

79

00:07:50,271  -->  00:07:53,599
in application about motion classes in OOP

80

00:07:54,111  -->  00:08:00,255
You see here the table of contents C drive class pos class...

81

00:08:05,375  -->  00:08:09,471
And maybe not all of the functionality of the

82

00:08:09,983  -->  00:08:11,775
Current technology objects

83

00:08:12,543  -->  00:08:18,431
But this way you set that remove access enable positioning

84

00:08:23,295  -->  00:08:27,647
And superimpose positioning gearing and camming will be

85

00:08:27,903  -->  00:08:31,487
Executed by OOP programming

86

00:08:32,511  -->  00:08:37,631
Another way than the classical way

87

00:08:38,399  -->  00:08:44,287
The constructure of the library you see

88

00:08:44,543  -->  00:08:47,359
It looks like this

89

00:08:50,175  -->  00:08:54,783
Initialization of the simple subject

90

00:08:56,575  -->  00:08:58,879
Is looks like this

91

00:09:01,439  -->  00:09:03,487
there are some methods

92

00:09:03,743  -->  00:09:09,887
construct to class or deconstruct the class you see the example in the ST

93

00:09:11,423  -->  00:09:12,447
Structure

94

00:09:14,239  -->  00:09:17,823
and General properties of the methods

95

00:09:20,895  -->  00:09:26,783
Global structures Global error constants and

96

00:09:27,295  -->  00:09:30,623
next page the First Class C drive access

97

00:09:33,951  -->  00:09:38,303
You see here as your notation

98

00:09:38,815  -->  00:09:44,959
There are some interface section and implementation section methods mark

99

00:09:45,215  -->  00:09:47,263
With a Plus public methods

100

00:09:47,775  -->  00:09:53,919
Can be used in other application or classes

101

00:09:54,687  -->  00:09:58,527
method mark with a sharp or protected

102

00:09:58,783  -->  00:10:00,831
and For internal use

103

00:10:06,719  -->  00:10:09,279
So

104

00:10:12,095  -->  00:10:14,911
let extract our example here

105

00:10:23,359  -->  00:10:25,919
And open with manager

106

00:10:35,135  -->  00:10:40,255
I will change the default settings of the simatic manager

107

00:10:41,791  -->  00:10:43,583
Options customize okay

108

00:10:56,127  -->  00:10:58,943
I have to restart normally

109

00:11:01,247  -->  00:11:03,295
Temporary folder

110

00:11:19,679  -->  00:11:21,983
OOP Let's open the Scout project

111

00:11:33,503  -->  00:11:36,831
Let's take a look into the programs

112

00:11:46,303  -->  00:11:50,143
This is the classical ST structure definition

113

00:11:53,983  -->  00:11:59,103
You see here the basic types of the class

114

00:11:59,359  -->  00:12:05,503
And you can use your object browser to view your library and device and class...

115

00:12:11,135  -->  00:12:16,511
Open the user motion following

116

00:12:18,559  -->  00:12:21,375
There's a class definition interface

117

00:12:21,631  -->  00:12:23,935
user in motion class

118

00:12:24,703  -->  00:12:25,727
Extends

119

00:12:25,983  -->  00:12:28,287
The axis type

120

00:12:30,335  -->  00:12:33,919
you see here methods

121

00:12:34,687  -->  00:12:40,831
public method and pos user

122

00:12:41,087  -->  00:12:42,111
input variables

123

00:12:48,255  -->  00:12:50,303
method starts

124

00:12:50,815  -->  00:12:52,607
Some program code

125

00:12:55,423  -->  00:12:57,727
Some position commands

126

00:12:59,007  -->  00:13:01,055
System command once here

127

00:13:02,335  -->  00:13:06,431
This is a class

128

00:13:07,967  -->  00:13:11,039
There's another ST structure

129

00:13:11,551  -->  00:13:13,599
Message archive

130

00:13:14,111  -->  00:13:16,671
implements message archive

131

00:13:24,351  -->  00:13:27,935
Inside this class that are some private label

132

00:13:29,727  -->  00:13:35,871
it says you're boolea whatever and that is that other variable

133

00:13:36,127  -->  00:13:38,431
new entry with public method

134

00:13:39,199  -->  00:13:45,087
And other public methods and so on some private method

135

00:13:49,439  -->  00:13:54,815
Classical message handling implemented

136

00:13:56,095  -->  00:13:59,935
There's a structure text for

137

00:14:00,703  -->  00:14:02,495
command history

138

00:14:02,751  -->  00:14:07,359
Normally our library located here with LCmotion

139

00:14:08,127  -->  00:14:09,663
You'll see here the

140

00:14:10,431  -->  00:14:12,991
drive axis structure

141

00:14:14,783  -->  00:14:17,599
class drive access public types

142

00:14:20,415  -->  00:14:25,791
Protected override variables protected variables

143

00:14:28,863  -->  00:14:30,143
Public methods

144

00:14:32,959  -->  00:14:35,519
And another public methods

145

00:14:37,823  -->  00:14:42,431
If you have some experience with pc world

146

00:14:42,687  -->  00:14:44,991
Already written some kind of

147

00:14:45,759  -->  00:14:47,295
You know

148

00:14:48,063  -->  00:14:54,207
dot net programs with visual studio for instance you have already some information about object

149

00:14:54,463  -->  00:15:00,607
OOP this calls should be familiar for you the notation is

150

00:15:00,863  -->  00:15:03,679
Different but the logic is the same

151

00:15:07,775  -->  00:15:09,823
inheritance And other things

152

00:15:10,591  -->  00:15:12,127
Is a common

153

00:15:12,895  -->  00:15:18,527
For example in our drive axis class some system function called

154

00:15:19,551  -->  00:15:24,927
So that's way we're able to use our classes

155

00:15:25,439  -->  00:15:30,303
With technology objects together to build up

156

00:15:30,559  -->  00:15:32,095
system

157

00:15:32,607  -->  00:15:34,911
and our program

158

00:15:36,191  -->  00:15:39,519
So this is an example project for you

159

00:15:42,079  -->  00:15:47,199
If you are using the visual studio

160

00:15:47,455  -->  00:15:49,247
with C# or

161

00:15:49,759  -->  00:15:52,063
C plus plus or JAVA

162

00:15:59,743  -->  00:16:03,071
Let's create new project

163

00:16:06,143  -->  00:16:09,215
Maybe Windows forms application

164

00:16:09,471  -->  00:16:11,775
With c#

165

00:16:15,871  -->  00:16:21,503
Let's say temp

166

00:16:38,143  -->  00:16:41,471
Example Library shows

167

00:16:41,727  -->  00:16:47,871
you Use of simotion system functions in classes and methods for different kind of axes

168

00:16:48,127  -->  00:16:54,271
here the library demonstrates the simplifying uses of this functions

169

00:16:54,527  -->  00:16:59,391
Library does not claim all over the system functions

170

00:16:59,903  -->  00:17:06,047
please note this provides fundemental info

171

00:17:07,071  -->  00:17:11,423
I assumed and so on and the other Library

172

00:17:11,679  -->  00:17:17,823
LCADDTOs class

173

00:17:18,079  -->  00:17:22,687
contains

174

00:17:22,943  -->  00:17:24,735
Used is basic class

175

00:17:24,991  -->  00:17:27,039
Extend

176

00:17:27,295  -->  00:17:29,855
And adjust by you

177

00:17:32,415  -->  00:17:38,559
The purpose are pointed out in the manual

178

00:17:40,607  -->  00:17:45,983
So basically this is our simple application and program

179

00:17:47,519  -->  00:17:53,663
Yeah that are some class that are some methods like static void main as one

180

00:17:54,943  -->  00:18:00,575
The simpler way to copy and paste your program or your create classes here

181

00:18:02,367  -->  00:18:07,487
What's on other page example

182

00:18:08,767  -->  00:18:14,911
Counter class examples let's save as

183

00:18:15,167  -->  00:18:17,215
Counter Class in OOP

184

00:18:36,927  -->  00:18:38,975
so...

185

00:18:42,047  -->  00:18:45,887
that is a little example project

186

00:18:46,143  -->  00:18:47,935
Related to book

187

00:18:55,359  -->  00:18:59,711
It's simotion C

188

00:19:24,543  -->  00:19:26,847
Convert to new version yes

189

00:19:27,871  -->  00:19:30,175
not write protected

190

00:19:35,807  -->  00:19:40,415
A project opens there is a script than watch table

191

00:19:42,207  -->  00:19:44,511
And empty script

192

00:19:46,559  -->  00:19:49,375
Let's see the execution system

193

00:19:51,167  -->  00:19:55,007
motion task are empty on the background task

194

00:19:55,775  -->  00:20:01,919
Counter step 5 is called a program called counters ST

195

00:20:06,015  -->  00:20:07,295
Okay

196

00:20:15,231  -->  00:20:20,095
And you're able to work with

197

00:20:20,607  -->  00:20:24,191
The same way and simosim or real system

198

00:20:24,447  -->  00:20:29,823
Only your software side will be changed OOP

199

00:20:31,871  -->  00:20:34,431
So this version doesn't support

200

00:20:35,199  -->  00:20:37,759
simosim at this case

201

00:20:40,063  -->  00:20:44,671
i will replace On the hardware with the new version

202

00:21:05,919  -->  00:21:10,527
There's no Replacements unfortunately

203

00:21:20,768  -->  00:21:22,048
with the same

204

00:21:22,304  -->  00:21:23,840
MLFB number

205

00:21:24,352  -->  00:21:27,424
firmware 5.1

206

00:21:27,680  -->  00:21:28,704
Yes

207

00:21:29,984  -->  00:21:31,776
save and compile

208

00:21:33,568  -->  00:21:36,384
Let's go one step back

209

00:21:41,760  -->  00:21:45,600
Reloading to project on Scout side

210

00:22:05,824  -->  00:22:09,152
Let's just enter and leave the code

211

00:22:11,456  -->  00:22:16,576
Function calls single counter uses class counter step5

212

00:22:17,344  -->  00:22:20,672
There's a program and function this is the classical way

213

00:22:21,952  -->  00:22:24,768
Now we have here

214

00:22:25,792  -->  00:22:26,816
Another

215

00:22:27,584  -->  00:22:31,936
Command called out equals

216

00:22:32,192  -->  00:22:34,496
c dot up

217

00:22:34,752  -->  00:22:37,312
output parameter is

218

00:22:37,568  -->  00:22:38,848
up value reach

219

00:22:39,104  -->  00:22:42,688
This is the simple use of calling a method with a class

220

00:22:44,480  -->  00:22:46,272
cCounter class

221

00:22:47,296  -->  00:22:50,880
And here is the definition of C1 C2

222

00:22:51,648  -->  00:22:52,928
with step5

223

00:22:53,184  -->  00:22:54,208
Counter

224

00:22:56,256  -->  00:22:59,072
For the calling to call to c1

225

00:22:59,840  -->  00:23:01,888
It looks like this

226

00:23:03,424  -->  00:23:05,472
call single counter

227

00:23:07,008  -->  00:23:10,848
class one counters and so on

228

00:23:13,152  -->  00:23:19,296
in your structure text class counter you'll see here the global definition

229

00:23:19,552  -->  00:23:22,368
At the class definition

230

00:23:23,904  -->  00:23:30,048
Under class counter step5 that are some Global variables as classes also

231

00:23:36,192  -->  00:23:39,264
And this is the first class counter

232

00:23:42,592  -->  00:23:47,968
current value overrides the value method

233

00:23:49,760  -->  00:23:52,832
return value integer public methods

234

00:23:53,088  -->  00:23:55,392
There's a program

235

00:23:55,904  -->  00:24:01,024
extended class counter looks like this

236

00:24:02,560  -->  00:24:04,864
Public method as integer

237

00:24:06,144  -->  00:24:10,240
And public method down extended

238

00:24:11,264  -->  00:24:12,800
So

239

00:24:13,056  -->  00:24:19,200
Here are the class definition and here are the simple function call to single counter

240

00:24:19,456  -->  00:24:22,016
looks like this

241

00:24:27,136  -->  00:24:30,720
So that way you are able to program

242

00:24:31,232  -->  00:24:33,792
Are using the object-oriented programming

243

00:24:34,816  -->  00:24:36,864
I just wanted to show you

244

00:24:37,120  -->  00:24:40,448
Simple example how can you achieve that.
