# HG changeset patch # User edouard # Date 1297960469 -3600 # Node ID 6765adf587115c16c6b2cf3b220014df193cbf08 # Parent 1b6bd9f590aaf4b24b5fd71745c78b6ff273892b Removed status polling for LPC, as status cannot change by itself, fixed MD5 comparison in app mode diff -r 1b6bd9f590aa -r 6765adf58711 LPCBeremiz.py --- a/LPCBeremiz.py Thu Feb 17 17:04:10 2011 +0100 +++ b/LPCBeremiz.py Thu Feb 17 17:34:29 2011 +0100 @@ -492,9 +492,9 @@ status = "" self.logger.write(_("PLC is %s\n")%status) - if self.StatusTimer and not self.StatusTimer.IsRunning(): - # Start the status Timer - self.StatusTimer.Start(milliseconds=2000, oneShot=False) + #if self.StatusTimer and not self.StatusTimer.IsRunning(): + # # Start the status Timer + # self.StatusTimer.Start(milliseconds=2000, oneShot=False) if self.previous_plcstate=="Started": if self.DebugAvailable() and self.GetIECProgramsAndVariables(): @@ -808,7 +808,7 @@ else: self.logger.write(_("Resetting PLC\n")) - self.StatusTimer.Stop() + #self.StatusTimer.Stop() self.LPCConnector.ResetPLC() self.AbortTransferTimer.Start(milliseconds=5000, oneShot=True) diff -r 1b6bd9f590aa -r 6765adf58711 connectors/LPC/LPCAppObject.py --- a/connectors/LPC/LPCAppObject.py Thu Feb 17 17:04:10 2011 +0100 +++ b/connectors/LPC/LPCAppObject.py Thu Feb 17 17:34:29 2011 +0100 @@ -31,7 +31,6 @@ self.SerialConnection = LPCAppProto(comport,#number 115200, #speed 2) #timeout - self.HandleSerialTransaction(IDLETransaction()) def StartPLC(self, debug=False): self.HandleSerialTransaction(STARTTransaction()) @@ -45,13 +44,13 @@ return self.PLCStatus def GetPLCstatus(self): - self.HandleSerialTransaction(IDLETransaction()) + self.HandleSerialTransaction(GET_PLCIDTransaction()) return self.PLCStatus def MatchMD5(self, MD5): data = self.HandleSerialTransaction(GET_PLCIDTransaction()) if data is not None: - return data[:32] == MD5 + return data[:32] == MD5[:32] return False class IEC_STRING(ctypes.Structure):