1

00:00:01,280  -->  00:00:04,352
Ladies and gentlemen welcome on board

2

00:00:05,632  -->  00:00:09,472
current chapter 24

3

00:00:09,728  -->  00:00:13,312
Programming with structure text

4

00:00:15,360  -->  00:00:19,712
Let's switch back to our lecture notes

5

00:00:21,504  -->  00:00:24,832
Yep  simotion programming SITRAIN notes

6

00:00:26,112  -->  00:00:31,488
Here at this chapter you will learn about

7

00:00:32,000  -->  00:00:34,816
contents

8

00:00:35,072  -->  00:00:37,888
Integration of structure text

9

00:00:38,912  -->  00:00:41,984
st source

10

00:00:42,240  -->  00:00:46,080
specify st source

11

00:00:46,336  -->  00:00:49,920
Settings for working with editor

12

00:00:50,944  -->  00:00:56,576
Identifiers and syntax coloring in St editor

13

00:00:57,344  -->  00:01:02,464
Structure of a ST source file

14

00:01:02,976  -->  00:01:09,120
Components of the interface section components of the implementation section

15

00:01:10,656  -->  00:01:16,800
Declerations in the interface and implementation Parts decleration

16

00:01:17,824  -->  00:01:20,640
part of A program

17

00:01:25,248  -->  00:01:28,320
validity and Initializing and variable

18

00:01:29,088  -->  00:01:32,928
Overview of simotion data types

19

00:01:33,184  -->  00:01:36,512
Elementary data types For siemotion

20

00:01:36,768  -->  00:01:42,912
Arrays string structure technology object

21

00:01:43,168  -->  00:01:44,448
datatypes

22

00:01:45,984  -->  00:01:47,776
And so...

23

00:01:48,800  -->  00:01:52,128
Continue next page

24

00:01:53,152  -->  00:01:59,040
control statements is if Case for while loops

25

00:01:59,296  -->  00:02:02,880
Exit and return key wrods usage

26

00:02:03,648  -->  00:02:09,536
Access to individual bits with permit language extension option

27

00:02:10,048  -->  00:02:13,376
before wait Go lable condition statement

28

00:02:14,144  -->  00:02:20,288
Comment controlling compilation with preprocessor

29

00:02:20,544  -->  00:02:23,360
Testing program

30

00:02:23,616  -->  00:02:28,480
operationg mode change for program testing in debug mode

31

00:02:29,760  -->  00:02:35,648
monitoring variables symbol browser and watch table

32

00:02:36,160  -->  00:02:42,304
New functions in St editor as of version 4.2

33

00:02:43,328  -->  00:02:45,376
Setting the breakpoint

34

00:02:45,632  -->  00:02:51,776
Specify the debug test group of useful other things and so on

35

00:02:54,848  -->  00:03:00,992
Let's talk or first page of this chapter

36

00:03:01,248  -->  00:03:04,576
Integration of St in Scout

37

00:03:07,392  -->  00:03:13,536
You see here in symbol browser compile menu program status

38

00:03:13,792  -->  00:03:19,936
st editor is opened under ST1 unit that are several different

39

00:03:20,192  -->  00:03:22,752
1 + 2 +3 + 4

40

00:03:23,008  -->  00:03:29,152
Three and four Programs located description in interface section

41

00:03:29,920  -->  00:03:33,248
there is an implementation section

42

00:03:35,296  -->  00:03:41,440
So also an external editor can be used in integrated in

43

00:03:41,696  -->  00:03:44,512
simotion workbench if you want

44

00:03:49,376  -->  00:03:55,520
To generate an st source for just double click to insert St source for 

45

00:03:55,776  -->  00:03:57,568
write The name of your source

46

00:04:00,128  -->  00:04:02,688
Names are not case sensitive

47

00:04:03,712  -->  00:04:07,040
You may use letters numbers or _

48

00:04:10,880  -->  00:04:12,928
and name

49

00:04:13,184  -->  00:04:19,327
Contains up to 128 characters

50

00:04:21,631  -->  00:04:27,775
you will see here how do specified St Source file compile settings we have already done

51

00:04:29,567  -->  00:04:34,431
If you want you can ask someone or read the detail

52

00:04:38,015  -->  00:04:41,599
settings for working with St editor

53

00:04:42,367  -->  00:04:47,999
You'll see here font-time font size format settings for display

54

00:04:52,351  -->  00:04:57,215
I'll see you see here the ccommand library on the left side and project window

55

00:04:59,263  -->  00:05:05,407
Identifiers and syntax coloring in the ST editor

56

00:05:06,687  -->  00:05:11,039
User-defined name is colored as black

57

00:05:11,295  -->  00:05:16,159
Favorite color is blue and contant color as pink

58

00:05:16,671  -->  00:05:21,535
comments as color as green color

59

00:05:26,655  -->  00:05:29,471
There are some restrictions

60

00:05:31,263  -->  00:05:33,311
There is no umlaut

61

00:05:35,359  -->  00:05:38,431
That means a double quotation

62

00:05:40,479  -->  00:05:42,271
not case sensetive

63

00:05:43,551  -->  00:05:46,367
must not start with a digit

64

00:05:47,647  -->  00:05:49,183
Names identifiers

65

00:05:49,439  -->  00:05:55,583
Should not start with an underscore because it's reserved for siemens

66

00:05:55,839  -->  00:06:01,471
And identifiers must not be same as key words

67

00:06:03,519  -->  00:06:06,079
Yep

68

00:06:07,359  -->  00:06:13,503
So reserved keywords if as program and so on

69

00:06:15,551  -->  00:06:16,831
Next page

70

00:06:18,111  -->  00:06:23,743
And you see here the structure of an ST source

71

00:06:23,999  -->  00:06:25,535
for connection

72

00:06:26,559  -->  00:06:32,703
Two other units and execution system unit to describe your

73

00:06:32,959  -->  00:06:36,287
Functional interface section of unit

74

00:06:36,543  -->  00:06:41,407
and implementation section later on

75

00:06:41,919  -->  00:06:46,015
Define and write your own program for function

76

00:06:46,783  -->  00:06:50,367
returns a value as

77

00:06:50,623  -->  00:06:51,903
You describe

78

00:06:52,159  -->  00:06:55,487
at this acse long-real type 64-bits

79

00:06:57,791  -->  00:07:01,375
Function block and program

80

00:07:05,471  -->  00:07:09,823
So components of interface section

81

00:07:13,151  -->  00:07:14,943
Is use package

82

00:07:15,711  -->  00:07:18,527
This is the technology package Cam

83

00:07:19,039  -->  00:07:19,807
path

84

00:07:20,319  -->  00:07:22,623
TCONTROL

85

00:07:23,135  -->  00:07:25,183
Possibilities

86

00:07:25,439  -->  00:07:26,975
Use Library

87

00:07:27,743  -->  00:07:30,559
created Library name

88

00:07:31,071  -->  00:07:34,399
uses keywords for

89

00:07:34,655  -->  00:07:38,239
Make a connection to other unit

90

00:07:40,287  -->  00:07:45,407
Public variables and other types described with type

91

00:07:47,711  -->  00:07:52,319
here are the color red yellow blue

92

00:07:52,831  -->  00:07:55,135
it is an enumeration

93

00:07:55,391  -->  00:08:00,511
Red means zero yellow means one blue means 2

94

00:08:01,791  -->  00:08:03,071
This is a type

95

00:08:07,935  -->  00:08:13,311
volatile Global variables set an actual as long real the time and

