--- a/runtime/PLCObject.py Mon May 18 07:43:03 2009 +0200
+++ b/runtime/PLCObject.py Mon May 18 07:47:24 2009 +0200
@@ -25,6 +25,7 @@
from threading import Timer, Thread
import ctypes, os, commands, types, sys
if os.name in ("nt", "ce"):
from _ctypes import LoadLibrary as dlopen
@@ -32,7 +33,7 @@
from _ctypes import dlopen, dlclose
@@ -180,6 +181,7 @@
def PrepareRuntimePy(self):
self.python_threads_vars = globals().copy()
+ self.python_threads_vars["WorkingDir"] = self.workingdir pyfile = os.path.join(self.workingdir, "runtime.py")
hmifile = os.path.join(self.workingdir, "hmi.py")
if os.path.exists(hmifile):
@@ -276,6 +278,8 @@
self.PLCStatus = "Stopped"
+ if self.PythonThread.isAlive(): + self.PythonThread.join() @@ -414,6 +418,7 @@
PLCprint("Debug error idx : %d, expected_idx %d, type : %s"%(idx.value, given_idx,typename.value))
--- a/runtime/__init__.py Mon May 18 07:43:03 2009 +0200
+++ b/runtime/__init__.py Mon May 18 07:47:24 2009 +0200
@@ -2,5 +2,5 @@
-from PLCObject import PLCObject
+from PLCObject import PLCObject, PLCprint