I want to write to a tag in the PLC using a client event script. I have the tag trigger set up and want to write a value, which is the sum of multiple tags, to a specified tag.
Example:
system.tag.write("My/Tag/Path_Total", "Other/tag/path_Value" + "this/tag/path_Value" + "that/tag/path_Value")
but this is not writing to the tag.
I can insert a value just to test it, and it writes a value to the tag.
Any help is appreciated!
This just concatenates these three strings. Jython has no idea that these string are the names of tags.
To get the tag values, you need to use one of the system.tag.read* functions. Read the docs carefully, because these functions do not return the actual tag value directly, but return a combination object that contains .quality, .timestamp, and .value properties.