# Driven Tags and Gateway Tag Change Scripts

**URL:** <https://forum.inductiveautomation.com/t/driven-tags-and-gateway-tag-change-scripts/20129>\
**Category:** Ignition\
**Created:** [October 12, 2018, 6:13pm UTC](https://forum.inductiveautomation.com/t/driven-tags-and-gateway-tag-change-scripts/20129 "2018-10-12T18:13:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteveE](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/stevee/32/14460_2.png) [@SteveE](https://forum.inductiveautomation.com/u/SteveE)\
**Post date:** [October 12, 2018, 6:13pm UTC](https://forum.inductiveautomation.com/t/driven-tags-and-gateway-tag-change-scripts/20129/1 "2018-10-12T18:13:51Z")

</div>

Hi Guys, I’ve got a timing question…

Say I have the following tags:

Tag A (Bool)  
Tags B,C,D,…Z (Whole bunch of tags)

I set up Tag A to scan every 500ms  
I set up Tags B,C,D,…Z to be driven as a one-shot from Tag A going 0 \> 1

I have a Gateway Tag Change Script that triggers from Tag A going 0 \> 1

The Tag Change Script uses values from tags B,C,D,…Z

Will the script use the latest values from the PLC (freshly driven values) or the cached values from the last drive? And will the behavior be 100% consistent?

---

<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:** [October 12, 2018, 6:49pm UTC](https://forum.inductiveautomation.com/t/driven-tags-and-gateway-tag-change-scripts/20129/2 "2018-10-12T18:49:40Z")

</div>

There’s no guarantee on any of the timing.

If you want to be sure your tag change script uses current values it should call `system.opc.readValues` for all the values it needs.

If it uses a `system.tag` call it’s going to get the current value of the tag with no guarantee it’s executing before or after the one-shot values arrived.

---

<div class="post-metadata">

**Author:** ![SteveE](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/stevee/32/14460_2.png) [@SteveE](https://forum.inductiveautomation.com/u/SteveE)\
**Post date:** [October 12, 2018, 6:53pm UTC](https://forum.inductiveautomation.com/t/driven-tags-and-gateway-tag-change-scripts/20129/3 "2018-10-12T18:53:40Z")

</div>

Excellent - thank you Kevin - man you guys are fast…
