Improve your PLC programming skills with CODESYS sample projects for students. Learn through practical PLC examples that help you understand ladder logic, input and output control, timers, counters, and basic machine control programming using CODESYS.
Tags:
CODESYS sample projects, CODESYS PLC projects, CODESYS projects for students, CODESYS PLC programming, CODESYS tutorial, CODESYS training, PLC sample projects, PLC projects for students, PLC programming examples, PLC programming for beginners, CODESYS ladder logic, PLC ladder logic projects, CODESYS practical projects, PLC automation projects, PLC training projects, CODESYS programming examples, PLC exercises for students, PLC logic examples, CODESYS automation, industrial automation PLC, PLC programming tutorial, CODESYS beginner projects, PLC learning projects, CODESYS PLC training, PLC automation training
Show More Show Less View Video Transcript
0:00
[Music]
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:13
will be drawing latter diagram from
0:15
boolean expressions. So let's look at
0:18
the example first.
0:30
Example 50. Y1 is equal to A1 KN dot B1
0:35
+ A1 dot B1 dot. Y2 is equal to A2 dot
0:41
A2 KN dot B2 + C2 dot D2.
0:46
So in the first boolean expression we
0:49
have two inputs and we will be using
0:52
normally open contacts as well as
0:54
normally close contacts. We will be
0:57
implementing N logic kit and we will
1:00
connect A1 as normally closed contact
1:04
in series with B1 as normally open
1:07
contact and then we will connect
1:09
parallel parallelly A1 and B1 but we
1:13
will connect A1 and B1 in series A1 as
1:17
normally open contact and B1 as normally
1:20
closed contact. Similarly in the second
1:22
boolean expression we will use normally
1:24
closed contact
1:26
for A2 and then we will connect B2 C2 D2
1:30
in series with A2 as normally closed
1:33
contact and then we will connect C2 and
1:36
D2 in series with each other but in
1:39
parallel with B2. So let's move to
1:42
cortices where we will draw a ladder
1:44
diagram for this boolean expressions one
1:47
by one. So I will open Cortis.
2:08
Let's create a new project. First
2:11
write the name of the project example
2:13
15.
2:16
Then click on okay.
2:17
You can also select the template as uh
2:20
standard project and select the location
2:22
where this file will be saved and then
2:24
click on okay.
2:29
After that you can also select the
2:31
device and PLC programming. Let's keep
2:34
PLC programming as ladder logic diagram
2:36
and click on okay.
2:42
We need to double click here PLC
2:44
programming. So here we will draw the
2:46
ladder diagram. So we'll start with the
2:49
first boolean expression that is A1 dot
2:53
B1.
2:55
So we will use a normally closed contact
2:58
for A1 and a normally open contact for
3:01
B1 that is A1 not do B1. So this will be
3:08
a1.
3:19
So this will be a1. Okay. And this will
3:23
be b1.
3:26
Again we have plus that means we need to
3:29
add another contacts in parallel. So
3:32
here we will
3:35
select both A1 and B1 and then insert
3:40
contact parallel like this. Okay, we
3:43
need to delete this and then we need to
3:46
insert a normally closed contact here.
3:50
Great. So this normally open contact
3:53
will be
3:55
A1
3:58
and this normally closed contact will be
4:00
V1 and then there will be one coil for
4:03
Y1 for the output Y1.
4:06
Okay. So for output Y1 to be on
4:11
either A1 should be off and B1 should be
4:15
on or A1 should be on and B1 should be
4:18
on. That means only one input should be
4:20
on then only output Y1 will be on. One
4:23
input should be on and other should be
4:26
off. Then let's move to another boolean
4:29
expression. For that we will insert one
4:31
more network below to this network. And
4:34
we have
4:36
C2
4:38
D2 C2 dot D2. That means we need to uh
4:43
connect C and D parallelly. Before that
4:46
we have E not. So, uh let's insert an
4:50
orbital close contact for A2
4:54
and then we have C2 dot D2.
4:59
So I will insert to normally open
5:02
contact. So this will be C2
5:05
and this will be D2. Great. And then
5:11
then uh then is plus B that is C2 do D2
5:16
+ B that means we need to add B as
5:19
normally open contact parallel to C and
5:22
D. So we will select C and D and then
5:26
add a normally open contact parallel
5:29
like this. Okay. And then this will be
5:32
equal to. So this will be A2
5:38
C dot V2 + P2 and then we will insert a
5:42
coil here and this coil will be Y2.
5:47
Right? So for output Y2 to be on A2
5:50
should always be off and then there is a
5:52
choice either C2 and T2 should be on or
5:55
B2 should be on. Okay. So let's uh
5:59
generate code.
6:02
go to online and start stimul.
6:06
After that you need to login here. Yes
6:12
and then start.
6:15
So as you can see here Y1 is off. So to
6:18
turn on Y1 we need to turn on either of
6:21
the two switches. Either B1 should be on
6:24
or A1 should be on. If both are on then
6:27
output Y1 will not be on. So if I turn
6:30
on A1, click here. Turn it true. Then go
6:32
to debug and write values. And you can
6:35
see here when B1 is sorry A1 is true the
6:39
signal will pass through this and B1 is
6:41
false. As it is a normally closed
6:43
contact in false state it will allow
6:45
signal to pass through this. As a result
6:47
this Y1 will be on. And similarly when I
6:50
turn off A1 and turn on B1 we'll go to
6:53
debug and write values. You can see Y1
6:56
will be on because A1 is false. It is a
6:59
normally closed contact. It will allow
7:01
signal to flow through this and B1 is
7:03
on. It is a normally open contact. The
7:05
signal will pass through this. As a
7:07
result, this Y1 will turn on. If I turn
7:09
on both the inputs A1 and B1, let's
7:12
debug it and write values. You can see
7:14
here Y1 will not turn on. So A1 is on.
7:17
So it is a normally closed contact. In
7:20
true state, it will not allow signal to
7:22
pass through this. Similarly, A1 is on.
7:24
The signal will flow through this. But
7:26
B1 is true. It is a normally closed
7:28
contact. The signal will not pass
7:30
through this. As a result, this Y will
7:32
not turn on. It will remain on. And then
7:35
for Y2, A2 should be off. Okay, we will
7:39
keep A2 off. And then we have a choice
7:42
either C2 and D2 should be on. We will
7:44
turn on C2 and D2. C2 on, D2 on. Let's
7:48
debug it and see. You can see here Y2
7:52
gets on because A2 is off. It is a
7:54
normally closed contacts. The signal
7:56
will flow through this. C2 is on. signal
7:58
passes, D2 is on, signal passes. As a
8:01
result, this Y2 will turn on. If I turn
8:04
on A2 as well, let's debug it and write
8:07
values. You can see here Y2 gets off
8:09
because A2 as an oric closed contact in
8:12
true state, it will not allow signal to
8:14
pass through this. As a result, this
8:16
output Y2 will not turn on. So, A2
8:19
should be off and then if 2 and D2 are
8:22
both are off, then B2 should uh be true.
8:26
Then also the output Y2 will turn on.
8:28
Let's debug it and write values. You can
8:30
see here Y2 is on. If B2 is on with that
8:34
A2 is also on. Let's see what happens.
8:38
Go to debug and write values. You can
8:41
see here Y2 gets off. So output Y2 will
8:44
turn on when A2 is off and B2 is on or
8:48
A2 is off and C2 and D2 are on. It was
8:52
all about this example. Thank you for
8:54
watching.
8:56
[Music]
Science