96

00:08:14,079  -->  00:08:16,895
It's not initialized this case

97

00:08:17,151  -->  00:08:20,223
For specification of public blocks

98

00:08:21,503  -->  00:08:25,599
here interface section program name

99

00:08:25,855  -->  00:08:27,903
And function name

100

00:08:29,695  -->  00:08:30,975
So

101

00:08:31,487  -->  00:08:36,607
implementation section

102

00:08:37,119  -->  00:08:39,167
The program code for display

103

00:08:46,079  -->  00:08:52,223
next thing is components of the implementation section here

104

00:08:54,527  -->  00:09:00,671
on this page an Unit example implementation private and unit global

105

00:09:00,927  -->  00:09:06,303
variables and datatypes is the similar description type

106

00:09:08,607  -->  00:09:10,143
Global variables

107

00:09:10,655  -->  00:09:11,679
Not retain

108

00:09:12,191  -->  00:09:16,799
Implementation of public and private blocks

109

00:09:17,055  -->  00:09:19,871
Program function and function blocks

110

00:09:22,175  -->  00:09:23,455
Also

111

00:09:24,223  -->  00:09:30,367
We will see in detail later on in next pages that are some decleration party

112

00:09:30,623  -->  00:09:34,719
 parts inside the function

113

00:09:34,975  -->  00:09:37,023
And program and function block

114

00:09:40,351  -->  00:09:43,423
so...

115

00:09:44,447  -->  00:09:45,727
next page

116

00:09:46,495  -->  00:09:51,359
Declerations in the interface and implementation parts

117

00:09:51,615  -->  00:09:54,943
global constant decleration

118

00:09:55,199  -->  00:09:56,223
Example

119

00:09:56,479  -->  00:09:58,527
Real

120

00:09:59,295  -->  00:10:02,367
constant as pink color

121

00:10:06,207  -->  00:10:07,231
type

122

00:10:07,487  -->  00:10:09,279
Real motor

123

00:10:09,791  -->  00:10:12,351
Structure

124

00:10:12,863  -->  00:10:18,239
There are several different kind of variables inside this motor structure

125

00:10:20,031  -->  00:10:23,359
we just Define here are types

126

00:10:23,615  -->  00:10:29,759
And later on we will create a new user defined variables

127

00:10:30,015  -->  00:10:31,039
of This ttype

128

00:10:32,575  -->  00:10:34,367
so one type

129

00:10:35,391  -->  00:10:37,183
Maybe consist of

130

00:10:37,439  -->  00:10:42,303
One structured one variable or several different type of variables

131

00:10:46,143  -->  00:10:52,287
If you already use a different data types in classical Works in simatic

132

00:10:52,543  -->  00:10:54,591
you are familiar Description

133

00:10:54,847  -->  00:10:57,151
There are some Elementary data types

134

00:10:57,919  -->  00:11:01,503
Like Real or long and so on

135

00:11:02,271  -->  00:11:04,063
There are other Drive

136

00:11:04,319  -->  00:11:08,671
 types structures in enumerators

137

00:11:09,951  -->  00:11:11,487
Just like this

138

00:11:12,511  -->  00:11:15,327
And structure like that

139

00:11:16,351  -->  00:11:22,495
and technology object or system data types already described in our

140

00:11:23,519  -->  00:11:24,543
CPUs

141

00:11:26,079  -->  00:11:27,359
So

142

00:11:28,127  -->  00:11:34,271
Global variables for global global constant and var global retain

143

00:11:39,903  -->  00:11:44,511
Decleration part of a program you see here

144

00:11:45,535  -->  00:11:50,399
In implementation and the program declaration type

145

00:11:52,191  -->  00:11:54,239
Local variables

146

00:11:55,519  -->  00:11:58,335
And temporary variables

147

00:11:58,591  -->  00:12:02,687
As local or local constants

148

00:12:03,199  -->  00:12:05,759
here is the Declaration section

149

00:12:07,551  -->  00:12:11,647
here Is the program section really

150

00:12:18,559  -->  00:12:24,703
so validity of variables unit left and unit right

151

00:12:24,959  -->  00:12:27,775
Two examples here

152

00:12:30,079  -->  00:12:33,407
you see here with different colors

153

00:12:36,479  -->  00:12:40,063
Global device variables here

154

00:12:41,343  -->  00:12:45,439
Is accessible from all of the other units

155

00:12:45,695  -->  00:12:47,743
Readable and writable

156

00:12:48,255  -->  00:12:54,399
You'll see here and the background some simotion device available

157

00:12:56,447  -->  00:13:02,079
on the unit left There's interface section and Global variables

158

00:13:03,103  -->  00:13:07,199
It's accessible by other units right

159

00:13:07,967  -->  00:13:10,783
The same way or vice versa

160

00:13:18,463  -->  00:13:21,791
If you are describing

161

00:13:22,047  -->  00:13:28,191
local variable Your program test and is has and what it is of usage of this variable

162

00:13:36,127  -->  00:13:42,271
If you're using a global variable in your implementation section

163

00:13:42,783  -->  00:13:44,319
And validity

164

00:13:44,575  -->  00:13:46,623
Is accessible from

165

00:13:47,135  -->  00:13:50,975
Program test 1 and program to test 2

166

00:13:51,743  -->  00:13:54,815
From inside out

167

00:13:59,935  -->  00:14:06,079
Global variables can we declerate in the interface or implementation part of the units

168

00:14:07,615  -->  00:14:13,759
local variables can only be used in exercise program in which they wrote declerated

169

00:14:14,783  -->  00:14:15,807
Like this

170

00:14:17,087  -->  00:14:23,231
These variables can either be monitored in symbol browser

171

00:14:23,487  -->  00:14:25,535
nor Accessed from

172

00:14:25,791  -->  00:14:28,863
Operator control and monitor devices

173

00:14:29,375  -->  00:14:35,519
Like HMI devices or OPC XML server

174

00:14:35,775  -->  00:14:39,359
locals Are the private property of the corresponding

175

00:14:39,615  -->  00:14:42,431
POU as it were

176

00:14:42,687  -->  00:14:43,711
So...

177

00:14:43,967  -->  00:14:50,111
If I want to use privates betable I have to do it here as locally

178

00:14:52,927  -->  00:14:59,071
next page initializing variables interface and

179

00:14:59,327  -->  00:15:01,375
Implementation section

180

00:15:02,399  -->  00:15:08,031
 initialization on overrall resed or downloads

181

00:15:08,287  -->  00:15:12,383
Is possible with retain variables

182

00:15:13,663  -->  00:15:19,807
for Non retain or volatile variables initialization on

183

00:15:23,135  -->  00:15:26,463
power on and overall reset

184

00:15:26,975  -->  00:15:28,511
from stop mode to run mode as version

185

00:15:29,279  -->  00:15:33,119
from 4.2 is always done

186

00:15:35,679  -->  00:15:39,263
For retain it depends on your choice

187

00:15:39,775  -->  00:15:41,823
It's possible to do

188

00:15:42,591  -->  00:15:43,871
in download

189

00:15:44,127  -->  00:15:47,455
Or with overall reset

190

00:15:48,735  -->  00:15:49,759
Next thing

191

00:15:50,783  -->  00:15:53,599
For implementation section

192

00:15:53,855  -->  00:15:59,999
Initialization on overall reset and download possible for retained Global variables

193

00:16:03,583  -->  00:16:06,399
What is the same way for

194

00:16:07,167  -->  00:16:13,055
Other Global variables in implementation section what about the program insight?

