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. svghmi
authorEdouard Tisserant
Thu, 10 Sep 2020 16:08:26 +0200
branchsvghmi
changeset 3053 bff50b7e50ee
parent 3052 ffce85221ea5
child 3054 b4a84892e369
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 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))