Gantt Chart

I am wanting to track DOWNTIME from our PLC’s. I will have 6-8 PLC’s that trigger alarms using SQLtags. So i will have an active_time and clear_time. I can do a simple query to tell me how long each alarm lasted, but this does not ultimately help me on TOTAL downtime.
As you can imagine, we might have multiple alarms CURRENTLY active at the same moment in time, but the active_time and clear_time could be different.

So, here is my ultimate question:

Say Alarm1 becomes active at 12:00:00 and clears at 12:05:30
Alarm2 becomes active at 12:02:30 and clears at 12:00:06
and Alarm3 becomes active at 12:03:00 and clears at 12:04:00

How could I determine ELAPSED time from the EARLIEST active to the LATEST clear?

I would also be totalling downtime by shift(12hrs), day, week, month and year.

So in conclusion, I need to GRAPHICALLY represent this on a chart with a timeline, which is why i chose the Gannt chart, and ALSO show the total downtime (based on filtering).

Time to break out the SQL book!

I’m a bit confused, maybe you could clarify a few points.

You want the elapsed time that each alarm was active for a given shift, or you want the total elapsed time during which any alarm was active?

For totalling like that, you might want to look at the row selector component of the Reporting Plugin…

You also might want to look at the new “Status Chart” component.

Lastly - what database are you using?

How 'bout a tag that ORs the Multiple alarms? I’m thinking like an FSQL Action Item, or have it ORed in the PLC and a single OPC Tag. It may save a lot of extra FPMI coding.

For graphing, though, I think I’d agree with Carl and go with the Status Chart.

The status chart is a GOOD generalization. IF I just want to know how long the machine was down for and UP for. But, if i want to know SPECIFIC alarms and I want it represented GRAPHICALLY, then the GANTT chart is awesome.

As far as totaling my alarm times, this is what I mean:

item_name, active_time, clear_time:
alarm1, 12:00:30, 12:00:50
alarm2, 12:00:40, 12:05:10
alarm3, 12:01:00, 12:04:00

alarm1 duration was 20 sec
alarm2 duration was 270 sec
alarm3 duration was 180 sec

TOTAL time for line being down was 280 sec (i.e. alarm1 active_time to alarm2 clear_time)

I need to be able to Total MANY alarm times, but it needs to be ONLY when the line is DOWN… AND needs to show me INDIVIDUAL alarms and times. ALL graphically

Ok… I’m not seeing how the status chart won’t do that (it’ll display the status of multiple alarms just fine, but you can use the gantt chart if you want.

Was there a question in your post?

yes… lol sorry. Can you give me an example? Of how i might make that work? with say 10 alarms and where some of them overlap, as far as the time frame they were active. maybe perhaps some code snippet that will help me grasp the concept? lol

thanks in advance :wink: