I have a VERY basic tag event change script that I am trying to run and cannot understand why it does not work. All I am trying to do is write 0 to a memory tag when a certain tag value changes in the system. I also do not want it to run on an initial change.
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents): """ Fired whenever the current value changes in value or quality. Arguments: tag: The source tag object. A read-only wrapper for obtaining tag properties. tagPath: The full path to the tag (String) previousValue: The previous value. This is a "qualified value", so it has value, quality, and timestamp properties. currentValue: The current value. This is a "qualified value", so it has value, quality, and timestamp properties. initialChange: A boolean flag indicating whether this event is due to the first execution or initial subscription. missedEvents: A flag indicating that some events have been skipped due to event overflow. """ if not initialChange: system.tag.write("[.]../Daily Actuals/Starting Count.value",0)
That being said, here is the really easy piece of script that I wrote. It works when I remove the initial change if statement, but otherwise throws an error and creates a bad tag value.
Has anyone else experienced this before?