# How to make a totalizer?

**URL:** <https://forum.inductiveautomation.com/t/how-to-make-a-totalizer/52935>\
**Category:** Ignition\
**Created:** [November 10, 2021, 7:11pm UTC](https://forum.inductiveautomation.com/t/how-to-make-a-totalizer/52935 "2021-11-10T19:11:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_King](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@Alex\_King](https://forum.inductiveautomation.com/u/Alex_King)\
**Post date:** [November 10, 2021, 7:11pm UTC](https://forum.inductiveautomation.com/t/how-to-make-a-totalizer/52935/1 "2021-11-10T19:11:52Z")

</div>

I have an OPC float tag that is displaying a GPM reading from a flow meter. I want to create a totalizer for the GPM and make it reset to 0 when a different tag becomes true. Any ideas?

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [November 10, 2021, 7:50pm UTC](https://forum.inductiveautomation.com/t/how-to-make-a-totalizer/52935/2 "2021-11-10T19:50:35Z")

</div>

Are you sure your meter doesn’t have a point for the cumulative flow? If it doesn’t then you would need to know the interval at which it provides the current flow rate, and then calculate the volume. Assuming it is reporting every second it would be something like the number representing flow rate (Gallons per minute), multiply it by 1 second. Divide the result by 60.  
You could do this with an expression tag, and set a use a tag change script triggered by your reset tag to zero out your volume tag.

---

<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:** [November 10, 2021, 7:58pm UTC](https://forum.inductiveautomation.com/t/how-to-make-a-totalizer/52935/3 "2021-11-10T19:58:40Z")

</div>

This should be done on the PLC side. Any timing on the ignition side will be delayed from the actual reading and it will not be as accurate.

---

<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:** [November 10, 2021, 8:03pm UTC](https://forum.inductiveautomation.com/t/how-to-make-a-totalizer/52935/4 "2021-11-10T20:03:19Z")

</div>

A better solution would be to store your values in a database, then use the database to do your calculations. A couple of blasts from the past:

> [@Creating a tag that records a cumulative total of parts being made in a shift, storing it at the end of the shift and then resetting it to 0](https://forum.inductiveautomation.com/t/creating-a-tag-that-records-a-cumulative-total-of-parts-being-made-in-a-shift-storing-it-at-the-end-of-the-shift-and-then-resetting-it-to-0/50521/2):
>
> Store each box weight in the database. You can then query the database for total production, or production on one side or the other, what time each box is completed, etc.

> [@Logging flow totals](https://forum.inductiveautomation.com/t/logging-flow-totals/9525/2):
>
> Personally, I’d go with a transaction group. That way, if you happen to lose connection to the database, the Store and Forward engine will hold the entries for you until it restored. Just my 51-cent’s worth (adjusting for inflation). wink

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [November 10, 2021, 8:07pm UTC](https://forum.inductiveautomation.com/t/how-to-make-a-totalizer/52935/5 "2021-11-10T20:07:12Z")

</div>

> [@JordanCClark](#):
>
> A better solution would be to store your values in a database

Agreed, though im surprised the flow meter doesn't already totalize, the flow meters i have for our hydronic system do this out of the box.

---

<div class="post-metadata">

**Author:** ![Alex\_King](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@Alex\_King](https://forum.inductiveautomation.com/u/Alex_King)\
**Post date:** [November 10, 2021, 8:12pm UTC](https://forum.inductiveautomation.com/t/how-to-make-a-totalizer/52935/6 "2021-11-10T20:12:43Z")

</div>

Sadly we don’t have the capability to do this on the PLC side. The unit came as a package deal and has an odd PLC that we don’t have the software for.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 11, 2021, 1:47pm UTC](https://forum.inductiveautomation.com/t/how-to-make-a-totalizer/52935/8 "2021-11-11T13:47:08Z")

</div>

You _ **really** _ need to do this in the PLC. Really. Buy that software. Spec your desired PLC for future purchases.

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [November 11, 2021, 5:15pm UTC](https://forum.inductiveautomation.com/t/how-to-make-a-totalizer/52935/9 "2021-11-11T17:15:12Z")

</div>

@Alex_King what kind of PLC is it?

---

<div class="post-metadata">

**Author:** ![Arnaud\_Declerck](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/arnaud_declerck/32/44872_2.png) [@Arnaud\_Declerck](https://forum.inductiveautomation.com/u/Arnaud_Declerck)\
**Post date:** [November 11, 2021, 7:02pm UTC](https://forum.inductiveautomation.com/t/how-to-make-a-totalizer/52935/10 "2021-11-11T19:02:25Z")

</div>

@Alex_King even if i agree with @JordanCClark and @pturmel. I’ve made a ressources on the ignition platform that would do what you want. This will need first to be validated by the IA team. I can post a link when it’s done.

---

<div class="post-metadata">

**Author:** ![Arnaud\_Declerck](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/arnaud_declerck/32/44872_2.png) [@Arnaud\_Declerck](https://forum.inductiveautomation.com/u/Arnaud_Declerck)\
**Post date:** [March 2, 2022, 6:27am UTC](https://forum.inductiveautomation.com/t/how-to-make-a-totalizer/52935/11 "2022-03-02T06:27:26Z")

</div>

@Alex_King,

it has been a long time ago , but here is the flow totalizer ressource on the exchange

> **[Ignition Exchange](https://inductiveautomation.com/exchange/2238/overview)**
>
> Discover, share, and download community made Ignition resources in collaboration with your organization or the Ignition community.

Regards
