0
1
00:00:22,090 --> 00:00:22,750
Hello.
1

2
00:00:22,810 --> 00:00:27,880
In this video we are going to learn analog input and output usage.
2

3
00:00:27,880 --> 00:00:35,200
The common analog signals are voltage as voltage 0 to 10 Volt and the current as current 4 to
3

4
00:00:35,230 --> 00:00:40,370
20 mA to use the analog signals inside of the PLC.
4

5
00:00:40,390 --> 00:00:49,090
We have to convert them as digital values like 0 to 4000 , 0 to 8000.
5

6
00:00:49,090 --> 00:00:51,220
The important point is here.
6

7
00:00:51,220 --> 00:01:00,530
Animal input means analog to digital converter and analog output means digital to analog converter.
7

8
00:01:00,550 --> 00:01:09,860
For example if our converter is 8 bit so 1 divided by 2^8 - 1.
8

9
00:01:10,030 --> 00:01:14,040
So 10 divided by 255.
9

10
00:01:14,100 --> 00:01:19,450
Equals to 0.04V as we can say it.
10

11
00:01:19,450 --> 00:01:20,550
Resolution.
11

12
00:01:20,650 --> 00:01:31,660
So if we to this equation if we apply 4V  to analog input of module we are going to read 1000
12

13
00:01:31,660 --> 00:01:34,530
value inside of our plc.
13

14
00:01:34,780 --> 00:01:41,100
It's calculated for 8 bit but let's say our converter is 12 bit.
14

15
00:01:41,170 --> 00:01:45,250
So 10 divided by 4095.
15

16
00:01:45,250 --> 00:01:46,690
So it equals
16

17
00:01:46,710 --> 00:01:48,430
from  equation.
17

18
00:01:48,430 --> 00:01:53,600
Result is 0.00244 
18

19
00:01:53,620 --> 00:01:57,190
This is a voltage value and it equals one bit.
19

20
00:01:57,190 --> 00:02:05,260
So if I apply 2.44Vdc to analog input of module we are going to read one thousandth
20

21
00:02:05,260 --> 00:02:07,460
value inside of plc.
21

22
00:02:07,520 --> 00:02:16,630
It is calculated for 12 bit  example that DVP06XA analog input and output modules allows
22

23
00:02:17,080 --> 00:02:26,860
4 analog input and 2 x 12 bit digital output connections the data transfer can be done using DVP
23

24
00:02:27,070 --> 00:02:36,020
06XA via RS485 communication or by connecting directly these modules to our CPU.
24

25
00:02:36,160 --> 00:02:42,790
If you put this module to CPU the closest module a number is going to be 0.
25

26
00:02:42,820 --> 00:02:51,730
The furthest modules number is going to be 7 and the maximum 8 modules can be connected to CPU in
26

27
00:02:51,730 --> 00:02:52,450
here.
27

28
00:02:52,480 --> 00:03:00,910
You can take a picture also you can see how to voltage input is applied to our modules how to connect
28

29
00:03:00,910 --> 00:03:10,480
your current input to your module and how to output from module voltage output then you can get a cabling
29

30
00:03:11,110 --> 00:03:19,110
structure is here v+ is for voltage I+ for current input and output and the com is common
30

31
00:03:19,420 --> 00:03:26,230
cable communication and in here you can see your power supply and the ground connection and you can
31

32
00:03:26,230 --> 00:03:34,210
see in here Channel 1 the lowest side and Channel 3 and Channel 5 for voltage or current output and
32

33
00:03:34,300 --> 00:03:35,370
channel 6.
33

34
00:03:35,370 --> 00:03:44,020
And in here Channel 4 and in here Channel 2 IO terminals in here you can see what is offset and gain
34

35
00:03:44,380 --> 00:03:52,540
and offset is a starting point from zero then you can adopt it for example inside of the plc you are
35

36
00:03:52,540 --> 00:03:57,660
reading a zero and offset is zero but you can adapt your offset.
36

37
00:03:57,700 --> 00:04:04,890
For example 1V then until one volt to your analog input.
37

38
00:04:04,920 --> 00:04:12,670
for example it can come zero point five fold or zero point six volt than you will read zero inside your
38

39
00:04:12,850 --> 00:04:22,420
plc THEN you can block or you can cut some sections of your analog input and the gain is you are
39

40
00:04:22,420 --> 00:04:31,660
going to see a 1000 as digital value insİDE your plc according to or after 5v applied to your
40

41
00:04:31,960 --> 00:04:33,790
analog input module.
41

