0:06
Hello everyone, welcome to automation
0:08
community. Today in this video we are
0:12
going to discuss an example in which we
0:14
will be controlling four lights using a
0:17
single toggle switch. So let's start.
0:22
Example eight. If toggle switch one is
0:25
on then light one, light two, light
0:27
three and light four will be on. If
0:30
toggle switch one is off then light one,
0:33
light two, light three and light four
0:39
So in this example we will use normally
0:42
open contacts. With that we will be also
0:44
using memory bits and set coil.
0:49
So let's move to codicis where we will
0:51
draw a ladder diagram for this example.
1:09
I need to create a new project. Let's
1:11
create a new project.
1:14
And I will start standard project the
1:16
template for this. and click on okay.
1:22
After that you need to you know change
1:24
the PLC programming to latter logic
1:27
diagram and then click okay.
1:38
After that go to PLC programming here
1:42
and here we will draw the ladder
1:44
diagram. So firstly I will insert a
1:48
normally open contact here and a set
1:54
We'll insert a set coil. Insert set
1:56
coil. And this normally open contact
2:00
will be toggle switch one. Toggle
2:16
And then this coil will be a memory bit.
2:19
Let's say memory bit.
2:25
And after that we will insert one more
2:29
network. Here I will right click and
2:32
click on insert network below.
2:35
And in this network we will use this
2:38
memory bit as normally open contact. So
2:41
we will insert a contact here. And this
2:50
And then we will insert some coils. So I
2:53
will insert a coil here. And then I will
2:56
open the branch here.
2:59
Here. And then insert a coil. Then one
3:03
more. I will insert once again branch.
3:10
So for now this contact will be light
3:14
one. This is light one. Okay. And then
3:19
this will be light two. And then we need
3:24
to insert two more coils here.
3:28
So I will click here and then insert co
3:32
uh insert branch below and then add a
3:35
coil here. And this coil will be light
3:40
three. Okay. And then we need to insert
3:43
one more branch here below. And then
3:46
insert a coil. And this coil will be
3:54
So when toggle switch one is turned on,
3:57
the signal will pass through it and it
4:00
will make this memory bit true. And when
4:04
this memory bit is true, the signal will
4:07
pass through this. And as a result, this
4:09
light one, light two, light three and
4:13
light four, all the lights gets on. All
4:16
the lights turn on. And then when the
4:19
toggle switch one is turned off, it will
4:22
not allow signal to pass through it. As
4:26
a result, this memory bit should turn
4:28
off. It should turn pause. But as you
4:34
as you can see here, we have used.
4:47
We have used a me a set coil for this
4:55
this memory bit remains true even when
4:59
we turn off this toggle switch one. So
5:02
when toggle switch one is turned off
5:05
this memory bit remains on and when
5:09
memory bit remains on the signal still
5:12
passes through this. As a result this
5:14
light one, light two, light three and
5:17
light four remains on. So in short when
5:20
toggle switch one is turned on all the
5:23
lights light one light two light three
5:25
and light four turns on and when toggle
5:27
switch one is turned off these lights do
5:30
not turn off light one remains on light
5:33
two light three and light four also
5:39
now let's generate code
5:55
and let's go to online and start
5:57
simulation and then I need to log in
6:20
So when toggle switch one so we need to
6:23
first start here and we will we will
6:28
turn toggle switch one as true. So we
6:30
will click here turn it to true and then
6:37
force values uh or we can click on write
6:40
values and you can see here this memory
6:44
bit gets true when we turn on the toggle
6:47
switch one and when memory bit gets true
6:51
all the lights turn off. As you can see
6:53
here, light one is true. The state of
6:55
light two is also true. Light three and
6:58
light four all the lights are on. And
7:01
then so what happens is that toggle
7:04
switch one is turned on. The signal
7:06
passes through this. As a result this
7:09
memory bit gets true and we have used
7:12
that memory bit here as normally open
7:14
contact. So it is true. The the signal
7:17
will pass through this. As a result,
7:19
this light one, light two, light three
7:21
and light four gets on.
7:30
So when I turn off this toggle switch
7:32
one, I need to click here. When it is
7:35
gets false here, then go to debug and
7:38
write values. You can see here toggle
7:41
switch one. The state of toggle switch
7:43
one is false. But the state of memory
7:45
bit is still true. As you can see here
7:48
it is true. Why is it true? Because we
7:51
have used a set coil for this memory
7:53
bit. So a set coil keeps that output
7:56
true even when the out uh even when the
7:59
input gets paused even when we turn off
8:03
the output. So this memory bit remains
8:06
true and when this memory bit remains
8:08
true here as normally open contact the
8:11
signal will still pass through this. As
8:13
a result, this light one, light two,
8:15
light three and light four, all the
8:17
lights remain on. It was all about this
8:21
example. Thank you for watching.