0
1
00:00:21,840 --> 00:00:23,400
Hello in this video.
1

2
00:00:23,400 --> 00:00:31,720
We are going to learn serial communication plc programming example for vfd parameter settings.
2

3
00:00:31,740 --> 00:00:32,110
Okay.
3

4
00:00:32,130 --> 00:00:39,330
We are adapting our plc or  master plc to communicate with the slaves but also if you are communicating
4

5
00:00:39,330 --> 00:00:46,710
with the AC drive or vfd you need to communicate, adapt parameters of this vfd or AC
5

6
00:00:46,720 --> 00:00:47,340
drive.
6

7
00:00:47,340 --> 00:00:53,620
First of all modbus communication address of the device is specified must be plc is master.
7

8
00:00:53,880 --> 00:01:02,400
So address of plc is one vfd address cannot be one so you can give to your VFD address as to
8

9
00:01:02,430 --> 00:01:09,690
three or another the parameters that will be communicated with  RS485  must be set.
9

10
00:01:09,690 --> 00:01:18,930
So your source of first master frequency command and also source of first operation command must be
10

11
00:01:19,230 --> 00:01:25,600
adopted RS485 so for the vfd-e
11

12
00:01:25,740 --> 00:01:27,270
You can see it in here.
12

13
00:01:27,270 --> 00:01:38,300
Parameter 2.00  must be 3 and also parameter 02.01 should be 3 or 4.
13

14
00:01:38,550 --> 00:01:45,480
And also if the frequency read and write operation is to be done from plc the related parameters should
14

15
00:01:45,480 --> 00:01:51,570
be adjusted  stop operations will be done from plc  the relevant parameter input must
15

16
00:01:51,570 --> 00:01:52,260
be made.
16

17
00:01:52,260 --> 00:02:01,050
These are so we can give operation command to go run forward or stop or backward parameter 2.01
17

18
00:02:01,190 --> 00:02:10,650
is relevant parameter and for the frequency read and write operations source of first frequency
18

19
00:02:10,650 --> 00:02:11,430
command.
19

20
00:02:11,670 --> 00:02:18,540
So we will give frequency value  from our plc to our vfd so we need
20

21
00:02:18,540 --> 00:02:28,950
adopt parameter 2.00 4 VFD-E drive parameter setting should be done for 9600 baudrate.
21

22
00:02:29,010 --> 00:02:37,890
This is an example for example if you are using baudrate as 19200  So what
22

23
00:02:37,890 --> 00:02:38,260
you need.
23

24
00:02:38,280 --> 00:02:46,120
You need to adopt your these parameters these parameters are starting from 09.00
24

25
00:02:46,410 --> 00:02:47,370
And it goes on.
25

26
00:02:47,610 --> 00:02:52,960
So in here you're gonna see a communication address of your device for vfd-e.
26

27
00:02:53,150 --> 00:02:58,870
you need to give a address for example two or three or five.
27

28
00:02:59,010 --> 00:03:03,150
You need to change your parameter 9.00 parameter.
28

29
00:03:03,150 --> 00:03:07,950
This is important and also transmission speed is means our baudrate.
29

30
00:03:07,950 --> 00:03:15,470
You need to change your 09.01 parameter, parameter must be entered for example seven.
30

31
00:03:15,490 --> 00:03:17,180
E 1,  7 even 1.
31

32
00:03:17,180 --> 00:03:18,720
It's our protocol.
32

33
00:03:18,720 --> 00:03:20,130
Imagine like this.
33

34
00:03:20,130 --> 00:03:23,580
You need to put it in here.
34

35
00:03:23,670 --> 00:03:25,790
09.04
35

36
00:03:25,820 --> 00:03:29,760
So timeout detection and also transmission fault treatment.
36

37
00:03:29,820 --> 00:03:37,680
These are whole parameters that you're gonna use for the vfd side and also the last thing it should
37

38
00:03:37,680 --> 00:03:43,890
be noted RS485 communication between PLC and inverter is cross in here.
38

