Safer debug unpack result checking, more verbose error message, slower retry when waiting PLC startup
authorEdouard TISSERANT <edouard.tisserant@gmail.com>
Sun, 06 Dec 2009 19:06:36 +0100
changeset 460 73a53278833b
parent 459 af7350d24ab5
child 461 bcbc472c0ba8
Safer debug unpack result checking, more verbose error message, slower retry when waiting PLC startup
plugger.py
runtime/PLCObject.py
--- a/plugger.py	Sun Dec 06 18:52:50 2009 +0100
+++ b/plugger.py	Sun Dec 06 19:06:36 2009 +0100
@@ -1708,7 +1708,7 @@
             else:
                 if plc_status == "Started":
                     # Be patient, tollerate PLC to come up before debugging
-                    time.sleep(0.01)
+                    time.sleep(0.1)
                 else:
                     wx.CallAfter(self.logger.write, _("Debugger disabled\n"))
                     self.debug_break = True
--- a/runtime/PLCObject.py	Sun Dec 06 18:52:50 2009 +0100
+++ b/runtime/PLCObject.py	Sun Dec 06 19:06:36 2009 +0100
@@ -392,10 +392,16 @@
                                                            ctypes.POINTER(c_type)).contents))
                         offset += ctypes.sizeof(c_type)
                     else:
-                        PLCprint("Debug error !")
+                        if c_type is None:
+                            PLCprint("Debug error - " + iectype + " not supported !")
+                        if offset >= size:
+                            PLCprint("Debug error - buffer too small !")
                         break
             self._FreeDebugData()
             self.PLClibraryLock.release()
-            return self.PLCStatus, tick.value, res
+            if offset == size:
+                return self.PLCStatus, tick.value, res
+            else:
+                PLCprint("Debug error - bad buffer unpack !")
         return self.PLCStatus, None, None