42
00:04:33,850 --> 00:04:43,660
The for example Channel 1 and if you want to see 1000 when 6 voltDc apply to your analog input then
42

43
00:04:43,870 --> 00:04:51,920
you can adopt it with the gain settings and in here also you can see current input and digital output.
43

44
00:04:52,180 --> 00:04:59,800
So for example for the current input you can start if you want to start for example from 4 ma
44

45
00:05:00,100 --> 00:05:10,280
then you need to adopt your offset settings in here we can see a complete control registers of DVP06XA
45

46
00:05:10,290 --> 00:05:20,310
and we are going to learn how to read this manual and how can we control this manual , okay.
46

47
00:05:20,570 --> 00:05:30,360
Let's go to our example in Channel 1 of analog module ,sensor is connected to this sensor is 4 to 20
47

48
00:05:30,360 --> 00:05:38,870
ma pnp current output it gives to us 4 to 20 ma,and when this sensor detects the
48

49
00:05:38,870 --> 00:05:46,340
light and it will give a current output to us and if this output is greater than 10ma motor1
49

50
00:05:46,340 --> 00:05:53,720
is going to start if this output greater than 15 ma motor 2 starts to run in the second
50

51
00:05:53,750 --> 00:05:54,500
input.
51

52
00:05:54,500 --> 00:06:03,170
This is our first input channel and you can see the current input connection is done in here we have
52

53
00:06:03,170 --> 00:06:11,230
one we can see thermocouple symbol temperature sensor is connected and this sensor output than that
53

54
00:06:11,230 --> 00:06:17,860
means input of our analog module is between 0 to 10VDC 
54

55
00:06:18,110 --> 00:06:27,940
So if boiler water temperatures lower than 5V, motor3 is going to turn and starts and if boiler
55

56
00:06:27,940 --> 00:06:38,750
water temperatures is bigger than 5v motor 4 is going to start to turn and now let's how to, try
56

57
00:06:38,750 --> 00:06:48,920
to solve this problem with use of our DVP06XA's module control registers and first thing we need
57

58
00:06:48,920 --> 00:06:57,800
to use TO command for write to module and if you need to read from module we need to use FROM command
58

59
00:06:58,070 --> 00:07:06,880
and this is our channel numbers and this is, these are all bit numbers of our channels so this table
59

60
00:07:06,890 --> 00:07:14,060
shows bits of all channels and we will assign bit values as 0 or 1 and we will calculate our value to
60

61
00:07:14,270 --> 00:07:19,950
send device first let's determine whether the status of channels of our analog module.
61

62
00:07:20,090 --> 00:07:24,840
So Channel 1 is going to be current input read rest of all will be voltage input.
62

63
00:07:24,920 --> 00:07:33,260
Let's take a look to voltage input is 0 0 0 and current input or current output but this needs to be
63

64
00:07:33,620 --> 00:07:42,230
input not an output but okay we will use this one mode 3 and this should be 0 1 1 So Channel 1 will
64

65
00:07:42,230 --> 00:07:51,140
be current input so I will put it tohere and the 0 0 0 will be Channel 2 the rest of all will be voltage
65

66
00:07:51,140 --> 00:07:53,710
input so all of them will be 0.
66

67
00:07:54,020 --> 00:08:03,200
If you calculate this number as binary, you can open your calculator and you
67

68
00:08:03,200 --> 00:08:07,420
can write this as binary but this is work like this.
68

69
00:08:07,520 --> 00:08:13,940
0 0 0 1 and 1 0 and 1 1.
69

70
00:08:13,940 --> 00:08:21,950
These are all 0 so this is 3 as hexadecimal 3 and decimal 3 also but we need to send hexadecimal values
70

71
00:08:21,950 --> 00:08:29,010
to our plc hexadecimal 3 value that we get and this and this value in here.
71

72
00:08:29,000 --> 00:08:37,220
to first module with   first scan inside in the first second with the TO Command we write this value
72

73
00:08:37,430 --> 00:08:46,300
to our analog module and now we need to adapt our offset and gain adjustment and authorization
73

74
00:08:46,310 --> 00:08:53,990
settings must be done so in the first scan and the controller registers 33 we write 
74

75
00:08:54,020 --> 00:08:56,210
h0 but why.
75

76
00:08:56,240 --> 00:08:58,140
Let's take a look to in here.
76

77
00:08:58,170 --> 00:09:06,440
33 is control registers that offset and gain took tuning 
77

78
00:09:06,800 --> 00:09:17,360
I couldn't say authorization so the default is 0 0 0 so we need to use this 0 value because
78

79
00:09:17,600 --> 00:09:26,150
  we need to get permission for the offset and gain settings so what is the gain an offset adjustment
