0
1
00:00:21,080 --> 00:00:21,850
Hello.
1

2
00:00:21,860 --> 00:00:30,600
Let's continue to create a function blocks with AS332 Delta Cpu and come here to create a new project.
2

3
00:00:30,770 --> 00:00:31,520
I said OK
3

4
00:00:35,650 --> 00:00:46,600
but don't forget we selected AS332  Plc type and come here to function block and new and the pou
4

5
00:00:46,600 --> 00:00:48,500
name will be FB0.
5

6
00:00:48,610 --> 00:00:49,550
That's okay.
6

7
00:00:49,660 --> 00:00:56,260
And I will say okay to use this function block in the program we need to create at least one program
7

8
00:00:56,260 --> 00:01:00,060
section so come here say new and program 0.
8

9
00:01:00,070 --> 00:01:03,390
That's okay with the ladder diagram.
9

10
00:01:03,570 --> 00:01:04,790
It's okay.
10

11
00:01:05,070 --> 00:01:13,860
First of all we need to know for example we are writing a ladder diagram example like this for example
11

12
00:01:14,240 --> 00:01:23,990
and with one input one output and the second input LD X0.1 and the second output.
12

13
00:01:24,210 --> 00:01:25,350
And now
13

14
00:01:28,800 --> 00:01:32,190
this is 0.0 or 0.1
14

15
00:01:32,190 --> 00:01:43,250
It is a according to AS Series CPUs, for example for the DVP Cpu we are using just X0, X1 ..
15

16
00:01:43,250 --> 00:01:49,990
X2,X3 or as output Y0,Y1,Y2..,Y7
16

17
00:01:50,090 --> 00:01:59,930
etc. but for the AS CPU for Delta plcs the structure is changed so you need to use
17

18
00:01:59,930 --> 00:02:04,930
it like X0.0 , X0.1 , X0.2 .. etc.
18

19
00:02:05,000 --> 00:02:16,160
It will be like this add one more network and LD X0.2 and out Y0.2 and one more
19

20
00:02:16,160 --> 00:02:24,800
network for example ld x0.3  and out Y0.3
20

21
00:02:24,820 --> 00:02:26,970
So this is your program.
21

22
00:02:27,040 --> 00:02:30,480
Imagine like this and it is taking a lot of area.
22

23
00:02:30,490 --> 00:02:38,470
A lot of networks from you but we can put them all in just one function block so let's create our function
23

24
00:02:38,470 --> 00:02:41,530
block according to these LD SM400
24

25
00:02:41,530 --> 00:02:47,140
So this is always on contact and ld  in here.
25

26
00:02:47,160 --> 00:02:56,040
what we gonna write we need to create our identifiers our texts identify for example start
26

27
00:02:56,610 --> 00:03:09,000
motor1 will be bool and the class will be variable input and start motor 2 will be bool and the variable
27

28
00:03:09,240 --> 00:03:21,480
input and start motor 3 will be will and variable input and the fourth one again start motor 4 and type
28

29
00:03:21,480 --> 00:03:33,620
will be bool and this will be variable input and motorone forward and bool will be variable output and
29

30
00:03:34,710 --> 00:03:39,520
motor two forward will be bool and variable output.
30

31
00:03:39,540 --> 00:03:48,720
And the third one motor three forward will be bool and this is will be variable output also and motor
31

32
00:03:48,720 --> 00:03:54,930
four forward will be bool and this will be variable output.
32

33
00:03:55,380 --> 00:03:56,970
And one more thing.
33

34
00:03:57,070 --> 00:03:59,300
Let's create our speed.
34

35
00:03:59,500 --> 00:04:02,520
Speed motors from
35

36
00:04:05,960 --> 00:04:08,090
HMI will be word.
36

37
00:04:08,160 --> 00:04:18,990
This will be variable input and in here motor speed to drive leave it like this will be word and this
37

38
00:04:18,990 --> 00:04:25,590
will be variable output and let's create our project LD .
38

39
00:04:25,730 --> 00:04:34,130
Start motor 1 and out motor 1.
39

40
00:04:34,270 --> 00:04:50,330
Forward again motor 2 forward I will add contact here start motor two again Motor3 forward.
40

41
00:04:50,540 --> 00:04:51,970
And here.
41

42
00:04:52,990 --> 00:04:58,750
Start motor 3 and add one more motor four.
42

43
00:04:58,810 --> 00:05:03,040
Forward and start motor.
43

44
00:05:03,210 --> 00:05:05,490
Four and also in here.
44

45
00:05:10,380 --> 00:05:28,280
I will use add or move instruction and I will say speed motors from HMI  motorspeedtodrive
45

46
00:05:29,060 --> 00:05:29,480
--
46

47
00:05:32,300 --> 00:05:32,710
--
47

48
00:05:34,170 --> 00:05:36,030
Like this Also we can.
48

49
00:05:36,090 --> 00:05:46,050
We can do in here for example  multiplication  we can say multiply
49

50
00:05:47,120 --> 00:05:51,020
speed motors from
50

51
00:05:54,910 --> 00:06:06,060
HMI for example with 10 and speedmotorsfromHMI like this.
51

