runtime/PLCObject.py
changeset 3578 d74eb1be6abe
parent 3577 6c7a7b22bec9
child 3642 cd3d15e8ef42
child 3861 7e17f7e02a2b
equal deleted inserted replaced
3577:6c7a7b22bec9 3578:d74eb1be6abe
   464             elif cmd == "Start":
   464             elif cmd == "Start":
   465                 # Ack Immediately, for responsiveness
   465                 # Ack Immediately, for responsiveness
   466                 self.PythonThreadAcknowledge(cmd)
   466                 self.PythonThreadAcknowledge(cmd)
   467                 self.PythonRuntimeCall("start")
   467                 self.PythonRuntimeCall("start")
   468                 self.LogMessage("Python extensions started")
   468                 self.LogMessage("Python extensions started")
   469                 self.PostStartPLC()
   469                 self._PostStartPLC()
   470                 self.PythonThreadLoop()
   470                 self.PythonThreadLoop()
   471                 self.PythonRuntimeCall("stop", reverse_order=True)
   471                 self.PythonRuntimeCall("stop", reverse_order=True)
   472             elif cmd == "Finish":
   472             elif cmd == "Finish":
   473                 self.PythonThreadAcknowledge(cmd)
   473                 self.PythonThreadAcknowledge(cmd)
   474                 break
   474                 break
   501         Here goes actions to be taken just before PLC starts, 
   501         Here goes actions to be taken just before PLC starts, 
   502         with all libraries and python object already created.
   502         with all libraries and python object already created.
   503         For example : restore saved proprietary parameters
   503         For example : restore saved proprietary parameters
   504         """
   504         """
   505         pass
   505         pass
       
   506 
       
   507     def _PostStartPLC(self):
       
   508         try:
       
   509             self.PostStartPLC()
       
   510         except Exception:
       
   511             self.LogMessage(0, 'Post Start Exception'+'\n'.join(
       
   512                 traceback.format_exception(*sys.exc_info())))
   506 
   513 
   507     def PostStartPLC(self):
   514     def PostStartPLC(self):
   508         """ 
   515         """ 
   509         Here goes actions to be taken after PLC is started, 
   516         Here goes actions to be taken after PLC is started, 
   510         with all libraries and python object already created,
   517         with all libraries and python object already created,