Synchronization Question

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?

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.

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