52
00:06:06,080 --> 00:06:13,900
So let's compile our project and let's take a look just in here we have a problem.
52

53
00:06:14,430 --> 00:06:17,030
I'm just looking it .
53

54
00:06:17,040 --> 00:06:17,980
This is not correct.
54

55
00:06:17,990 --> 00:06:22,080
That's okay because this should be lower.
55

56
00:06:22,890 --> 00:06:25,780
And I'm looking okay.
56

57
00:06:25,970 --> 00:06:27,110
Again compile
57

58
00:06:31,220 --> 00:06:34,080
speed motors from HMI
58

59
00:06:34,160 --> 00:06:35,620
that's okay.
59

60
00:06:35,630 --> 00:06:36,620
That's okay.
60

61
00:06:36,650 --> 00:06:38,870
Data type doesn't match.
61

62
00:06:39,020 --> 00:06:40,030
This is the error
62

63
00:06:43,800 --> 00:06:47,860
but for a moment forget it doesn't matter.
63

64
00:06:48,690 --> 00:06:51,820
To understand function block I will create.
64

65
00:06:51,960 --> 00:06:58,950
I created this and I will close them all and I will delete them all and I will put my function block
65

66
00:06:58,980 --> 00:06:59,670
to here.
66

67
00:07:05,150 --> 00:07:07,170
With the drag and drop method
67

68
00:07:13,940 --> 00:07:14,670
that's okay.
68

69
00:07:14,730 --> 00:07:20,690
The identifier of these function blocks or the name of this function block FB00.
69

70
00:07:20,840 --> 00:07:21,890
That's okay.
70

71
00:07:21,890 --> 00:07:28,210
So the class variable or variable retained this is just a variable for the.
71

72
00:07:28,520 --> 00:07:33,860
If you want to retain the values of this function block you can select the variable retained but I will
72

73
00:07:33,860 --> 00:07:41,150
just say this is a variable function block just we are learning now this is just for testing.
73

74
00:07:41,150 --> 00:07:49,100
So add here x0.0, x0.1 , x0.2, x0.3 
74

75
00:07:49,190 --> 00:07:51,800
And like this and in here
75

76
00:07:54,630 --> 00:08:04,980
Y0.0 , Y0.1 , Y0.2 , Y0.3 and for example D10 the just
76

77
00:08:05,100 --> 00:08:13,470
put your fixed speed let's say it will be D5 and compile our project and go online to simulator
77

78
00:08:13,950 --> 00:08:22,460
and yes we want to do a download this code to our plc or simulator and status of plc run.
78

79
00:08:22,530 --> 00:08:23,550
Doesn't matter.
79

80
00:08:23,690 --> 00:08:24,670
And okay.
80

81
00:08:25,470 --> 00:08:37,860
So force release all this is the not forced device list just release like this.
81

82
00:08:37,860 --> 00:08:43,650
So this is our function block and assign a value to D5
82

83
00:08:43,650 --> 00:08:50,430
For example we want to send 100 value to our drives from the HMI like this.
83

84
00:08:50,430 --> 00:08:52,800
And it is equals to 100.
84

85
00:08:52,890 --> 00:08:55,360
So output is one hundred.
85

86
00:08:55,440 --> 00:09:05,640
So you press start motor two and force and set on so motor 2 is turning forward is set on and force
86

87
00:09:05,670 --> 00:09:07,110
for example three motor.
87

88
00:09:07,380 --> 00:09:09,120
So this is output.
88

89
00:09:09,120 --> 00:09:11,940
So look now in just one network.
89

90
00:09:12,270 --> 00:09:21,650
And  it is really easily understandable or you can really easy understand this function
90

91
00:09:21,660 --> 00:09:29,190
block just here and here here on here and the complete for example you are wasting just five network
91

92
00:09:29,190 --> 00:09:30,300
for this code.
92

93
00:09:30,570 --> 00:09:36,020
But now in just one network in just one function block you can see them all.
93

94
00:09:36,060 --> 00:09:39,080
You can monitor them all and you can adopt them all.
94

95
00:09:39,090 --> 00:09:43,930
So this is how to use function blocks in delta plcs
95

96
00:09:44,010 --> 00:09:51,120
So you can put a lot of inputs put a lot of outputs to a function block also inside your function block
96

97
00:09:51,390 --> 00:09:58,770
you can create variables just like you are writing program sections in program sections you are using
97

98
00:09:58,770 --> 00:10:06,030
for example auxiliary replace a lot of you can use them all in here with just a variable you can adopt
98

99
00:10:06,020 --> 00:10:12,000
it not a variable input or variable output you can select it just a variable you can use them all in
99

100
00:10:12,000 --> 00:10:19,770
here and then you need to just put your function block with
drag and drop method to here that's all.
100

101
00:10:19,980 --> 00:10:24,930
So this is the function block usage this as the function block how can we use it.
101

102
00:10:24,930 --> 00:10:32,400
How can we created in the next videos we will do a lot of exercises or applications about the function
102

103
00:10:32,400 --> 00:10:34,660
blocks for this video I am finished here.
103

104
00:10:34,680 --> 00:10:36,210
See you in the next video.