39
00:03:43,890 --> 00:03:53,320
You can see VFD-E side or vfd side or AC drive side connection cabling.
39

40
00:03:53,420 --> 00:03:57,470
So it will be RJ45 jack.
40

41
00:03:57,680 --> 00:04:02,160
if you look behind it or front it.
41

42
00:04:02,240 --> 00:04:12,200
So from the right side to the left side it is starting from 1 to 8,  8 pin so 14 should be SG-
42

43
00:04:12,530 --> 00:04:14,250
15 should be.
43

44
00:04:14,260 --> 00:04:23,570
SG+ and 13 should be ground so for the ground doesn't matter it is important but the for RS485
44

45
00:04:23,890 --> 00:04:33,320
communication you need 2 cable because RS 485 communication is 2 wiring cabling it is need just 2 cable
45

46
00:04:33,560 --> 00:04:36,780
+ and - in here the first part.
46

47
00:04:36,830 --> 00:04:45,550
of our program in the first scan we are writing k1 So this is our Master Plc address in D1121
47

48
00:04:45,580 --> 00:04:52,850
in here we are writing our protocol the timeout and we are resetting
48

49
00:04:52,880 --> 00:05:04,010
complete steps no from starting S1 to S45 and we are setting S0 and then in S0
49

50
00:05:04,010 --> 00:05:15,520
step we are activating M0 bit so we are using a timer timer it's going to the count or after two.
50

51
00:05:15,800 --> 00:05:26,380
multiply by 100 milliseconds so after two hundred milliseconds this timer will be on in m0 after
51

52
00:05:26,380 --> 00:05:33,790
M0 activated so suddenly S0 step is activated M zero will be activated so m0 in the
52

53
00:05:33,820 --> 00:05:40,370
rising edge contact we are setting M1122
53

54
00:05:40,400 --> 00:05:48,450
So this is our sending request auxiliary relay or internally special bit.
54

55
00:05:48,530 --> 00:05:55,420
So in the previous  lesson we already showed it to in the table remember that.
55

56
00:05:55,520 --> 00:06:03,470
So we are setting this one modrw command or modrw instruction what we are
56

57
00:06:03,470 --> 00:06:13,550
doing in here ,in here D50 is written to hexadecimal 2001
57

58
00:06:13,550 --> 00:06:15,170
Let's take a look what is it.
58

59
00:06:15,230 --> 00:06:16,160
It is frequency
59

60
00:06:16,160 --> 00:06:16,790
command
60

61
00:06:16,790 --> 00:06:26,050
So what you entered inside of D50 this will be your frequency and then we are waiting.
61

62
00:06:26,060 --> 00:06:28,540
M1123
62

63
00:06:28,730 --> 00:06:33,140
And if I'm sending or receiving is completed.
63

64
00:06:33,140 --> 00:06:41,270
So we are resetting this flag and inside of this time already we write this data because the communication
64

65
00:06:41,270 --> 00:06:50,180
is very high very  high speed communication also according to our baudrate and we are writing
65

66
00:06:50,210 --> 00:06:53,300
and reading a lot of data inside of the seconds.
66

67
00:06:53,390 --> 00:07:00,680
So we are setting after these timer is on in the rising edge contact we are setting S1, S1 is
67

68
00:07:00,680 --> 00:07:06,350
activated so M1 is activated this auxiliary relay bit is activated.
68

69
00:07:06,350 --> 00:07:15,550
So in the rising edge of this bit  in we are using M100 auxiliary relay also.
69

70
00:07:15,560 --> 00:07:28,370
So if M100 goes high or activated by you we are sending request read and write request
70

71
00:07:28,490 --> 00:07:29,180
again.
71

72
00:07:29,180 --> 00:07:33,080
So now what we are using -> H2000.
72

73
00:07:33,140 --> 00:07:34,100
Let's take a look.
73

74
00:07:34,120 --> 00:07:42,830
H2000 so we are gonna give a command to our vfd run forward or backward or similar or
74

