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)