# HG changeset patch # User Edouard Tisserant # Date 1615366758 -3600 # Node ID a7941f053a8357d3a2f1232bf5330bb41e8d0e32 # Parent 21cb76012c78ee5c7164c6d9c8ea61dff0cabf44 Runtime: Added PostStart methot to PLCObject, called after PLC is started, with all libraries and python object already created, and python extensions "Start" methods being called. This is called before python thread processing py_eval blocks starts. Example purpose: attach additional ressource to web services diff -r 21cb76012c78 -r a7941f053a83 runtime/PLCObject.py --- a/runtime/PLCObject.py Wed Mar 03 11:45:13 2021 +0100 +++ b/runtime/PLCObject.py Wed Mar 10 09:59:18 2021 +0100 @@ -459,6 +459,7 @@ self.PythonThreadAcknowledge(cmd) self.PythonRuntimeCall("start") self.LogMessage("Python extensions started") + self.PostStartPLC() self.PythonThreadLoop() self.PythonRuntimeCall("stop", reverse_order=True) elif cmd == "Finish": @@ -496,6 +497,16 @@ """ pass + def PostStartPLC(self): + """ + Here goes actions to be taken after PLC is started, + with all libraries and python object already created, + and python extensions "Start" methods being called. + This is called before python thread processing py_eval blocks starts. + For example : attach additional ressource to web services + """ + pass + @RunInMain def StartPLC(self):