79

80
00:09:26,150 --> 00:09:35,870
and why is it needed conversion of analog signal to digital signal in plc between 0 to 4000 value
80

81
00:09:35,900 --> 00:09:45,420
for the voltage input and 1 to 0 to 1000 value for the current input then it changes to according to plc
81

82
00:09:45,470 --> 00:09:47,090
brands and the hardware.
82

83
00:09:47,210 --> 00:09:56,600
For example 10 Volt it means 10 divided by 4000 and 2.5 mv equals to 1 as digital
83

84
00:09:56,600 --> 00:09:58,250
value in plc.
84

85
00:09:58,250 --> 00:10:06,710
In other words lowest valued bit that we can express as resolution is that sensitivity and it equals
85

86
00:10:06,710 --> 00:10:08,470
2.5 mv
86

87
00:10:09,180 --> 00:10:16,820
And in this case for example it is necessary to use the expression of for example 8000 lowest values
87

88
00:10:16,850 --> 00:10:21,500
bit equals to two , why because 800
88

89
00:10:21,760 --> 00:10:28,480
Multiply by 2.5 mv will be two volt and 2000 value
89

90
00:10:28,540 --> 00:10:33,310
will be five volt and 2000 multiply by 2.5mV
90

91
00:10:33,310 --> 00:10:40,570
mv , this is the answer of our question and if we looked in the same way for the current 20ma
91

92
00:10:40,570 --> 00:10:50,850
current and one lowest valued bit will be 20 mA divided by 1000 and will be 20 ma
92

93
00:10:50,960 --> 00:10:59,260
And in here Channel 1 will work in the range of 4-20mA  and the Channel 2 is going to be
93

94
00:10:59,260 --> 00:11:08,330
range will be 0-10 Volt and output channel in the range of will be 5 to 10 Volt.
94

95
00:11:08,360 --> 00:11:12,760
Okay first gain settings and office settings.
95

96
00:11:12,760 --> 00:11:21,400
Let's take a look them all then come here and we will see also in here analyzed one by one for the gain
96

97
00:11:21,400 --> 00:11:26,760
settings it is starting from Channel 24 to channel 29.
97

98
00:11:27,010 --> 00:11:28,410
Let's go to here.
98

99
00:11:28,410 --> 00:11:30,730
24 to 29
99

100
00:11:30,760 --> 00:11:35,860
You can see them all in here for the Channel 1 and Channel 4.
100

101
00:11:35,860 --> 00:11:45,520
gain settings default value was 1000 when the voltage input range from 800 to 4000 for the
101

102
00:11:45,520 --> 00:11:56,290
current input 800  to 2600 for the outputs of ourChannel 5 and Channel6
102

103
00:11:56,290 --> 00:11:58,990
to adjust gain of outputs.
103

104
00:11:58,990 --> 00:11:59,920
Look in here.
104

105
00:11:59,950 --> 00:12:07,450
Default is K 2000  and the range is 0-4000 and come here.
105

106
00:12:07,480 --> 00:12:10,660
Let's take a look once to our values.
106

107
00:12:10,870 --> 00:12:15,790
So what is the meaning of 1000 in here.
107

108
00:12:15,790 --> 00:12:18,940
So first thing we need to know.
108

109
00:12:19,420 --> 00:12:23,630
The gain settings for the current input.
109

110
00:12:24,000 --> 00:12:25,600
Like in here.
110

111
00:12:25,780 --> 00:12:31,350
Channel 1 will be default 1000 for the current input.
111

112
00:12:31,600 --> 00:12:41,590
So in here K 4000 will be a maximum value of our voltage input because we will say it like this.
112

113
00:12:41,740 --> 00:12:52,360
Now if 20 ma comes to our current input channel then it will be 1000  value inside of
113

114
00:12:52,420 --> 00:12:53,430
the PLC.
114

115
00:12:53,500 --> 00:13:04,630
If we see 10 volt of our channel 2 or analog input then this will be inside of the PLC 4000 value.
115

116
00:13:04,870 --> 00:13:09,340
So Channel 3 and Channel 4 not used and the outputs.
116

117
00:13:09,340 --> 00:13:11,940
Also we adopted it like this.
117

118
00:13:11,940 --> 00:13:14,910
We will give to 0-10 volt output.
118

119
00:13:15,160 --> 00:13:26,020
So if we give 10 Volt as analog output from our plc we are writing to this registers to 4000 in our
119

120
00:13:26,020 --> 00:13:35,030
PLC offsets settings for 4 mA ,in here we need to write here to 200
120

