# Gantt Chart

**URL:** <https://forum.inductiveautomation.com/t/gantt-chart/1171>\
**Category:** Archived Topics\
**Created:** [June 1, 2009, 7:02pm UTC](https://forum.inductiveautomation.com/t/gantt-chart/1171 "2009-06-01T19:02:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris\_d\_sanders](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/chris_d_sanders/32/3359_2.png) [@chris\_d\_sanders](https://forum.inductiveautomation.com/u/chris_d_sanders)\
**Post date:** [June 1, 2009, 7:02pm UTC](https://forum.inductiveautomation.com/t/gantt-chart/1171/1 "2009-06-01T19:02:39Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [June 2, 2009, 3:33pm UTC](https://forum.inductiveautomation.com/t/gantt-chart/1171/2 "2009-06-02T15:33:46Z")

</div>

Time to break out the [SQL book!](http://www.inductiveautomation.com/forum/viewtopic.php?f=23&t=4291)

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?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [June 2, 2009, 5:10pm UTC](https://forum.inductiveautomation.com/t/gantt-chart/1171/3 "2009-06-02T17:10:06Z")

</div>

> [@chris\_d\_sanders](#):
>
> 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?

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.

---

<div class="post-metadata">

**Author:** ![chris\_d\_sanders](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/chris_d_sanders/32/3359_2.png) [@chris\_d\_sanders](https://forum.inductiveautomation.com/u/chris_d_sanders)\
**Post date:** [June 16, 2009, 6:15pm UTC](https://forum.inductiveautomation.com/t/gantt-chart/1171/4 "2009-06-16T18:15:11Z")

</div>

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

So:  
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

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [June 16, 2009, 8:18pm UTC](https://forum.inductiveautomation.com/t/gantt-chart/1171/5 "2009-06-16T20:18:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![chris\_d\_sanders](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/chris_d_sanders/32/3359_2.png) [@chris\_d\_sanders](https://forum.inductiveautomation.com/u/chris_d_sanders)\
**Post date:** [June 17, 2009, 1:14am UTC](https://forum.inductiveautomation.com/t/gantt-chart/1171/6 "2009-06-17T01:14:47Z")

</div>

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 😉
