Siemens TIA Portal & Factory IO (Timer Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
alright guys so last class what do we do we got the the factory oh talking to the Siemens Ti a portal and we had a basic two and three wire control and then we brought in the HMI so the next thing we're going to do we have to look at is the timers so we're gonna set up a circuit like this where we hit the start button on the control panel on factory i/o and once we do that then it turns on the timer and then we'll see the value increment on the digital display here so if we hit the start here then it will you know increment up and with this gaya this is an on delay timer so it takes some time to change state and you can see that as soon as the Q value goes true then I've got a light that turns on here if I hit the stop at any point then it turns off the timer okay so let's take a step back let me show you how I created this program and the different settings that we had for last week in order for this program the TI a to talk to the factory i/o I'll show you some changes that we've made within the factory oh and make sure that everything is working together so let's take a look at our TA portal first so if you are working on this in the lab then where's my USB then on your on your desktop you have this folder advanced instrumentation so you're opening this folder here and in order to open up that Siemens PLC program like you may have saved it to the desktop so you can use your save program or if you've lost that one then open this one up so generic PLC and HMI and factory IO program so this one I once you open up I want you to save it as a different different name because I want these programs to be here in case you screw something up you can always go back to these programs that work I know they work because I've tried them out and I don't want you to save to this file folder advanced instrumentation if I make any changes within this folder I basically wipe out the folder off of this the computer and I put a brand new advanced instrumentation on there with all my gorgeous material on there but in doing so if you have saved to this then your program will vaporize and disappear so save to the desktop if you just want to be do things simple then use my program so you're going to open up this generic program and you double click on this guy and it will open up a base PLC program okay so let's open up this guy let's go offline okay let's go back to the portal view so when you open up your program so I'm just going slow because this is what our fourth week of doing PLC's so each week we're just doing a little bit more than we did the week before but it's been a week since we last talked so I'm just going through all the steps so once you open up your program then you're gonna go to project view once you're in project view then you will have a blank slate there won't be anything in your ob1 you might not even be able to get to your o b1 so in order to get there you need to open up this pro this project tree so you're gonna expand this one right here by hitting this triangle when you open that up then if you want to look a little bit more or see everything you can move that to the side so yours is going to be set up like this with your PLC and the H my that we had set up from before if I want to see my program I hit this triangle right here I moved down to program blocks I open up program blocks and if I double click on main o b1 then it opens up this window right here for you guys this will be a blank slate okay the changes that we made last week within this program because this is the one that talks between the PLC and the factory i/o so let's look at the changes there so let's go to device configuration so we're double clicking on this guy you'll notice that another tab opens up in the bottom here and in two seconds the actual PLC will come up so there's our PLC there's our analog card and so if we want to make this just a touch bigger we'll go to 200% and what I want to do is right-click on the PLC and then go to properties once you do that and this should come up again if that doesn't come up if it's hidden below just hover over here do you see this line see that hold down your mouse button and bring it up so you can see the properties of the PLC okay again I right clicked on this portion right here right that's my PLC right there don't wreck lick on this this is an additional analog card and this is an additional analog card over here so I'm right-clicking on the s7 1200 then I'm going to properties and that brings up this guy and if I want to see a little bit more I bring this up and I'm good to go okay so first thing is is that every PLC in the lab has 192.168.0.0 store the plc so make sure that you have disconnected from the Ethernet switch and you're going from the computer into your box with the PLC and that way you're not talking to your friends PLC across the ribbon well we can change this IP address later on but for beginners it's much easier if we can just grab any box with any PLC and download our program each of the boxes will already have this IP address already in there that's the first step okay next step is our I own I oh I nurses so below here so you have digital inputs digital outputs IO addresses click on this guy and you'll notice that we have offset our physical inputs by 10 that is so that our physical inputs which are at is zero because we don't have any signals going in they don't supersede would say Trump but I I'm not using that word anymore they would supersede any value that's in the the PLC program so we have to offset the value by 10 and that way our physical inputs are not going to interfere with our inputs within the factory IO okay last thing we needed to do was aside from the Ethernet address and the i/o addresses we came down to protection and security so we clicked on this guy we gave it full access so no protection whatsoever and we went down and I have no idea what this means but we clicked on this one permit access with Pio tget communication with Romo partner so that allows us to talk to the factory okay once those guys are there then we're coming back to our main OB today okay I can go back to my main OB here or I can click on my main OB right here so let me just make this a little bit bigger so you can see okay so I want you to start off with a three-wire control so a stop a start similar to the previous labs that we did right these are inputs you'll notice that these are not offset by by 10 and the reason why they're not offset by 10 is because these numbers right here have to match with the factory Oh so if I go to my factory oh and go to file and drivers then you'll notice that my stop is address 2 input 0 times 0 and my start is input 0.1 so that corresponds to this stop in this start ok if I go back again to use you know what are you doing Pete file drivers then my reset is on input 0.2 so if I need to make use of my reset I'm going to use input 0.2 so that's why I had to offset my physical real-world inputs by 10 so that they didn't mess up any these values okay then I have the output Q 0.0 and I have labeled that timer dot Q and then you may have to drag this down so this may not be there for some reason I keep changing this and then saving it but it's not saving properly so you may have to grab the digital display and drag it down to QW 100 and you'll notice that it's an integer value okay so the value for the digital display is being you being held in a word and it's an integer value going to that display okay once you're there you can then quickly go to configuration make sure that the IP address 192.168.1.1 matches with your PLC program and then once you actually download the program to the PLC then you can hit connect so I don't have anything here let's say I've already downloaded my program to the PLC I can hit connect and then I should see a green checkmark if you try to connect without having the PLC program in the actual PLC then this will not work so our next step is to download our PLC but before we do that we need to do one more thing so this digital display again I keep changing this and saving it to the image but for some reason it's not saving property I want you to right-click on this guy very quick here sorry I have to stop this so you're not playing your a you're hitting stock I believe it's a right click yeah so right click on the digital display go down to configuration and change it yours is most likely gonna be set from 0 to 10 0 to 10 volts but we're looking at an integer value so switch this to integer value okay one more time I right-click on the digital display go down to configuration and I change it to integer okay then it will be able to show my in this case 1 through 5 ok once you're done that then we're going back to our ta portal and we're gonna drop in a 3 wire so in this program right here I've got an input a physical input that matches with my 5 tryingo for my stop input 0.0 my start push button on factor IO is infant 0.1 and I'm just going that there to a memory BIST remember this is just a bit in the memory and all it does is it turns on another line in my program down here doesn't do anything else other than that ok the 3 wire control is that when this guy is a 1 this one's looking for a 1 and so this provides logic continuity so when I let go of the start push button then it keeps that M 0 dot 0 true if that guy is true then all of a sudden it will turn on my timer so the second line I want you to do is to drop in a timer here so these guys are easy you're just dragging and dropping down from your favorites full tab right here but in order to find this timer then you open up your instructions so see this arrow right here or this triangle I'm going to expand here I'm gonna go to instructions down to timers and it looks like we have a pulse timer and on delay and off delay any retentive timer so we're gonna start off with an on delay timer we're gonna grab grab this drag it over and drop it down okay once it's dropped down then it'll ask you to hit OK you're gonna do an automatic rather than a manual and I just kept it as IEC timer zero you can change the name if you wish okay once that's in there then I want you to put in a preset time of five seconds so remember that the the standard is that when you put in a value it's in milliseconds so you're gonna have to put 5s or are you gonna have to put 5,000 as the value right so if here if I put in five then it's gonna say five milliseconds well that's no good I want 5,000 at that point it changes to five seconds okay we're gonna leave the elapsed time the same like not connect anything to it but I want you to have an output here because I want to turn on a light when when this guy is true so when the timer Q is true then I'm gonna turn on this output Q 0.0 and I have tied the Q 0.0 into this guy right here so that guy is gonna be my light right there so Q 0 to 0 is going to be going to my light which I've labeled timer dot Q okay so that's this guy right here okay if we go back that's this guy right here okay if you want to relay rename these how do you rename those guys I'll leave it for now um this this is an important point for this scene in fact Rio you don't have to create this one this one's also going to be in your advanced instrumentation folder under factory IO scenes if you double-click on this guy then this is the timer tutorial that you're gonna open up so it'll it will open up this image for you you just have to make those small changes that we saw before when I remember I will tell you in class how to change those names I can't remember I think it's like edit I can't make you dock all your tags and then once the tags are docked yes once the tags are docked then you can change the label on there so in order to change any of these labels so there just have generic labels or this one might not be legal time or docu so again I went to view dock all the tags and then I can double click on each one and I can change the the name of that light if I need to okay so I'm gonna go here and clear all of my dog tags so in our program here we have our memory bit turning on our on delay timer we're gonna use five seconds and we're gonna have that going to an output Q 0.0 okay in order to send that value to the digital display I got to do two other things so what I'm gonna do is I'm going to divide the value because these are in milliseconds right so this is going to increment from zero to a thousand to 2,000 to 3,000 to 4,000 to 5,000 milliseconds so I just want on my digital display I just want it to display one two three four you got it at five okay so what I want to do is I want to divide my IAC timer so what I did here is I went to my my timer and then for the timer I have the ability to look at my elapsed time and marry preset time so I'm looking at my elapsed time and I just dividing it by a thousand so my input 1 is my IEC timer 0 DT and I'm dividing it by a thousand and I'm gonna have that go out as a memory word okay so gonna have one word holding all those values and I just relabeled it as counter value you'll notice that down here I have MW 100 and % M 1 MW 100 here so these guys are identical this value will go into here so I've used division so that where would you find that that was probably under math functions so I'm grabbing this division dragging and dropping into here and then what I'm gonna do is I'm gonna move that value so I want to move it from the memory to the real world so I want to move this this word to this word right here so I'm moving the value of % MW 102 percent QW 100 QW 100 is matching with my factory i/o in my drivers and we see look at that it's so weird how that keeps disappearing so that digital display is going down to qw 100 ok hopefully that's all fairly clear let's take a look one more time in our program now where did I get that wait a minute going a little bit too fast where'd I get that move function that guy was right here under move operations I opened this up I grabbed a move and holding the mouse button down I dragged and dropped it on to the page and I just labeled this one % MW 100 they bought this one percent QW 100 so I don't have a preset program for you to just open up and download because I want you to go through the motions of finding these guys dragging them in making mistakes you know seeing that that doesn't compile properly and trying to find where your mistakes are okay but the actual program is really simple we have a three wire control a stop start in a holding contact that hole in contact is tied into this memory a bit that memory bit is then turning on a timer and on delay timer in this case with the preset of five seconds or five thousand milliseconds and on the cue we have an output with cue 0.0 that turns on a light on our display so that's going to turn on this bad boy right here okay then below that I have one math function a division function a double integer here where it's taking the IEC timer elapsed time the e T value dividing it by a thousand and then punching that out in a word a memory word % MW 100 that % MW 100 is going into a move function and I'm simply moving it from the virtual world to the real world MW 100 moving over to the qw 100 okay once you've done that we've done a number of different changes right so first thing is click on the screen here and go up and compile your program and see if you've messed anything up ok cool I've got zero errors and zero warnings so that means that my software is cool I haven't made any mistakes in the software ok I've made some hardware changes though so remember you have no idea what the previous person did on this PLC so we need to drop in both the hardware and the software changes onto our PLC so if I download this I'm only going to download the software and I'm not going to be able to talk to my factor i/o I have to download my hardware changes like that off set of 10 for the inputs and the protection and everything and I have to download my software for my program so I'm coming over to PLC I'm right-clicking on this bad boy I go down to here I've already compiled it I'm going to go download and I go download my hardware and my software it changes okay this is gonna rock through because I already have my program there but it will ask you for like remember the steps are that you're choosing prophy night and then you do the search and it finds the PLC and it finds that the HMI and it may need to do another IP address for the the PLC like it goes to 0.2 for one you just hit okay meant and then remember that you may need to do like manual configurations right maybe there's a difference between what the PLC has and what you're dropping in mines identical alright harder or not be loaded because the online status is everything's like exactly the same right so but just keep hitting okay okay okay okay then hit load that'll drop your program on to your PLC and then hit finish okay zero errors zero warnings beautiful okay now that everything's there gonna move everything to the side I'm gonna drop this guy down to maybe a hundred percent and I'm gonna go here and hit the court you guys don't seem to know who Corey Hart is but the Corey Hart sunglasses for the monitoring on and off so click on this guy right here that will bring us online so if we had this open green lights all the way across green for logic continuity gorgeous okay now I'm good now I'm gonna float this guy right here so I floated the about the image then grab this guy and then bring it over to the center of the screen bring it over the side snapper over and then it will be good to go then open up your factory Oh again if it's not there you can bring it over the side snapper and then it will take up the rest of the screen and I want the the factory node to be a little bit larger so I want this guy over top of my ta portal cool okay before I do that let's make this large I need to go to file drivers and at this point you have now dropped in your PLC programs so now you can hit connect now you see the green checkmark and you were ready to rock and roll go back over here hit play okay then float this guy down bring it up so that both of them are on the screen and now let's see if I hit this stop push button whether it changes Hey very nice it changes the value on the screen here so when I hit the stop you can see that it stops the or change of the state of that examine if closed right here okay so when I hit the start this is an on delay timer so this is going to take let's see five seconds two increments you'll see this value increment up and after five seconds then the timer will change state when it changes state then my timer Q will be true and this light will turn on okay I'm gonna drop down a little bit so you can see the division and the move as well so hopefully we will see this guy mimicking the value that's up here okay so we hit the start once we hit the start our memory bit will go true and that will make our timer turn on okay so this one should increment up by five two three four five this guy goes true so this guy goes true beautiful and you can see that this value is just moving to here gorgeous okay so if you had any issues there then go back to your program or go back to your factorio chain make those changes so that everything's coming in nicely but let's take a look one more time at this guy I'm gonna hit the stop excuse me okay as soon as I hit the stop then this is no longer true and the timer Q is false I'm going to hit the start and I'm gonna hit the stop halfway through so it's incrementing up if I hit the stop then this guy never went true the only way that this guy goes true is if your preset time and your elapsed time are the same so it has to increment up to five then it's true cool as soon as I hit the stop this is no longer true and you can see that the elapsed time goes right back to zero so this one does not retain the value okay so that's an on delay timer where you send the signal in and it takes a little bit of time to change state excellent now we can look at an off delay timer so what's this this is awesome off line two kilometers right and I want to change this to an off today so I'm gonna click on this bad boy you could just make out there is a little orange triangle right there and when I hover over that guy I can change this from an on delay to an off delay timer I've made a software change so I'm now going to download to my PLC you know over eight my Hobie won I don't have to do anything with the hardware cuz the hardware it was already set I go back online and now I can use the same guy to check out and off delay timer okay same circuit if I hit the start this isn't off delay timer so the oftenly timer has to be energized and then de-energized so I'm gonna hit the start this will go true and you'll see that the timer changes state right away okay so that output changes state right away my elapsed time is still zero because an off delay timer has to be energized and then de-energized so when I hit the stop button then this will no longer be true so we have now put a positive pulse in here now we're gonna take that pulse away then the timer will start to timeout this is still true until these guys are the same at that point and now my timer dot Q goes off so with an off delay timer with you hit the start it change to the state of the output right away but I have to take away the input to the timer once I take away that the way the input to the timer then it starts the timeout so this is like an exhaust fan you keep an exhaust fan on for another five seconds after the machine has turned off it's a stop now it times out four five once these two values are the same then all of a sudden this guy turns off beautiful excellent hopefully that helps you with an off delay timer okay then I want you to change this to the next guy so we're gonna go offline remember that in our instructions we had let's look at our timers here we had an on delay and off delay a retentive and a pulse timer okay the next one we're gonna look at is a pulse timer the pulse timer is cool and that it just needs a quick pulse and then it will change states so watch this we're going to change this to a pulse timer okay once we've done that we've made a software change so I'm now going to download that I don't need to compile because I've always done is just change that the timer there's zero warnings beautiful go online and now we can use this same program now to look at a pulse timer okay pulse timer just needs a quick little pulse so I'm gonna hit the start and I'm going to release the start and we're would know that's not gonna work I'm gonna need a little pulse so in order to have this pulse going on and off I'm gonna have to hit the start and then hit the stop right away so watch this I'm gonna hit the start I hit the stop this is no longer true but that little pulse came through and now at times oh so what did that look like that looked like an on delay or an off delay timer let's take a look at again pulse comes in pulse is gone it takes some time and then changes state there then on delay or off delay looks like it's like an off delay timer right because it has a little pulse that comes through right and as soon as the pulse comes in then it changes the state of the output and then once the elapsed time and the preset time are the same then it changes back and revert back to the rest state they're so little pulse coming in so I'm hitting the start immediately hitting the stop that way this will be true and I mean I'm taking several like at least a second to do that right but this could be like a millisecond input into this timer here little pulse all it needs is the the rise from a zero to a one and then that positive pulse will turn the timer on so positive pulse in that thing is gone whoops and it increments up beautiful let me just zoom in one more time let's show it one more time so this is where you have just one pulse come through and you need to kind of make use of an off delay timer here so pulse comes in pulse is gone keeps incrementing up until the two values are the same and then the timer output turns off okay so most of the time you you be using an on delay or an off delay this is a cool little timer the pulse timer that you can make use of as well okay let's go offline there is one more time err to look at so none of these guys have been able to retain a value so we need this guy the on delay with the retentive timer so it's gonna mimic an on on delay timer but it's going to retain the value I need a reset push button here though so let's go back to the factory oh let's make this guy bigger and let's go to file drivers and it looks like my reset is tied into input zero - okay in put 0.2 okay so let's go back to this guy I need to drop in an input into my reset there so I'm gonna drag and drop into my reset there I'm gonna label this guy percent input 0.2 okay I've already Nitin labeled this as my reset push-button so I'm good to go I'm going to now click on the screen then I'm going to compile it just to make sure that everything's cool alright everything's good I've made a software change so I'm now going to download that to my PLC overwrite my ob1 beautiful okay and go online very nice okay so we'll take a look at this guy remember that these guys are all the same through the three wire and the division and the move have been the same and all we've been doing is literally clicking on the timer and changing it to and off delay a pulse or now a retentive timer now okay so this one should to hold the value so this one is an on delay timer so it's gonna take some time to change state the only time that it's gonna change State right here is if the preset time in the elapsed time are the same I've made a preset time of five seconds so the elapsed time up here has to be at five seconds before this guy is gonna change State okay so I'll hit the start and again it goes up to five once it gets to five then it changes the state of the timer okay if I hit the stop that's cool then the value stays at five so it retains the value remember that if we had hit the stop and this easy now and this was no longer true then we lost the value this reverted back to zero milliseconds right but right now we're stuck at the five seconds so I'm gonna hit the reset push button this is tied in with this guy right here so if I hit the reset then it should very nice bring it back to zero so now this guy and this guy are exactly the same cool okay so let's hit the start and let's stop it at like three seconds and see what happens hit the start one two three we'll hit the stop so this is no longer true and look at that we stopped at three SEC four eight nine right so this is a only showing us the integer value of three it's not showing us the milliseconds there but we stop there and it retains the value okay so we can see that the value is at three right now I'm gonna hit the start get the stop again and I go up to four seconds this is no longer this is not true yet because I need the elapsed time and the preset time to be the same so as soon as it gets to five then the timer output changes beautiful so if I hit the stop that values still there I have to hit the reset this will be true and it will bring this back to zero cool so an eight on our is able to increment up just like we had with the on delay but it retains the value in the memory here okay and that value right there is going to MW 100 that's going to QW 100 and being displayed right here so if I start again and stop then it retains this value in there if I hit the reset it goes back to zero and it's an on delay timer so it will take some tenth some time to change state so I have to increment up all the way to five and once it gets to five and the preset and the accumulated are the same then the timer cue output turns on beautiful alright guys so we've gone through all the different timers with this simple project here next week we're gonna bring everything together so we're gonna go back to doing our conveyor project and we're gonna make use of this timer like we're gonna have some some flashing lights so we want the when we hit the start we don't want the conveyor to turn on for a couple seconds until a flashing light has gone off to tell the operator that the conveyor is going to turn on so you have a week between now and the time that I going to present that information so you may want to come and see me and get the handout and that will tell you exactly the parameters of what we're going to do for next week and then you can think about it and come into class when the lab is open but there's no classes running and you can work away at it so that next week during lab you can just rock through it or you have a really good understanding you get it done and then you can help your partner to to understand it but you really need to understand all the different types of timers before we move on so make sure that you create this project have it talking to the factory I know go through the the on delay the off delay the pulse timer and now the retentive timer make sure you're cool with all those guys before we move on make sure you do not understand how to do the division and the move function and ask me as many questions as you can going through all right guys thanks for your patience hopefully that cleared everything up and hopefully we'll we'll build on this to build a pretty cool project next week all right we'll see you in the next video thanks very much
Info
Channel: Pete Vree
Views: 14,620
Rating: undefined out of 5
Keywords: plc, programmable logic controller, siemens, tia portal, ton, tof, tonr, timer, factory io, factoryio
Id: ijrm8nThVbc
Channel Id: undefined
Length: 34min 48sec (2088 seconds)
Published: Tue Feb 25 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.