You are on page 1of 3

Section 4- 13.

Exercise Example

Okay, so let's take an example now, it says design XOR gate XOR gate, this is exclusive OR gate such that
output is True, if only one of the two inputs are true. It means only one of the inputs if you see this
required condition, if the both, both output both inputs are false 0, output will not be on if any of the
input is true, the output is True. So if I 0.1 is true or what is true, if I 0.0 is true, the output is true, but if
both the inputs are true, output is false. Okay, so this is like a different situation from what we have
learned in the previous slide. This is XOR gate. So if you want to design it by yourself, you can practice in
your paper, before I proceed to show you the logic you can pause this video and practice Otherwise, the
logic of this discussion looks like this. Now, this is XOR gate. Now it says, first is my NO contact of input
I0.0 which is tagged as A, another is NC contact, because what do I want, if any of the input is true,
output is true. So let's take this example. We have let's take I0.0 as A, so I'm taking the third case if A is
true, so I take this NO contact, if B is 0 means I want to take this situation when closed. So I took this NC
here, my output is true, output is connected like this, or output is True in another case, so this case will
come in parallel. If A is 0, so A is NC, B is 1, I took it as NO and output is True. So I connected that in
parallel. So if both are true now in this case, let's let's let's start from 0 if both are 0, so if this is 0, this
will not pass the signal, if this is 0, this will pass a signal but there is no signal at the back so it will not be
on, so output is false. Second case, I'll go to the false first if both are 1. So if this is 1, so it will pass the
signal, if this is 1 this will be open. So output will not be on, this is easy to understand. Now let's come
with a true case. To the true case, I would like to first erase this and I'll take a green color for the true
situations now if A is zero and B is 1, if A is zero, so if this is 0, this is passing and if B is 1, if B is one, so
the signal will come from this power rail and it will pass and the output will be true. Okay. Another case
if A is 1 and B is "0", so if A is 1, this will be true, B is zero, so this will pass. So this will pass this will pass
and output will be on, so our gate is defined. This is how it will work. So let's go back to our Siemens Tia
and design this logic so we'll go to ladder program. So one, this is A so let me just rename this tag, I can
rename like this, "A" and I have to make NC of B so this will be I0.1, I will rename that to "B" okay, so I
have an output which is Q0.0, let it be a motor, it's okay. Now I have to connect things in parallel. So I
will go to this, open branch and now I will take NC of A, first I took NO of A, now we'll take NC of A so I
can just write A directly it's the quickest way to write the tag or to write the address because I have
defined that are already in so I'll just type A press Enter twice and this will be same address now here I
have to take NO of B, alright B and the addresses here. So I have to connect that in parallel so click and
release, this logic is defined. Now I have to download this logic in my PLC so I will go to "download to
device" and it will take okay it needs... I'm sorry I have to assign my hardware because I didn't do that in
the previous previous... so I go to Device Configuration and I have to assign which PLC I'm using so it will
take couple of seconds to assign the hardware. Generally if you have high power RAM this will not take
much time but I have 6GB of RAM. This is taking time so you open the CPU. So mine is this one and I
have the ... this model.

So this is how you can configure the PLC once you open the ladder logic, this thing you can also take
when you start your project, okay, so I have to just drag it and drop it here. To define that I'm using this
PLC everything is OK Click OK and you can see your PLC here and this thing comes in the PLC column at
the bottom Okay, once you define your PLC once you assign the IP addresses you have to go to the main
logic which will take its time to assign my hardware

Internal
okay my hardware is here now I will go to main. A logic is defined I will download and then again it will
ask to find my PLC so that it will locate that this is the PLC i am using. This you have to do only once once
you start your project so don't think that this is such a you know time consuming but this generally
happened once once you start your project once you define the PLC once you assign the IP address, then
you can reprogram it just using one click OK. So this will search my PLC so my PLC is found in this IP
address. So it will automatically show that compatible device in this window that's here. I click on Load
and then it will load my program in my PLC

