--- a/LPCBeremiz.py Thu Feb 17 17:34:29 2011 +0100
+++ b/LPCBeremiz.py Fri Feb 18 12:29:48 2011 +0100
@@ -499,8 +499,7 @@
if self.previous_plcstate=="Started":
if self.DebugAvailable() and self.GetIECProgramsAndVariables():
self.logger.write(_("Debug connect matching running PLC\n"))
self.logger.write_warning(_("Debug do not match PLC - stop/transfert/start to re-enable\n"))
@@ -834,8 +833,7 @@
if self.GetIECProgramsAndVariables():
self._connector.StartPLC()
self.logger.write(_("Starting PLC\n"))
self.logger.write_error(_("Couldn't start PLC !\n"))
self.UpdateMethodsFromPLCStatus()
--- a/connectors/LPC/LPCAppObject.py Thu Feb 17 17:34:29 2011 +0100
+++ b/connectors/LPC/LPCAppObject.py Fri Feb 18 12:29:48 2011 +0100
@@ -94,10 +94,11 @@
for idx,iectype,force in idxs:
idxstr = ctypes.string_at(
- ctypes.c_uint32(length)),4)
+ ctypes.c_uint32(idx)),4) c_type,unpack_func, pack_func = self.TypeTranslator.get(iectype, (None,None,None))
- forcedsizestr = chr(ctypes.sizeof(c_type))
+ forced_type_size = ctypes.sizeof(c_type) + forcedsizestr = chr(forced_type_size) forcestr = ctypes.string_at(
pack_func(c_type,force)),
@@ -117,8 +118,8 @@
strbuf = self.HandleSerialTransaction(
GET_TRACE_VARIABLETransaction())
- if size > 0 and self.PLCStatus == "Started":
+ if strbuf is not None and len(strbuf) > 4 and self.PLCStatus == "Started": ctypes.c_char_p(strbuf[:4]),
ctypes.POINTER(ctypes.c_int)).contents
--- a/connectors/LPC/LPCAppProto.py Thu Feb 17 17:34:29 2011 +0100
+++ b/connectors/LPC/LPCAppProto.py Fri Feb 18 12:29:48 2011 +0100
@@ -17,7 +17,7 @@
raise LPCProtoError("controller did not answer as expected")
- raise LPCProtoError("LPC transaction error : "+str(e))
+ raise LPCProtoError("application mode transaction error : "+str(e)) self.TransactionLock.release()
return LPC_STATUS.get(current_plc_status,"Broken"), res
--- a/connectors/LPC/LPCObject.py Thu Feb 17 17:34:29 2011 +0100
+++ b/connectors/LPC/LPCObject.py Fri Feb 18 12:29:48 2011 +0100
@@ -46,7 +46,7 @@
self.PLCStatus, res = self.SerialConnection.HandleTransaction(transaction)
- self.pluginsroot.logger.write_error(str(e)+"\n")
+ self.pluginsroot.logger.write_warning(str(e)+"\n") self.SerialConnection.close()
self.SerialConnection = None
self.PLCStatus = "Disconnected"
--- a/connectors/LPC/LPCProto.py Thu Feb 17 17:34:29 2011 +0100
+++ b/connectors/LPC/LPCProto.py Fri Feb 18 12:29:48 2011 +0100
@@ -9,7 +9,7 @@
- return "LPC communication error ! " + str(self.msg)
+ return "Exception in PLC protocol : " + str(self.msg) def __init__(self, port, rate, timeout):