Sign in to follow this  
Followers 0
fcflores1

Downtime Help!

13 posts in this topic

Hello, I recently installed a Keyence Micro meter to an existing machine with Allen Bradley controls and I need to be able to store downtime in the event of a power loss. I currently have some experience with S: 1/15 (First Pass) and S: 37-42 bits; but I don’t know how to utilize them correctly to get me what I want. I want to able to store downtime, compare it to the current time and if im greater than an hour fault the machine out. I played with the idea on utilizing an input but I don’t want to use I/O if I don’t have to. Slc 5/04 Thank you

Share this post


Link to post
Share on other sites
Are you referring to PLC downtime or meter downtime?

Share this post


Link to post
Share on other sites
First question, can you use the current PLC program to determine when the meter is offline? If you have some way of detecting when the meter is offline, you can capture the current PLC time, and then when the meter comes back on line, compare the saved time to the current time and take action if greater than your tolerance. Easier to implement would be a retentive TON, when the meter goes offline, start the timer. When the meter comes back, see if the timer accumulated value is greater than 30 minutes, set your fault bit. Don't forget to reset the timer.

Share this post


Link to post
Share on other sites
I guess I need to explain myself better. When the machine looses power for any reason; I want to be able to capture "time lost" during power failure and compare it to "current time" once the processor is in run mode. Then I can calculate what action to perform. Thanks.....

Share this post


Link to post
Share on other sites
I do believe that the SLC clock will run on battery power when power supply power is off. Under that assumption, you could simply store the PLC clock every scan except first scan. During first scan, you can calculate the difference between those stored, non-volatile values you had saved and the current PLC time to find out how long power was off.

Share this post


Link to post
Share on other sites
If I'm following, you need the PLC to keep track of how long the main power has been shut off during a power failure. I would assume, then, that the PLC is running off a UPS? Couldn't you just turn on an input based on the status of the main (not UPS) power, and trigger a timer from that?

Share this post


Link to post
Share on other sites
Okie's solution should work very nicely but exactly how accurate to you need to be? The SLC will continue to run off the capacitors for a short time. I think those values are posted somewhere but don't have time to look right now. If you need to know the instance add an input as Gravitar suggested. The SLCs program will continue to run long enough to log the time. I think is its somewhere aroung 100-250ms so no UPS will be required to do this

Share this post


Link to post
Share on other sites
I still must be totally misunderstanding. I thought he needed to close an output when the main power is lost for a certain amount of time, to tell something else that the machine is faulted. you would need some backup means of power to keep the micro alive during the time that main power is off.

Share this post


Link to post
Share on other sites
Okie's method is what I want to do; I just dont know how. How would I let the processor know that I lost power and to immediatly store my information? I want to acomplish this without using any additional I/O. The reason for this madness is for... When the machine losses power and the "acc. time" is greater than an hour upon "Start up"; the Keyence micro-meter requires 30 min to warm up. (In order to function correctly) Edited by fcflores1

Share this post


Link to post
Share on other sites
If i understand you correctly then the attached example should help I have done this quickly so there may be errors in it, i am tired and need some food and wine! It is UNTESTED. If the power is off for 30 minutes or more (and your battery is good in the plc!! Then Bits B50:0/0 or B50:0/1 will be LATCHED I have not done any logic to UNLATCH these, use these bits in your software to take appropriate action and then UNLATCH them Like i said untested and tired but it will get you started 30MinutePowerDetect__2_.zip Edited by 504bloke

Share this post


Link to post
Share on other sites
The code walk through shows me some bugs - Maybe better coding after lots of wine I find Time and date stuff requires lots of blood sugar and a clear head (no wine) fcflores1 It all depends on your needs I read that you are trying to reduce the startup time after a power failure otherwise you will always wait 30 minutes before using the meter I assume that the site could be 24 hour operation and people go on holidays so code must cope with 1) hour rollover Time 10:59 AM power off Time 11:01 AM Power on - within 30 minutes Calculates 2 minutes 2) day rollover Time 23:59 power off Time 01:01 AM Power on Calculate 62 minutes power off 3) month rollover - easy to add as coping with day rollover Adding Month to the day rollover lets us cope with 30 days of power off 30MinutePowerDetect.zip

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