Sign in to follow this  
Followers 0
hboyer90

Down time timer in RSLogix 500

6 posts in this topic

Hello, I am trying to capture my downtime on one of my machines. I'm using a MicroLogix 1100 running RSLogix500. A part is produced every half second or so on this machine. There is a bit that goes true every time that a part is produced. I have the logic set up so that the 'part produced' bit is an input in line with a TOF. The preset of the TOF is 5 seconds. So, if the 'part produced' bit goes true and then false, the TOF starts to time. Now, if the machine is running, it will go true again within .5 seconds, resetting the TOF, and the whole processes starts again. If a part has not been produced for 5 seconds, then the TOF done bit goes true, which I have latching on a "down time bit". As soon as another part is produced, I have the "down time bit" unlatching. So, anytime that the machine has not produced a part for 5 seconds, a "down time bit" goes true. I then have the "down time bit" as an input in line with an RTO which I made the time base 1 second. So, every time the machine is down for more than 5 seconds, the RTO starts timing, and even when the machine starts running again, the RTO retains it's accumulated count. I then have that accumulated count being moved into an integer so that i can manipulate it and view it how I so please. I have the RTO being reset every shift change (every 8 hours). My question is how can I manipulate the RTO count, which is in seconds, and convert it into hours and minutes? I suppose i could just divide the number by 60 to get minutes, and the minutes my 60 to get hours, but is there a clean cut way that I can have it convert to hours, and then take the remainder and convert to minutes, and take the remained and put it into seconds? For example, if the seconds were 7320, I dont want it to say: 2 hours, 122 minutes, and 7320 seconds, I would want it to say 2 hours, 2 minutes and 0 seconds. Any help would be greatly appreciated. Thanks!

Share this post


Link to post
Share on other sites
Read the Micrologix instruction manual (1763-rm001-en-p.pdf) for the DIV instruction. I quote the relevant part here.

Share this post


Link to post
Share on other sites
Awesome, thank you.

Share this post


Link to post
Share on other sites
So I ended up just making a timer that counted up to 60 seconds, once it got to 60 seconds the done bit went true and a counter increased by one, and also the timer reset it's self. Once the counter got to it's preset of 60, it's done bit went true and counted up on another counter (my hour counter) and also reset it's self. I was over thinking the whole dividing the current seconds thing, all I needed was one timer and two counters. Thanks for the help though!

Share this post


Link to post
Share on other sites
This is close to how I do it...cascading registers (Secs, Mins, Hours, Days) with a SECS timer. A SECS timer, when it times out to 59, then increment the MINS register; when MINS register = 59, increment the HOURS register, when HOURS register >= 24, increment the DAYS register. You can apply this to both UPTIME and DOWNTIME. Keep in mind techincally the PLC is counting 0-59 secs which is 60 seconds; likewise with minutes.

Share this post


Link to post
Share on other sites
You can make it even simpler by forgetting about the counters altogether, and just using an ADD instruction: [edit: looks like will got in quicker :)] Edited by ASForrest

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0