# Flow Totalizer on 15 min increments

**URL:** <https://forum.inductiveautomation.com/t/flow-totalizer-on-15-min-increments/105791>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [May 1, 2025, 5:16pm UTC](https://forum.inductiveautomation.com/t/flow-totalizer-on-15-min-increments/105791 "2025-05-01T17:16:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zachary\_Kacel1](https://avatars.discourse-cdn.com/v4/letter/z/ea666f/32.png) [@Zachary\_Kacel1](https://forum.inductiveautomation.com/u/Zachary_Kacel1)\
**Post date:** [May 1, 2025, 5:16pm UTC](https://forum.inductiveautomation.com/t/flow-totalizer-on-15-min-increments/105791/1 "2025-05-01T17:16:21Z")

</div>

I am trying to build a totalizer I have never built one before.

Engineering only needs 15min resolution so I am summing up the GAL used every 15min then incrementing a counter to trigger ignition to save the value to SQL using a Transaction Group. It was requested I make the datapoints fall on the 15min increments throughout the day. Right now I am using a TON so the intervals I track at might be 2:03 - 2:18 - 2:33. How can I make a totalizer based on the time in the hours so it will track 2:00 - 2:15 - 2:30

Any help or tips on this are welcome.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/c/8c2125e996d1b73aa1856adf907fc1b6c9ca2994.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/1/417777cd08b72a0c690e3cc5271b2a59a7f9cc87.png)

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [May 1, 2025, 5:29pm UTC](https://forum.inductiveautomation.com/t/flow-totalizer-on-15-min-increments/105791/2 "2025-05-01T17:29:15Z")

</div>

Record them on the minute in the PLC and include the timestamp. Hand it off to Ignition with the value and timestamp, and insert the timestamp into the table with the value.

As @amarks mentioned below, you'll want your PLC time to be synced.

On PLC side, you can make an on change logic looking at the internal clock's minute value, and record whenever the value changes to increments of 15.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [May 1, 2025, 5:29pm UTC](https://forum.inductiveautomation.com/t/flow-totalizer-on-15-min-increments/105791/3 "2025-05-01T17:29:20Z")

</div>

First, you'll want to sync your PLC time with the Ignition server. I use a gateway script to sync it daily.

Second, I would have a operator setpoint value 0-14 that would signify the "first" log time for the hour and then trigger the transaction group at that value, that value +15, +30, +45, then restart.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 1, 2025, 6:42pm UTC](https://forum.inductiveautomation.com/t/flow-totalizer-on-15-min-increments/105791/4 "2025-05-01T18:42:02Z")

</div>

> [@Zachary\_Kacel1](#):
>
> I am summing up the GAL used every 15min then incrementing a counter to trigger ignition to save the value to SQL using a Transaction Group.

1. There's no need to signal Ignition to read the PLC. Ignition can schedule that itself either using a transaction group or a gateway scheduled event. It would be simpler.
2. Log the **non-resetting total counter value** every 15 minutes. You can then easily get the difference between any two timestamps (15 minutes apart or years apart) without having to add up the individual readings. It will also mean that you won't lose data if the gateway or comms fails for a period of time. (You won't be able to know what happened during the breakdown but you'll be able to calculate the total and average for the period.)

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [May 1, 2025, 6:53pm UTC](https://forum.inductiveautomation.com/t/flow-totalizer-on-15-min-increments/105791/5 "2025-05-01T18:53:50Z")

</div>

> [@Transistor](#):
>
> gateway scheduled event

Just a note that, for this method to work correctly, you will need to use `system.opc.readValues()`, if you use `system.tag.readBlocking()` you are _not_ guaranteed to get the "real" value at that time.
