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.
authorEdouard Tisserant
Thu, 10 Sep 2020 16:08:26 +0200
changeset 2689 7f67a7f6bfcc
parent 2688 4dd67aa45855
child 2690 4de6a587f7f9
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.
runtime/PLCObject.py
--- a/runtime/PLCObject.py	Thu Aug 13 19:00:38 2020 +0100
+++ 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))