--- a/runtime/PLCObject.py Thu Feb 16 14:57:04 2012 +0100
+++ b/runtime/PLCObject.py Thu Feb 16 15:13:05 2012 +0100
@@ -23,7 +23,7 @@
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from threading import Timer, Thread, Lock
+from threading import Timer, Thread, Lock, Semaphore import ctypes, os, commands, types, sys
from targets.typemapping import SameEndianessTypeTranslator as TypeTranslator
@@ -217,6 +217,7 @@
if self._startPLC(len(self.argv),c_argv(*self.argv)) == 0:
self.PLCStatus = "Started"
+ self.StartSem.release() self.evaluator(self.PrepareRuntimePy)
@@ -240,14 +241,17 @@
PLCprint("Problem %s PLC"%error)
self.PLCStatus = "Broken"
+ self.StartSem.release() if self.CurrentPLCFilename is not None and self.PLCStatus == "Stopped":
- self.PLCStatus = "Started"
+ self.StartSem=Semaphore(0) self.PythonThread = Thread(target=self.PythonThreadProc)
self.PythonThread.start()
+ self.StartSem.acquire()