Micro800 Timers

Home / Micro800 / Micro800 Programming

Description
Using TON and TOF timers in the Micro800 PLC.


Transcript
(00:02) all right in this video i’ll show you kind of the the steps we’re going to use and what i’ll call lab three lab three will be about timers timers are a way of delaying the action so we can use a timer to delay like so many seconds like 10 seconds um we could and there are a few different types there are there’s an on delay timer there’s an off delay timer and then there’s even one called on off so the on delay timer works in that when i energize the timer it will count up for the amount of time that is set for
(00:42) the timer and when the timer’s done timing then it’ll turn on the output the off delay timer kind of works in the opposite where it is always energized but when you de-energize it that’s when the timer starts timing and after the timer times out then it will turn off so you know um it’s a so we call that an off delay it’ll delay before it turns itself off and then the on off timer works in a manner to where the timer actually pauses if you pause the action then the timer itself would pause so the idea of this lab 3 is for you to
(01:26) just simply get a feel for how these three timers work okay i’m going to use the micro 850 simulator once again and i’m going to go ahead and show the steps this time of how to use it because you if you’re not familiar if you haven’t used the simulator i’ll show you basically how we start the simulator and how we can actually download it and use it but first i’m going to again we’re going to use the same logic we already created for lab two so we don’t need to worry about re recreating the logic here but what i want to do first is i want to
(02:02) add an on delay timer to delay the start of the pump so this the premise of this will be when i press the start switch i’m going to delay 10 seconds before i turn on the pump and that’s a pretty common occurrence we might want to delay the start maybe uh you know we might want to push the button and walk away um you know give ourselves 10 seconds to get out of the out of the area maybe we want to you know sound a horn and alert the operators that hey you know within you know in 10 seconds this thing’s going to start right so
(02:35) back off so there’s plenty of reasons why we might want to delay the start of something um so to do this it’s going to be pretty simple i’m i’m offline right now i have the white background so that tells me that i’m offline and up here in the uh in the menu bar of this of this window that we’re in we have a few you have all these different things by uh typically you start here with favorites and the favorites you had the add a new rung the branch the normally open normally close and the coils but we have a bunch of other
(03:08) instructions here that we haven’t even begun to explore so math compare move copy trig logical etc but we’re going to move down to timers and counters i’m just going to click on that when i clicked on timers and counters then the um a new set of instructions showed up right here now i left new new rung and a branch but it it took away the normally open normally closed contacts etc and brought these things so each one of these guys has a they’re kind of acronyms and for for something these are actually the instructions
(03:45) names themselves so we have counters and then we have t’s for timers so we’re going to work with counters a little bit later but we’re going to work with timers first so i have a tof a t o n and a t on off so tof is the off delay ton is the on delay and the t on off is the on off delay so i’m going to click on to in and when i did that it dropped it into this first rung now the other way i could have done that if i delete that real quick is if i would have just held my mouse uh my left mouse down on ton and i could
(04:26) have just dragged it i could put it wherever i want for this lab we’re going to put it right behind the stop switch but of course before the coil so now we have a t-o in underscore one and t-o-n now the ability that the the to to configure this timer is actually very simple we are going to uh in this pt and the the pt the p stands for preset and the t stands for timer the so there’s a few there’s a few pins on this block we have an n which of course is whenever whenever this logic here is true this timer gets energized all right
(05:11) and then the q the q stands for the output so that would be the output of the timer which would basically flow to the next element here on this rung so we will put whatever logic you know whatever logic we want to to start the timer will will be brought into this into the n pin then we have a pt and an et the pt stands again for preset uh preset timer preset value uh and the et will stand for elapsed time so this actually will show you what is the elapsed time of the timer once the timer starts timing so in this case we’re going to set it to
(05:57) 10 seconds so so when the timer gets activated we can watch it actually count up to 10 seconds using this et box we can actually use this in the program too so if we wanted to display the timer somewhere like on a touch screen we can actually read the value of that as a tag and we can display that and use it somewhere else in the program we don’t have to program anything in that et box it’s just going to be a value that timer generates we do need to set the preset timer because we need to know what is the time
(06:36) what is the length of time that we’re going to um make the timer we have to tell it then so the premise i think is 10 seconds so we’ll make it a 10 second timer 10 seconds it’s kind of good because it’s not too long for you to have to sit there and wait for it but it allows you to kind of have some time to watch what’s going on you can set these things to you know orders of milliseconds to seconds to minutes to hours um so you know we don’t want it to be you know three hour timer for for our labs because that will just take forever to to watch it
(07:11) run so we’ll set the seconds so timers for the micro 800 and this would be one of those things too that you know each plc manufacturer and uh does the timers all of a different way they all work in the same manner but they kind of you know do the do this part of it just slightly different so for the microwave 20 the uh the syntax that you actually will put into into here is actually in this upper box when i click clicked in this upper box it gave me a kind of a pull down i could put a tag in here um i’m going to put a constant but to make
(07:50) it a timer constant i’m going to put a t and i’m going to put a hashtag or the pound symbol depending on how you refer to that and then i’m going to put the value 10 but last piece here is i have to put the base what what is the base again i have many options i could put an s and that will make it seconds if i put an m that will make it 10 minutes if i put an h i believe it’ll make it be 10 hours so we want to we have to specify the base so all i’ve got to do is put an s and that will make it a 10 second timer i hit enter when i hit enter
(08:37) this box is green and we have the the text is blue indicating it’s a constant and it just says t 10 s okay and again this box can stay empty that’s it that’s it so what’s going to happen now is when i when i press the start switch this will start timing for 10 seconds once the timer is done the pump will turn on so let’s actually watch this in action so again we’re going to use the micro 800 simulator so to actually start the simulator you’re going to come here to tools and you’re going to choose micro800 simulator
(09:24) and that will actually open the simulator now back up a second if you are doing this and if you are going to use a simulator you actually when we when we created the project we had to choose the micro850 simulator as the device if you kinda if you created your logic and you you use the micro820 as your uh device then you have to kind of go back and make it the micro850 simulator otherwise it will not work you can’t download to the simulator if you didn’t tell it to be that the simulator is part of its configuration
(10:09) now this brings up the simulator it looks like a micro850 plc two things have to happen here before we can actually download one verify the ip address mine says 127.0.0.1 yours may be the same it may not um but if you hit the pull down it’s important to make sure that it is set to the one that says software loopback interface one here we don’t want to be tied to the ethernet connection or the or the wireless card these are my uh these are my nic cards that are actually in my laptop we want to be tied to this software
(10:50) loopback interface so mine is 127.0.0.1 yours could be different or it could be the same and the second step is we have to start we actually have to start the simulator so the on off button right here it is on the pi it’s when it’s first powered up or when we first open up the simulator it is powered off so we need to power it on so it just gives us a warning so it’s only going to run for 10 minutes which is you know one of the limitations of the um of the free version of the software so we know that it’s running now because
(11:25) this turned green and i have a power light on my plc and i got some you know thing blinking here and i actually do have my run light on because i had a program in the simulator already okay so we got this uh set so now it’s time to download um i if uh you know so just to show you that when i came back to my micro 850 uh kind of simulator page i had a connect button here but i already have my path set so if you had not i’m going to clear the path out and i’m going to hit connect so i want to show you how to set the path to the simulator if
(12:09) you haven’t done it before so when i hit connect it pulls up this rslinks kind of uh tree and you see i have a bunch of options here but one of the options is ethernet emulate ethernet and i’m going to ex kind of just expand the the the triangle there and now it shows 127.0 to 0.1 and it says it’s a 2080 lc50 and it’s a microwave 50.
(12:38) that happens to match what i set it to on the emulator before i started it i should note that once i started the in the simulator i cannot go back and change this ip address so if you didn’t set this right you have to stop the simulator you might actually power down completely bring it back up and then um you can change your ip address so i’m going to choose that as my path i’m going to hit ok so at the moment it is actually connecting to the simulator and it will pop up a window in a second and ask me do i want to download do you
(13:15) want to download the current project i’m going to say yes it’s going to probably prompt me one more time in just a moment yep do you want to download i’m going to say yes notice that down here there’s a little um a running scroll of what’s going on if there’s any kind of errors or faults or syntax errors i’ll get that right so one succeeded zero failed so any errors would pop up down here in in this output window they call it and then the next pop-up says hey download is complete do you want to change it back to remote run state and
(14:03) i’m going to say yes because that will now put it back into run mode and it just says um you can only run for 10 minutes basically and that’s fine that’s plenty of time for us to do what we need to do so i’ll pull the simulator back up you’ll see that uh i am powered and i am running and here is the logic now so the logic is uh is um so i am connected again the background is now yellow that indicates that i’m actually connected it does say that i’m connected here so that way we know that we are connected controller you can
(14:37) see that also my stop switch is showing as red you can see that this is in red two so this is the elapsed time which will show in red and the fact that it’s red means that it’s a live number and it’s going to actually update on the screen um you know with live data so let’s test out our circuit right so again when i press the start switch i’m going to delay 10 seconds before i turn the pump on now in this case i’m going to start to push this i’m going to select the start switch and keep it on so i’m going to show you why here in a second
(15:14) so i activate the start switch that brought power to the timer the timer is now counting so you see we’re at 5 6 7 8 9 10 and then after 10 seconds that came on and of course when that energized so did my pump running light okay now i’m going to turn that off so if i turn off the input i still keep the timer up and the output on because i have my latch circuit going and next step is i’m going to hit the stop switch and basically reset the timer so when i do that the timer gets reset now i want to show you what happens i
(16:00) want you to experiment with this too when i press the start switch if i stop it if i took if i if i turn off the start switch look what happens the timer goes back to zero okay so the timer will basically clear if it doesn’t make it all the way to 10 seconds if something happens to whatever the the condition here if this goes back to false or off the timer goes back to zero we have to start the timer all over again so when i press start again we’re going to start counting one two three now this will lag slightly
(16:41) just because of the connection to this to the device but there we go so 10 seconds okay so the exercise here i’m going to disconnect the exercise here is to try the three different timers and see how they work so this is the on delay we will use an off delay so i can i can cut this out and i can put the off delay right here in its place the off delay it looks exactly the same as the on delay we will put a 10 rsrt 10 s as well to make it a 10 second timer but the difference now is is that when i press the start switch the pump will
(17:30) immediately turn on but when i press the stop switch it will delay 10 seconds before it turns off and i’ll go ahead and show that to you let’s go ahead and do that real quick this will take a moment to reconnect to download again so we’ll choose to download to the controller take another moment he’ll ask me once again do you want to download i’ll say yes and after the download is done it will prompt you one more time do you want to put it back in run mode and i’ll say yes it’ll run for 10 minutes so we’ll pull up our simulator screen
(18:34) and in just a moment it’ll pull up the logic all right so now we uh we have our our we’re connected again we have our object showing i’m going to hit the start switch now just like i said the pump turned on immediately now when i press the stop switch that will take away this will make this part false that’ll make the timer turn off essentially and then we will start counting 10 seconds but this output here will remain on until this timer is done so let’s just watch that in action so we’re counting four five six seven eight nine ten
(19:31) and there went so every ten seconds it turned off now let’s look at the same condition what happened like we tested before so i turn on the i turn on the pump and what happens now if i press the stop but then i take my finger back off so that the timer actually paused and or i should say it it stopped and it cleared uh reset itself but the output is still on so the output just like that just like the on delay timer um you know resets itself if you if you change its state midway through this off delay does the exact same thing so to
(20:12) keep to turn this pump off this this thing has to stay off for the full 10 seconds so i’m going to go ahead and put the stop switch back on now this this statement is false timer is not energized after 10 seconds the pump turned off now i can turn off the turn off the uh the stop input okay so that’s on delay that’s off delay and then the third one will be the on off delay and i’ll let you experiment with that basically the on off delay means that if you were to lose your stop switch halfway through the 10 seconds
(21:01) then the timer actually pauses at that point and when you turn this on switch back on it’ll continue uh it’ll continue timing from the point that i got that it left off at so it retains its value basically so you don’t have to start back again from zero in the timer all right um and then once you’re you’re finished with this lab you can um disconnect from the simulator and uh if you to just basically take a screenshot of each time you you do this um if you’re connected online with the simulator or your real controller then
(21:40) that would be that’d be great show me that connection and just send me the screenshots of the three timers