runtime/PLCObject.py
changeset 1035 0f905e027d18
parent 1027 4e44c2c3e081
child 1045 a220a27defe5
--- a/runtime/PLCObject.py	Mon Apr 15 00:36:41 2013 +0200
+++ b/runtime/PLCObject.py	Wed Apr 17 10:54:17 2013 +0900
@@ -196,6 +196,9 @@
             self._GetLogMessage.argtypes = [ctypes.c_uint8, ctypes.c_uint32, ctypes.c_char_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)]
 
             self._loading_error = None
+
+            self.PythonRuntimeInit()
+
             return True
         except:
             self._loading_error = traceback.format_exc()
@@ -402,11 +405,8 @@
 
             if self.LoadPLC():
                 self.PLCStatus = "Stopped"
-                try:
-                    self.PythonRuntimeInit()
-                except:
-                    self.PLCStatus = "Broken"
             else:
+                self.PLCStatus = "Broken"
                 self._FreePLC()
             self.StatusChange()