OPC/en: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen
Zeile 35: Zeile 35:
===The node-opcua Sample Server===
===The node-opcua Sample Server===
If you installed the samples (as above), a server can be started with:
If you installed the samples (as above), a server can be started with:
cd ~/node_modules/node-opcua-samples/bin
node ~/node_modules/node-opcua-samples/bin/simple_server.js
node simple_server.js


If warning messages about missing modules are shown, you may restart it after
If warning messages about missing modules are shown, you may restart it after

Version vom 16. Dezember 2018, 13:10 Uhr

OPC is a wellknown communication framework used in manufactoring, factory automation and the IoT ("Internet of Things").

Traditionally, OPC used COM/DCOM as underlying transport and was therefore more or less bound to Windows architectures (or required expensive COM/DCOM frameworks under Unix/Linux). In contrast, the more recent OPC-UA ("OPC-Unified Architecture") uses standard TCP communication on top of which either binary data or XML-based HTTP requests are exchanged.

This plugin provides both a server and a client implementation of OPC-UA, by interfacing an open source (and license free) OPC-UA implementation written for NodeJS.

Node Installation[Bearbeiten]

NodeJS is mandatory to be installed on our machine.

Check if node is already present (by entering on the command line):

node --version

or open the expecco settings-dialog and navigate to "External Script Interpreters". If node is not installed, download and install it from "https://nodejs.org/en/download".

Also make sure that the node package manager (npm) is installed with

npm -v

Node-OPC-UA Installation[Bearbeiten]

"node-opcua" is an open source, license free and pure JavaScript implementation of OPC-UA for nodeJS. For more information, consult "https://github.com/node-opcua".

Using "npm", the node package manager, install the "node-opcua" package:

npm install node-opcua 

and optionally, the demo examples with:

npm install node-opcua-samples

Verify that the modules are present in your "~/node_modules" folder. (the OPC_UA_Interface library contains a action block named "Assert "node-opcua" module is present" to verify that the module is found.

If it is not found (typically, because the "node_modules" folder is not configured to be found by node), you can adjust the NODE_PATH setting in the "Extras" - "Settings" - "External Script Interpreters" dialog, or set it in the shell environment before starting expecco.

Launching a Demo Server[Bearbeiten]

The node-opcua Sample Server[Bearbeiten]

If you installed the samples (as above), a server can be started with:

node ~/node_modules/node-opcua-samples/bin/simple_server.js

If warning messages about missing modules are shown, you may restart it after installing additional packages:

npm install usage

Connecting to the Demo Server[Bearbeiten]



Copyright © 2014-2024 eXept Software AG