0:05
Hello everyone, welcome to automation
0:08
community. Today in this video we are
0:11
going to discuss an example
0:13
in which we will be drawing ladder
0:16
diagram for boolean expressions. So
0:20
Example 14. Y1 is equal to a1 + b1 dot
0:25
c1 + d1. Then we have y2 is equal to a2
0:30
+ b2 dot c2. So for the first boolean
0:33
expression we have four inputs a1 b1 c1
0:44
there is an or logic gate between a1 and
0:48
b1. That means we need to connect a1 and
0:52
b1 in parallel to each other. And then
0:55
we need to connect C1 and D1 in parallel
0:58
with each other but in series with A1 +
1:03
Similarly, we need to connect A2 and B2
1:06
in parallel and then C2 in series. So
1:09
for all these inputs, we will be using
1:12
normally open contacts. So let's move to
1:15
codices where we will draw a ladder
1:17
diagram for both the boolean expressions
1:20
one by one. So I will open codices.
2:05
So firstly we need to create a new
2:07
project. Click on new project
2:10
and then we need to uh give name to this
2:13
project. Let's say example
2:16
14. And then we can uh select the
2:19
template as standard project and click
2:21
on okay. So the new project is being
2:27
and then we will uh select the device
2:30
from the this drop-down list and then we
2:33
will select PLC programming as ladder
2:35
logic diagram and click on okay
2:41
and then we will double click here PLC
2:43
programming and here we will draw the
2:45
ladder diagram. So firstly we have a +
2:48
b. So we will insert a normally open
2:54
a1 and then we have then plus b1. So
2:58
plus means we need to connect one more
3:00
normally open contact in parallel to
3:03
this a1. So I will insert a normally
3:06
open contact in parallel with this and
3:10
And then we have dot. dot means whatever
3:14
we have to use we will add those
3:17
contacts in series with this A1 plus B1.
3:20
So we will insert contacts here. So here
3:28
I will insert a normally open contact
3:30
here. So let me show you once again.
3:33
First click here and then add a normally
3:36
open contact. Okay. So if we click here
3:39
and then then add a normally open
3:41
contact. So it will be in parall to P1.
3:45
So we don't need to do this. So let's
3:47
click here and then add a normally open
3:49
contact. And this will be C1.
3:53
Okay. And then we will insert a normally
3:56
open contact with parallel to C1 like
4:04
Okay. and this will be
4:10
Okay. And then we will insert a coil for
4:16
So this output Y1 will be on when
4:20
either A1 and C1 should be on or A1 or
4:25
and D1 should be on or B1 and C1 should
4:28
be on or B1 and D1 should be on. So any
4:33
one of these two inputs should be on and
4:35
any one of these two should be on either
4:38
A1 or C1 should be on or B1 or D1 should
4:45
So if C1 and D1 is on then output Y1
4:49
will not be on. So either A1 or B1
4:54
should be on and C1 or D1 should be on.
4:58
And then we have one more boolean
5:00
expression that is a + b dot c. So a + b
5:04
means we need to connect a and b in
5:07
parallel to each other. So we will uh
5:10
insert network below this and we will
5:13
insert a normally open contact for a2
5:18
and then we have plus b2 plus b2 means
5:21
we need to connect a contact
5:26
paddle. So this will be P2 and then we
5:31
have dot C2. So for that we will click
5:34
here and add an orally open contact
5:38
and this normally open contact will be
5:43
and then we will insert a coil and this
5:46
coil will be Y2. So for Y2 to be on
5:51
either of the two inputs should be on
5:53
and C2 should be on. Either A2 and C2
5:56
should be on or B2 and C2 should be on.
6:02
Let's generate code here.
6:06
Go to online and start simulation.
6:18
So firstly I will make A1 true. Let's
6:22
debug it and write values. So, Y1 is
6:27
still off. So, A1 is on and we need to
6:31
turn on either of these two inputs.
6:34
Either C1, we will turn on C1 or we will
6:38
turn on D1. So, when I when I turn on
6:41
C1, go to debug and write values. You
6:45
can see here Y1 will turn on. So the
6:47
signal is passing through A1 and C1
6:50
because both of these contacts are true.
6:53
And then instead of C1 when I will turn
6:56
on D1, let's debug it.
6:59
And you can see here Y1 is still true
7:02
because the signal passes through this
7:05
A1 and then goes like this and then
7:07
passes through D1 because D1 is true, A1
7:10
is true. So the signal will pass through
7:12
this. As a result, this Y1 will turn on.
7:15
And then instead of A1, if I turn on B1
7:22
B1 and D1, let's debug it. And you can
7:27
see here Y1 is on because the current
7:30
the signal will pass through this. As a
7:32
result, Y1 will be on. And then instead
7:35
of D1, I will turn on C1. And let's see
7:40
what happens. Let's debug it. and write
7:43
values. You can see here the signal is
7:45
passing like this. Then passes through
7:47
C1 and Y1 will turn on and then instead
7:51
of C1 I will turn on A1 and B1. Let's
7:55
see what happens. A1 and B1 is true.
7:58
Then what will happen? The output Y1
8:01
will not be true because the signal
8:02
passes through this. The signal passes
8:04
through this but does not pass through
8:06
this. As a result, this Y1 will turn
8:08
off. So then after that I will turn on
8:12
C1 and D1. Let's debug it. Write values.
8:16
So the output Y1 will not turn on
8:18
because the signal is not passing
8:20
through A1. The signal is not passing
8:23
through B1. As a result, this Y1 will
8:27
And then we have one more boolean
8:30
expression here that is Y2 is equal to
8:35
A2 + B2 C2. So A2 and C2 should be on or
8:40
B2 and C2 should be on. Okay. So I will
8:44
turn on A2. Okay. Let's debug it. See
8:49
right values. So this output Y2 will not
8:52
turn on because the signal is passing
8:54
through A2. But C2 is false. It will not
8:57
allow signal to pass through this. As a
8:59
result, Y2 will remain off. And then I
9:02
will turn on C2. I will turn on C2.
9:11
right values. And you can see here Y2
9:16
And then instead of A2, I will turn off
9:26
Let's see. And you can see here the
9:29
signal will pass through B2 because it's
9:31
true. And also passes through this C2
9:34
because it's true. As a result, this Y2
9:36
will turn on. And when I turn on A2 and
9:40
B2 and turn off C2, let's debug it and
9:43
write values. You can see here Y2 is
9:46
false because A2 passes the signal. B2
9:49
passes the signal but C2 does not pass
9:51
the signal. As a result, this Y2 will
9:54
not turn on. It was all about this
9:56
example. Thank you for watching.