0:08
welcome to automation community. Today
0:11
in this video we are going to discuss
0:14
about an example in which we will be
0:17
controlling valves using switches. So
0:22
Example five. If toggle switch one is on
0:26
then valve one and wall two will be
0:28
open. Open means output on. Close means
0:31
output off. If toggle switch is on, then
0:34
valve two and valve three will be open.
0:37
If toggle switch three is on, then val 3
0:39
and valve four will be open. If toggle
0:42
switch four is on, then valve one and
0:44
valve four will be open.
0:48
So we have four toggle switches and four
0:51
valves. So val one will be open when
0:56
switch one or switch four is on.
0:59
Similarly wall two is open when switch
1:03
one or switch two is on. Similarly wall
1:07
three gets open when either switch two
1:11
is on or switch four is on. And while
1:14
four gets open either when switch three
1:18
gets on or switch four gets on. So for
1:22
this example we will use normally open
1:25
contacts with that we will be
1:27
implementing all logic gate. So let's
1:30
move to codicuses where we will draw the
1:33
ladder diagram for this example.
1:36
So we will open cortices here.
1:47
Let's create a new project
1:50
template. Select the template as
1:52
standard project and click on okay.
2:00
And then click on okay.
2:04
So let's go to this PLC programming.
2:07
Double click on it and here we will draw
2:16
we will insert a normally open contact
2:20
and then we will insert a uh one more
2:23
normally open contact but will connect
2:27
and then we will insert a coin. So in
2:30
this way we have implemented or logic
2:33
gate. So this will be switch
2:39
Okay. and then this will be switch four.
2:44
So when if switch one or switch four is
2:48
on then wall one will be open. So this
2:55
Similarly we will insert one more rung
2:58
one more network glow and here uh this
3:02
will be for wall two. So wall two will
3:04
be on if switch one or switch two is on.
3:07
So we'll insert a contact and then we'll
3:11
insert one more contact but in parallel.
3:13
So here is option insert contact in
3:15
parallel and then we will insert a coil.
3:18
So this normally open contact will be
3:24
and this will be switch
3:31
So when switch one or switch two is on
3:34
then wall two will get open.
3:38
Okay. And then we need to uh draw the
3:42
ladder diagram for val 3. So we'll
3:44
insert one more network below it. And
3:47
here for valve three to open either
3:51
switch two or toggle switch three should
3:54
be on. So we'll insert a normally open
3:58
contact and then we will insert one more
4:00
contact but parallel here. And then we
4:03
will insert a coil. So this will be
4:09
two and this normally open contact will
4:13
be switch three. Okay. And this coil
4:18
will be val three. So val 3 gets on when
4:22
switch two is on or switch three is on.
4:25
So this will be val 3.
4:29
And similarly we will insert one more
4:32
network. We'll insert network below it.
4:35
And here this will be for valve 4. So
4:38
val 4 will get open when switch three is
4:41
on or switch four is on. So we'll insert
4:44
a contact here and then we will insert.
4:49
We should click here and add one more
4:52
contact parall to it and then a coil. So
4:57
this uh valve four will get on when
5:00
switch three switch three or switch four
5:06
gets on and then valve four gets open.
5:13
So when switch one is on val one gets on
5:17
and val 2 gets off. And then when switch
5:20
two is on then val two and while three
5:23
gets on and when switch three is on then
5:26
val three and while four gets on and
5:28
when switch four is on while four and
5:31
while one gets on. So when switch one is
5:33
on the signal will flow through this and
5:35
while one gets on the signal will also
5:38
flow through this while two gets on and
5:41
when switch two is on
5:44
for wall one we have not used switch
5:46
two. So here you can see switch two is
5:48
here for W two. So when switch one is on
5:50
the current the signal will pass through
5:52
this while two gets on and also we have
5:55
used switch two here. So when it when we
5:57
turn it on the signal will pass through
5:59
this as a result this valve 3 gets on.
6:02
Similarly when we turn on switch three
6:04
you can see here when we turn it on the
6:06
signal will pass through this val 3 gets
6:08
on and also here the signal will pass
6:10
and turn on this valve four. That means
6:13
valve four gets open. And similarly when
6:16
switch four gets on the signal pass
6:18
through this as a result this valve 4
6:20
gets open and with that valve one also
6:23
gets open. So we'll generate code here.
6:28
Let's go to online and start simulation
6:34
and then we will log.
6:41
After that we will start. So as you can
6:45
see here no valve is open. So when I
6:50
let's debug it first write values and
6:53
you can see valve one and while two gets
6:56
on. So when switch one is on val one
6:58
gets on with that wall two get will also
7:01
get on. So we'll turn it off and we will
7:05
turn on switch two. So let's debug it
7:09
and write values. As you can see while
7:11
one gets off but W two and W three gets
7:14
on. So switch two is turned on while two
7:16
gets on. Sorry W two gets open actually.
7:20
Okay. So the output pin will get on the
7:24
valve will open. So with that switch two
7:27
will uh will open val 3. Similarly we'll
7:34
and turn on switch three.
7:39
So let's debug it write values and you
7:42
can see switch three when switch three
7:45
gets on while three opens and also with
7:48
that val 4 gets opened and similarly
7:51
we'll turn it off. We will turn off
7:53
switch three and turn on switch four.
8:00
It will open val 4 and val one. It was
8:05
all about this example. Thank you for