TIA Portal: Sequential Programming (S7-GRAPH)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to our next video in our year or PLC programming sessions today we're going to talk about the s7 graph or graph set it's not exactly rough said but it's very very similar so about sequential programming what we have done so far is we have programmed we have written a little function reuse it so we have two conveyor belts here inside there is the behavior of the conveyor belt and we have used it twice with different pair different sensors and actuators so we can use it with to converse or three or four or five of six it's reusable so the converse they are standardized do they look like this you put a part here and be one conveyor starts after pressing s one start at P 2 then a oops let me push that to the side then a stopper will open we're going further B 3 conveyor stops also this one only tracks yeah after the B 2 is not active anymore so rather simple system and now we're going to not have it as a circuit as a letter diagram circuit we're going to have it as a graph circuit and a graph circuit is better for sequential programming where you have specific steps so our first step is going to be from b1 to b2 is step one is conveyor on step two we'll be opening and the stopper is step three will be closing the stopper two conveyors on all the time now step four will be going on know that still step three step three step three and step four will be stopping the conveyor when we're at b3 then we're done so it's not too complicated let's start for this because I have used functions here I can simply say I don't want that anymore I can I just deleted them out of main because they're functions I'm not calling them anymore the PSC won't do anything with them anymore what we will do for the graph for the sequence I would add a new block and I will have to add a function block the difference between a function and the function block is that the function block has a memory a dedicated memory space a database where it stores values we are going to need for example the step number which step are we in right now are we waiting right now or are we in the step where this gets here or are we in the step where it's here or we the step word waits here so needs to have a number through those steps that's just an example but there's more data behind so we will need a function block for this dedicated data space this block I want to call on the sequence the name doesn't really matter but I like organized names and then I have a different five different language second choice of actually six probably okay okay we've proven letter diagram so far letter function block diagram and statement list a those three are very similar so in what we can do with them STL is more like C or assembler it doesn't really matter and we are going to go with the graph which is for sequential or sequences so graphs and I'll hit OK and here we are it's going to open a new graph block where we can program our sequence and we can program our sequence our sequence consists of two components we always have a step where something happens and we have a transition that asks for a condition to go into the next step that's what it is you can say this is a little gate this gate can only open if the condition is true so we were first create the sequence and then fill out what's happening in the steps step one right now is the step where this sequence will start and so it's going to start in the initial step and our call this step in she'll step alright so basically what should happen in this step is it should do nothing it should wait right this initial step is right now this statement here notice empty we're waiting for work piece then we're putting a piece here and we press Start this is our first condition to go to the next step so B 1 and s 1 those are our conditions to go to the next step so this I will call waiting for piece then we can go to our next step as soon as we've waited for the piece we can go to the next and on the top here I have my favorites with with the structures I can use I can also find those structures here on the right on basic instructions and what we're looking for is a step and a transition or basically a step actually first so the second step will be from here to here all right so I can call it start conveyor I would say start somewhere start conveyor that's my first step that's my second step when do we know that we have to go to the next step of course whenever we reach b2 so my next condition here my next transition will be b2 in center position let's call it center position all right because this is in the center position here then what happens in my next step this will open so our always a step in to transition always go together so you should always the left one makes the most sense always a step and drizzle together next step will be open stop her then we close the stopper as soon as we get out of B 2 so the next step will the next transition will a nod in accenture I say he sent a position yeah let's keep it good let's let's say also a lot in center position postion yes sorry it's already late here no not too late but late enough what's the next step the next step is going from here to the end so I will say continue convair and we know that it's done when in and position as well this time I wrote it correct from the beginning on and then k1 will turn off so belt will turn off this will also be turned off so this is exactly the statement from the beginning the initial step so as soon as we are here in the end we can go back to our initial step and we can do this with doing a jump which is a little s here that indicates a step after a transition we have a step a step jump to another step and this will be our sequence now when we are in the end position right when we are in the end position we can go back to our beginning all right right now from here we can go back to our start position but actually I would like to have this statement first that we have to take this off right so I want him here in between I want another step in transition well I can just click on it after I watch this after this transition here and here I want to wait for empty belt and then I want felt empty all right so this is my last statement that I have to take this actually off now all that's left to do is actually filling out those single steps and transitions here let start with the transitions I can simply open them by clicking here on the symbol to the left this will open a letter a letter block I can also translate those by going to the property section of my conveyor here and I can say the function block diagram rather than this by right clicking here on conveyor on my function block for this I can change the language and then those will be in function block but let's keep it with the letter so the first condition is there's a part here right and as one is pressed so the first condition is b1 and s1 if I would like to make this this reusable I could now use data data block bits but let's keep it with the same conveyor belt right now so it's more about the graph here not about the reusability so b1 and s1 I want to use let's go to the next transition the next is true as soon as there is a part here so the next is simply B to the next is actually then the stopper is going to open the next is whenever we leave b2 so we can say we do not write B to not there we go next will be when we're in the end position here with b3 but b3 was a normally open a normally closed contact so we want to ask for b3 not active anymore just because it was a normally closed sanza so b3 not active anymore it sends a 0 whenever there's a piece it sends a 1 whenever there's no peace now I want to wait until there is no part in the end anymore so this is when I read a 1 again on v3 here we go so those are our conditions always go to the next step there we go I can close this pretty simple and now all that we need to do is do the do the contents of the step saying what should happen in each individual step so in the initial step let's keep that empty for now the start come because nothing happens in there right that's what we think we'll get to it in a second and the step two whenever we are here and we press s1 what should happen conveyor should go on all right I can open on the top right here I can open this little block if you double-click on this step a strange if you will open this is the step view where you can change everything for this sim single step here I don't know if you don't want that you this is just a detailed view of this one step you can't just double click here on the left on the sequence again or on the top left you have the different views here and I just want the the the how support step you add the sequence view yeah so we want to start the conveyor in the beginning and how do we want to start it I am using four different things in this scenario here I'll use here for the conveyor s and set and s because it should stay it should turn on should stay on even if it's not in the step anymore so I want to stay a set the conveyor and there's qualifiers if you see this there's different qualifiers and I want to set it to one and which one do I want to set to one it's k1 k1 is by conveyor so that's the first thing that's going to happen when we press b1 when V 1 is active and we press s1 then it's going on conveyor set it stays on we're reaching b2 all right we're in center position we open the stopper and here I want to say n it's the qualifier will poop the qualifier is N and means do something as long as your under step turn something on so make it a 1 as long as you are in a step if you leave the step it's going to set to 0 again so any and I want this to be one and one and one one that's the stopper so now when we're in step two the stopper is going to open as soon as we leave step two the stopper is going to close automatically right because it's not with the end anymore since we do not put it into the step four here we do not have this anymore and one one on one it automatically returns to the start position automatically turns zero again the output so I don't need to reset it here or something that happens automatically I just keep it empty we're going into the next step we are leaving the step meaning this we turn automatically to zero because we only have the end qualifier it's no set it's that it won't stay on it just as on as long as we're under step here so we're going to the next step we're leaving b2 here meaning going to the next step and in the next step one and one is not active anymore there's a return spring in this one so it will return automatically great so we don't even have to put anything in here then we're reaching the end position going into the end position what do we want to do you want to turn off the belt and since we said the belt turns off with the S with a set qualifier okay one is on here it's on here it's on here and it's should turn off here with an hour reset you want to reset K 1 here we go done all right this is our sequence this is this all the steps that we need to take and as soon as we take off the PCEHR sheet we're going back to the beginning to the initial step now one thing that we need to think about for later I'm going to make a second video just so that so something we don't need to think about for now is the initial step so I will talk about that later on the only thing here you see the difference between the first step and the second step it's those two lines around it right those two squares those just indicate that this is the step we're starting and if I right-click on this one and say this is the initial step right click on this this is not then now the sequence is going to start in step two already which we don't want right sometimes you want to start you have different sequences you could start anywhere but we want to start here in the initial step and I want to save the project and all that we need to do now is go to our main take our conveyor sequence alright and put it on the network one or network whatever put it in our program now it asks me to create a database so this database is an instance database and instance database is a database that has all the data for this specific function block here the blue one has all the data so the step number and so on the timings and a lot of things actually it has in there I want to create a new one it automatically gives the name and the number so I always keep that automatically I hit OK and now I see this strange block looks a little bit like an integrated circuit is now connected to my main and this is automatically called now if we don't put anything on the left and right this is what we're going to do for now if we don't put anything then the sequence here is called automatically an automatic mode and it's just going to do whatever it's supposed to do so it's starting an initial step then it's waiting for this if this is true then it's going here and so on and so on and so on so pretty much done let's see that in the simulation here maybe I should have started the simulation in before that would have made sense of course but now we're sitting here bear with me for one more minute and then we're done so this takes a minute to start up that's how you simulate repetition on simulation you click here on top on the little PC after selecting the PRC and this window is going to open this is my simulated PRC my download is going to open I load my program into this little simulation I want to start the POC and now it's in here so by simulating you why can't I'm a PC too slow blob now I can go in my Mane for example go online with those glasses right and I can see this one is active it's all green green means active at logic one and if I go in here I can also go online and I will see we're right now in our initial step so graph is very good for analyzing the the sequence itself so what happens here ah nothing okay and you see this is in the database for example we are already in the step for 37 seconds that's more than to the database and now we're waiting for this both of those are not true if I want to test it here in my little sequencer in my little simulation I click on the extended mode simulation is going to open the end yes sorry if you know how our simulations work then you can already quit the video you can already exit it because I'm just going to show how the how this works I already have a simulation but I could create a new one I'll just call a project one for now because I don't really care it's creating a new simulation right now I can do that because my PC is very fast that's why I can do it in a minute I hope I can be done before minute 21 of this video it's already 19 minutes 19 seconds so now I've got my system here my simulation I've got my PhD downloaded right it's loading the configuration right now it's downloading it's compiling it everything is okay cause the compiler actually for 1500 is inside the 1500 not inside the PC anymore here we go I have my simulation tables I can synchronize and now I can use this in the simulation here - those don't need before I don't need to 586 because those are on the other it owes you don't own you don't need yep that's it I've got my simulation here and now my smaller yes good now my sequence is waiting for b1 and s1 so if I turn on b1 you can see B 1 is active via green logic green logic 1 and I can click s1 Bob we're in step 1 in step 2 which is starting the conveyor and I do have this little pin stupid I can turn those off because we have made it we have started to convey we are now waiting for b2 and you can also see here the conveyors on you to click we're now in the next step open stopper b2 not active anymore and I can see really see that k1 already turned off because we have reached b3 already right here the condition groups here the condition was actually reaching b3 and since B 3 is a normally closed sensor I should have done that from the beginning on and that's fine our sequence is done right we've been through once perfect great now I want to make some changes this some very very easy simple changes to our system itself alright so 21 minutes so far I can still do some it so bear with me very simple things I want to add a sensor at this I want to call b4 b4 now is responsible here in the center or let's call it B 20 because it has to do with this one as well this is a mm-hmm let's say color detection sensor we've got green parts and we've got gray pots green parts if they are here they will send a logic b20 will send read the logic one indicating this part is ok and then we go to b3 if it's a great part b20 will send a logic 0 and we will go back here to the start and we will go back to the start so let's do this first thing I need to add off in my conveyor here is of course the sends will be 20 which is then in for 10.4 that's the freer color detection and now assume I also have on k1 I have a second I have a second output to make it actually run in the other way I would call that K 1.1 and this is Q 4.2 4.3 so I already have 4.0 as you can see perfectly and this is conveyor belt Reavers so now that I've got this I can make those changes here in my sequence so I've got my initial step nothing changed here right nothing changed there nothing changed there nothing changed for starting the conveyor the next thing is here in center position so if everything is okay here right now in the center position if we have this part we mean B 2 is active and be 20 years active indicating we've got a correct part so this would be the correct path B 2 and B 20 this will then do exactly what we had before and our sequence this will just stay the same what I want next to this is actually a parallel path so I can click on the step and on the top here we have something called eternity fresh there's also simultaneous branch that that's not the thing we want right now we want an alternative branch let's click on it you can see it's really an alternative either if this is true so if B 2 and B 20 are true we go this path if this here is true we will go this path so this will be in Center wrong heart or gray pot right this would be exactly like the O's but with the difference that B 20 is not active so on only closed here we go so this happens if we have this gray piece here we're go in here and now what we want to do is not open the stopper but reversing the conveyor and so what we will do is a new step what are the poop with those on the top here with those two blue ones you can open and close all the steps and all the transitions if you just want to organize the structure that's very convenient this is called a or reverse then the next would be that we are here in the start again back at start then someone takes the piece off right wait for empty now the problem is that you can't have the same name twice so I will just wait for empty I could also put a number there so back at start first it's if the one gets active and wait for empty is of course now b1o not active here we go and in the end we want to go back to in the surestep so what happens in conveyer reverse of course we want to reset our conveyor forward if we turn on both the conveyor could break because we're trying to push in both directions and I want to convey a reverse to be on how long do I want to convey a reverse to be on here so we start here and we go there only in this step right as soon as we're here we're waiting we turn it off again so I can say n4 only in this step and I want K one point one and I'm done all right wait for empty we don't do anything we wait and this automatically turns off K one point one the reverse conveyor because we don't have it in here anymore it's just this N so there we go that's it we have made a parallel branch an alternative branch and our structure will not run this path this path here if this is true and we will go to the left if this is true done pretty much all right so I could now see again but I think you get the idea that should be enough yeah that's it for the for the bbbbb graph I could also now temper a little bit with the Oh now I've changed something in there so I have to this is not all red I just have to compile again because there were changes there's an interface on here let's also yeah I still have three minutes then we make the half an hour perfect we have this interface here at this interface and there are some parts important on this on this call here and I just will explain the most important ones we have SW auto this is basically if the automatic mode is active I won't take anything right now you usually have a selector switch that says automatic mode or manual mode or so SW Auto means automatic mode is selected alright so the selector switch is an automatic mode then basically this is just what we have this is just what we have right now the conveyor belt runs an automatic mode in our case if I wanted to run it in for in step mode so I press Start every step I have to press that this is the tab mode the tab mode selected that will be start one step start second step start throat and so on so every button press is a is one step and I need to also put that next step in button because the sequence needs to know which is the next step alright the next step button here on T push the only last thing I also usually put on here is sometimes I want to reinitialize the sequence so a reset button and the reset brings my whole sequence back to the initial step alright so I could press reset right now when I'm in the open blocker fund step here and it will bring me back to a managers that the only thing I need to think about now is if I have a set for example then I will not go through the set the reset step here so I have to reset everything in my initial step all right because this is where we're jumping to this so we're not going through the other steps we will just directly jump here that's why we need to have the reset statements in there as well so I will just say here this is my reset mode selected and that's what I want to do here one more is sometimes you have a stop button or stop mode I will say stop button from somewhere and this would turn off the whole sequence and after trying it off you have to reset it again and then you can run it in any of those modes good so now that those are red let me do the last thing I want to define those as texts right and I will have those as inputs and I will just have to see which is my next free input therefore I can go into the brain tools assignment list and I can see I have not used input bite well I thought I used eleven I used eleven that's I haven't used it in the program that's why it doesn't tell me so let's take the that because it's four more inputs no let's take twelve twelve point zero twelve point one and so on and so on so you i 12 point zero all right well point one I just do that because I can't leave a program not be done all right twelve point three and all right twelve point four good now that we have our interface my sequence will react on those different modes here so it won't always run automatic mode we have three different modes we can sell it for actually we can stop it we can reset it we can run it automatic that's what we always did before and we can run it in automatic with every single transition so every condition we have the start button basically edit to it so we have to press start between every step here we go I could now simulate that but I won't because I'm running out of time it's 31 minutes and I think it's a good overview of the a7 graph here and so if you've got any questions on this just leave a comment below I hope you learned a little bit if you did put press the like button subscribe and I'll see you in the next video thank you very much for watching and yeah have a nice day bye bye
Info
Channel: Hegamurl
Views: 86,692
Rating: undefined out of 5
Keywords: plcsim, plcsimulation, plc simulator, sps simulation, tia, v13, v14, v15, step7, totally integrated automation, programmieren, ob1, getting started, easy programming, leicht, intro, lernen, siemens, tia portal, plc, automation, mechatronic, steuerung, controller, controls, graph, sequencing, sequantial programmin, grafcet, grafcet sps, s7graph, s7-graph
Id: CefjNWi0g9s
Channel Id: undefined
Length: 32min 12sec (1932 seconds)
Published: Thu Feb 14 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.