Gateway tag change event not working

I’ve created a tag change on the gateway script called “CommunicatieBewaking”, added a single counter tag, which the script should copy back each time it changes. See the script below.

I see in the wrapper log that this script does not progress beyond the initial value check on the gateway. However if I move the same script to the client events scope, it works! However I want it to work on the server-side, since there are multiple clients and we need to check the communications only once…
The tags are generated/imported, so I don’t want to attach it to the tag-events itself…
Any thoughts anyone?

print "TagChange Communicatiebewaking event.getTagPath(): " + str(event.getTagPath())
print "TagChange Communicatiebewaking initialChange: " + str(initialChange)
if not initialChange:
print "TagChange Communicatiebewaking newValue.getQuality(): " + str(newValue.getQuality())
if newValue.getQuality() != “Bad”:
nieuweWaarde = event.getCurrentValue().getValue()
oudeWaarde = event.getPreviousValue().getValue()
print "TagChange Communicatiebewaking nieuweWaarde: " + str(nieuweWaarde) + ", oudeWaarde: " + str(oudeWaarde)
if nieuweWaarde <> oudeWaarde:
sTagPath = str(event.getTagPath()).replace(“Teller”,“CopyTeller”)
print "TagChange Communicatiebewaking sTagPath: " + sTagPath
system.tag.write(sTagPath, nieuweWaarde)

As a tip, be sure to put triple backquotes around your code to make it easier to read.

That said, is the tag provider part of the tagname?

Hi Jordan,

Thanks for the response, I’ve added the triple quotes…
And yes, the tag provider ([default]) is part of the tagname…