Intro to PLCs. Siemens S7-200 CPU

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome in this video we will talk about a siemens s7 200 cpu and an intro to programming the plc the contents of this video are how to create your first program how to download your program how to test your program how to create symbols or variables how to program timers how to program counters and also how to program memories first you need to open a program called step 7 microwave there are tons of software for programming plc it basically depends on the brand and even if you have the same brand the software may be different however all plcs comply with iez standard 1131 so in the end they are very similar to program so first let's make a simple buffer so you will take an open contact you will select this button over here and select this symbol of course you want it around here and we are going to use an address the address is input slot 0 dot 0 well let's use input 1. so you write input 0.1 remember that this is called addressing this is the way we name our physical variables now we're going to take a coil and we're going to use i'm going to erase this by using my delete key so now we're going to take a coil and again we're going to use the name of the output that we want to activate so we're going to use the q 0.1 now realize that even if they are the same number 0.101 one refers to input and the other one refers to output by the letter q so that's it this is the first program you use input and you use an output so now that you have your program ready we're going to download this to the plc to download software into a plc you need a way to communicate in this case i'm using an adapter which i'm going to show you later and also we need to make sure that that adapter is properly configured for this and specifically for siemens devices you're going to go to this icon over here which says set pg pc interface and you want to make sure that this is properly made so in this case the cable i'm using is this one here i go to properties and i make sure that i have the proper transmission rate and i'm going to also make sure that i have the proper connection in this case i'm connecting this via usb so i click ok now let's proceed to download the program you can also upload the program that is you can read the current program that is on the plc and then upload it to the plc android to the pc so to download the program we are simply going to use this button over here that says download it will compile our program and after it compiles it gives you the option to download an important part here is that you're not seeing it i'm going to show you so here it's the status of the plc so you cannot appreciate it here but i can tell you that that led it's telling me that the program is running so if i go back and i click download it will tell me if i want to place that plc in stop mode this is important because if you have some sort of process and the plc is doing something well the program is going to stop so when i click ok it's going to proceed with the download once it downloads it gives you a prompt asking you if you want to place the plc in road mode again so i'm going to click ok and now we're going to proceed to test the program to test this program we have a training station let's quickly say it i have already shown you this but basically this station has a plc which is this one over here this block this also has a connection to the computer the connection is made through this adapter which is the one we configured before this also has outputs which are this over here which are lights and it also has inputs which are buttons so in order to test the program we are simply going to press the button the button is the red one so i'm going to press it and you see that the light goes off so if you remember we said that we wanted to make a buffer and this is not a buffer it is instead a not function now why do we have a not function if in the program we are we are not inverting anything we have an open contact an open coil this is very important and that is because even if we're not inverting the input signal in the program the program is just one part of the whole system in this case the physical button again you cannot see that but you can trust me the button is a normally closed button that's why even if we're not pushing the button it is giving me a signal hence it's inverting the signal so if you pay close attention you will see that i have some lights over here so notice those lights so when i press the button see that those lights turn off well the light in the bottom hope you can appreciate that and again that's because even if i'm not pressing this button the button is sending a signal to the plc once i press it the signal stops going into the plc so to correct this we are going to simply invert the instruction to get a normally closed contact so i'm going to create a contact over here but instead of using the open contact i'm going to use a closed contact i'm going to use the same input i 0.1 and i'm going to erase this one here with my keyboard now we cannot leave something like this this is as if it was not connected so i'm just going to put it together so we re-download the program notice how the light is off now so if i go and press the button you will see that now this is a buffer when i press the button the light goes on if i unpress the button the light goes off now we're going to use an animation so that you can see that apart from testing it physically you can actually see what's going on in the plc so you're going to press this button which is called program status and what this is going to do is this is going to animate what's happening so i'm not sure if you're able to appreciate it but you have a blue light over here that's telling me that i have voltage over here although remember this is a program it's not that you have voltage but it's the simulation of voltage so you can see that it it is telling me that the input is on again it's on because i have a normally closed contact or button outside the plc however if even if it is on you can see that this contact it's not letting the current pass so once i go press it you can see that the program animates as if it's letting me pass the current here and it also animates the coil to let me know that now the output it's on now let's create symbols for our program i'm gonna unpress this button i'm gonna stop the plc this is not necessary but i'm going to do it anyways and i'm going to go to the section that is called symbol table so here i can create variables and variables allow us to better understand our program in terms of what external physical signals we have connected to the plc so i know because how my plc is connected that i have some light i'm going to call it light uh i have a red light so i'm going to call it light red i also have a light yellow so i have those five variables i'm going to create those five variables now this is for me to better understand what i'm doing so i'm just going to fill the addresses and for the following programs we're going to use the symbols instead of the addresses although it's exactly the same again this is just for better understanding our program now we're going to talk about timers so timers are important elements of plcs and we're going to make a program that turns on a light after two seconds so we go back to the program block we are going to delete these so select the whole network and press delete in your keyboard and we're going to program a new a new block so you go here and you're going to find timers you have different types of timers right now i'm going to use the t on timer so i'm going to drag it i'm going to put it here so in order to see how to program the timer let's go to the help by pressing f1 so here you can see that we have different resolutions another name for this is time basis so in this case since i want to count two seconds i can go with a higher base so since i'm using that timer on you can see here timer on and i don't care for a very high resolution timer i can go with the higher base which is 100 milliseconds so if i want to use a 100 milliseconds timer in this plc i have the choice to use these timers from timer 37 to timer 63 so what i need to put is if you can see here i need to put t in the number of timer i'm going to use then i'm going to put mpt the time that i want to count so basically i'm going to use timer 37 so i'm going to put here t37 you can see that when i put this i immediately tells me that it's a 100 millisecond based timer so if i want to count 20 seconds i'm sorry two seconds i need to put here 20 because 20 multiplied by 100 milliseconds it's equal to two seconds now if i leave it like this this timer is always going to count and i want to count when i press a button so i'm gonna put an input over here and i'm going to use the black button sorry button black there it is so you can see that i can put the name and it automatically tells me which address that name is related to so now we're going to download the program i'm sorry before i do that i'm forgetting something i'm not doing anything when the timer finishes counting so what i need to do is i need to use another input but in this case it's going to be an internal input and the internal input is the timer itself so what that means is that when this activates this is going to count two seconds and when two seconds happen or pass this is going to turn on so with that i can activate a coil and for instance turn on the red light so i'm gonna put light the red one now i have the program complete i'm gonna download it i'm gonna animate the program put it in run mode and now you can see so if i go press this one over here just for a little time you can see that the light does not turn on and you can see you can even see the animation that this is activated but this is not so if i leave it pressed for more than two seconds then you can see that this activates this activates and of course the light turns on another important part of plcs are counters so let's make a program that turns on a light after we press three times a button so i'm going to erase this one here and this one here i'm going to start a new program and for that i'm going to go instead of timers i'm going to go to counters it's over here i'll have a lot of counters so i'm going to go with the ctu ctu stands for count up you can see on your screen so i'm going to put this one here because in this particular example i'm only interested in counting up i'm not interested in counting down so what i'm going to do is i'm gonna put again a button over here and this button is going to be again the black button so i'm gonna put button black and again to see how the timer i'm sorry the counter works i press the help and here i can see that i have a lot of counters from 0 to 255 and basically that's it we have a count up input a reset input and the number of counts we're going to count so what i'm going to do is i'm going to put a reset so to reset the timer i'm sorry the counter i'm going to use the button with the red one so i have it here i'm going to use the first counter which is the counter 0 and i'm going to count to three so that's it i want to count three times with counter zero every time i press the black button again we need to do something after that so i'm gonna put here um a contact with the counter 0 which is going to activate once it finishes counting and i'm going to put a coil to turn on the the yellow light so i download the program so now if i press the count up button you can see that the counter it's not counting so if one two three presses nothing happens now if you go back to the program you will see that the red button it's actually resetting the counter so that's why it's never counting and that is because again the red button it's a normally closed contact so i'm gonna stop it i'm gonna and i'm gonna change this by a normally closed the same button i'm going to erase this one here connect it and i'm going to re-download the program so now if i do the same you can see one time two times three times and you can see that now that the light is on also i have here a number three indicating me that that the counter has counted three times i can go press the button a fourth time you can see that it says now four but again the light remains on so how do i reset the counter in order to turn off the light well i simply press the red button it resets and it turns off the light last but not least we're going to see memories and memories are crucial for sequential circuits so let's build a reset dominant latch and just a common enough flip-flops are available on plc's so i'm going to erase what i have done and i'm going to build the reset dominant memory so i'm going to use a comment here and i'm going to remind you of the equation so the question is reset inverted and the set or the memory itself and this is the equation of the memory so i'm going to build this function it has an or function it has an and function and you have it has also a not function for this my set is going to be the black button in the reset it's going to be my red button so in order to build this function i just need to we'll do these operations for the or operation i simply connect i'm sorry i simply connect uh two contacts in parallel so i'm gonna put here the set button the set signal which is the black button the memory is going to be a new component that you're going to see which is a memory so i'm going to use a memory 0.0 this is an internal bit of the plc i'm going to add these two together so this is an or operation to make an and operation i simply put contacts in serial so i put here now here's an important part the equation it's reset inverted but remember that the red button is inverted outside the plc so because of that i'm actually going to put a not inverted contact because the inversion is happening outside so i'm going to put here a button red and when this happens i'm going to put a coil and the coil is going to be the memory so that's it this is my memory now in order for this to do something i'm going to use again the contact with the memory and a coil with the thing that i want to turn on so i'm going to turn on the light the red one so that's it i'm gonna download the program remember this is a reset dominant memory so now when i press the black button i press it this is as if it was a buffer but if i unpress the button you can see that the light remains on again that is because we have a memory so the only way we can turn off it's if i press the red button so if i press the red button it turns off now this is a reset memory because if i press both at the same time here i'm pressing them both at the same time the reset is winning because the light is not turning off that's why this is a reset dominant memory now we can also build the same memory with another function within a specific function that i think it's very useful if you use it right and i'm going to erase this one here and i'm going to insert a new network insert network uh i'm gonna start a new one so i have two networks and for now i'm gonna say okay the set it's going to be again my button black and instead of building the whole function i'm going to use a function that is called set this over here so when i press the black button i want to set a memory which is the same memory that we used before m0.0 i'm going to put a 1 here i suggest that you investigate what this one is now for the reset now for the reset i'm going to use the inversion this is weird hopefully you can think of this on your own but i'm going to use the red button again it has to do with the inversion that is outside the plc and i'm going to use the reset instruction and for the reset i'm going to reset the md 0.0 the number one so now that i have the program i'm going to download it so now the same happens if i press the black button the memory turns on and if i press the red button the memory turns off now this is a reset dominant memory also if i press both of them the light remains off so i have a little challenge for you if you can think of how you can build a set dominant function with these two i'm sorry a set dominant memory with these two functions uh thanks for watching with these basic components you can start building your own plc programs
Info
Channel: Joel Castillo
Views: 76,134
Rating: undefined out of 5
Keywords: Simatic S7-200, Programmable Logic Controller, Ladder
Id: YCEm6F42Q4I
Channel Id: undefined
Length: 22min 15sec (1335 seconds)
Published: Sun Apr 10 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.