--- a/runtime/PLCObject.py Tue May 26 09:58:20 2020 +0200
+++ b/runtime/PLCObject.py Thu May 28 11:38:09 2020 +0200
@@ -451,17 +451,27 @@
self.PythonThreadCond.notify()
self.PythonThreadCondLock.release()
+ self.LogMessage(0, msg) + self.PLCStatus = PlcStatus.Broken + Here goes actions to be taken just before PLC starts, + with all libraries and python object already created. + For example : restore saved proprietary parameters
- self.LogMessage(0, msg)
- self.PLCStatus = PlcStatus.Broken
if self.PLClibraryHandle is None:
- fail(_("Problem starting PLC : can't load PLC"))
+ self._fail(_("Problem starting PLC : can't load PLC")) if self.CurrentPLCFilename is not None and self.PLCStatus == PlcStatus.Stopped:
c_argv = ctypes.c_char_p * len(self.argv)
@@ -472,7 +482,7 @@
self.PythonThreadCommand("Activate")
self.LogMessage("PLC started")
- fail(_("Problem starting PLC : error %d" % res))
+ self._fail(_("Problem starting PLC : error %d" % res))