runtime/PLCObject.py
changeset 2732 a3f0e4148714
parent 2720 971bb3503957
child 3282 725d3e9ac913
equal deleted inserted replaced
2731:c6a55270d468 2732:a3f0e4148714
   457             elif cmd == "Start":
   457             elif cmd == "Start":
   458                 # Ack Immediately, for responsiveness
   458                 # Ack Immediately, for responsiveness
   459                 self.PythonThreadAcknowledge(cmd)
   459                 self.PythonThreadAcknowledge(cmd)
   460                 self.PythonRuntimeCall("start")
   460                 self.PythonRuntimeCall("start")
   461                 self.LogMessage("Python extensions started")
   461                 self.LogMessage("Python extensions started")
       
   462                 self.PostStartPLC()
   462                 self.PythonThreadLoop()
   463                 self.PythonThreadLoop()
   463                 self.PythonRuntimeCall("stop", reverse_order=True)
   464                 self.PythonRuntimeCall("stop", reverse_order=True)
   464             elif cmd == "Finish":
   465             elif cmd == "Finish":
   465                 self.PythonThreadAcknowledge(cmd)
   466                 self.PythonThreadAcknowledge(cmd)
   466                 break
   467                 break
   491     def PreStartPLC(self):
   492     def PreStartPLC(self):
   492         """ 
   493         """ 
   493         Here goes actions to be taken just before PLC starts, 
   494         Here goes actions to be taken just before PLC starts, 
   494         with all libraries and python object already created.
   495         with all libraries and python object already created.
   495         For example : restore saved proprietary parameters
   496         For example : restore saved proprietary parameters
       
   497         """
       
   498         pass
       
   499 
       
   500     def PostStartPLC(self):
       
   501         """ 
       
   502         Here goes actions to be taken after PLC is started, 
       
   503         with all libraries and python object already created,
       
   504         and python extensions "Start" methods being called.
       
   505         This is called before python thread processing py_eval blocks starts.
       
   506         For example : attach additional ressource to web services
   496         """
   507         """
   497         pass
   508         pass
   498 
   509 
   499     @RunInMain
   510     @RunInMain
   500     def StartPLC(self):
   511     def StartPLC(self):