# Understanding Transaction Group Execution

**URL:** <https://forum.inductiveautomation.com/t/understanding-transaction-group-execution/76714>\
**Category:** Ignition\
**Created:** [July 21, 2023, 3:40pm UTC](https://forum.inductiveautomation.com/t/understanding-transaction-group-execution/76714 "2023-07-21T15:40:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Salem\_Marshall](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@Salem\_Marshall](https://forum.inductiveautomation.com/u/Salem_Marshall)\
**Post date:** [July 21, 2023, 3:40pm UTC](https://forum.inductiveautomation.com/t/understanding-transaction-group-execution/76714/1 "2023-07-21T15:40:41Z")

</div>

Goal: I have a binary OPC input that triggers whenever x is produced. I want to count how many x are produced in a minute and record that number to a database. And then reset the count for the next minute. So it would be something like:

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/c/2c378d23bfe8dbbaafacd0d055b82deda0d90034.png)

Where each record is how many x were produced in the last minute. Note that I would like to incorporate multiple tags into this table, but I am just simplifying it to explain.

What I am trying: Using a standard transaction group with event meters. I run into 2 problems:

1. If the timer is set to 1 minute, my event meter doesn't count up. I can only see the count iterating if I set the timer to 1 second. I thought tag values would evaluate regardless of the execution scheduling. I tried making an OPC item and checking "Override OPC subscription rate" but that didn't work either.

2. Is there an easy way to set the event meter to reset after each execution?

Any input is appreciated, thank you so much.

---

<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:** [July 21, 2023, 3:50pm UTC](https://forum.inductiveautomation.com/t/understanding-transaction-group-execution/76714/2 "2023-07-21T15:50:53Z")

</div>

Don't do the counting in Ignition. Do the counting in your PLC. Use a never-resetting integer tag (odometer-style). Use the transaction group to record that counter at the top of every minute. When querying the database, include one extra row beyond the bounds of the time period of interest, then use `lead()` or `lag()` in the SQL to get the deltas per minute, using a modulus to handle rollover. Sum the one-minute values when querying larger time spans.
