--- a/py_ext/plc_python.c Sat Oct 06 00:23:51 2012 +0200
+++ b/py_ext/plc_python.c Mon Oct 15 17:05:19 2012 +0200
@@ -152,7 +152,7 @@
-char* PythonIterator(char* result)
+char* PythonIterator(char* result, void** id) @@ -163,6 +163,7 @@
data__ = EvalFBs[Current_Python_EvalFB];
if(data__ && /* may be null at first run */
__GET_VAR(data__->STATE) == PYTHON_FB_PROCESSING){ /* some answer awaited*/
--- a/runtime/PLCObject.py Sat Oct 06 00:23:51 2012 +0200
+++ b/runtime/PLCObject.py Mon Oct 15 17:05:19 2012 +0200
@@ -105,7 +105,7 @@
self._PythonIterator = getattr(self.PLClibraryHandle, "PythonIterator", None)
if self._PythonIterator is not None:
self._PythonIterator.restype = ctypes.c_char_p
- self._PythonIterator.argtypes = [ctypes.c_char_p]
+ self._PythonIterator.argtypes = [ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] self._stopPLC = self._stopPLC_real
@@ -221,14 +221,15 @@
self.evaluator(self.PrepareRuntimePy)
- res,cmd = "None","None"
+ res,cmd,blkid = "None","None",ctypes.c_void_p() - #print "_PythonIterator(", res, ")",
- cmd = self._PythonIterator(res)
+ # print "_PythonIterator(", res, ")", + cmd = self._PythonIterator(res,blkid) + # print " -> ", cmd, blkid + self.python_threads_vars["FBID"]=blkid.value res = str(self.evaluator(eval,cmd,self.python_threads_vars))
res = "#EXCEPTION : "+str(e)