195

00:16:15,103  -->  00:16:15,871
So

196

00:16:16,127  -->  00:16:20,991
For static program or function block

197

00:16:21,503  -->  00:16:23,295
local variables

198

00:16:23,551  -->  00:16:26,111
Initialization

199

00:16:26,367  -->  00:16:29,439
Will be done on start of tasks

200

00:16:29,951  -->  00:16:33,279
For example switch to stop to run

201

00:16:37,375  -->  00:16:43,519
and Temporary variables initialization on program called or function block call

202

00:16:43,775  -->  00:16:47,615
That's why the the variables are temporary

203

00:16:55,295  -->  00:16:57,343
Normally

204

00:16:57,599  -->  00:17:00,159
Inside the program section

205

00:17:00,671  -->  00:17:02,975
These are static variables

206

00:17:05,535  -->  00:17:11,679
they only reset to initial value is Task is running

207

00:17:12,447  -->  00:17:13,983
restarted

208

00:17:16,543  -->  00:17:17,311
Yeah

209

00:17:18,335  -->  00:17:23,455
in FB this variables are part of instance data

210

00:17:24,735  -->  00:17:30,367
Initialization depends upon variable type

211

00:17:31,135  -->  00:17:33,951
global retain or volatile which instance

212

00:17:40,351  -->  00:17:46,495
If I want to preserve my parameter or online data

213

00:17:46,751  -->  00:17:50,079
During CPU runtime

214

00:17:50,591  -->  00:17:53,151
Then I have to choose

215

00:17:53,919  -->  00:17:57,247
This global global retainer area

216

00:17:58,015  -->  00:18:00,063
when i

217

00:18:00,575  -->  00:18:06,719
want to choose to use static variable inside my programs or function blocks

218

00:18:06,975  -->  00:18:11,071
After task restart or CPU stopped run

219

00:18:11,327  -->  00:18:12,607
Even the data

220

00:18:13,119  -->  00:18:19,263
is static will be initialized that's an important

221

00:18:20,543  -->  00:18:26,687
Overview of the simotion data types are Elementary and

222

00:18:26,943  -->  00:18:29,759
Compounds or derived types

223

00:18:31,551  -->  00:18:33,087
As you can see

224

00:18:35,647  -->  00:18:40,767
So what kind of Elementary data types do we have

225

00:18:41,279  -->  00:18:43,071
keywords...

226

00:18:43,839  -->  00:18:49,983
bool byte word Integer and double integer types you will see here on the right

227

00:18:50,239  -->  00:18:51,775
Column...

228

00:18:52,031  -->  00:18:57,919
Real a long real as possible special we use

229

00:18:58,175  -->  00:19:04,319
For Action position value or parameters Long real

230

00:19:04,575  -->  00:19:07,647
Are memory is quite good enough

231

00:19:09,439  -->  00:19:10,719
Yep

232

00:19:11,999  -->  00:19:15,839
So array data type

233

00:19:16,095  -->  00:19:19,679
here type description

234

00:19:19,935  -->  00:19:22,239
A Is all right

235

00:19:23,007  -->  00:19:24,543
one dimentional

236

00:19:24,799  -->  00:19:27,359
1 to 6 of real time

237

00:19:28,895  -->  00:19:29,919
6 columns

238

00:19:30,175  -->  00:19:34,015
Matrix is an example type

239

00:19:34,271  -->  00:19:35,807
Consist of A

240

00:19:38,111  -->  00:19:44,255
That means array inside array and so we will describe two dimensional array

241

00:19:44,511  -->  00:19:47,839
 and six columns here

242

00:19:49,119  -->  00:19:51,679
This is just for tpye description

243

00:19:52,191  -->  00:19:57,055
That's it I'm going to create a user variable

244

00:19:57,823  -->  00:19:59,871
Static variable here

245

00:20:00,639  -->  00:20:04,735
A on the score one B on the score 1 and on the score one

246

00:20:06,271  -->  00:20:09,087
Type of A that means

247

00:20:11,391  -->  00:20:14,975
A1 is variable of 1 dimentional array data type

248

00:20:17,535  -->  00:20:21,375
so We are using

249

00:20:21,887  -->  00:20:28,031
elementary data types or combine data types to create new data types

250

00:20:28,543  -->  00:20:29,311
And

251

00:20:29,567  -->  00:20:31,615
Define deliverables

252

00:20:32,383  -->  00:20:33,663
So that way

253

00:20:36,479  -->  00:20:40,831
character strings in structure text

254

00:20:41,343  -->  00:20:44,159
data type with a maximum length of

255

00:20:44,415  -->  00:20:47,231
254 characters

256

00:20:48,255  -->  00:20:52,095
Variable declaration is here

257

00:20:52,351  -->  00:20:54,143
If you don't use

258

00:20:54,399  -->  00:20:59,775
This option the maximum length with be 80 characters as default

259

00:21:00,031  -->  00:21:04,127
You can set a maximum length under

260

00:21:04,383  -->  00:21:07,455
For example 120 characters is possible

261

00:21:08,223  -->  00:21:14,111
An example assignments you see here as his name equals

262

00:21:14,623  -->  00:21:15,647
Transporter

263

00:21:17,184  -->  00:21:19,232
So with string

264

00:21:19,744  -->  00:21:21,536
Characters and variables

265

00:21:21,792  -->  00:21:27,936
It's possible to use compression operations like greater or

266

00:21:28,192  -->  00:21:33,056
Let's equal and so on string functions

267

00:21:33,312  -->  00:21:37,152
located in Library as character streams

268

00:21:37,408  -->  00:21:38,432
Concat

269

00:21:38,944  -->  00:21:41,504
delete find replace len

270

00:21:41,760  -->  00:21:44,064
These are the universal keyboards

271

00:21:44,576  -->  00:21:47,904
I guess your familiar already

272

00:21:48,928  -->  00:21:52,256
An assignment to byte

273

00:21:52,512  -->  00:21:56,352
Bit variables is possible by

274

00:21:56,864  -->  00:21:59,424
Of course 20

275

00:21:59,680  -->  00:22:01,472
Which connected here

276

00:22:02,752  -->  00:22:06,336
You can get the ASCII codes of the character as bytes

277

00:22:07,104  -->  00:22:08,640
Or vice versa

278

00:22:09,408  -->  00:22:13,248
Conversion from or to

279

00:22:13,760  -->  00:22:17,856
So integer real long real is possible

280

00:22:19,392  -->  00:22:20,672
Yep

281

00:22:23,744  -->  00:22:25,536
there are some notes

282

00:22:25,792  -->  00:22:28,864
You should read later on

283

00:22:32,192  -->  00:22:35,776
Another data type is structure

284

00:22:36,544  -->  00:22:41,152
For example in there is an electrical motor

285

00:22:43,456  -->  00:22:49,600
Grouping of components of different data types in the structure is possible

286

00:22:51,648  -->  00:22:54,464
here see an example

287

00:22:55,232  -->  00:22:58,816
UDT definition as type

288

00:23:00,864  -->  00:23:02,656
we will

289

00:23:03,168  -->  00:23:05,472
Describe our structure

290

00:23:06,240  -->  00:23:09,312
isside type definition motor

291

00:23:10,336  -->  00:23:16,480
Consists of set point speed actual speed enable and fault if this case

292

00:23:16,736  -->  00:23:22,880
After that is second step we will use this user-defined data type

293

00:23:23,136  -->  00:23:26,464
Motor 1 is a motor

294

