OPC/en
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.
Inhaltsverzeichnis
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:
Disclaimer! using install
in this way will install the files locally in your current directory.
If you wish for a globally available module, add a -g
at the end.
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]
The node-opcua Sample Client[Bearbeiten]
For a quick smoke test, run the node sample client against the above sample server:
node ~/node_modules/node-opcua-samples/bin/simple_client.js