Hello - I have a basic question which I’m sure has an easy solution (but cannot figure out):
I am trying to use ignition to totalize incoming values on a particular tag. Changes to the value of the tag are all I need (not absolute values), so scripting should be straightforward:
if currentValue.value !=previousValue.value:
oldvalue = system.tag.read("[.]Totalizer").value
system.tag.write("[.]Totalizer",oldvalue+1)
The problem is that when there is a gateway reset or update, I’m also registering a bump in totalizer value. One of my tags even registered three changes during the reset event. I should also mention that I ran the following code and STILL saw the totalizer updating in response to the gateway reset instead of the tag itself actually changing value:
if (initialChange==0) and (currentValue.value !=previousValue.value):
oldvalue = system.tag.read("[.]Totalizer").value
system.tag.write("[.]Totalizer",oldvalue+1)
Can anyone suggest what I may be doing wrong here? Thanks!