Runtime: Fix PLC python thread crash in case of exception in PostStart customization hook.
--- a/runtime/PLCObject.py Tue Aug 02 11:50:54 2022 +0200
+++ b/runtime/PLCObject.py Tue Aug 02 11:53:37 2022 +0200
@@ -466,7 +466,7 @@
self.PythonThreadAcknowledge(cmd)
self.PythonRuntimeCall("start")
self.LogMessage("Python extensions started")
- self.PostStartPLC()
+ self._PostStartPLC()
self.PythonThreadLoop()
self.PythonRuntimeCall("stop", reverse_order=True)
elif cmd == "Finish":
@@ -504,6 +504,13 @@
"""
pass
+ def _PostStartPLC(self):
+ try:
+ self.PostStartPLC()
+ except Exception:
+ self.LogMessage(0, 'Post Start Exception'+'\n'.join(
+ traceback.format_exception(*sys.exc_info())))
+
def PostStartPLC(self):
"""
Here goes actions to be taken after PLC is started,