runtime/PLCObject.py
changeset 237 9a50936bc55f
parent 235 a66e150f2888
child 238 02d0daed3e46
equal deleted inserted replaced
236:a32817e81f5e 237:9a50936bc55f
   292         """
   292         """
   293         Return a list of variables, corresponding to the list of requiered idx
   293         Return a list of variables, corresponding to the list of requiered idx
   294         """
   294         """
   295         tick = self._WaitDebugData()
   295         tick = self._WaitDebugData()
   296         if tick == -1:
   296         if tick == -1:
   297             return -1,None
   297             res = None
   298         idx = ctypes.c_int()
   298         else:
   299         typename = ctypes.c_char_p()
   299             idx = ctypes.c_int()
   300         res = []
   300             typename = ctypes.c_char_p()
   301 
   301             res = []
   302         for given_idx in self._Idxs:
   302     
   303             buffer=self._IterDebugData(ctypes.byref(idx), ctypes.byref(typename))
   303             for given_idx in self._Idxs:
   304             c_type = self.TypeTranslator.get(typename.value, None)
   304                 buffer=self._IterDebugData(ctypes.byref(idx), ctypes.byref(typename))
   305             if c_type is not None and given_idx == idx.value:
   305                 c_type = self.TypeTranslator.get(typename.value, None)
   306                 res.append(ctypes.cast(buffer, 
   306                 if c_type is not None and given_idx == idx.value:
   307                                        ctypes.POINTER(c_type)).contents.value)
   307                     res.append(ctypes.cast(buffer, 
   308             else:
   308                                            ctypes.POINTER(c_type)).contents.value)
   309                 print "Debug error idx : %d, expected_idx %d, type : %s"%(idx.value, given_idx,typename.value)
   309                 else:
   310                 res.append(None)
   310                     print "Debug error idx : %d, expected_idx %d, type : %s"%(idx.value, given_idx,typename.value)
       
   311                     res.append(None)
   311         self._FreeDebugData()
   312         self._FreeDebugData()
   312         return tick, res
   313         return tick, res
   313         
   314         
   314 
   315 
   315 
   316