# HG changeset patch # User Edouard Tisserant # Date 1380351590 -32400 # Node ID 7f264cc6e75d39713245554a364e0ea89124ace3 # Parent 9d0cb01312f0f35740251ddceb811fb04f8e2f35# Parent ac7d39f4e37650d457b64b13c3b79e7a97159be5 merged diff -r ac7d39f4e376 -r 7f264cc6e75d py_ext/plc_python.c --- a/py_ext/plc_python.c Fri Sep 27 17:48:05 2013 +0200 +++ b/py_ext/plc_python.c Sat Sep 28 15:59:50 2013 +0900 @@ -163,7 +163,6 @@ LockPython(); /* Get current FB */ data__ = EvalFBs[Current_Python_EvalFB]; - *id=data__; if(data__ && /* may be null at first run */ __GET_VAR(data__->STATE) == PYTHON_FB_PROCESSING){ /* some answer awaited*/ /* If result not None */ @@ -209,6 +208,7 @@ __SET_VAR(data__->, BUFFER, 0, .body[__GET_VAR(data__->BUFFER, .len)]); /* next command is BUFFER */ next_command = (char*)__GET_VAR(data__->BUFFER, .body); + *id=data__; /* free python mutex */ UnLockPython(); /* return the next command to eval */ diff -r ac7d39f4e376 -r 7f264cc6e75d runtime/PLCObject.py --- a/runtime/PLCObject.py Fri Sep 27 17:48:05 2013 +0200 +++ b/runtime/PLCObject.py Sat Sep 28 15:59:50 2013 +0900 @@ -329,7 +329,7 @@ if ccmd is None or ccmd!=cmd: AST = compile(cmd, '', 'eval') compile_cache[FBID]=(cmd,AST) - result,exp = self.evaluator(eval,cmd,self.python_runtime_vars) + result,exp = self.evaluator(eval,AST,self.python_runtime_vars) if exp is not None: res = "#EXCEPTION : "+str(exp[1]) self.LogMessage(1,('PyEval@0x%x(Code="%s") Exception "%s"')%(FBID,cmd,