121
00:13:35,050 --> 00:13:35,770
Why.
121

122
00:13:35,830 --> 00:13:45,410
Because1 lowest valued bit is 20uA and we calculated in here and 20uA
122

123
00:13:45,400 --> 00:13:55,960
multiply by 200 -> 200 x 20uA an it equals to
123

124
00:13:55,960 --> 00:14:02,170
4000uA and it equals to 4 mA
124

125
00:14:02,380 --> 00:14:12,980
So we want to use our analog input as 4-20mA because of we want to started to 4mA
125

126
00:14:12,980 --> 00:14:15,060
we write it here.
126

127
00:14:15,070 --> 00:14:16,590
K200
127

128
00:14:16,690 --> 00:14:30,850
So it is now default offset value and it will start from 4mA
128

129
00:14:30,850 --> 00:14:33,670
to 20mA and the range will be like this.
129

130
00:14:33,670 --> 00:14:42,820
And for the our analog   inputs for Channel 2 we are going to use 0 to 10 volts and we don't need
130

131
00:14:42,820 --> 00:14:51,220
to use an offset anything and for Channel 4 No ,for Channel 5 we write in here.
131

132
00:14:51,310 --> 00:14:53,870
K1000 Why?
132

133
00:14:54,000 --> 00:15:01,460
Because let's go back to here and for offset of Channel 5 you can see it.
133

134
00:15:01,750 --> 00:15:11,650
The range is K -2000 to +2000 so two thousand equals to 10v for analog
134

135
00:15:11,800 --> 00:15:12,770
output.
135

136
00:15:12,850 --> 00:15:17,060
This is equals to 10 volts because we are using 0 to 10 volt.
136

137
00:15:17,350 --> 00:15:18,880
Okay go back here.
137

138
00:15:18,880 --> 00:15:21,750
So if we start it from the K1000.
138

139
00:15:22,090 --> 00:15:27,730
It starts from 5 volt so in our example let's go to there.
139

140
00:15:27,940 --> 00:15:35,410
So we are   wanting to   calculate according to 5V lower than or bigger than.
140

141
00:15:35,500 --> 00:15:45,290
So   we can adopt it these offsets to 1000 and it starts from 5V to 10v then
141

142
00:15:45,330 --> 00:15:51,680
Channel 6 is not used so we can leave it like this and for the CR
142

143
00:15:51,680 --> 00:16:02,630
24 to 29 is for the Channel 1 to Channel 6 sequentially in order to enter gain settings from table.
143

144
00:16:02,630 --> 00:16:12,600
And we already saw it ,in here from CR registers 18 to CR 23.
144

145
00:16:12,620 --> 00:16:18,680
These are all adjusted offset settings and the for the gain value for Channel 1 2 and 3.
145

146
00:16:18,680 --> 00:16:22,040
It's starting from 24 to 29.
146

147
00:16:22,050 --> 00:16:34,010
And this one is coming from here so CR1 that we can adopt our input and output mode.
147

148
00:16:34,160 --> 00:16:38,270
And we are going to read our values from where.
148

149
00:16:38,540 --> 00:16:44,920
Let's take a look it also and let's take a look once to our complete plc project.
149

150
00:16:45,020 --> 00:16:52,340
Remember in the first line we adopted our channels current and voltage situations and the permissions
150

151
00:16:52,340 --> 00:16:54,760
for the offset and gain settings.
151

152
00:16:54,770 --> 00:17:04,940
So we adopted it we write H3 and we write 0 to first module to CR33
152

153
00:17:05,210 --> 00:17:13,340
and offset settings are adopted for 4mA and for 5V and the gain settings of all channels
153

154
00:17:13,350 --> 00:17:17,930
adopted when we get 20mA  we will get 1000.
154

155
00:17:18,110 --> 00:17:26,210
When we get what inside of the plc  4000 and it will be equal to 10 volt and the outputs will
155

156
00:17:26,210 --> 00:17:27,710
be 0 to 10 volt.
156

157
00:17:27,710 --> 00:17:37,940
And if we write 4000 to our outputs it will give 10 volt and in here we are reading   from analog
157

158
00:17:38,000 --> 00:17:39,920
inputs with the from command.
158

159
00:17:40,010 --> 00:17:47,160
So from the first module we are reading C12-13
159

160
00:17:47,180 --> 00:17:48,540
Let's take a look.
160

161
00:17:48,710 --> 00:17:57,430
12 is Channel One input present value then Channel 13 or control registers 13 is Channel 2 input
161

162
00:17:57,440 --> 00:17:58,300
present value.
162