00:23:26,976  -->  00:23:31,840
and we can access subtitles like this

295

00:23:32,352  -->  00:23:35,168
Moto R1.

296

00:23:36,448  -->  00:23:39,520
setpoint speed 100.0

297

00:23:39,776  -->  00:23:40,800
for write

298

00:23:41,312  -->  00:23:44,896
data of structure and so on...

299

00:23:51,552  -->  00:23:52,832
Yep

300

00:23:53,344  -->  00:23:59,488
data type enumerator is limited number of identifier

301

00:23:59,744  -->  00:24:02,048
Declaration of axis

302

00:24:06,656  -->  00:24:12,288
For instance. Describe a situation or state graph of a guards

303

00:24:13,056  -->  00:24:19,200
1 means opening 2 mins open 3 Means closing + 0 means it is closed

304

00:24:19,456  -->  00:24:22,016
At this case

305

00:24:24,832  -->  00:24:28,928
Type definition is like this grass States

306

00:24:29,184  -->  00:24:32,000
Coolest - 1 opening

307

00:24:32,256  -->  00:24:33,536
Is 2

308

00:24:35,840  -->  00:24:37,376
Open is 0

309

00:24:38,912  -->  00:24:41,216
Closing is

310

00:24:44,032  -->  00:24:45,312
1 perhaps

311

00:24:45,568  -->  00:24:47,360
lets try

312

00:24:48,384  -->  00:24:51,200
you can read....

313

00:24:55,040  -->  00:25:01,184
Technology object data types structure and function provided by simotion

314

00:25:01,440  -->  00:25:03,744
cam type drive axis...

315

00:25:04,768  -->  00:25:08,608
It's like a class structure

316

00:25:11,424  -->  00:25:15,264
You can use your own variable

317

00:25:16,032  -->  00:25:17,056
Here

318

00:25:18,080  -->  00:25:20,640
Define as pos axis

319

00:25:20,896  -->  00:25:23,200
Make an

320

00:25:23,456  -->  00:25:26,016
You know Arrangements

321

00:25:26,272  -->  00:25:31,904
Long as you're my axis variable equals axis one

322

00:25:32,672  -->  00:25:37,792
You can use later on in your program available

323

00:25:40,864  -->  00:25:41,888
So...

324

00:25:42,144  -->  00:25:48,288
TOs structure and functions provided by individual technology

325

00:25:48,544  -->  00:25:49,312
packages

326

00:25:50,080  -->  00:25:56,224
Yep simotion provides as the following TOs Drive access

327

00:25:56,480  -->  00:26:00,832
pos axes following axes

328

00:26:01,088  -->  00:26:06,720
measuring input-output system encoder temperature controller

329

00:26:06,976  -->  00:26:09,792
And an object.

330

00:26:12,864  -->  00:26:17,728
This convert for example

331

00:26:17,984  -->  00:26:20,544
Position axis

332

00:26:20,800  -->  00:26:23,872
To following axis in our program

333

00:26:24,640  -->  00:26:26,688
As an input

334

00:26:28,224  -->  00:26:32,576
Statement part of a program see here

335

00:26:32,832  -->  00:26:35,392
The statement that program code

336

00:26:36,160  -->  00:26:41,280
Equal length * width blah blah blah

337

00:26:42,560  -->  00:26:48,704
This isn't right axis here the east branch controls

338

00:26:48,960  -->  00:26:51,264
and so on...

339

00:26:54,336  -->  00:27:00,480
Types of a statement is value assigment control statement and subroutine execution

340

00:27:00,736  -->  00:27:05,600
Or system function calls looks like this

341

00:27:06,368  -->  00:27:08,672
ST

342

00:27:09,952  -->  00:27:16,096
You'll see here the expressions and operators and Operands in structure text

343

00:27:17,120  -->  00:27:20,704
mathemathical or relational operators

344

00:27:21,984  -->  00:27:25,056
variables

345

00:27:25,568  -->  00:27:28,896
...

346

00:27:31,456  -->  00:27:36,832
assigment will be looks like in structure text

347

00:27:39,392  -->  00:27:41,696
structure Assignment

348

00:27:43,744  -->  00:27:48,352
It's right to assignment entire structure assignment is possible

349

00:27:49,120  -->  00:27:55,264
Or component assignment is possible entire array assignment is possible

350

00:27:55,776  -->  00:28:01,152
There's no need to use another function like block move

351

00:28:01,920  -->  00:28:04,992
or array copy in simatic world

352

00:28:06,272  -->  00:28:12,416
So that's why it's sometimes harder to convert your program from simotion

353

00:28:12,672  -->  00:28:13,952
to simatic

354

00:28:17,280  -->  00:28:23,424
Access IOs and process images you see here that's an identifier

355

00:28:23,680  -->  00:28:25,728
it is possible in program

356

00:28:25,984  -->  00:28:30,336
but Normally view of Define are symbols in table

357

00:28:35,456  -->  00:28:41,600
There's some input image table and there is an  output image table

358

00:28:44,416  -->  00:28:48,000
And there's another small table

359

00:28:48,512  -->  00:28:51,072
named Process image input

360

00:28:51,840  -->  00:28:57,984
Process image Inputs or user defined process images

361

00:29:00,544  -->  00:29:06,176
Normally this small tables refreshed by System

362

00:29:06,432  -->  00:29:08,992
At the beginning of the cycle

363

00:29:09,248  -->  00:29:13,600
for inputs at the end of the cycle for outputs

364

00:29:13,856  -->  00:29:20,000
So if you want to get the news

365

00:29:20,256  -->  00:29:24,096
Level or logic step of an input

366

00:29:24,864  -->  00:29:27,168
You should use

367

00:29:27,680  -->  00:29:31,520
Process image byte instead of

368

00:29:32,032  -->  00:29:33,056
This

369

00:29:33,312  -->  00:29:34,848
Deceleration

370

00:29:39,456  -->  00:29:40,480
So

371

00:29:40,736  -->  00:29:46,880
Logical address space for simotion Drive based system

372

00:29:47,392  -->  00:29:49,440
That's quite good enough

373

00:29:51,744  -->  00:29:55,840
For other Hardware platforms it's limited weeks

374

00:29:56,096  -->  00:29:57,376
4 kilobytes

375

00:30:02,752  -->  00:30:08,896
Access to individual bits with the permit language extension compile option

376

00:30:11,712  -->  00:30:16,320
But now we see how do we use this function in our program

377

00:30:17,344  -->  00:30:21,696
we will described here my results my anybit

378

00:30:21,952  -->  00:30:23,744
And make it definition

379

00:30:24,512  -->  00:30:29,888
After that if I want to get a bit from

380

00:30:30,656  -->  00:30:33,216
a byte

381

00:30:33,472  -->  00:30:39,360
Any bits but I will answer here the bit no as 5

382

00:30:39,872  -->  00:30:41,664
This is one way to do that

383

00:30:42,432  -->  00:30:47,808
without language Extinction you will see here

384

00:30:50,112  -->  00:30:52,416
easily byte variable dot 5

385

00:30:52,928  -->  00:30:56,768
Results a bit status with language Extension

386

00:30:57,792  -->  00:30:59,072
Is possible

387

00:31:00,864  -->  00:31:07,008
and for setting bit use this function or language extension here

388

00:31:07,264  -->  00:31:09,824
That is also toggle bit functions

389

00:31:10,080  -->  00:31:14,432
Is possible to do with xor gate

390

00:31:15,456  -->  00:31:19,808
as scout 4.1

391

