runtime/PLCObject.py
changeset 460 73a53278833b
parent 459 af7350d24ab5
child 461 bcbc472c0ba8
--- 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