0
1
00:00:21,510 --> 00:00:22,190
Hello.
1

2
00:00:22,260 --> 00:00:32,750
Let's continue to learn structure takes basic structure and I will create a new project in programs
2

3
00:00:32,780 --> 00:00:33,440
area.
3

4
00:00:33,530 --> 00:00:35,700
I will create two program
4

5
00:00:35,810 --> 00:00:37,820
One will be ladder diagram
5

6
00:00:42,860 --> 00:00:45,950
and another will be structure text 
6

7
00:00:54,380 --> 00:01:00,510
and program is creating now and program zero in the ladder diagram area.
7

8
00:01:00,650 --> 00:01:12,170
I will add LD M1 for example and plus D10 D12 to D14 multiplied by D14 D16
8

9
00:01:12,170 --> 00:01:13,910
to D20.
9

10
00:01:13,940 --> 00:01:16,270
So this is a ladder diagram example.
10

11
00:01:16,280 --> 00:01:22,610
For example in here and how to write this ladder diagram.
11

12
00:01:22,610 --> 00:01:25,740
Example as ST  language.
12

13
00:01:25,880 --> 00:01:31,910
So I will create a I already created a st language program area in here.
13

14
00:01:31,910 --> 00:01:42,510
So let's write if M1 THEN and I will check one is it m1 or m0 m1.
14

15
00:01:42,510 --> 00:01:43,290
That's okay.
15

16
00:01:43,320 --> 00:01:52,250
And D10 multiplied D12 equals to D14 D14 multiplied by D16 to d20.
16

17
00:01:52,290 --> 00:01:59,880
So the way is going to d20 what should we do.
17

18
00:01:59,920 --> 00:02:02,260
We can say D20.
18

19
00:02:02,410 --> 00:02:05,290
equals to D16
19

20
00:02:05,440 --> 00:02:11,330
Multiply by D10 plus D12 END_IF
20

21
00:02:12,040 --> 00:02:14,640
so let's take a look.
21

22
00:02:14,740 --> 00:02:15,610
Is it correct
22

23
00:02:18,640 --> 00:02:22,340
D20 equals to 16 multiplied by 14.
23

24
00:02:22,360 --> 00:02:26,000
But already 14 is equals  to 10 plus 12.
24

25
00:02:26,140 --> 00:02:35,100
So let's check once ten plus twelve multiply by D16 equals  to D20
25

26
00:02:36,220 --> 00:02:37,150
Let's check once.
26

27
00:02:37,150 --> 00:02:37,600
to.
27

28
00:02:37,630 --> 00:02:39,830
Is it correct or not is it.
28

29
00:02:39,910 --> 00:02:42,330
The project is compiling now.
29

30
00:02:42,730 --> 00:02:52,600
I will send this code to my simulator and say transfer it's transferring now and transfer is finished.
30

31
00:02:52,600 --> 00:03:02,500
Go program 0 and activate M1 and let's give to present value to D10 ,D10 equals to 5.
31

32
00:03:02,570 --> 00:03:03,180
Okay.
32

33
00:03:03,280 --> 00:03:06,660
And D12 equals two let's say two.
33

34
00:03:06,880 --> 00:03:12,570
Okay and D16 will be equals to two.
34

35
00:03:12,640 --> 00:03:13,900
That's okay.
35

36
00:03:14,200 --> 00:03:14,680
And
36

37
00:03:17,780 --> 00:03:19,420
that's okay.
37

38
00:03:19,420 --> 00:03:23,320
Finished my cpu is stopped now.
38

39
00:03:23,320 --> 00:03:25,290
So the result is zero.
39

40
00:03:25,420 --> 00:03:29,910
I will say run plc  it's run now.
40

41
00:03:30,440 --> 00:03:30,900
--
41

42
00:03:30,920 --> 00:03:36,280
Set on and change present value because of it wasn't it was a stop.
42

43
00:03:36,280 --> 00:03:37,260
position.
43

44
00:03:37,280 --> 00:03:39,440
So the values are cleared now.
44

45
00:03:39,710 --> 00:03:50,590
So D10 give a valued to a d12 will be for example five and D16 will be two then
45

46
00:03:50,660 --> 00:03:58,340
output two plus five is equal to seven and seven multiplied by two fourteen and go to a ST program
46

