I recently took over a project for a coworker and noticed that we are getting an error from one of there loggers. This error is to warn that the Boolean tag was not turned off correctly. After the logger happens, it then flips the boolean tag itself. (Here is the script, but I don't think this is the problem:)
"""
DESCRIPTION: Tag Event changes for matrox.status
"""
from time import sleep
logger = system.util.getLogger("SmartInterface_Rev2")
def dataReady(tagPath, currentValue):
""""
DESCRIPTION: Data Ready tag path change
PARAMETERS: tagPath (REQ, str): tagPath from change event
RETURNS: None
"""
logger.debug("tagPath: %s" %tagPath)
RETRY_ATTEMPTS = 10
if currentValue.value:
for attempt in range(RETRY_ATTEMPTS):
sleep(1)
# recheck that the data ready has gone False
dataReady = system.tag.readBlocking([tagPath])[0].value
if not dataReady:
break
elif dataReady and attempt == RETRY_ATTEMPTS - 1:
logger.warn("%s timed out, reset" %tagPath)
system.tag.writeBlocking(["%s" %tagPath], [0])
I started checking the PLC and found the tag is being latched within the code, but not being unlatched. I am having trouble finding where/what it is supposed to be unlatching this tag. I have even done some extensive searches within the find/replace tool.
We have 2 machines running off this program, one is working fine the other is throwing this error.
Is there a way that I can trend a tag so that I can find exactly what is unlatching the tag for the working machine and what is supposed to be unlatching the tag for the broken machine?