# Log how long opc tag is high to data base

**URL:** <https://forum.inductiveautomation.com/t/log-how-long-opc-tag-is-high-to-data-base/98735>\
**Category:** General Discussion\
**Created:** [November 18, 2024, 1:52pm UTC](https://forum.inductiveautomation.com/t/log-how-long-opc-tag-is-high-to-data-base/98735 "2024-11-18T13:52:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joshua\_Hoekstra](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@Joshua\_Hoekstra](https://forum.inductiveautomation.com/u/Joshua_Hoekstra)\
**Post date:** [November 18, 2024, 1:52pm UTC](https://forum.inductiveautomation.com/t/log-how-long-opc-tag-is-high-to-data-base/98735/1 "2024-11-18T13:52:18Z")

</div>

Just looking for effective ways to measure the duration an opc tag is high then write results to the database. Is it better to do it in plc with timer or is there an easier way to do it in ignition with scripting or memory tags.

---

<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 18, 2024, 1:56pm UTC](https://forum.inductiveautomation.com/t/log-how-long-opc-tag-is-high-to-data-base/98735/2 "2024-11-18T13:56:57Z")

</div>

It is far more robust to simply record the transitions. Then there are a number of tools in databases to give you precise answers. And Ignition's historian has an aggregation function for similar results.
