0:05
Hello everyone, welcome to automation
0:08
community. Today in this video we are
0:11
going to discuss an example in which we
0:14
will be controlling LEDs with toggle
0:17
switches. So let's look at the example
0:22
Example 11. If toggle switch one is on,
0:25
then LED one and LED 2 will be on. If
0:28
toggle switch one is off, then LED 1
0:31
will be off and LED 2 will be on. If
0:34
toggle switch two is on, then LED 2 will
0:37
be off and LED 3 will be on. If toggle
0:40
switch 2 is off, then LED 3 will be off
0:43
and LED 4 will be on. So when we will
0:47
turn on toggle switch one, two LEDs will
0:50
turn on. And when we will turn off
0:52
switch one, one LED will turn off but
0:55
the other will remain on. And then when
0:58
we will turn uh on the switch two then
1:02
the LED 2 will turn on and LED 3 will be
1:06
on. And then uh when we will turn off
1:08
switch two LED 3 will uh turn off and
1:12
other LED will turn on. So for this
1:15
example we will use normally open
1:18
contacts, normally close contacts with
1:21
that we will be also using memory bits
1:24
and also we will be also implementing
1:28
logic. So let's move to coders where we
1:31
will draw a ladder diagram for this
1:34
So I will open cortices.
2:16
So let's create a new project. First I
2:19
will click on new project.
2:22
You can choose a template as standard
2:24
project. You can also select the uh
2:26
location and name. So let's say it's
2:30
11 and click on okay. So the new project
2:34
is created. After that we need to select
2:38
device and PLC programming. So we you
2:41
can select device from this drop-down
2:43
list and select PLC programming as glad
2:46
logic diagram and click on okay.
2:52
After that click on PLC programming
2:54
here. So here we will be drawing ladder
3:04
I will insert a normally open contact
3:07
here that will be for toggle switch one.
3:11
So I will write toggle
3:17
and then we will insert a coil here for
3:21
LED one. So this will be LED one. So
3:25
when toggle switch one is turned on LE
3:34
we will insert one more network below
3:39
below and we will insert one more
3:42
normally open contact that will be for
3:45
toggle switch one and this toggle switch
3:50
one will turn on LED 2 as well. So for
3:52
that we will insert a coil. This will be
3:55
LED 2. So sorry this will be LED 2. LED
4:06
So we will delete this here.
4:13
Okay. So when toggle switch one is
4:15
turned on, LED one and LED 2 both turn
4:18
on. And when we will turn off toggle
4:24
should turn off but LED 2 should remain
4:26
on. For that we will latch LED2 here. So
4:30
we will insert a contact parall to this
4:32
toggle switch one and this normally open
4:34
contact will be LED 2. So when toggle
4:37
switch one is turned off, LED 1 gets off
4:40
but LED 2 remains on. And then we will
4:43
insert one more network. Sorry, we will
4:46
insert one more network below. Okay. So
4:49
here we will use a normally open contact
4:53
for toggle switch two toggle switch
4:58
two. So when toggle switch two is turned
5:01
on motor three and motor four get
5:12
sorry motor 3 gets on. So for this we
5:15
will insert a coil here. This will be
5:18
sorry LED 3 LED 3 gets on. Okay.
5:25
And with that LED 2 gets off. So for
5:28
that we will use a normally close
5:30
contact here. And this will be toggle
5:46
Okay. So when toggle switch two is
5:48
turned on, LED 3 gets on and LED 2 gets
5:51
off. And when toggle switch two is
5:54
turned off, LED 3 gets off but LED 4
5:58
should get on. So for that we will
6:00
insert one more network here below this
6:05
So we'll insert a normally open contact
6:08
for this toggle switch
6:12
two. And this toggle switch two will
6:15
make a memory bit two. So we'll insert a
6:18
coil that will be used as
6:25
Okay. And this memory bit
6:30
will be last here. So we will insert a
6:33
contact parallel to it. And this will be
6:37
memory bit. Okay. So this memory bit
6:42
will be used in another network that
6:44
will be inserted below this we'll use
6:46
this memory bit as normally open
6:48
contact. So this will be memory bit and
6:53
this memory bit when uh when true and
6:56
when uh this uh toggle switch to is
6:59
turned off. So for that we will use a
7:01
normally close contact
7:09
So LED 4 gets on. So we'll insert a coil
7:13
that will be for LED 4. Okay. So when
7:18
toggle switch one is turned on, LED one
7:20
gets on. With that LED 2 gets on. The
7:23
signal passes through this. LED 1 gets
7:25
on. The signal passes through this. And
7:27
this toggle switch two is false. So this
7:30
is a normally closed contact. In false
7:31
state, the signal will pass through
7:33
this. As a result, this LED2 gets on.
7:36
And when toggle switch one is turned off
7:37
the the signal will not pass through
7:39
this. As a result LED 1 gets off but LED
7:43
2 remains on due to this lagging. And
7:46
then when toggle switch two is turned on
7:48
the signal will not pass through this.
7:50
As a result LED 2 gets on. And with that
7:52
the signal will pass through this. As a
7:54
result LED 3 gets on. Okay. And with
7:57
also that memory bit gets true. Okay.
8:01
And when toggle switch turned off the
8:03
signal will not pass through this LED 3
8:06
gets off but this memory bit is true and
8:08
toggle switch two is false. So LED get
8:11
LED 4 gets on. So we'll generate code
8:17
Go to online start simulation and after
8:20
that we will log in. Yes.
8:25
and then we will start.
8:33
Okay. So when toggle switch one is
8:35
turned on. So we'll click here turn it
8:37
through. Go to debug and write values.
8:39
You can see here LED 1 and LED 2 gets
8:42
on. And when when we will turn off
8:44
toggle switch one, go to debug and write
8:46
values. LED 1 gets off but LED2 remains
8:50
on. And then when toggle switch two is
8:53
turned on, go to debug and write values.
8:55
LED 2 gets off and LED 3 gets off. With
8:59
that this memory bit also gets true. And
9:02
when we will turn off toggle switch two,
9:05
we will click here make it false and go
9:08
to debug and write values. This memory
9:10
bit remains true due to latching. And
9:13
with that this toggle switch to false
9:15
LED 4 gets off. It was all about this
9:18
example. Thank you for watching.