is asking me to stop the PLC device Okay, you can load again finish Okay, my programming is
downloaded, then I can go to monitor because I want to see what's happening here. And you can see
this is a PLC device, program is loaded and PLC is running and you can see that this contact is true, this is
green why because this is 0. Okay, I told you before. Now the logic says if any of these two input is true,
output will be true. So if I make 0 true or 1 true, output should be true. So let's start with the first case
I'll run this 0 as high. So, you can see that if this A goes true if this goes true, this is true and signal goes
and output will be on. So this is the output which is connected here. Now, let's see the in other case, I
will turn off this input and I will turn on the another input okay one input which is the B input. So, this is
true when this goes true, output will be on. So, you can see that if another input is true my output is on.
Now, the fourth case was if both the inputs are true, output will be off, the light will be off let's see that.
So, if I turn on both the inputs, output is off why because this is true, this is true. So signal comes from
here, but when it comes to this contact, this is false. Now you might be wondering why this is false. If
this is true in the hardware, because we have used NC contact This is the invert logic if outside it is high,
in the program it will be low. So it will not pass the signal. Similar in the second branch. If the outside it
is true inside this is NC this will be open, it will not pass the signal and this is true, it will pass the signal
but there is no signal at the back because element behind it is false. So output will not be true. So this is
the example of ladder logic, XOR gate. Okay, now, let's move back to our presentation. So this is what
I've explained you in Tia. If I go back to my FBD now we have a similar FBD logic. So what I all have to do
is I just go to my ladder logic and right click on my program block, main block and move it to FBD. If I
move it to FBD, this logic will automatically be created for me and I can also test that same so for that I
have to download this logic again because this is FBD. Previously I have downloaded using only ladder
logic so I have to download this logic in the PLC. So this time we have seen that it doesn't ask for any IP
addresses or PLC search. It is downloaded. And I go for monitoring. Monitoring and let's see it's
examples. So this is monitored. Again, if both inputs are true output is off, so you can see that this is
green, and this is green with a bubble so this is false, this block is false. Okay, so let's let me turn off
both. Okay, now let's done the first input. So the first input is true, which means this is true and this is
false, so it's inverted, it is true, so this block is true, which pass the signal here, this is the OR gate, this is
the AND gate. Or you can say that AND logic. This is the AND logic of A and B. Okay, this is the AND logic
of A and B, but here B is inversed. Here, A is inverse. This is the OR gate... Okay, if you don't understand
this logic, I would like to go back to presentation and relate that. So if you see this part, let me take a
pen with red, yeah. This part of the logic is defined by this block A - no contact, B -NC so B is with a
bubble. Okay, this block is represented by this series connection. And this series connection is here. B
with NO, B without the bubble, A- NC, A with the bubble, okay, now these two are connected. For this
node, it means these are connected parallel. So the output of this branch output of this branch is
connected in parallel. So output of this branch and this branch is in parallel, if you see notice the symbol,
okay, this is the parallel connection, and the output goes to the X. So this output goes here. So that's
how this this

Internal
logic is created. Okay. And the same function will be performed if any of the input is true. output will be
true. Okay. Easy at it's sound. If both inputs are true, output will be off, if both inputs are off, output will
be off. So this is the XOR gate of the same FBD. I hope this makes sense. So let's move back and proceed.
So what did we learn in this lesson? The normally open contact is closed when the assigned bit is 1,
normally open contact Okay, normally close contact is close when the assigned bit is 0, what's the
opposite. The ladder NOT contact inverts the logical state of power flow input, exactly. It means if you
have 1 in your physical power input, NOT contact will inverted, it means inside it will be 0. That's that's
what this normally closes it. If there's a power flow through the output coil or FBD "=" is enabled, then
the output bit is set to 1. This is what exactly here if this is enabled, means there is a signal here, this will
be true. Okay. So this is about NO, NC and OUT contact in ladder and FBD in Siemens, thank you for
listening and you can get a copy of this presentation with all the ink notations in the course. Thank you
so much.

Internal

You might also like