"system.tag.write" Tag path error

Hello everyone,

I’m using the attached script to troubleshoot an odd issue I’m having with a tag change gateway event script. I’m triggering the tag event using the Boolean “San_Cycle_Test” tag, and then trying to pull the parent path from that event and use it to write a string to a different tag within the same UDT (“San_Start_Time”). Basically, I want the attached script to write to this tag when I input the “path” variable into the tag.write function.

The issue I’m having is that the “path” variable will not work in the write function, even though it is identical to the hard-coded version named “path2”, which does work. I have verified that both the value and data type (“class org.python.core.PyString”) of the two are identical. I’m stumped as to why one of these could work but not the other, so if anyone has any suggestions I’d love to hear them! Thank you in advance.

PS: I’m fairly new to scripting in Ignition (and Python in general) so go easy on me if there’s something basic I missed!

You sure those are equal?

It looks to me like you have a space in your format string, which would end up in your resulting tag path at a place path2 doesn’t have one.

2 Likes

That took care of it - silly of me to miss that. Thank you!