Reset ADS-OCX application

After a program error, it is often not possible to terminate the application via the operating function "Start -> Program Reset", as is usually the case.  The following message of the debugger is the consequence:

Reset ADS-OCX application 1:

The cause of this is that using the ADS-OCX generates a client-server connection to the TwinCAT router, and this must be closed when the application stops. The Delphi application cannot be closed using the "Program Reset" menu command, because at this point there is a connection to the TwinCAT router. Their connection is generated in the application through the assignment of the AdsAmsNetId and the port number.

The following methods may be used to close the application without having to restart the computer: