Runtime/PLCObject : move call to PreStartPLC right after call to the "start" method of all python extensions, and then just before the start of the python loop executing python_* blocks.
--- a/runtime/PLCObject.py Thu Sep 03 11:16:08 2020 +0200
+++ b/runtime/PLCObject.py Thu Sep 10 16:08:26 2020 +0200
@@ -440,6 +440,7 @@
if cmd == "Activate":
self.PythonRuntimeCall("start")
+ self.PreStartPLC()
self.PythonThreadLoop()
self.PythonRuntimeCall("stop", reverse_order=True)
else: # "Finish"
@@ -471,8 +472,6 @@
if not self.LoadPLC():
self._fail(_("Problem starting PLC : can't load PLC"))
- self.PreStartPLC()
-
if self.CurrentPLCFilename is not None and self.PLCStatus == PlcStatus.Stopped:
c_argv = ctypes.c_char_p * len(self.argv)
res = self._startPLC(len(self.argv), c_argv(*self.argv))