Learn PLC Logic Development Using CODESYS with practical examples, PLC programming techniques, ladder logic, and industrial automation concepts. Perfect for students and beginners.
Tags:
PLC CODESYS, CODESYS PLC, CODESYS programming, PLC programming, PLC logic development, CODESYS tutorial, CODESYS projects, PLC projects, PLC programming tutorial, CODESYS examples, PLC logic, ladder logic, industrial automation, automation training, PLC training, PLC course, CODESYS for beginners, PLC programming for students, automation projects, PLC sample projects, CODESYS sample projects, PLC software, IEC 61131-3, industrial PLC, PLC development
Show More Show Less View Video Transcript
0:00
[Music]
0:05
Hello everyone, welcome to automation
0:07
community. Today in this video we are
0:10
going to discuss an example in which we
0:13
will be drawing ladder diagram for a
0:15
boolean expression.
0:17
So let's look at the example first.
0:20
Example 16. Y2.
0:24
Example 16. Y is equal to A dot B dot C
0:30
plus T E not dot M.
0:35
So for this example we have six inputs A
0:39
B C D E and F. So for input A, C and E
0:44
we will be using normally closed
0:47
contacts. Okay. So A, B and C will be
0:50
connected in series. D, E and F will be
0:53
connected in series but D, E and F will
0:56
be connected in series with each other
0:59
but parallel to A, B and C. So for
1:04
output Y to be on we have two uh you
1:07
know options either A should be off, B
1:10
should be on, C should be off or D
1:12
should be on, E should be off and F
1:16
should be on. Okay. So let's move to
1:18
codices where we will draw a ladder
1:21
diagram for this exam.
1:24
I will open codices.
1:38
Let's create a new project. Click on new
1:40
project
1:41
and we need to write the name of the
1:44
project that is sample
1:50
16. Then we can also select the location
1:53
where this project will be saved. Okay.
1:56
And then we can also select its
1:58
template. Let's keep it standard project
2:01
and click on okay.
2:04
So the project has been created. We can
2:06
also select the device uh which we will
2:09
be using. We can select this from our
2:12
from this list. For now I will be using
2:14
cords control when v3 64 cords and then
2:19
the PLC programming there is a list of
2:21
different language. We are using ladder
2:24
logic diagram LD and click on okay.
2:29
So now let's click double click here TLC
2:32
programming. So here we will be drawing
2:35
ladder diagram for the boolean
2:36
expression. So we have a kn first that
2:40
means we have to use a normally closed
2:42
contact for a not. So this will be a
2:46
so this will be a and it represents a
2:49
not and then we we have b dot b dot b
2:54
means we have to connect b in series. So
2:56
we will connect we'll insert a normally
2:59
open contact as a normally uh sorry for
3:02
B that that represents dot B and then we
3:05
have dot C not dot means in series
3:10
C not means a normally closed contact
3:13
for C. Okay so this will be C. So when
3:18
uh we are using normally closed contacts
3:20
we are implementing not logic gates.
3:23
Okay. A not C not understood? A should
3:26
be off, C should be off and B should be
3:29
on. Then the output Y will turn on. So
3:33
we have inserted a coil here for the
3:35
output Y. Great. Click on okay. And
3:40
after that we have plus. Okay. Plus
3:43
means
3:44
so. So the inputs written after plus
3:49
means they have to be inserted here in
3:52
parallel to these A B C. Okay. So we
3:55
need to select all these inputs A by uh
3:59
pressing the shift button. Click on
4:01
every this contact and then insert
4:05
contact parallel. Okay. So great. So
4:08
this normally open contact will be for
4:11
D. Okay. So this is D. Then we have E
4:16
not okay dot D dot. Dot means in series
4:20
to D. Okay. Then we have E not. E not
4:23
means a normally closed contact for E.
4:26
And then we have dot. Dot means in
4:29
series. So we have to connect F. Okay.
4:32
So we'll insert a normally open contact
4:34
for F. Okay. So for output Y to be on, A
4:39
should be off, B should be on, and C
4:42
should be off. So if A is off, it is a
4:44
normally closed contact. The signal will
4:46
pass through this. B is on, it is a
4:49
normally open contact. In true state,
4:51
the signal will pass through this. And C
4:53
is off, C is a normally closed contact.
4:55
In a false state, the signal will pass
4:57
through this. As a result, this output Y
4:59
will be on. So here we are implementing
5:02
or logic gate. Okay. So we have a choice
5:05
either A, B and C are controlling Y or
5:08
D, E and F are controlling Y. So the
5:12
second choice is D should be on A should
5:14
be off. F should be on. If D is on the
5:17
signal passes through this E A is off.
5:20
So this is a normally closed contact. In
5:22
false state the signal will pass through
5:23
this. F is on. It is a normally open
5:26
contact. The signal will pass through
5:27
this. The output Y will turn on. So now
5:31
let's go to uh sorry let's generate code
5:34
first. here.
5:38
Go to online and start simulation.
5:42
After starting the simulation, we need
5:44
to log in here. Click on yes
5:48
and then we will click here to start the
5:51
simulation. So for now this output Y is
5:54
off, isn't it? This output Y is off. We
5:57
can also see it here. The output Y is
6:00
off. So to turn on we need to to turn on
6:04
the output Y we need to uh make output
6:07
sorry input B true. So let's debug it
6:10
and write values and you can see here
6:13
the output Y turn on. Okay so here you
6:16
can see A is false B is true and C is
6:20
false. So the the signal is passing
6:22
through these contact these three
6:24
contacts. As a result this output Y is
6:27
on. If I turn on A, I will click here,
6:30
make it true. Go to debug and write
6:32
values. So A is true but it is a
6:34
normally closed contact. In true state,
6:36
it will not allow signal to pass through
6:38
this. As a result, this output Y will be
6:42
on. Okay. So when A is true, no matter
6:44
what is the state of B and C, Y will not
6:47
turn on. Similarly, if A is false and C
6:51
is true, what will happen? The output Y
6:54
will not turn on. A is off, the signal
6:56
passes. B is on, the signal passes. But
6:59
C is on at a normally closed contact. It
7:01
will not allow it will never allow the
7:04
signal to pass through this. As a
7:06
result, this output Y will turn off.
7:08
Okay, great. So we will turn off A as
7:11
well. Sorry, we will turn off B and C as
7:15
well. So let's go to debug and write
7:17
values. And now instead of A, B and C,
7:20
we can also use D, E, and F. So when I
7:23
turn on D, when I turn on D, click here.
7:26
true. Go to debug and write values. When
7:29
I turn on D, output Y will not turn on.
7:32
So we need to uh turn on F as well and
7:37
keep E keep the input E false. Okay,
7:40
let's go to debug and write values. So
7:43
what will happen? The signal will flow
7:45
through this. E is off as a normally
7:47
closed contact. In false state, the
7:49
signal passes through this. F is also
7:51
true. It is a normally open contact. The
7:53
signal passes through this. As a result,
7:55
this output Y will turn on. Great. So if
7:59
I turn on E, if I turn on E, go to debug
8:02
and write values, you can see here the
8:04
signal will not pass through this
8:06
because this is a normally closed
8:07
contact. In true state, a normally
8:09
closed contact never allow signal to
8:11
flow through this. As a result, the
8:13
output Y will not turn on. So E should
8:16
be off. E should be off and D and F
8:20
should be on. Let's debug it and write
8:22
values. Boom. Output Y will turn turn
8:26
on. It was all about this example. Thank
8:29
you for watching.
8:31
[Music]
#Jobs & Education

