--- a/runtime/PLCObject.py Fri Jul 27 00:38:45 2012 +0200
+++ b/runtime/PLCObject.py Sun Jul 29 19:33:52 2012 +0200
@@ -365,29 +365,29 @@
buffer = ctypes.c_void_p()
- if self.PLClibraryLock.acquire(False) and \
- self._GetDebugData(ctypes.byref(tick),
- ctypes.byref(buffer)) == 0 :
- for idx, iectype, forced in self._Idxs:
- cursor = ctypes.c_void_p(buffer.value + offset)
- c_type,unpack_func, pack_func = \
- TypeTranslator.get(iectype,
- if c_type is not None and offset < size.value:
- res.append(unpack_func(
- ctypes.POINTER(c_type)).contents))
- offset += ctypes.sizeof(c_type)
- PLCprint("Debug error - " + iectype +
- #if offset >= size.value:
- #PLCprint("Debug error - buffer too small ! %d != %d"%(offset, size.value))
+ if self.PLClibraryLock.acquire(False): + if self._GetDebugData(ctypes.byref(tick), + ctypes.byref(buffer)) == 0: + for idx, iectype, forced in self._Idxs: + cursor = ctypes.c_void_p(buffer.value + offset) + c_type,unpack_func, pack_func = \ + TypeTranslator.get(iectype, + if c_type is not None and offset < size.value: + res.append(unpack_func( + ctypes.POINTER(c_type)).contents)) + offset += ctypes.sizeof(c_type) + PLCprint("Debug error - " + iectype + + #if offset >= size.value: + #PLCprint("Debug error - buffer too small ! %d != %d"%(offset, size.value)) self.PLClibraryLock.release()
if offset and offset == size.value:
return self.PLCStatus, tick.value, res