# Update Tags and Save to Non-Database Strategy

**URL:** <https://forum.inductiveautomation.com/t/update-tags-and-save-to-non-database-strategy/61860>\
**Category:** Ignition\
**Created:** [July 13, 2022, 4:32pm UTC](https://forum.inductiveautomation.com/t/update-tags-and-save-to-non-database-strategy/61860 "2022-07-13T16:32:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Funguy](https://avatars.discourse-cdn.com/v4/letter/f/58f4c7/32.png) [@Funguy](https://forum.inductiveautomation.com/u/Funguy)\
**Post date:** [July 13, 2022, 4:32pm UTC](https://forum.inductiveautomation.com/t/update-tags-and-save-to-non-database-strategy/61860/1 "2022-07-13T16:32:11Z")

</div>

What’s the best strategy to update a lot of tags from a PLC which will then be saved to a database? The promising Strategy would appear to be a Driven Tag Group with a One Shot and Polled. However, I can’t seem to find a good way to confirm that the Tags have all updated prior to saving to the database. Using a timer delay seems inelegant and problem prone.

Thanks in advance!

Cheers, Sean

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 13, 2022, 4:37pm UTC](https://forum.inductiveautomation.com/t/update-tags-and-save-to-non-database-strategy/61860/2 "2022-07-13T16:37:42Z")

</div>

Transaction group in read mode?

[https://docs.inductiveautomation.com/display/DOC81/Understanding+Transaction+Groups](https://docs.inductiveautomation.com/display/DOC81/Understanding+Transaction+Groups)

---

<div class="post-metadata">

**Author:** ![Funguy](https://avatars.discourse-cdn.com/v4/letter/f/58f4c7/32.png) [@Funguy](https://forum.inductiveautomation.com/u/Funguy)\
**Post date:** [July 13, 2022, 4:45pm UTC](https://forum.inductiveautomation.com/t/update-tags-and-save-to-non-database-strategy/61860/3 "2022-07-13T16:45:16Z")

</div>

Thanks Kevin. I did not ask the question correctly.

I am actually using Sepasoft for the save so its a database in the background but the save is done in script…

Cheers, Sean

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 13, 2022, 4:47pm UTC](https://forum.inductiveautomation.com/t/update-tags-and-save-to-non-database-strategy/61860/4 "2022-07-13T16:47:23Z")

</div>

I’m not sure how Sepasoft has anything to do with your script, can you explain further?

---

<div class="post-metadata">

**Author:** ![Funguy](https://avatars.discourse-cdn.com/v4/letter/f/58f4c7/32.png) [@Funguy](https://forum.inductiveautomation.com/u/Funguy)\
**Post date:** [July 13, 2022, 4:57pm UTC](https://forum.inductiveautomation.com/t/update-tags-and-save-to-non-database-strategy/61860/5 "2022-07-13T16:57:13Z")

</div>

Thanks for the interest Kevin. I don’t want to write directly to the Sepasoft underlying database directly. I want to just run a script that uses some Sepasoft python functions to save the data. So I think that rules out using Transaction groups.

I think I want to minimize the number of tags being polled on the PLC or at least reduce the frequency of the polling to when I really need it. In doing so, I suspect that I should use the Driven Tags Group strategy. If I head down this path, I then need to know when the Tags have all been updated so that I can trigger my script to save the fresh data. I guess I am just trying to preemptively avoid a race situation.

I hope that makes a bit more sense.

Cheers, Sean

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 13, 2022, 4:59pm UTC](https://forum.inductiveautomation.com/t/update-tags-and-save-to-non-database-strategy/61860/6 "2022-07-13T16:59:02Z")

</div>

Hmm, well, I think the only way you can be sure the tags all updated atomically is to issue an explicit read with `system.opc.readValues`. Anything else will be subject to timing race conditions as you already suspect.

---

<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:** [July 13, 2022, 5:22pm UTC](https://forum.inductiveautomation.com/t/update-tags-and-save-to-non-database-strategy/61860/7 "2022-07-13T17:22:19Z")

</div>

I would create a buffer register in the PLC, then using some type of Synchronous Copy operation (In AB this would be a CPS instruction) copy the values into the buffer. Once that operation was complete, I would set a flag which would drive the script, insuring that the values were all in the buffer prior to being read with `system.opc.readValues()`

---

<div class="post-metadata">

**Author:** ![Funguy](https://avatars.discourse-cdn.com/v4/letter/f/58f4c7/32.png) [@Funguy](https://forum.inductiveautomation.com/u/Funguy)\
**Post date:** [July 13, 2022, 5:26pm UTC](https://forum.inductiveautomation.com/t/update-tags-and-save-to-non-database-strategy/61860/8 "2022-07-13T17:26:40Z")

</div>

Thanks Kevin. That’s the road I have been going down but just thought I would ask the Brain Trust.

Thanks Irose. I have already assured the PLC data is fully updated.

Cheers, Sean