00:31:20,320  -->  00:31:25,184
It is possible to use user-friendly

392

00:31:25,696  -->  00:31:26,464
Axis

393

00:31:26,720  -->  00:31:32,864
of Individual bits of advice or words of double word is possible

394

00:31:34,144  -->  00:31:37,728
next page

395

00:31:37,984  -->  00:31:41,824
See the control statement if else case

396

00:31:42,080  -->  00:31:45,920
it Looks like this in our user program

397

00:31:46,176  -->  00:31:52,320
else fi and this and Case commission is similar to Pascal

398

00:31:52,576  -->  00:31:56,672
Programming language so it's look like in MCC

399

00:31:57,440  -->  00:32:03,584
This is the same thing in structure text

400

00:32:04,608  -->  00:32:10,752
Control statements for vwhile repeats here example

401

00:32:11,008  -->  00:32:12,032
 usage

402

00:32:23,296  -->  00:32:26,880
What's the difference between while and repeat?

403

00:32:27,904  -->  00:32:33,536
In while loop program interpolator is running from up to down

404

00:32:33,792  -->  00:32:39,936
If the condition is not met that you skip the statements here then your

405

00:32:40,192  -->  00:32:40,960
commands

406

00:32:41,216  -->  00:32:45,568
For example set the alarm bit is not executed

407

00:32:46,592  -->  00:32:48,384
It's a repeat Loop

408

00:32:48,640  -->  00:32:51,200
It was see here some statements

409

00:32:52,224  -->  00:32:58,368
commands will be Executives here after that the condition will be checked

410

00:32:59,904  -->  00:33:02,464
If the condition is not met

411

00:33:03,488  -->  00:33:06,048
The program to continue to Next Step

412

00:33:07,584  -->  00:33:12,448
At least once your output is set here

413

00:33:12,960  -->  00:33:17,312
Because you check the condition after your statement

414

00:33:20,384  -->  00:33:23,968
control statements exit and return

415

00:33:24,224  -->  00:33:30,368
we will used this statement in or Loops for example

416

00:33:31,136  -->  00:33:35,232
If input 1.1 is through the exit Loop

417

00:33:35,488  -->  00:33:37,024
This is the endless loop

418

00:33:38,304  -->  00:33:40,864
User return in functions

419

00:33:41,376  -->  00:33:47,520
is true then return from function to

420

00:33:48,288  -->  00:33:52,640
Points or line were it called

421

00:33:55,200  -->  00:33:59,808
we will not execute next steps in this function

422

00:34:03,136  -->  00:34:04,672
Next page

423

00:34:05,952  -->  00:34:09,536
Go to and wait for conditional statement

424

00:34:12,864  -->  00:34:14,400
with go to

425

00:34:14,912  -->  00:34:21,056
we Create several labels in different places in our program

426

00:34:21,312  -->  00:34:23,360
After that

427

00:34:24,128  -->  00:34:27,968
It's possible to use go to keyword for jump

428

00:34:28,736  -->  00:34:31,808
wait for condition

429

00:34:33,088  -->  00:34:35,648
we will call with an expression

430

00:34:36,160  -->  00:34:39,232
if Expression is true

431

00:34:39,744  -->  00:34:43,072
We will execute some statement

432

00:34:52,288  -->  00:34:54,080
So comments

433

00:34:55,104  -->  00:35:00,480
Breaking news line come with double / or we may use block commands

434

00:35:01,248  -->  00:35:02,528
With that way

435

00:35:06,880  -->  00:35:11,232
contorl the compilation with preprocessor

436

00:35:11,488  -->  00:35:14,560
Replace the names in ST source

437

00:35:15,072  -->  00:35:20,192
Yeah we change is defined and undefined identifiers

438

00:35:21,728  -->  00:35:23,520
for compilation

439

00:35:24,800  -->  00:35:27,872
It's another useful feature

440

00:35:30,688  -->  00:35:32,224
you see

441

00:35:33,504  -->  00:35:38,880
And example of use preprocessor

442

00:35:40,160  -->  00:35:46,304
An example program code you see here function block definition interface Global variable

443

00:35:46,560  -->  00:35:50,400
After that your Define my Define

444

00:35:50,656  -->  00:35:54,240
global var

445

00:35:55,008  -->  00:36:00,640
At the implementation section there's a function function block

446

00:36:01,664  -->  00:36:02,688
So

447

00:36:02,944  -->  00:36:07,296
Define assignment var

448

00:36:07,808  -->  00:36:11,136
And it's called the

449

00:36:11,648  -->  00:36:13,952
my define

450

00:36:14,720  -->  00:36:19,328
afterf the preposition

451

00:36:20,096  -->  00:36:26,240
Or assignment to f g 1 + 1

452

00:36:26,496  -->  00:36:29,312
Not replaced here

453

00:36:32,128  -->  00:36:36,224
So I special cases it reduces time

454

00:36:36,992  -->  00:36:40,064
but as

455

00:36:40,320  -->  00:36:43,392
 an Disadvantage your program will be

456

00:36:43,648  -->  00:36:46,464
little bit complicated for read

457

00:36:48,768  -->  00:36:54,912
soTesting testing programs program status symbol browser for monitoring and

458

00:36:55,168  -->  00:36:57,472
Controlling monitor watch table

459

00:36:57,984  -->  00:37:00,544
trace tool

460

00:37:01,568  -->  00:37:03,616
How do you do that?

461

00:37:04,640  -->  00:37:10,784
So I'm Target system or right-click to CPU operating mode

462

00:37:11,040  -->  00:37:12,832
It's just switch between modes

463

00:37:15,648  -->  00:37:21,792
For test program and switch on the program status on St sides it looks like this

464

00:37:23,840  -->  00:37:25,632
There's a program status

465

00:37:25,888  -->  00:37:27,936
looks like some

466

00:37:28,704  -->  00:37:31,008
Glasses

467

00:37:32,800  -->  00:37:35,104
And there isn't stop monitoring

468

00:37:36,640  -->  00:37:37,664
Button

469

00:37:37,920  -->  00:37:40,992
Is possible to force an update variables

470

00:37:42,272  -->  00:37:48,416
This is the monitoring screen divided as vertically on the right

471

00:37:48,672  -->  00:37:54,304
side see status of wearables

472

00:37:55,328  -->  00:37:57,120
If else ase

473

00:37:58,656  -->  00:38:01,216
You'll see your counter variable is

474

00:38:02,496  -->  00:38:05,312
Less of 500 that's why

475

00:38:05,568  -->  00:38:10,176
You see this site and as condition is not met

476

00:38:10,688  -->  00:38:12,224
You'll see here

477

00:38:12,736  -->  00:38:14,016
The question marks

478

00:38:14,272  -->  00:38:15,552
That's the reason

479

00:38:21,184  -->  00:38:27,328
Normal structure text we will use symbol browser to monitor variables

480

00:38:28,352  -->  00:38:29,632
Together

481

00:38:32,704  -->  00:38:36,800
It's also possible to add to watch table at monitor

482

00:38:37,568  -->  00:38:40,896
The group up or user variables

483

00:38:42,944  -->  00:38:49,088
There are some new functions in ST editor as of firmware version

484

00:38:49,344  -->  00:38:50,624
4.2

485

00:38:51,648  -->  00:38:56,512
Context menu with comments for copy and paste lights

486

00:38:56,768  -->  00:38:58,304
Changing the view

487

00:38:59,328  -->  00:39:01,888
Go to bookmarks startup block

488