47
00:03:58,670 --> 00:04:05,930
in here you can see D20 is fourteen so that's okay change present value in here for example
47

48
00:04:05,960 --> 00:04:14,680
D12 to for example ten and the result will be twelve multiply by two and twenty four.
48

49
00:04:14,870 --> 00:04:15,350
That's okay.
49

50
00:04:15,350 --> 00:04:27,520
Go offline and program zero delete this one and complete the ladder diagram is deleted  and we will say
50

51
00:04:27,570 --> 00:04:37,450
just only ST  language section to our simulator and project is compiling and download this execution
51

52
00:04:37,450 --> 00:04:39,750
code to simulator and transfer again
52

53
00:04:45,180 --> 00:04:52,620
then go back to running state and if M1 that's ok and change present values.
53

54
00:04:52,680 --> 00:04:57,010
D12 five and D10 will be five.
54

55
00:04:57,010 --> 00:05:07,110
For example D16 will be five so five plus five equals to Ten Ten multiplied by five equals to 50.
55

56
00:05:07,110 --> 00:05:21,350
So this is working and go off line and say else D20 will be zero and go online again if M1 is not
56

57
00:05:21,620 --> 00:05:23,180
active or not high.
57

58
00:05:23,180 --> 00:05:31,290
So D20 will be zero download this code to simulator and OK
58

59
00:05:34,830 --> 00:05:47,370
and say yes m1 is active and then I will change these ones and D5 , D12 will be five
59

60
00:05:47,460 --> 00:05:49,880
and D16 will be five.
60

61
00:05:49,920 --> 00:05:55,060
So you see D20 is 50 now if M1 is set off
61

62
00:05:55,170 --> 00:06:05,660
So because of else condition D20 equals to now zero and I will finish this video for a moment but first
62

63
00:06:05,660 --> 00:06:08,340
of all I need to explain one more thing.
63

64
00:06:08,600 --> 00:06:12,670
Structure of ST 
64

65
00:06:13,160 --> 00:06:13,530
--
65

66
00:06:13,580 --> 00:06:14,110
How is it.
66

67
00:06:14,120 --> 00:06:19,190
So we need  comment
67

68
00:06:19,270 --> 00:06:20,650
Like I am writing now.
68

69
00:06:20,650 --> 00:06:21,460
This is a.
69

70
00:06:21,880 --> 00:06:27,460
When we put when we want to put a comment like here we can say this is
70

71
00:06:31,200 --> 00:06:39,600
is comment like this structure of st equals to we have a comment in here.
71

72
00:06:39,610 --> 00:06:51,060
That's okay and we need keyword and we need expression and we need again.
72

73
00:06:51,100 --> 00:06:52,070
Keyword.
73

74
00:06:52,540 --> 00:06:54,880
And we have substatement
74

75
00:06:57,790 --> 00:07:01,340
and we have keyword again.
75

76
00:07:01,360 --> 00:07:05,590
So let's check this one we didn't used comment.
76

77
00:07:05,680 --> 00:07:09,580
That's okay but keyword is in here.
77

78
00:07:09,580 --> 00:07:16,870
If ->if is keyword, expression is M1 and the keyword again then and the keyword again.
78

79
00:07:17,290 --> 00:07:31,300
END_IF; , and keyword again ELSE sub-statement is this one this is substatement and this is for example keyword
79

80
00:07:31,780 --> 00:07:38,170
and this is our expression and this is our keyword again.
80

81
00:07:38,890 --> 00:07:41,920
This is our keyword again like this.
81

82
00:07:42,160 --> 00:07:49,240
This is how to create ST language programming examples how to write a a ST language and how
82

83
00:07:49,240 --> 00:07:58,600
to structure of ST or how to adopt your structure text programming language in the plcs
83

84
00:07:58,900 --> 00:08:07,240
but we will learn if and repeat and while and for and case loops and also the usage of the structure
84

85
00:08:07,240 --> 00:08:15,560
texts in plc like and conditions or conditions or parenthesis and everything but for the moment I
85

86
00:08:15,570 --> 00:08:17,110
am finished for this video.
86

87
00:08:17,140 --> 00:08:18,700
See you in the next video.
