Hello guys, I have a new discussion regarding the confirmation of writing tags.
This come because of the process of a client that includes the activation of bit that change the status of an integer tag from ignition to start an order, this bit also make an update of the warehouse and the information of the recipe is copied to the PLC.
After the PLC executes this, it changes the status of this integer tag and in the ignition because of the tag change executes an script that process the data and send the info to a database.
However sometimes this bit isn't written for any reason, maybe the scan time between the PLC and the ignition. So the idea is to use the following script to know if this tag is really written.
paths = ["[default]testBit"]
values = [0]
def myCallback(asyncReturn):
for result in asyncReturn:
# Do something if a bad qualified value was returned
if not result.good:
print "The result is " + str(result)
else:
print "The result is " + str(result)
system.tag.writeAsync(paths, values, myCallback)
The thing with this code is that I want to specify a path in the function "myCallback", this would mean 2 arguments for this function, however the manual says it must be only one argument that it is surely the result of that write asynchronous.
So I wonder how to use the result of this function at the moment of the writing to write another tag in ignition to know if something goes wrong with the writing to the OPC tag. This last part is a little confusing but I hope you can understand it.
Any ideas?