Safer debug unpack result checking, more verbose error message, slower retry when waiting PLC startup
--- 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