# Transaction Group basic functionality question

**URL:** <https://forum.inductiveautomation.com/t/transaction-group-basic-functionality-question/80760>\
**Category:** Ignition\
**Created:** [October 20, 2023, 12:39pm UTC](https://forum.inductiveautomation.com/t/transaction-group-basic-functionality-question/80760 "2023-10-20T12:39:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bogdan\_Persa](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@Bogdan\_Persa](https://forum.inductiveautomation.com/u/Bogdan_Persa)\
**Post date:** [October 20, 2023, 12:39pm UTC](https://forum.inductiveautomation.com/t/transaction-group-basic-functionality-question/80760/1 "2023-10-20T12:39:53Z")

</div>

Hi guys,

I can't seem to get the right combination of settings to create this simple functionality with a transaction group:

Monitor an OPC tag  
When it transitions high, start an hour meter  
Increment the hour meter value until the monitored OPC tag transitions to low  
Write the incremented value to the DB as a new entry, only once, when the OPC tag transitions LOW  
Any subsequent execution starts the hour meter count from zero again

Thanks for your help,

---

<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:** [October 20, 2023, 12:53pm UTC](https://forum.inductiveautomation.com/t/transaction-group-basic-functionality-question/80760/2 "2023-10-20T12:53:39Z")

</div>

Doesn't sound like a normal use of a transaction group. Consider recording timestamps and tag value whenever the tag value changes. Then your DB can tell you the duration with a `lead()` or `lag()` expression.

---

<div class="post-metadata">

**Author:** ![Siebold](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/siebold/32/47336_2.png) [@Siebold](https://forum.inductiveautomation.com/u/Siebold)\
**Post date:** [October 20, 2023, 1:09pm UTC](https://forum.inductiveautomation.com/t/transaction-group-basic-functionality-question/80760/3 "2023-10-20T13:09:34Z")

</div>

I would probably have an event on the tag for value changed and when it goes high it writes to another tag and records the datetime then when it goes back low it takes the difference in between now() and the datetime tag then writes it to the database.

---

<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:** [October 20, 2023, 1:30pm UTC](https://forum.inductiveautomation.com/t/transaction-group-basic-functionality-question/80760/4 "2023-10-20T13:30:02Z")

</div>

Use of hour meter and event meters are normal uses of a transaction group. Else they wouldn't be options. 😉

That said, they're not quite as intuitive to use.

You need to use the tag twice in the transaction group. Once as an hour meter, once as a trigger.

**My Test Tag**  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/0/700171bc9eaf097f997ab226f0a3d8c474bb293c.png)

**Tag Setup**

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/e/4ee64a8de3f42a57a20020fb13654fd274781484.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/8/a85823fbe1cc024fdfdea360af2c04ae4e2a5fd0.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/7/b75763330bb0d92e3634681c90754996e3243f07.png)

**Action Tab**

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/1/7133d59b4826a9621d19692a5e32e018db56a969.png)

**Trigger Tab.**  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/d/fd1d997c27b27d202da4e4c0b49db806c0240044.png)

**DB Table**  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/8/68931fb98b2a4494aaa84d4413e0ae31bc8fdeeb.png)

---

<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:** [October 20, 2023, 2:11pm UTC](https://forum.inductiveautomation.com/t/transaction-group-basic-functionality-question/80760/5 "2023-10-20T14:11:51Z")

</div>

> [@JordanCClark](#):
>
> hour meter and event meters are normal uses

> [@JordanCClark](#):
>
> not quite as intuitive to use.

Yeah, totally normal. Not. IMNSHO.

---

<div class="post-metadata">

**Author:** ![Bogdan\_Persa](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@Bogdan\_Persa](https://forum.inductiveautomation.com/u/Bogdan_Persa)\
**Post date:** [October 23, 2023, 1:07pm UTC](https://forum.inductiveautomation.com/t/transaction-group-basic-functionality-question/80760/6 "2023-10-23T13:07:10Z")

</div>

Jordan, I have implemented this as you suggested, but it seems it always writes a zero to db. Somehow, mine is resetting the hour meter before it can write the value to the DB. But I do see that your implementation does not. What could I be missing? Only thing I see different is that my first OPC tag in the group is the trigger, and the retentive hour meter one is second. Could this affect it?

---

<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:** [October 23, 2023, 2:49pm UTC](https://forum.inductiveautomation.com/t/transaction-group-basic-functionality-question/80760/7 "2023-10-23T14:49:27Z")

</div>

You can try swapping them, but it should be logging the _latched value_ of the hour meter.

Try it with a memory tag. If it works as it should, and not with the OPC tag, then you may have a bouncing signal.

Otherwise you can use the method outlined by others (especially @pturmel). It would be easier to maintain, in any case, as you can see how much of a pain this can be.

---

<div class="post-metadata">

**Author:** ![Bogdan\_Persa](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@Bogdan\_Persa](https://forum.inductiveautomation.com/u/Bogdan_Persa)\
**Post date:** [October 23, 2023, 3:01pm UTC](https://forum.inductiveautomation.com/t/transaction-group-basic-functionality-question/80760/8 "2023-10-23T15:01:58Z")

</div>

Seems to be working now. I put them in the order you had them in the screenshot. Thank you!