75
00:07:42,830 --> 00:07:43,990
something like this.
75

76
00:07:44,030 --> 00:07:51,710
So let's go back here what we are writing in here we are writing to third slave K3 is the slave number
76

77
00:07:51,710 --> 00:07:53,270
slave number is three.
77

78
00:07:53,300 --> 00:07:54,410
So third slave.
78

79
00:07:54,770 --> 00:08:05,210
We are writing hexadecimal twelve so in here let's go back to in here how can we calculate it in here.
79

80
00:08:05,210 --> 00:08:06,110
Let's take a look.
80

81
00:08:06,140 --> 00:08:13,350
Our calculator and go back to programmer
81

82
00:08:22,960 --> 00:08:27,450
--
82

83
00:08:27,480 --> 00:08:28,980
I will use binary
83

84
00:08:32,490 --> 00:08:33,310
in here.
84

85
00:08:33,700 --> 00:08:34,440
OK.
85

86
00:08:34,710 --> 00:08:38,630
So hexadecimal12 (h12 / 16#0012)
86

87
00:08:41,960 --> 00:08:43,560
hexadecimal eight.
87

88
00:08:43,640 --> 00:08:45,010
I will activate this.
88

89
00:08:45,110 --> 00:08:46,970
Not this one.
89

90
00:08:46,970 --> 00:08:47,720
I'm going to
90

91
00:08:51,160 --> 00:08:53,310
find  it.
91

92
00:08:53,360 --> 00:08:54,680
So this is seven.
92

93
00:08:54,680 --> 00:08:56,830
This is f this is D.
93

94
00:08:56,840 --> 00:09:11,750
This is C. ten and twelve so forth bit is one so Fifth bit is zero so 0 and 1.
94

95
00:09:11,840 --> 00:09:13,550
This is forward command.
95

96
00:09:13,850 --> 00:09:20,860
So  first bit is zero.
96

97
00:09:20,900 --> 00:09:28,030
Okay bit zero is zero but bit 1 is 1 so 01 is what is the meaning of it.
97

98
00:09:28,670 --> 00:09:29,950
Or 1and 0 
98

99
00:09:29,960 --> 00:09:32,480
We can we should look from left to right.
99

100
00:09:32,510 --> 00:09:39,890
It is run ,run and forward command is used in our example.
100

101
00:09:39,890 --> 00:09:49,100
So we are writing in this step to our vfd run and forward turn forward and run command is write
101

102
00:09:49,100 --> 00:09:58,610
it in here and also after M101 auxiliary relay bit or this contact is activated by
102

103
00:09:58,610 --> 00:10:05,000
you in the after is activated or goes from off to on.
103

104
00:10:05,090 --> 00:10:14,790
We are sending request again and then we are writing to 3.slave hex 1.
104

105
00:10:15,050 --> 00:10:21,470
what was the hex 1 so hex 1 in here let's take a look.
105

106
00:10:21,470 --> 00:10:23,000
1 should be stopped.
106

107
00:10:23,030 --> 00:10:35,920
So if you want to stop your machine  or stop your vfd in step 1 after M101  is activated
107

108
00:10:35,950 --> 00:10:39,460
by you you are stopping your VFD.
108

109
00:10:39,730 --> 00:10:41,040
So what we get.
109

110
00:10:41,050 --> 00:10:45,440
Till now we write our frequency command here.
110

111
00:10:45,450 --> 00:10:45,860
Okay.
111

112
00:10:45,870 --> 00:10:46,090
This.
112

113
00:10:46,090 --> 00:10:48,730
is written into the vfd.
113

114
00:10:48,820 --> 00:10:52,450
So this is forward button and run button.
114

115
00:10:52,480 --> 00:11:02,080
This is stop button from your HMI or  it's coming inside of HMI or you can put these contacts
115

116
00:11:02,320 --> 00:11:09,810
as output with your physical inputs and etc or you can use it inside of your plc in any
116

117
00:11:09,820 --> 00:11:11,680
any part of your project.
117

118
00:11:11,770 --> 00:11:16,470
And after these are finished are these writing and reading is completed.
118

119
00:11:16,480 --> 00:11:18,030
But we are writing in here.
119

120
00:11:18,100 --> 00:11:19,630
Writing is completed.
120

121
00:11:19,630 --> 00:11:28,210
This flag is activated and then suddenly it is resetted and we jump to set S2,  S2 step in here.
121

122
00:11:28,400 --> 00:11:30,760
Let's go to S2 in here.
122

123
00:11:30,760 --> 00:11:38,160
We have two part for S2 and in here a request to read and write to specified.
123

124
00:11:38,180 --> 00:11:39,040
That's okay.
124

125
00:11:39,090 --> 00:11:45,300
The current frequency information was read from the drives from where , from h2102
125

126
00:11:45,290 --> 00:11:51,000
address 2102 is here it is frequency command
126

127
00:11:51,000 --> 00:11:59,360
let's go back here from the 3.slave we read these data how many will be read.
127

128
00:11:59,520 --> 00:12:06,650
Six data is read automatically and saved in D1050 and D1055
128

129
00:12:06,720 --> 00:12:15,290
So at the moment also after is ,reading is completed this flag is goes high the rising edge
129

130
00:12:15,300 --> 00:12:19,010
Okay then the block move we are moving this data
130

131
00:12:22,180 --> 00:12:31,930
six data from this D1050 to it starting from D300,301 
131

132
00:12:31,930 --> 00:12:33,720
d302,303,304,305..
132

133
00:12:33,850 --> 00:12:44,500
So read data stored in D300 to d305 and in here we are resetting
133

134
00:12:45,040 --> 00:12:54,550
this read  data from slave first time we read data from our vfd and this data readed and that
134

135
00:12:54,550 --> 00:13:02,290
moment it can be changed so already the output frequency is or the output current and the a lot of
135

136
00:13:02,290 --> 00:13:09,700
things are all parameters can be changed so we are resetting this data in here so we are resetting these
136

137
00:13:10,000 --> 00:13:16,840
read or write it is completed flags again and we are resetting M1129
137

138
00:13:16,840 --> 00:13:26,170
auxiliary relay bit , special bit also and we are going back to S0 so this is just for the 3.
138

139
00:13:26,170 --> 00:13:34,090
slave communication program imagine that ,this is just one function block and it is starting from
139

140
00:13:34,090 --> 00:13:41,830
here so you can put these codes to your function block or your program if you are communicating with
140

141
00:13:41,850 --> 00:13:52,030
a five device so you just need to change this address so we are now reading and writing with this
141

142
00:13:52,060 --> 00:13:56,900
from 3. vfd or 3. AC drive.
142

143
00:13:57,070 --> 00:14:06,020
So you can if you put here to two so that the address of 2 which address which drives or vfd  
143

144
00:14:06,030 --> 00:14:12,990
address is 2 we will communicate with it if you put in 4 which drives or AC drive or vfd addresses
144

145
00:14:12,980 --> 00:14:15,550
4 then we will communicate with it.
145

146
00:14:15,700 --> 00:14:24,400
So you can communicate with your vfds or drives or external devices via serial communication
146

147
00:14:24,430 --> 00:14:31,210
and you can write the frequency you can give a command to run forward or stop and run an etc. and
147

148
00:14:31,210 --> 00:14:37,720
you can monitor or read frequency,  output frequency and the current and etc. are complete list
148

149
00:14:37,780 --> 00:14:42,110
in here you can see them all with like this.
149

150
00:14:42,220 --> 00:14:48,950
This is the example of the communication between plc and the drives this was the first example.
150

151
00:14:49,060 --> 00:14:57,660
So see you in the next video there will be a second example about the communication about the modbus 
151

152
00:14:57,660 --> 00:15:00,280
communication for delta plcs.
