When using system.util.invokeAsynchronous() I keep receiving this error:
Message:
Error running function from
fpmi.system.invokeAsynchronous
Details:
TypeError: 'NoneType' object is not callable
at org.python.core.Py.TypeError(Py.java:236)
at org.python.core.PyObject.call(PyObject.java:396)
at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:847)
at com.inductiveautomation.ignition.client.script.DesignerSystemUtilities.lambda$_invokeAsyncImpl$1(DesignerSystemUtilities.java:140)
at java.base/java.lang.Thread.run(Unknown Source)Ignition v8.1.32 (b2023091211)
Java: Azul Systems, Inc. 11.0.18
After running this code:
path = "Select Query"
tagPaths = "[Queue]Queue"
sequenced = system.db.runNamedQuery(path)
updateBlockQueue = system.dataset.toDataSet(sequenced)
system.tag.writeBlocking(tagPaths, updateQueue)
tagData = system.tag.readBlocking(tagPaths)[0].value
pyTagData = system.dataset.toPyDataSet(tagData)
updates = []
def updateSize(index, row, updates):
config = system.db.runNamedQuery("Select Config",{"WO": row[1]})
engineSize = system.db.runNamedQuery("Select Size", {"configCode": config[0][0]})
updates.append((index, {"SIZE":Size[0][0]}))
def applyUpdates(tagPaths, tagData, update):
for index, update in updates:
tagData = system.dataset.updateRow(tagData, index, update)
system.tag.writeBlocking([tagPaths], [tagData])
def runUpdates():
a = system.date.now()
for index, row in enumerate(pyTagData):
system.util.invokeAsynchronous(updateSize(index, row, updates))
system.util.invokeAsynchronous(applyUpdates(tagPaths, tagData, update))
b = system.date.now()
total = system.date.secondsBetween(a, b)
print(total)
runUpdates()
This will execute with the result I need, and all of the data is correct, but the error mentioned is still being posted. I do not know why.
I am running this in the Script Console for testing purposes.