# Synchronization Question

**URL:** <https://forum.inductiveautomation.com/t/synchronization-question/99641>\
**Category:** Module Development\
**Tags:** vision, scripting, ignition80\
**Created:** [December 10, 2024, 5:03pm UTC](https://forum.inductiveautomation.com/t/synchronization-question/99641 "2024-12-10T17:03:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Noah\_St\_Mark](https://avatars.discourse-cdn.com/v4/letter/n/7ab992/32.png) [@Noah\_St\_Mark](https://forum.inductiveautomation.com/u/Noah_St_Mark)\
**Post date:** [December 10, 2024, 5:03pm UTC](https://forum.inductiveautomation.com/t/synchronization-question/99641/1 "2024-12-10T17:03:58Z")

</div>

Hi Everyone,

I am creating a module and ran into an issue where I may need to use synchronization. On some _TagChangeListeners_, Before I proceed with this implementation, I would like to understand how Ignition handles a `runScript()` method call like this:

`runScript("project.devices.getVTISDeviceStateColor(" + tag({Root Container.DeviceTagPath} + '/Status/Status') + "," + tag({Root Container.DeviceTagPath} + '/Faulted') + ")"))`

The method needs both values to function correctly, and from what I can tell, it does. However, I am concerned about what happens if the `tag()` method calls are out of sync. Does it just pass a `-1` to my method? I have observed this behavior, but only after the initial call.

Can anyone explain how Ignition handles potential synchronization issues with `runScript()` and `tag()` method calls? Are there best practices to ensure both values are available before the method executes?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [December 12, 2024, 3:46pm UTC](https://forum.inductiveautomation.com/t/synchronization-question/99641/2 "2024-12-12T15:46:53Z")

</div>

> [@Noah\_St\_Mark](#):
>
> tag({Root Container.DeviceTagPath} + '/Status/Status')

> [@Noah\_St\_Mark](#):
>
> Are there best practices to ensure both values are available before the method executes?

This has come up in the forum enough to say the consensus is to **not do this** because the `tag` expression is reserved for use inside expression tags. Inside a window, use either a direct or indirect tag binding on a custom prop, and then, reference the custom property value wherever it's needed.

---

<div class="post-metadata">

**Author:** ![Noah\_St\_Mark](https://avatars.discourse-cdn.com/v4/letter/n/7ab992/32.png) [@Noah\_St\_Mark](https://forum.inductiveautomation.com/u/Noah_St_Mark)\
**Post date:** [December 12, 2024, 4:04pm UTC](https://forum.inductiveautomation.com/t/synchronization-question/99641/3 "2024-12-12T16:04:09Z")

</div>

After taking a step back and analyzing my system, I realized that in the designer, `tag()` requests the tag regardless of whether it has changed, whereas a `TagChangeListener` only triggers when the tag actually changes. By understanding this distinction, I was able to adjust my module to behave as intended. Thank you for your response