00:39:02,144  -->  00:39:03,424
and so on...

489

00:39:03,936  -->  00:39:06,752
Support for Split windows

490

00:39:07,008  -->  00:39:08,800
possible to open

491

00:39:09,056  -->  00:39:12,384
Two different page St units

492

00:39:12,640  -->  00:39:15,200
Sequence generator

493

00:39:15,456  -->  00:39:20,064
Autocomplete with control + space

494

00:39:23,648  -->  00:39:27,744
Yeah you're a useful function you said it

495

00:39:28,000  -->  00:39:30,048
Index of an array

496

00:39:31,328  -->  00:39:33,120
click

497

00:39:33,888  -->  00:39:38,752
Or you just enter

498

00:39:39,520  -->  00:39:42,080
You

499

00:39:42,336  -->  00:39:48,480
alt key Press Ctrl shift on S7 buttons than you see it's automatically arranged

500

00:39:53,344  -->  00:39:55,904
You can do it on the other side

501

00:39:56,672  -->  00:39:58,464
For instance

502

00:39:59,744  -->  00:40:04,096
Set column by column width of alt key and mouse

503

00:40:05,376  -->  00:40:10,752
After you press Ctrl + shift key and

504

00:40:11,520  -->  00:40:16,640
Function 7 together you see on the right side

505

00:40:18,176  -->  00:40:19,968
value are arranged

506

00:40:25,600  -->  00:40:31,744
Setting breakpoints structure text is can only be used in program

507

00:40:32,000  -->  00:40:34,560
Function block and function

508

00:40:35,328  -->  00:40:38,656
And for procedure

509

00:40:40,960  -->  00:40:42,752
You have to set up debug mode

510

00:40:43,008  -->  00:40:48,896
And specify debug set breakpoints specified equipment

511

00:40:49,152  -->  00:40:51,456
Activate breakpoints

512

00:40:51,968  -->  00:40:57,344
At last it use variable status to monitor contents of local variables

513

00:40:59,648  -->  00:41:04,256
So you can set breakpoints within a program source

514

00:41:04,512  -->  00:41:07,072
It's this ST source whatever

515

00:41:07,840  -->  00:41:10,656
The preconditions are here

516

00:41:12,704  -->  00:41:14,240
already read

517

00:41:20,384  -->  00:41:23,200
so see debug task group

518

00:41:26,784  -->  00:41:28,832
Yeah

519

00:41:30,112  -->  00:41:36,000
First unit to right click and change operating mode to debug mode

520

00:41:36,256  -->  00:41:38,304
accept safety notes

521

00:41:40,096  -->  00:41:43,936
Okay program source is inconsistent has been changed

522

00:41:46,240  -->  00:41:48,032
Okay

523

00:41:49,056  -->  00:41:52,384
we changed something yes

524

00:41:52,895  -->  00:41:54,687
Let's save and compile

525

00:41:57,247  -->  00:42:01,599
You're offline and online program must be

526

00:42:04,927  -->  00:42:11,071
Same for debug your program and use the brakepoints

527

00:42:13,887  -->  00:42:17,215
When I click right

528

00:42:17,471  -->  00:42:21,055
It's now activated about test group and debug table

529

00:42:21,311  -->  00:42:27,455
For debug test group assign some of my tasks

530

00:42:28,223  -->  00:42:30,527
Which task of CPU should be stopped?

531

00:42:30,783  -->  00:42:32,063
When did break point?

532

00:42:32,319  -->  00:42:33,343
Is reached

533

00:42:33,599  -->  00:42:38,975
I'm going to use motion task one for instance.

534

00:42:42,047  -->  00:42:46,399
You can Define your debug table

535

00:42:47,167  -->  00:42:49,471
It's manage your break points

536

00:42:50,495  -->  00:42:55,103
I will group open my motion test motion program one

537

00:43:02,783  -->  00:43:07,135
You'll see here some basic programs

538

00:43:07,391  -->  00:43:09,439
And if the toolbar

539

00:43:12,255  -->  00:43:14,047
there are some ready to use buttons

540

00:43:15,583  -->  00:43:19,935
set Remove brake lines at this case I want at the breakpoint

541

00:43:21,215  -->  00:43:22,495
just 1 click

542

00:43:24,031  -->  00:43:30,175
If I click again it would be removed and next thing activate deactivate is breakpoint

543

00:43:31,199  -->  00:43:37,343
Maybe there are a lot of break points but you don't want to activate

544

00:43:37,855  -->  00:43:40,159
Next cycle or next try

545

00:43:41,183  -->  00:43:43,231
when I click this

546

00:43:44,255  -->  00:43:47,583
It's activated with filled with red

547

00:43:53,215  -->  00:43:55,007
When I go

548

00:43:55,263  -->  00:43:59,359
Yeah program statistics and monitor the variables

549

00:43:59,615  -->  00:44:01,151
And I double Click

550

00:44:02,175  -->  00:44:03,199
Here

551

00:44:04,223  -->  00:44:10,367
It's activated by the debug mode is working and break point reached

552

00:44:14,463  -->  00:44:17,279
at the mean time maybe you want to

553

00:44:17,791  -->  00:44:22,655
go device diagnostics at See on task manager

554

00:44:22,911  -->  00:44:27,775
You'll see here task is running but there's and Brake active

555

00:44:32,383  -->  00:44:34,687
If I could it again

556

00:44:35,455  -->  00:44:37,759
Breakpoint will be deactivated

557

00:44:41,599  -->  00:44:45,183
It's possible to edit the call path

558

00:44:46,719  -->  00:44:50,559
Which property is used for that preference

559

00:44:51,583  -->  00:44:57,727
I called this program from more than one but for function blocks you

560

00:44:57,983  -->  00:45:02,335
You have to describe it here to monitor

561

00:45:02,847  -->  00:45:06,175
Current points is important

562

00:45:08,735  -->  00:45:11,551
Activate all breakpoints

563

00:45:11,807  -->  00:45:17,951
Of the active POU you if there are five or six breakpoints and when you do

564

00:45:18,207  -->  00:45:22,815
Don't want to waste your time and activate all it's possible

565

00:45:23,327  -->  00:45:24,607
And that activates

566

00:45:25,375  -->  00:45:27,935
delete all breakpoints

567

00:45:29,215  -->  00:45:30,495
debug table

568

00:45:31,263  -->  00:45:32,543
here

569

00:45:33,055  -->  00:45:39,199
You'll see all of the breakpoints in your table you can just like activate deactivate or delete

570

00:45:40,991  -->  00:45:44,831
Display the call stack

571

00:45:45,599  -->  00:45:51,487
You can debug your call stack here breakpoint is activated everyone

572

00:45:53,023  -->  00:45:58,399
you can select

573

00:45:58,655  -->  00:46:02,239
Maybe every time or maybe ever

574

00:46:02,751  -->  00:46:04,543
20 run

575

00:46:05,311  -->  00:46:06,847
is possible

576

00:46:11,711  -->  00:46:13,759
then Our program is broken

577

00:46:15,295  -->  00:46:17,087
If you want to continue

578

00:46:17,343  -->  00:46:19,647
You have to keep the continiue button

579

00:46:20,415  -->  00:46:21,439
So

580

00:46:21,695  -->  00:46:24,255
In that case

581

00:46:24,767  -->  00:46:27,839
Its now running

582

00:46:28,607  -->  00:46:30,911
Executing our comments

583

00:46:31,167  -->  00:46:32,447
Basically

584

00:46:33,471  -->  00:46:36,799
So let's continue with notes

