2.3.1 • Published 4 years ago

@coaty/connector.opcua v2.3.1

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

Coaty JS - OPC UA Connector

Powered by Coaty 2 TypeScript License: MIT release npm version

Table of Contents

Introduction

The Coaty JS OPC UA connector seamlessly connects decentralized Coaty applications with OPC UA servers. It provides specialized controllers to transform OPC UA data sources into Coaty Sensor Things, IO routing sources/actors, and raw MQTT messages, and to map Coaty remote operation calls to OPC UA method calls.

This connector comes with complete API documentation and an example project that demonstrates best practices and typical usage patterns.

Installation

You can install the latest version of the OPC UA connector package in your Coaty project as follows:

npm install @coaty/connector.opcua

This npm package targets Coaty projects using ECMAScript version es5 and module format commonjs.

Note: The OPC UA connector only runs in a Node.js runtime, not in a browser. Internally, it depends on the npm package node-opcua-client.

Getting started

The OPC UA connector package includes the following specialized Coaty JS controllers:

  • OpcuaSensorThingsController - maps readable, monitored OPC UA data items to the Coaty Sensor Things API.
  • OpcuaMqttController - maps readable, monitored OPC UA data items to raw (non-Coaty) MQTT messages.
  • OpcuaIoSourceController - maps readable, monitored OPC UA data items to Coaty IO routing sources.
  • OpcuaIoActorController - maps IO values received by Coaty IO routing actors to writable OPC UA data items.
  • OpcuaRemoteOperationController - maps Coaty Call events to OPC UA method calls.

These controllers are ready to be used as Coaty container components and can be completely configured by controller configuration options. Moreover, if you need to overwrite specific base functionality of such a controller, you can subclass it and overwrite the exposed protected methods.

Custom OPC UA controllers

If none of the predefined OPC UA controllers satisfies your application needs, you can build your own one easily by subclassing the base Coaty Controller class and by utilizing a service class called OpcuaConnector, which is part of this npm package.

This service class provides OPC UA Client functionality to be used by a Coaty controller class:

  • Connect to/disconnect from an OPC UA server and open/close an OPC UA client session.
  • Register OPC UA data nodes to be browsed, monitored, read, or written.
  • Register OPC UA methods to be called.

Details on how to use this service class can be found in the API documentation. The source code of the predefined controllers is also a starting point for your own developments.

Contributing

If you like this connector, please consider starring the project on github. Contributions are welcome and appreciated.

The recommended practice described in the contribution guidelines of the Coaty JS framework also applies here.

To release a new version of this package, follow these steps:

  1. npm run cut-release - prepare a new release, including automatic versioning, conventional changelog, and tagging.
  2. npm run push-release - push the prepared release to the remote git repo
  3. npm run publish-release - publish the package on npm registry.

License

Code and documentation copyright 2020 Siemens AG.

Code is licensed under the MIT License.

Documentation is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.