163
00:17:58,550 --> 00:18:07,070
So we are reading current from here analog input from here and we are writing these values to D200
163

164
00:18:07,070 --> 00:18:17,540
is our current input value D202  inside of it we can see our voltage
164

165
00:18:17,810 --> 00:18:18,610
input value.
165

166
00:18:18,860 --> 00:18:24,650
So let's compare it for example in here we are comparing Channel 1 as mA
166

167
00:18:24,740 --> 00:18:33,520
So what we did we are starting from 200 and the maximum value is 1000.
167

168
00:18:33,590 --> 00:18:46,370
So in here we have 16 mA and so it is starting from 4-20Ma And  800 equals
168

169
00:18:46,790 --> 00:18:58,190
16Ma and so 1Ma equals to I'm sorry like this 50 value,
169

170
00:18:58,270 --> 00:19:02,840
If you want to   compare with 10 mA and 10 mA.
170

171
00:19:02,860 --> 00:19:04,510
Multiply by 50.
171

172
00:19:04,600 --> 00:19:06,100
So we get this value.
172

173
00:19:06,220 --> 00:19:08,580
So we are comparing it with this value.
173

174
00:19:08,830 --> 00:19:12,070
And if it's bigger than for example 500.
174

175
00:19:12,190 --> 00:19:15,990
So let's go back our   question.
175

176
00:19:16,120 --> 00:19:20,890
So if it is bigger than 10 mA then motor1  is going to start.
176

177
00:19:20,920 --> 00:19:21,360
Okay.
177

178
00:19:21,370 --> 00:19:23,990
Let's take a look ones in here.
178

179
00:19:24,070 --> 00:19:32,680
If it's bigger than this value so the motor will turn and if it bigger than 15 mA then 15 multiply
179

180
00:19:32,680 --> 00:19:33,750
by 50.
180

181
00:19:33,760 --> 00:19:36,810
So it is equal to 750.
181

182
00:19:36,850 --> 00:19:41,830
The second motor is going to turn and the compare Channel 2 which   5V.
182

183
00:19:42,100 --> 00:19:48,270
So   remember we started from K 1000
183

184
00:19:48,280 --> 00:19:49,630
It is our now.
184

185
00:19:49,780 --> 00:19:52,090
  zero position.
185

186
00:19:52,120 --> 00:19:58,280
So K2000 = 5V
186

187
00:19:58,310 --> 00:20:07,610
So because we started from   one thousand one thousand is zero and   go back to here and let's take
187

188
00:20:07,610 --> 00:20:10,650
a look to it for the offset value.
188

189
00:20:10,700 --> 00:20:12,010
This is our range.
189

190
00:20:12,020 --> 00:20:15,130
So two K 2000 
190

191
00:20:15,140 --> 00:20:17,590
So in here let's go back to here.
191

192
00:20:17,600 --> 00:20:20,960
So K 2000 = 5V
192

193
00:20:21,060 --> 00:20:21,730
Why.
193

194
00:20:21,740 --> 00:20:27,430
Because what we have we have 0 to
194

195
00:20:27,500 --> 00:20:30,350
K2000 it started from here.
195

196
00:20:30,510 --> 00:20:32,870
And this is completely.
196

197
00:20:32,910 --> 00:20:38,950
2000 was 10 Volt and one thousand is 5Volt
197

198
00:20:39,300 --> 00:20:49,080
So now we are starting from this one than the rest of all is not used but we can go a little
198

199
00:20:49,080 --> 00:20:49,810
bit further.
199

200
00:20:49,830 --> 00:21:00,120
How like this K 2000 is - K1000 and it equals 1000 so 1000 equals 5V
200

201
00:21:00,180 --> 00:21:08,710
And if it D202 our temperature is lower than 5V according to our comparision.
201

202
00:21:08,760 --> 00:21:12,410
Motor 3 is going to turn and if D202
202

203
00:21:12,420 --> 00:21:17,830
D202 value is equals or bigger than 5V
203

204
00:21:17,880 --> 00:21:19,110
K2000
204

205
00:21:19,110 --> 00:21:28,020
That means the 4. Motor will turn these are the outputs are from plc  then you can
205

206
00:21:28,020 --> 00:21:36,290
connect this output to your motors to your relays or contactors etc. then you can turn
206

207
00:21:36,300 --> 00:21:42,430
motors according to analog inputs then and also analog output.
207

208
00:21:42,480 --> 00:21:44,100
In this video.
208

209
00:21:44,130 --> 00:21:45,230
Finished in here.
209

210
00:21:45,480 --> 00:21:47,250
see you in the next video.
