Removed status polling for LPC, as status cannot change by itself, fixed MD5 comparison in app mode
--- 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)
--- 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):