I’ve written a script to set all OPCItemPath’s in a given UDT instance, based on a set of rules for the type of plc I’m talking to. It seemed to work perfectly and I was very happy with it, up until the point I changed some of the scan classes for some of the tags in the udt to leased.
In my script, I create an array of tag paths pointing to the OPCItemPath for each tag in the udt, and an array of values the OPCItemPath’s should be set to. I use the system.tag.writeAll function to perform the write.
As I said, this was working perfectly, but later on I started to notice that some tags weren’t good and that their OPCItemPath wasn’t being set anymore. I didn’t get any indication of a problem from the logs. I then changed my writeAll call to writeAllSynchronous, which did generate an error message in the log.
([Logix V1]JCB/ES1/Device/Name, valueChanged) Error executing tag event script: Traceback (most recent call last): File "", line 16, in valueChanged File "", line 58, in setOPCItemPaths ValueError: Error writing to tag "[Logix V1]JCB/ES1/Alarm/PV/SetPoint/Set/Severity.OPCItemPath": CONFIG_ERROR
This was one of the tags I had changed the scan class from direct to leased. I tried changing that tag back to direct, and it didn’t fail on it, but failed on the next leased tag encountered.
Through trial and error I discovered that everything works fine if I set the Slow Rate to any value but zero in the leased scan class, but setting it to zero will not work.
For now, I can workaround by temporarily changing the slow rate when I want the script to run, but is there anyway to fix this permanently or am I doing something too unconventional?
My version is Ignition 7.9.0 (b2016101208) on Ubuntu 16.04 server (amd64).