How to tell when to stop accumulating downtime

I know this is probably a real stupid question, but I have an application that displays line downtime and graphs each piece of equipments down time to allow users to drill down to determine what faults are causing the most problems. I show an overall down time for the line and then by each piece of equipment, then by fault. The problem I am having is that in calculating down time active_time - clear_time. All the time when the line is shut down in the evening is being added as well. There is no specific shutdown time for the line and each piece of equipment continues to run until all products on the line have been processed. Is there a good way to resolve this, or do I have to monitor some bit on the equipment to trigger when to exclude the data?

Your challenge is a classic overall equipment efficiency (OEE) problem.

I think the short answer to your question is “Yes.” You would need additional information, such a machine’s power-on status or a schedule, to determine when the machine should be running. In most cases, a single status bit doesn’t tell the whole story. You may have to look at more that one status bit to truly discern when the machine should be running but isn’t because of some fault or error.

You could have the operators indicate operational status from the HMI. However, this is analogous to the fox watching the hen house.

An imperfect but effective method is to assume a “fixed” schedule (e.g., 7am - 4pm) and only look at uptime/downtime during that time. No, it doesn’t capture all the information, but it is consistent and, if the schedule is defined judiciously, is likely to lose only marginal information. The big advantage of this approach is that it is consistent so, for the most part, you can compare apples to apples.

Hi Ron,

Could you explain a bit more how is your downtime tracking works right now? It sounds like you’re using the alert log a lot- are you tracking faults and then calculating downtime? Do you have any other operational data coming from the machine right now? Like an “is running” bit or anything? Is the main problem that you’re running into due to the alert staying active even after the machine is turned off?

There are a variety of configurations that people normally use to track downtime- sometimes based on time shifts, sometimes based on a log of when the machines were running or not, sometime with actual downtime information from the plc. For example, you might have two groups that operate on the same “downtime tracking table”. Both groups trigger off of an “is down” bit from the device- one inserts a new record when the machine goes down, the other updates the new row with an hour meter item to keep track of how long it was down. Later on an operator can assign a cause to the down time, which usually just updates the row with a fault id from a lookup table. There are obviously many variations of this, but the key point is that there is usually additional downtime specific information available.

I suppose if you did nothing else you could track a start and end time for when the machine should be running, like they hit “start” in the morning and “end” at night, so you could at least cap your calculations to those times.

Hope this helps a bit,

Hi Colby,
Currently I have a view that looks at the alert log and returns the sum of the difference between active_time and clear_time for each device for each alert.

We don’t have anything other than the fault data coming from the machines right now, but I’ll check with the packaging department to see if there is a “running” bit or something like that. It sounds like that is what I will need to track when we need to calculate the data.


I now have a bit that tells me when the machine is put into automatic operation mode. I want to use this to tell me when to use the information, but was not exactly sure how.

Is there a way to only log information on the machine when this bit is set. Something like adding an action item in FSQL for the OPC items that I am alerting on to only alert when the automatic operation mode bit is set.

I think it would help to get a better idea of what you ultimately want to achieve/calculate. I’ll ask some dumb questions to help me to understand.

What do “active_time” and “clear_time” represent exactly?

I assume you’re trying to calculate some measure of up-time versus down-time. Something like the amount of time a machine is down as a percentage of the time in “automatic operation.” Is this correct?

That’s what a trigger (your bit) does when Only execute group once when trigger is active is unchecked.

Sorry about abandoning this link. I got pulled off this project and am now moving back into this area.

If I understand Nathan’s post, does that mean that I can set the group to trigger on a machines “running” tag and all tags in that group will only write to the database when that tag is set to high?

MickeyBob, you are correct in what I am trying to accomplish. Active_time is when a particular fault occured and clear_time is when that fault cleared. The difference between the two is my amount of downtime attributed to that fault.

Yes, Nathan is correct.

Add the “Running” tag to your group.
On the “Trigger” tab within Factory SQL check the “Execute this group on a trigger” box.
Select your item in the “Trigger on item” drop down.
Set “Trigger Conditions:” to >0

When ‘Running’ = 1 this enables the group and is executed at the update rate on the “Action” tab.

When ‘Running’ = 0 this disables the group and all execution stops.

Great. Thanks for the info. It was very helpful.