This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // copyright Etienne Rossignon - 2017 | |
| var makeNodeId = opcua.makeNodeId; | |
| var ObjectTypeIds = opcua.ObjectTypeIds; | |
| function getAllEventTypes(session,callback) | |
| { | |
| var baseNodeId = makeNodeId(ObjectTypeIds.BaseEventType); | |
| var q = new async.queue(function(task,callback) { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const opcua = require("node-opcua"); | |
| const userName = "user1" | |
| const password = "password1" | |
| //xx const endpointUrl = "opc.tcp://192.168.249.31:4840"; | |
| const endpointUrl = "opc.tcp://localhost:26543"; | |
| //xx const nodeId = "ns=4;s=opctest1_Copy1"; | |
| const nodeId = "ns=411;s=Scalar_Static_UInt16"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*global require,console,setTimeout */ | |
| /// issues: #237 #288 | |
| const opcua = require("node-opcua"); | |
| const async = require("async"); | |
| const _ = require("underscore"); | |
| const client = new opcua.OPCUAClient({ | |
| endpoint_must_exist: false, | |
| keepSessionAlive: true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { OPCUAClient } from "../packages/node-opcua-client"; | |
| async function main() { | |
| try { | |
| const endpointUrl2 = "opc.tcp://localhost:48010"; | |
| const client = OPCUAClient.create({ | |
| endpoint_must_exist: false | |
| }); | |
| await client.connect(endpointUrl2); | |
| const session = await client.createSession(); | |
| await session.close(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // tslint:disable:no-console | |
| import { AttributeIds, ClientSession, OPCUAClient } from "node-opcua"; | |
| const endpointUrl = "opc.tcp://opcuademo.sterfive.com:26543"; | |
| async function main() { | |
| try { | |
| const client = OPCUAClient.create({clientName: "DemoClient"}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const opcua = require("node-opcua"); | |
| (async () => { | |
| const client = opcua.OPCUAClient.create(); | |
| client.on("backoff", () => console.log("reconnection in progress", client.endpointUrl)); | |
| const endpointUrl = "opc.tcp://opcuademo.sterfive.com:26543"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* global console, require */ | |
| const opcua = require("node-opcua"); | |
| const server = new opcua.OPCUAServer({ | |
| port: 26543 // the port of the listening socket of the server | |
| }); | |
| function post_initialize() { | |
| const addressSpace = server.engine.addressSpace; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # docker build . -t node-red-contrib-iiot-opcua | |
| # docker run node-red-contrib-iiot-opcua | |
| FROM mhart/alpine-node | |
| RUN apk add git make python g++ openssl | |
| RUN cd /home && git clone https://github.com/biancode/node-red-contrib-iiot-opcua.git | |
| RUN cd /home/node-red-contrib-iiot-opcua && \ | |
| git reset HEAD --hard && \ | |
| git fetch && \ | |
| git checkout develop && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { OPCUAClient , NodeCrawler} = require("node-opcua"); | |
| const async = require("async"); | |
| const util = require("util"); | |
| const client = OPCUAClient.create({ | |
| endpoint_must_exist: false | |
| }); | |
| // UA Automation Ansi Demo Server | |
| const endpointUrl = "opc.tcp://localhost:48020"; |