Trigger script Tag value change


I have script to generate xml file:

from xml.etree.ElementTree import ElementTree
from xml.etree.ElementTree import Element
import xml.etree.ElementTree as etree
import xml.etree.cElementTree as ET

value1 =“Torque/Torque_IP033/LTR_TIMESTAMP”).value
value2 =“Torque/Torque_IP033/LTR_TORQUE_STATUS”).value
value3 =“Torque/Torque_IP033/LTR_TORQUE_VALUE”).value
root = ET.Element(“root”)
doc = ET.SubElement(root, “doc”)

ET.SubElement(doc, “Date”, name=“Today”).text = str(value1)
ET.SubElement(doc, “Torque”, name=“Status”).text = str(value2)
ET.SubElement(doc, “Torque”, name=“Status”).text = str(value3)

tree = ET.ElementTree(root)

I would like to run this script every time the time stamp value change. I can run it on the button trigger but I would like this to be triggered always when tag value change regardless if client is opened or not.


You can use Tag Event scripts for this. These run on the gateway, so will run whether the client is opened or not, but they can only write to a gateway accessible path.

Thanks accyroy.

Totally forgot Ignition Gateway is in different server, so my script did not work because Gateway has no access in to location I did pointed.

Thanks a lot again.