Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

node-red-contrib-iiot-opcua

BiancoRoyal1.1kBSD-3-Clause4.1.2

An Industrial IoT OPC UA toolbox contribution package for Node-RED based on node-opcua.

node-red, plus4nodered, opcua, automation, biancoroyal

readme

node-red-contrib-iiot-opcua

Platform Node-RED Node-RED IIoT OPC UA License NPM version ES_Deploy_Version NodeJS_Version Standard - JavaScript Style Guide NPM download Build status Test Coverage Codacy Badge Gitpod Ready-to-Code

The IoT/IIoT OPC UA toolbox package for Node-RED based on node-opcua

  • tested with Node.js v16.15 and Node-RED v3.0.0
  • tested with Node.js v14.19 and Node-RED v2.2.2
  • based on node-opcua v2.64

The actual DATATRONiQ and Iniationware contributions to v4.x+ upgrade the original work of v3.x by migrating to TypeScript, breaking-changes, and updating dependencies, including updates to new major release versions of Node-RED (v1.x to v2.x and higher) and node-opcua (v0.7 to v2.64 and higher). Now DATATRONiQ and Iniationware working together and try to build a community from the industry and individuals to provide an LTS Industrial IoT package for OPC UA.

International IIoT Website for Node-RED

For an international area, Iniationware has provided the PLUS for Node-RED International website.

IIoT Webseite Deutschland für Node-RED

Für einen deutschsprachigen Bereich hat Iniationware die Webseite PLUS for Node-RED Germany bereitgestellt.

Installing

Node-RED

Use the Node-RED "Manage Pallet" to install it via Node-RED

Manual

  1. Navigate to your Node-RED data directly. This defaults to $HOME/.node-red/
  2. Install via npm.
    npm install node-red-contrib-iiot-opcua

Migrating from previous versions

The update from v3.x to v4.x changed the way some nodes are implemented. As a major version v4.x has breaking-changes.

General Changes

  • The message format was standardized. While in older versions, a lot of additional properties were placed directly into the message, they have been moved into the message's payload (msg.payload). This is to ensure the standard Node-RED message format is used, where the message itself may only contain an ID, a topic, and a payload. This means that any references like msg.nodetype should be changed to msg.payload.nodetype.

Browser

  • The option singleBrowseResult has been replaced with multipleOutputs, and the default value now combines all outputs into one message. To maintain the same output, replace singleBrowseResult with multipleOutputs and swap the corresponding boolean value (true becomes false, false becomes true).

