Hello,
I want to close properly all my sockets before the complete shutdown of a CTRL manager.
Is there a way to add a script to react on the shutdown of a CTRL manager?
Closing event scripting
- adaneau
- Posts:310
- Joined: Tue Feb 21, 2012 9:49 am
Re: Closing event scripting
Hi Manh Thang
in 3,16 you have sysConnect()
"exitRequested"
This event is triggered the first time a CTRL manager is requested to exit, e.g. either by losing the connection to the event manager or by a stop request from pmon (e.g. project shutdown) or a SIGTERM signal.
Exiting is done in the following steps:
stop all running scripts (threads/CTRL-modules)
start "exitRequested" event callback threads
disconnect everything (e.g. dpConnect, query connects, alertConnect, sysConnect)
When the last thread started for the exitRequest event will stop, the manager stops as well. Be careful that the started threads will not take too long, since on a project shutdown pmon will kill the CTRL manager when it does not terminate in the defined number of seconds (set via console panel). When a second exit request happens while the "exit requested" threads are still running, the manager will terminate immediately without starting any threads again.
The callback will get the exit code (int) as argument.
I guess it will makes what you want
in 3,16 you have sysConnect()
"exitRequested"
This event is triggered the first time a CTRL manager is requested to exit, e.g. either by losing the connection to the event manager or by a stop request from pmon (e.g. project shutdown) or a SIGTERM signal.
Exiting is done in the following steps:
stop all running scripts (threads/CTRL-modules)
start "exitRequested" event callback threads
disconnect everything (e.g. dpConnect, query connects, alertConnect, sysConnect)
When the last thread started for the exitRequest event will stop, the manager stops as well. Be careful that the started threads will not take too long, since on a project shutdown pmon will kill the CTRL manager when it does not terminate in the defined number of seconds (set via console panel). When a second exit request happens while the "exit requested" threads are still running, the manager will terminate immediately without starting any threads again.
The callback will get the exit code (int) as argument.
I guess it will makes what you want
- uxout
- Posts:82
- Joined: Wed Jul 20, 2016 12:07 pm
Re: Closing event scripting
Oh great ! That's what I'm looking for, thank you.
How can I do it with WinCC OA prior to 3.16?
How can I do it with WinCC OA prior to 3.16?
- Gertjan van Schijndel
- Posts:634
- Joined: Mon Aug 02, 2010 10:37 am
Re: Closing event scripting
The 'sysConnect' is a new 3.16 feature, so there is no real solution for a control manager.
As a workaround you could use the close/terminate event of a panel in a silent UI.
As a workaround you could use the close/terminate event of a panel in a silent UI.
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: Closing event scripting
A Ui in silent mode is designed for printing a panel without the need to open the panel in a runtime UI.
It is not designed to execute runtime tasks, e.g. tasks which are normally done in a CTRL manager.
Best Regards
Leopold Knipp
Senior Support Specialist
It is not designed to execute runtime tasks, e.g. tasks which are normally done in a CTRL manager.
Best Regards
Leopold Knipp
Senior Support Specialist