585

00:46:42,687  -->  00:46:43,967
Yep

586

00:46:55,231  -->  00:47:01,375
If you said it's your old tasks note that all outputs will be deactivated

587

00:47:02,399  -->  00:47:04,447
when break point is reached

588

00:47:05,215  -->  00:47:11,359
Be careful if you are energizing some contractors or

589

00:47:11,615  -->  00:47:14,687
Your outputs connected to

590

00:47:15,711  -->  00:47:18,783
Some valves you need to be careful

591

00:47:19,039  -->  00:47:21,855
during debug

592

00:47:23,135  -->  00:47:28,255
Next page setting breakpoints in St source file

593

00:47:29,279  -->  00:47:34,655
Actually is the same way you just said it to your online and use the

594

00:47:34,911  -->  00:47:38,751
Same buttons located in your toolbar

595

00:47:40,799  -->  00:47:44,639
then you specify the call path

596

00:47:48,991  -->  00:47:54,111
Then you can activate deactivate or delete your breakpoints

597

00:47:56,159  -->  00:47:58,207
You can use keyboard shortcuts

598

00:48:02,815  -->  00:48:06,143
So it's available status

599

00:48:07,167  -->  00:48:08,447
Below the screen

600

00:48:14,335  -->  00:48:16,639
You can status your variable

601

00:48:17,919  -->  00:48:20,991
After program stops

602

00:48:25,087  -->  00:48:29,183
You can use breakpoint and program status together

603

00:48:31,231  -->  00:48:33,023
to see current

604

00:48:34,303  -->  00:48:35,327
values

605

00:48:39,935  -->  00:48:46,079
You can record with Device trace or your firmware

606

00:48:46,335  -->  00:48:49,151
if is higher than

607

00:48:49,407  -->  00:48:54,271
4.2 record variables with system trace

608

00:49:05,023  -->  00:49:09,375
here you see device trace and system Trace

609

00:49:13,983  -->  00:49:19,615
Unlimited isochron endless trace Servo Factor 2

610

00:49:21,151  -->  00:49:23,455
Then you should

611

00:49:24,223  -->  00:49:27,295
Use maybe the ring buffer okay

612

00:49:30,111  -->  00:49:32,415
Let's add some variable here

613

00:49:38,303  -->  00:49:43,679
Some technology objects variable

614

00:49:52,895  -->  00:49:54,175
or...

615

00:49:56,991  -->  00:49:59,807
Or positioning States

616

00:50:09,279  -->  00:50:13,119
yes...

617

00:50:16,703  -->  00:50:21,567
It's possible to add until 128

618

00:50:21,823  -->  00:50:24,127
i need downloads

619

00:50:24,383  -->  00:50:26,943
Parameterization available

620

00:50:27,199  -->  00:50:33,343
System trace cannot be used as only device simultaneously okay alright

621

00:50:33,599  -->  00:50:34,879
Yes

622

00:50:39,743  -->  00:50:43,071
System Trace parameterization

623

00:50:43,327  -->  00:50:45,119
Is that start

624

00:51:00,223  -->  00:51:01,503
Stop

625

00:51:04,831  -->  00:51:09,183
You can change your the active curve standtstill monitoring

626

00:51:12,511  -->  00:51:14,815
For the face of position monitoring

627

00:51:25,823  -->  00:51:31,711
It's possible to select the other values

628

00:51:34,015  -->  00:51:36,063
here with

629

00:51:36,319  -->  00:51:38,111
This way

630

00:51:39,135  -->  00:51:40,671
Okay

631

00:51:46,303  -->  00:51:52,447
a system trace is support data used to report up 128

632

00:51:52,703  -->  00:51:56,031
From multiple simotion controllers

633

00:51:56,287  -->  00:51:59,103
Together with profinet IRT

634

00:51:59,871  -->  00:52:05,247
At the same trigger criteria as for

635

00:52:05,759  -->  00:52:11,903
Individual device Trace are available or shooting of a specific volume

636

00:52:12,159  -->  00:52:13,695
and so on...

637

00:52:14,463  -->  00:52:20,607
Corporate system such as printing process with multiple motor controllers and

638

00:52:20,863  -->  00:52:27,007
sync Operation across all devices this is signefficiently reduces

639

00:52:27,263  -->  00:52:31,359
Commission also service requirements

640

00:52:31,615  -->  00:52:35,711
So the systems trace is in advance

641

00:52:37,503  -->  00:52:38,783
Next page

642

00:52:39,295  -->  00:52:43,391
Diagnostics with the to trace

643

00:52:43,903  -->  00:52:50,047
you will see here technology object trace we're already used to set up

644

00:52:51,071  -->  00:52:57,215
Debug our technology objects comments or configuration data change

645

00:52:57,471  -->  00:53:02,847
Or system readable change it is also possible

646

00:53:03,103  -->  00:53:09,247
Actually the firmware version 4.2 it's was

647

00:53:10,015  -->  00:53:11,295
Radical game changer

648

00:53:12,063  -->  00:53:18,207
Version and there are a lot of usable features

649

00:53:18,463  -->  00:53:20,255
Just like this

650

00:53:26,399  -->  00:53:28,191
That's why

651

00:53:28,703  -->  00:53:33,823
a lot of Details about this version added

652

00:53:34,847  -->  00:53:38,175
later on so...

653

00:53:40,479  -->  00:53:46,623
now we have completed our lecture notes for programming with structure

654

00:53:51,743  -->  00:53:54,559
I will switch back to

655

00:53:54,815  -->  00:53:57,375
simotion projects

656

00:53:58,655  -->  00:54:01,471
you will see here or

657

00:54:01,727  -->  00:54:07,871
Empty almost empty ST you can Define here some types

658

00:54:08,127  -->  00:54:13,503
Structures you can Define your programs here

659

00:54:16,319  -->  00:54:22,463
For instance i say empty program 1 that means I will call this program

660

00:54:22,719  -->  00:54:28,863
From motion task i will Define here in interface

661

00:54:30,399  -->  00:54:32,447
Exportable

662

00:54:34,239  -->  00:54:38,847
back program on me so I recorded for background

663

00:54:41,663  -->  00:54:44,991
IPO programming means

664

00:54:45,247  -->  00:54:48,575
i will call this program from IPO task

665

00:54:49,343  -->  00:54:55,487
And I have to Define my program and write some code

666

00:54:55,743  -->  00:54:58,815
Implementation section

667

00:54:59,071  -->  00:55:01,119
Here it should be

668

00:55:01,375  -->  00:55:02,655
Like this

669

00:55:02,911  -->  00:55:04,447
end program

670

00:55:07,263  -->  00:55:09,311
Yep.

671

00:55:16,223  -->  00:55:19,551
This is our empty program

672

00:55:19,807  -->  00:55:22,111
This is an empty program

673

00:55:22,367  -->  00:55:26,719
This is an empty program let's use preprocessor

674

00:55:29,279  -->  00:55:31,071
no error no warning

675

00:55:32,095  -->  00:55:38,239
Let's add some variables and

676

00:55:38,495  -->  00:55:39,519
variable

677

00:55:40,543  -->  00:55:43,103
variable temp

678

00:55:43,359  -->  00:55:45,407
Available

679

00:55:47,967  -->  00:55:52,063
static so...

680

00:55:55,391  -->  00:56:00,255
function block definition is similar

681

00:56:01,535  -->  00:56:02,815
Let's see

682

00:56:03,071  -->  00:56:05,631
If the test 1

683

