Class WinccoaSysConnect

Class that provides access to system events. It can be accessed with WinccoaManager.sysConnect and uses the Node.js event emitter mechanism to inform clients of various global system events.

Clients can connect using the method on() and specifying the event name and a listener function that will be called whenever the event occurs. The enumerator WinccoaSysConEvent enumerates all events for which a listener can be registered.

To disconnect, the method off() togther with the event name can be used.

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

function dpCreatedListener(details: WinccoaSysConDpDetails) {
console.log('DP created - details:');
console.log(details);
}

async function dpCreate() {
winccoa.sysConnect.on(WinccoaSysConEvent.DpCreated, dpCreatedListener);

// create data points
...

winccoa.sysConnect.off(WinccoaSysConEvent.DpCreated, dpCreatedListener);
}

Hierarchy

  • EventEmitter
    • WinccoaSysConnect