equal
deleted
inserted
replaced
30 def connect(self,comport): |
30 def connect(self,comport): |
31 self.SerialConnection = LPCAppProto(comport,#number |
31 self.SerialConnection = LPCAppProto(comport,#number |
32 115200, #speed |
32 115200, #speed |
33 2) #timeout |
33 2) #timeout |
34 self.HandleSerialTransaction(IDLETransaction()) |
34 self.HandleSerialTransaction(IDLETransaction()) |
35 |
35 |
36 def StartPLC(self, debug=False): |
36 def StartPLC(self, debug=False): |
37 self.HandleSerialTransaction(STARTTransaction()) |
37 self.HandleSerialTransaction(STARTTransaction()) |
38 |
38 |
39 def StopPLC(self): |
39 def StopPLC(self): |
40 self.HandleSerialTransaction(STOPTransaction()) |
40 self.HandleSerialTransaction(STOPTransaction()) |
48 self.HandleSerialTransaction(IDLETransaction()) |
48 self.HandleSerialTransaction(IDLETransaction()) |
49 return self.PLCStatus |
49 return self.PLCStatus |
50 |
50 |
51 def MatchMD5(self, MD5): |
51 def MatchMD5(self, MD5): |
52 data = self.HandleSerialTransaction(GET_PLCIDTransaction()) |
52 data = self.HandleSerialTransaction(GET_PLCIDTransaction()) |
53 return data[:32] == MD5 |
53 if data is not None: |
|
54 return data[:32] == MD5 |
|
55 return False |
54 |
56 |
55 class IEC_STRING(ctypes.Structure): |
57 class IEC_STRING(ctypes.Structure): |
56 """ |
58 """ |
57 Must be changed according to changes in iec_types.h |
59 Must be changed according to changes in iec_types.h |
58 """ |
60 """ |