Flex-Server

  • The node-opcua library is now directly accessible as opcua. This means all references to coreServer.core.nodeOPCUA should be replaced with opcua.
  • node.iiot.assert is no longer accessible. The functionality can be replaced by using an if statement that throws a new error (if (errorConfition) throw new Error('Error Message'). Errors can be displayed by using a catch node connected to a debug node, which displys the entire message.

Contributing

Every bit helps! If you come across any bugs, please send a bug report, or if you feel inclined to fix it yourself, submit a pull request.

Debugging

To increase the verbosity of logging, enable debug modes and verbose logging.

Start debug with Node-RED in verbose (-v) mode to get a verbose logging:

DEBUG=opcuaIIoT* npm run start -v 1>nodeREDIIoTOPCUA.log 2>&1

Examples

Basic Flow

Flow Example

Your own address space model!

With the flex server you could create your own information model with the OPC UA address space.

Flex server Example

Learn with the examples!

The server node contains demo objects and variables to start playing with OPC UA method call, read and write operations.

see Node-RED menu (right upper corner) -> Import -> Examples -> iiot opcua

Flow Example

... secure reading from OPC UA servers with your own key pairs ...

Read Example

... and secure writing and moving data between OPC UA servers ...

Write Example

Read Write Example

... create your own variables and objects from events ...

Node-RED UAExpert / Client
ASO Example ASO UAExpert

Reconnect via events with the Flex Connector!

Flow Flex Connector

Package Information

License

The BSD 3-Clause License

DATATRONiQ, is the current maintainer of the DATATRONiQ node-red-contrib-iiot-opcua detached Fork

This Node-RED package has been revitalized in 2022 and is based on the node-red-contrib-iiot-opcua package created by Klaus Landsdorf in 2017. Copyright notices by Mika Karaila, Klaus Landsdorf, and others are to honor their work in previous years on Node-RED, OPC-UA, and node-red-contrib-iiot-opcua; we are very grateful for all the time and energy they've invested!!

Klaus Landsdorf, creator and current maintainer of the Bianco-Royal node-red-contrib-iiot-opcua

That is a whole new Node-RED package started in 2017 based on the node-opcua v0.4 and the API documentation. The old copyrights by Mika Karaila are just to honor his pioneer work in the years 2015/2016 for Node-RED and OPC UA.

Important

This is not an official product of the OPC Foundation or Plattform Industrie 4.0.

Special thanks

Special thanks go to Etienne Rossignon for the node-opcua packages and very special for the node-opcua-isa95 package! Special thanks also go to Klaus Landsdorf for creating node-red-contrib-iiot-opcua in the first place!

changelog

4.1.1 (2022-12-12)

Bug Fixes

  • core: #190 data check was wrong (f560daf)
  • demo-server: no events active on i=1234 (2df5a92)
  • known-issues: corrected version num of approximated fix of filter (6a4d0b5)
  • opcua-node: #202 set value on write from local value in node (d6d2dd8)

Features

  • checkEndpoint: now checks Endpoint for a the colon of the port (8cdc790)

4.1.0 (2022-12-08)

Bug Fixes

  • all tests working with node-opcua 2.79.1 (a2a08dc)
  • changed Node-RED PLUS to PLUS for Node-RED (767d567)
  • connector state machine problems on test (55db355)
  • connector-tests: connector e2e tests running again (12cda71)
  • connector: fixed state machine tests and stuff left from testing (78cec80)
  • connector: max subscription deprecated (d58462b)
  • connector: More secure checks for server reconnection and typo fix (9471605)
  • connector: on undefined default throws no error anymore (4aa7620)
  • connector: Removed unnecessary code that got back due to cherrypick (4a1651e)
  • core: missing inject handling and wrong method call (b8ff7e3)
  • crawler: tests improved (0d73663)
  • e2e-flows: new enum value None instead NONE of node-opcua (4b45547)
  • event node changes now the nodetype to "events" (eb6264d)
  • event shortcut functions deprecated (04dafc3)
  • event-listener: e2e tests improved (73a6e94)
  • flex-connector: new throw error and e2e works again (efce751)
  • flex-server: missing new msg structure handling (be856dd)
  • listener now handles nodetype='events' msg and subs events (c20d6ea)
  • listener now handles nodetype='events' msg and subs events (2ef0bfc)
  • listener: did not stop directly (cad1543)
  • listener: e2e test improved (bb3ac03)
  • node problem with an inject payload (8d51868)
  • response-test: wrong node id (6fc8405)
  • response: now fills the green box after an incoming message (e9387cc)
  • response: now fills the green box after an incoming message (a8ea725)
  • server-cmd: e2e test server cmd works again (ee47e17)
  • test: cleaned and extracted flows of ASO test and fixed msg testing (e96998c)
  • test: more result filter e2e tests pass again (10d9b0e)
  • test: payload type is object rather than Array (2e59210)
  • test: Read e2e history range tests now work again (bf9fc6d)
  • tests: None instead NONE of node-opcua for all tests (778ee96)
  • tests: server NONE to None as connector parameter (d811b04)
  • test: test still failed sometimes and +-10ms is still acceptable (2f2ce68)
  • unit_test: corrected done placement and decreased precision to 5 ms (692ea60)
  • units: removed node.receive() from inject tests (d018120)

Features

  • @xstate/fsm: Connector now uses xstate/fsm and all tests pass (019ed45)
  • added default unit test (c764822)
  • added npm run scripts for e2e, unit and core tests on their own (f282bd4)
  • continued working on tests (a37f6f5)
  • created type safe xstate fsm template (b0e1188)
  • direct use of OPC UA object types (9b9cc72)
  • extracted flows from unit tests (523a835)
  • extracted flows from unit tests (66ea610)
  • extracted flows from Unit tests (b1929c7)
  • extracted read-flows (b08a1a5)
  • listener: Now properly uses xstate/fsm instead of stately (0f6bc07)
  • replaced every stately call to xstate/fsm call (d46422b)
  • response-filter: message is to filter (8066c9a)
  • response: new payload type in json (de22d9b)
  • start xstate implementation 1 (77a5ec6)
  • xstate/fsm: started converting stately to @xstate/fsm for listener (ca318a3)

4.0.10 (2022-09-20)

Bug Fixes

  • listener: deconstruct monitoredItem during sendDataFromMonitoredItem (081414a)

4.0.9 (2022-07-29)

Bug Fixes

  • connector: tests mostly working again (81f9917)
  • method-caller: duplicate in value assign (7cb32f5)
  • test: connector method caller (d58cf1d)
  • test: method caller works again but needs more (52f93d3)
  • test: test works again (16633a2)

4.0.7 (2022-07-26)

4.0.6 (2022-07-26)

Bug Fixes

  • codacy markdown (7867233)
  • inject node once did not work (3441933)
  • read from inject does not work (76ce558)
  • test has now good reads (af60409)

4.0.4 (2022-07-22)

4.0.3 (2022-07-22)

Bug Fixes

4.0.2 (2022-07-15)

4.0.1 (2022-05-27)

Bug Fixes

  • missing pki pkg to install via Node-RED (fc852b8)
  • node-red install (8637c00)

4.0.0 (2022-05-27)

3.10.2 (2019-03-17)

Bug Fixes

  • comment unused todo (2c7ad46)
  • issue #89 by checking time interval to pass Int32 stream of node-opcua (d9be2ce)
  • remove ISA95 package (a0c60da)
  • server individual certificates control (a41f529)
  • server LDS options and individual server certs (dc1ea0d)

3.10.0 (2019-03-15)

Bug Fixes

Features

  • set requestedMaxReferencesPerNode to 100k (a62f5bb)

3.9.0 (2019-03-15)

Bug Fixes

3.8.0 (2018-12-21)

Features

  • use connection lost event of node-opcua (0dde329)

3.7.4 (2018-12-06)

Bug Fixes

  • just value on recursive browse was the wrong list (b1ecbf3)

3.7.3 (2018-12-06)

Bug Fixes

  • handle issue #76 different type of boolean results from node-opcua (87cebed)
  • issue #76 integration test addressSpaceList (00e4cea)
  • recursive browse on simple structures issue #77 (dcf17c5)

Features

  • ASO: propertyOf and type definitions with ASO (ecea056)

3.7.2 (2018-11-17)

Bug Fixes

  • listener: issue #71 context global was broken by collections map require (cec1606)

3.7.1 (2018-11-14)

Bug Fixes

  • connector: namespace could be null on deregister nodes (86f73d1)
  • flex-server: default model has to use node.bianco.iiot.assert (6b2ce0a)
  • issue: issue #74 - less memory on restart via CDM (1e2662a)
  • model is cleaned up in every case (a96510d)

Features

  • result-filter: filter from browser and crawler (f7662cc), closes #70
  • result-filter: issue #73 (b6a4653)
  • show more details on response node (b97206e)

3.5.0 (2018-11-09)

Bug Fixes

3.4.3 (2018-11-06)

Bug Fixes

3.4.1 (2018-11-05)

Bug Fixes

  • check user core function (2908f87)
  • terminate only started subscription (3fd767d)

3.4.0 (2018-11-04)

Bug Fixes

  • issue #69 (8477185)
  • listener should not terminate group items on reconnection (75b8dfa)

Features

  • check option and hide certificates and private key settings on default (0f68a40)

3.3.0 (2018-10-25)

Bug Fixes

Features

  • #65 max bad session requests before reconnect starts (77cf255)
  • #68 connector option to set if the connector has subscriptions or not (bbba493)
  • #68 connector option to set if the connector has subscriptions or not (38155ca)

3.2.0 (2018-10-20)

Bug Fixes

  • msg object missed in convert value (387aacd)
  • response multiple results (50510f5)
  • test: failing event subscription (7591119)

Features

3.1.0 (2018-10-18)

Bug Fixes

  • Byte and other datatypes to write to server #52 (02bfb71)
  • flex connector error on deploy to Node-RED (ed336c3)
  • server close improved (5528e23)
  • test do not need discovery every time (26f7fe9)
  • timing in connecting with actual node-opcua server inside node-red (56ae397)

Features

  • limits tab for flex server and option to set delay on close for the flex server (b8321a7)
  • new flex connector the send connection data to the connector via events #44 (25df528)
  • new option to to get some delay on server close (0f89d73)

3.0.0 (2018-10-14)

Bug Fixes

  • API getEndpoints (63f5c00)
  • API: self organised node-opcua (1cb4760)
  • browser: browse without recursive settings (5276e76)
  • browser: list to read and listen (98c1700)
  • browser: wrong result used (0db0aac)
  • code for standard.js (346dac6)
  • examples namespace since 0.4.4 of node-opcua (1088074)
  • issue #54 - new historyStart and historyEnd option parameter via msg or to set from node options (abffca0)
  • listener monitored item select from list (8213bef)
  • listener: browser to listener parameters and options (ee1c7b3)
  • method: variable was not declared anymore (60acae8)
  • new version node-opcua 0.4.6 to fix grouped monitored items problem (c922231)
  • read: history read (9c1b2be)
  • server delay on shutdown for listener subscriptions (82ba6f7)
  • test crawler error travis (029fa76)
  • test: failed on Windows 10 and nodejs 9 (8cef89d)
  • testing suites (72adde6)
  • tests: working with the new v0.4.1 of node-opcua (f8a2bd6)
  • test: test did not end while interval was running (e38e3d1)
  • test: with patterns of codacy (c0b493a)

Features

  • browser: recursive browsing (de98d78)
  • browser: recursive browsing with depth (5b86688)
  • crawler: filter by every key-value pair of the result items (bd16831)
  • crawler: filter by property with a match of string (e251a45)
  • issue #57 passing topic for monitored items (ab8b4ca)
  • listener: new structure for event fields (536f314)
  • new flex-server discovery options (f5de659)
  • response: compressing results (2cc4504)
  • server: flex server working with new namespace operations (0664f52)
  • upgrade node-opcua to v0.4.5 (4d48954)

2.7.1 (2018-05-28)

Bug Fixes

  • inject: error on a whole new flow with the address space items list (cf90fd0)

2.6.1 (2018-04-08)

Bug Fixes

  • reconnect handling via FSM states (9a14424)

2.6.0 (2018-04-07)

2.5.2 (2018-03-31)

Bug Fixes

  • server: ASO Demo switch off (01f7d37)

2.5.1 (2018-03-29)

Features

  • connector: new connection strategy defaults (afe9837)

2.5.0 (2018-03-28)

Bug Fixes

  • node: issue #46 inject type and using payload from events via Node node (b7c884f)
  • nodes: issues while testing (7944ea0)

Features

  • connector: discover for endpoints and endpoint lookup separated (7a55a54)
  • new-browse: browse to single result from multiple address space itmes (0dba722)

2.4.2 (2018-03-27)

2.4.1 (2018-03-27)

Bug Fixes

  • connector: issue #36 sessionId not needed and removed (0a5e1ee)

2.4.0 (2018-03-26)

Bug Fixes

  • BadSession: now reconnecting with a new session (c7b24aa)
  • connector: session handling by node-opcua v0.2.2 (afbaf87)
  • connector: session keepalive, auto select endpoint (1a1b991)

Features

  • new-lib: node-opcua v0.2.3 update (ef046dd)
  • new-lib: node-opcua v0.2.3 update (ef28e76)

2.1.0 (2018-03-05)

2.0.12 (2018-03-05)

2.0.10 (2018-02-25)

2.0.5 (2018-02-20)

2.0.4 (2018-02-16)

2.0.3 (2018-02-12)

1.3.1 (2018-01-07)

1.1.0 (2017-12-24)

1.0.17 (2017-12-03)