0:07
welcome to automation community. Today
0:10
in this video we are going to discuss an
0:13
example in which we will control lamps
0:17
using switches. So let's start.
0:20
Example six. If toggle switch one is on
0:24
then lamp one will be on. If toggle
0:26
switch two is on then lamp two will be
0:29
on and lamp one will be off.
0:33
If toggle switch three is on then lamp
0:36
three will be on and lamp two will be
0:38
off. Similarly if toggle switch four is
0:41
on then lamp four will be on and lamp
0:44
three will be off. Note do not turn the
0:47
toggle switches off once turned on.
0:51
So for a lamp one to be on, switch one
0:55
should be on and switch two should be
0:57
off. So turning on switch two will turn
1:00
off lamp one. Similarly switch two will
1:04
turn on lamp two and turning on switch
1:07
three will turn off lamp two and then a
1:11
light three will get on when switch
1:13
three is turned on and turning on switch
1:16
four will turn off uh lamp three.
1:21
And similarly switch four will turn on
1:24
at lamp 4. So for this example we will
1:28
be using normally open contacts and
1:30
normally closed contacts. So let's move
1:33
to codices where we will draw a ladder
1:36
diagram for this example and also we
1:54
Firstly, let's create a new project.
1:58
Select template as standard project and
2:05
Choose a PLC programming ladder logic
2:08
diagram and click on okay.
2:14
Double click on PLC programming and here
2:16
we will draw the ladder diagram. So
2:19
firstly we will insert a normally open
2:21
contact and this will be switch one
2:26
and this switch one will turn on lamp
2:29
one. So here we will click here and then
2:33
click on insert coil and this will be
2:41
Okay. So turning on switch one will turn
2:44
on switch uh sorry lamp one and then
2:47
turning on switch two will turn off lamp
2:50
one. So we will use here a normally
2:53
closed contact for switch two. So this
3:01
and click on okay. Similarly this switch
3:04
two will turn on lamp two. So I will
3:07
right click here and insert network
3:10
below this network. And here we will use
3:13
a normally open contact. We'll insert a
3:15
normally open contact. And this normally
3:18
open contact will be for switch two.
3:22
And then we'll insert a coil. I will
3:25
insert a coil here. And this coil will
3:31
So turning on switch two will turn on
3:33
lamp two. And turning on switch three
3:36
will turn off lamp two. So we'll use a
3:39
normally closed contact for switch
3:42
three. That will turn off lamp two. So
3:45
we'll insert a normally closed contact
3:47
here. And this will be for switch
3:56
And also this switch three will turn on
3:58
lamp three. So we will insert one more
4:01
network here. I will insert network
4:03
below this network and I will insert a
4:06
co uh normally open contact and a coil.
4:11
So I will insert a coil here and this
4:14
normally open contact will be switch
4:17
three. So switch three will turn on lamp
4:24
and this lamp three will be turned off
4:27
by switch four. So we'll use a normally
4:30
closed contact here. And this normally
4:33
closed contact will be for switch four.
4:36
So turning on switch four will result in
4:40
turning off of lamp 3. And this switch
4:44
four when we turn it on it will turn on
4:47
lamp 4 as well. So we will insert one
4:50
more network. Insert network below. And
4:54
I will insert a normally open contact
5:00
So this normally open contact will be
5:06
and this coil will be lamp 4. Click on
5:11
okay. So when I turn on switch one, the
5:15
signal will pass through this and
5:17
initially switch two is in false state
5:20
and this switch two is used as normally
5:23
closed contact and this normally closed
5:25
contact in false state will allow signal
5:28
to pass through it and as a result this
5:30
lamp one will get on.
5:34
And then when I turn on switch two, this
5:37
normally closed contact will go to true
5:41
state. And in true state and normally
5:43
closed contact does not allow signal to
5:46
pass through this. As a result, this
5:50
But the switch two here we have used it
5:53
as normally open contact. It will allow
5:56
signal to pass through this. And
5:58
initially switch three is in false
5:59
state. It is a normally closed contact.
6:02
In full state, it will allow signal to
6:04
pass through this. As a result, this
6:06
lamb two gets on and with that the
6:08
switch three will turn on lamp three. As
6:11
the switch three is a normally open
6:12
contact in in true state
6:16
in true state it will allow signal to
6:18
pass through this and initially
6:21
and at that time switch four four will
6:23
be false. The state of switch four will
6:25
be false and this switch four is used as
6:28
normally close contact. So a normally
6:30
close contact in false state will allow
6:32
signal to pass through this. As a result
6:34
this lamb three will get on. And
6:36
similarly when switch four gets on this
6:40
switch four this contact does not allow
6:42
signal to pass through this. As a result
6:44
this lamb three gets off and but the
6:47
switch four is uh we have used it as
6:50
normally open contact. In true state it
6:52
will allow signal to pass through this.
6:54
As a result this lamb four gets on. So
6:57
now let's generate a code for this here.
7:01
Go to online start simulation and then
7:09
And then start. So initially all the
7:12
lamps are off. And when I turn on switch
7:14
one, let's debug it. Write values. And
7:19
you can see lamp one gets on. And then
7:22
when I turn on switch two, when I turn
7:24
on switch two, we will go to debug and
7:28
write values. You can see lamp one gets
7:31
off but two gets on. And similarly when
7:34
I turn on switch three, when I turn on
7:37
switch three, lamp two gets off and lamp
7:40
three gets on. And then when I turn on
7:46
what will happen? Lamb three gets off.
7:48
Lamb four gets on. Let's see. Let's
7:50
debug it. right values. Yes, lamb three
7:53
got off and lamb three gets on. It was
7:56
all about this example. Thank you for