00:56:12,799  -->  00:56:13,823
Yo

684

00:56:16,127  -->  00:56:18,431
FB test 1

685

00:56:21,759  -->  00:56:23,039
were

686

00:56:23,807  -->  00:56:25,599
input

687

00:56:25,855  -->  00:56:31,487
varible

688

00:56:31,743  -->  00:56:33,535
outputs

689

00:56:33,791  -->  00:56:35,327
varible in out

690

00:56:35,583  -->  00:56:37,375
Is possible

691

00:56:38,655  -->  00:56:44,287
Another thing is available temp is possible

692

00:56:50,943  -->  00:56:51,967
Okay

693

00:56:55,039  -->  00:57:01,183
Accept and compile my program as you can see here

694

00:57:01,439  -->  00:57:06,559
That are three different programs and 1 function block

695

00:57:06,815  -->  00:57:08,351
if i click here

696

00:57:09,119  -->  00:57:12,447
the inputs and outputs

697

00:57:18,591  -->  00:57:24,735
object browser that are some items it looks like the classical CODESYS 

698

00:57:26,015  -->  00:57:28,063
based editor

699

00:57:28,575  -->  00:57:32,671
You'll see standart Functionality

700

00:57:33,183  -->  00:57:35,743
Which device package

701

00:57:35,999  -->  00:57:42,143
What is the units POUs Global variables

702

00:57:42,911  -->  00:57:47,007
If you're familiar with CODESYS is based

703

00:57:47,519  -->  00:57:50,591
Devices or you're using codesys

704

00:57:51,615  -->  00:57:54,431
It's really similar to you

705

00:57:57,503  -->  00:58:03,647
I told you I think it's a good idea to make some exercises

706

00:58:03,903  -->  00:58:10,047
Create a new St unit and write your own programs

707

00:58:10,303  -->  00:58:15,423
Execution system with different tasks and see

708

00:58:16,447  -->  00:58:18,495
with traces

709

00:58:18,751  -->  00:58:20,287
What's going on?

710

00:58:20,543  -->  00:58:23,615
Set some breakpoints

711

00:58:23,871  -->  00:58:26,687
in your program in structure text

712

00:58:27,967  -->  00:58:29,759
Let's try in run mode

713

00:58:35,135  -->  00:58:41,279
We are created in units when you are working with structure text

714

00:58:42,047  -->  00:58:44,351
It's

715

00:58:44,607  -->  00:58:47,167
More

716

00:58:47,423  -->  00:58:50,751
Possible to make a download in run

717

00:58:51,007  -->  00:58:56,127
when you compare program in MCC

718

00:58:56,383  -->  00:59:00,735
That's why it still has an advantage at this point

719

00:59:02,527  -->  00:59:08,671
This is another reason why we choose the program which structure text it's basic

720

00:59:08,927  -->  00:59:15,071
Easy to copy and paste and it has some advantages

721

00:59:15,327  -->  00:59:16,351
So ...

722

00:59:16,863  -->  00:59:23,007
We have our program and to program 1 let's set a breakpoint here

723

00:59:23,519  -->  00:59:25,567
for program 1

724

00:59:27,103  -->  00:59:33,247
There's no code I have to add some code here or make an assignment variable

725

00:59:37,343  -->  00:59:40,671
A variable as integer

726

00:59:41,695  -->  00:59:43,487
Let's say

727

00:59:48,095  -->  00:59:52,447
make and assignment is Equals

728

00:59:52,703  -->  00:59:55,007
15

729

01:00:07,039  -->  01:00:13,183
So we didn't called our program and MT program 1

730

01:00:18,047  -->  01:00:21,375
Maybe we should call First

731

01:00:31,615  -->  01:00:32,639
Okay

732

01:00:49,279  -->  01:00:53,119
Let's say remove breakpoints

733

01:01:06,175  -->  01:01:10,527
No that's a breakpoint here

734

01:01:11,807  -->  01:01:14,623
Let's take our glasses to look

735

01:01:15,391  -->  01:01:21,535
Program did not want to here your right is not assigned to any task

736

01:01:22,303  -->  01:01:25,631
Let's assigned to a task

737

01:01:29,471  -->  01:01:31,007
Backgrounds

738

01:01:33,823  -->  01:01:39,711
back program accept close

739

01:01:40,735  -->  01:01:43,039
Downloading in run

740

01:01:43,295  -->  01:01:44,319
Let's try

741

01:01:49,951  -->  01:01:53,279
How to change the execution system so

742

01:01:53,535  -->  01:01:57,631
I have to stop first then download again

743

01:02:00,447  -->  01:02:03,263
Set an alarm

744

01:02:03,519  -->  01:02:07,103
I want to work with my back program

745

01:02:09,919  -->  01:02:11,199
So

746

01:02:11,967  -->  01:02:15,807
Let's add here some variable

747

01:02:30,911  -->  01:02:32,959
Okay

748

01:02:47,295  -->  01:02:53,183
You went online and offline partner

749

01:02:53,951  -->  01:02:56,511
is Persistent after that

750

01:02:56,767  -->  01:02:59,839
The old breakpoints is activated to use

751

01:03:00,351  -->  01:03:03,935
So let's see here there is a break point

752

01:03:04,447  -->  01:03:10,591
Let's monitor available is 150

753

01:03:14,175  -->  01:03:19,807
But be careful assigned my program in background so

754

01:03:20,319  -->  01:03:22,623
if i Activate

755

01:03:22,879  -->  01:03:24,159
The breakpoints

756

01:03:26,463  -->  01:03:32,607
Note that brakepoints could be activated do you want to take the

757

01:03:32,863  -->  01:03:36,703
The first thing to develop test now and I say yes

758

01:03:51,551  -->  01:03:53,599
call positions

759

01:03:53,855  -->  01:03:55,903
okay

760

01:03:57,439  -->  01:04:02,559
CPU is in run and

761

01:04:03,839  -->  01:04:08,703
Debug mode background task to be stopped at this case

762

01:04:15,359  -->  01:04:17,919
Let's check the operating States

763

01:04:30,719  -->  01:04:33,791
You'll see a background task is running

764

01:04:43,007  -->  01:04:48,127
set in simotion

765

01:04:49,151  -->  01:04:52,479
in back program I hit to activate

766

01:04:59,647  -->  01:05:01,183
Okay

767

01:05:02,207  -->  01:05:07,071
Now it's broken and background task is

768

01:05:07,583  -->  01:05:10,143
Stop right here as you can see

769

01:05:12,191  -->  01:05:18,335
It's not logical to do this operation in background task but it's

770

01:05:18,591  -->  01:05:24,735
On the other hand looks like this now or program interpreter located

771

01:05:24,991  -->  01:05:27,295
line 49

772

01:05:28,063  -->  01:05:30,623
At this point at this breakpoint

773

01:05:30,879  -->  01:05:36,767
Then I can continue the same way as the MCC charts just continue

774

01:05:46,751  -->  01:05:50,847
at next cycle same breakpoint the program Brooks again

775

01:05:51,103  -->  01:05:53,407
I have to deactivate the breakpoints

776

01:05:53,663  -->  01:05:57,247
After that I hit the continiue

777

01:05:58,015  -->  01:06:00,063
And program continues

778

01:06:01,087  -->  01:06:05,183
So I can see it is running so

779

01:06:05,695  -->  01:06:10,815
Homework for you create structure program

780

01:06:11,327  -->  01:06:16,191
structure text and test your program in simulation

781

01:06:16,447  -->  01:06:17,727
See you next time
