winccoa-manager

API documentation for WinCC OA JavaScript Manager for Node.js®


The main API class is WinccoaManager, start your exploration there.


IMPORTANT

Most code examples in this documentation are not complete, but only snippets that show how to use a method or type. Note that the methods described in this documentation must be called from code inside a method or function to prevent unexpected or undefined behavior.

NOTE

If a code example does not contain an import statement, it is assumed that an instance of WinccoaManager has been created and can be accessed with the constant winccoa, e. g.:

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

NOTE

Almost all examples in this API documentation are given in TypeScript, but it is easy to convert them to JavaScript, if required:

  1. Replace import { ... } from 'winccoa-manager' with const { ... } = require('winccoa-manager').
  2. Remove all explicit type definitions (e. g. replace name: number with name).
  3. Remove all type conversions that are using the keyword as.
  4. Do not use the question mark for optional parameters.

Examples given both in TypeScript and JavaScript that illustrate all these points can be found In the documentation for WinccoaDpConnectCallback, WinccoaError and WinccoaAlertTime.


require() or import?

Using require() in JavaScript code allows the JavaScript Manager to find modules also when they are located in sub-projects or the WinCC OA installation. This includes the Node.js AddOn that implements this API. Therefore it is strongly recommended to use require() in JavaScript code.

This is also the reason why TypeScript ìmport statements will be transpiled to require() when using the templates provided by WinCC OA.