Clean Exiting of the Manager

The WinCC OA JavaScript Manager for Node.js is not automatically terminated after the script has been executed. In most cases, this is the expected behaviour, e.g. after calling dpConnect(), opening a server port, etc. However, if the manager is to perform some tasks and stop after they are completed, you must ensure that the script, and therefore the manager, is terminated properly.

For this purpose, the exit()-function of the WinccoaManager-class is available, see example below.

Clean termination of the WinCC OA JavaScript Manager for Node.js

import { WinccoaManager } from 'winccoa-manager';
const winccoa = new WinccoaManager();

async function main() {
  /* Add your productive code here */    
    
  winccoa.exit(0);
}

main();