LPCconnector/LPCAppObject.py
changeset 34 b2fb188c9bff
parent 31 a9c9d1fc97d3
child 35 cb9da964a178
equal deleted inserted replaced
33:961cf0f80c25 34:b2fb188c9bff
    44         self.HandleSerialTransaction(RESETTransaction())
    44         self.HandleSerialTransaction(RESETTransaction())
    45         return self.PLCStatus
    45         return self.PLCStatus
    46 
    46 
    47     def GetPLCstatus(self):
    47     def GetPLCstatus(self):
    48         strcounts = self.HandleSerialTransaction(GET_LOGCOUNTSTransaction())
    48         strcounts = self.HandleSerialTransaction(GET_LOGCOUNTSTransaction())
    49         if len(strcounts) == LogLevelsCount * 4:
    49         if strcounts is not None and len(strcounts) == LogLevelsCount * 4:
    50             cstrcounts = ctypes.create_string_buffer(strcounts)
    50             cstrcounts = ctypes.create_string_buffer(strcounts)
    51             ccounts = ctypes.cast(cstrcounts, ctypes.POINTER(ctypes.c_uint32))
    51             ccounts = ctypes.cast(cstrcounts, ctypes.POINTER(ctypes.c_uint32))
    52             counts = [int(ccounts[idx]) for idx in xrange(LogLevelsCount)]
    52             counts = [int(ccounts[idx]) for idx in xrange(LogLevelsCount)]
    53         else :
    53         else :
    54             counts = [0]*LogLevelsCount
    54             counts = [0]*LogLevelsCount