How to use the node-opcua-client.OPCUAClient function in node-opcua-client

To help you get started, we’ve selected a few node-opcua-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-opcua / node-opcua / packages / node-opcua / index.js View on Github external
module.exports.node_managment_service = require("node-opcua-service-node-management");

module.exports.ServerState = require("node-opcua-common").ServerState;
module.exports.ServiceCounter = require("node-opcua-common").ServiceCounter;

module.exports.SecurityPolicy = require("node-opcua-secure-channel").SecurityPolicy;
module.exports.MessageSecurityMode = require("node-opcua-service-secure-channel").MessageSecurityMode;

module.exports.utils = require("node-opcua-utils");
module.exports.crypto_utils = require("node-opcua-crypto");
module.exports.hexDump = require("node-opcua-debug").hexDump;

//----------------------------------------------------------------------------------------------------------------------
// client services
//----------------------------------------------------------------------------------------------------------------------
module.exports.OPCUAClient = require("node-opcua-client").OPCUAClient;
module.exports.OPCUAClientBase = require("node-opcua-client").OPCUAClientBase;

module.exports.NodeCrawler = require("node-opcua-client-crawler").NodeCrawler;
module.exports.ClientSubscription = require("node-opcua-client").ClientSubscription;
module.exports.ClientSession = require("node-opcua-client").ClientSession;

module.exports.client_utils = require("node-opcua-client/src/client_utils");
module.exports.perform_findServers = require("node-opcua-client").perform_findServers;
module.exports.perform_findServersOnNetwork = require("node-opcua-client").perform_findServersOnNetwork;
module.exports.readHistoryServerCapabilities = require("node-opcua-client").readHistoryServerCapabilities;

module.exports.callConditionRefresh = require("node-opcua-client/src/alarms_and_conditions/client_tools").callConditionRefresh;

module.exports.parseEndpointUrl = require("node-opcua-transport").parseEndpointUrl;

//----------------------------------------------------------------------------------------------------------------------
github node-opcua / node-opcua / packages / node-opcua-model / bin / extract_schema.js View on Github external
function parse_opcua_server(endpoint, callback) {

    const options = {
        endpoint_must_exist: false,
        keepSessionAlive: true,
        connectionStrategy: {
            maxRetry: 10,
            initialDelay: 2000,
            maxDelay: 10 * 1000
        }
    };

    const client = opcua.OPCUAClient.create(options);
    client.withSession(endpointUrl, function (session, callback) {
        callbackify(parse_opcua_common)(session, callback);
    }, function (err) {
        callback(err);
    });
}
github node-opcua / opcua-commander / index.js View on Github external
const privateKeyFile = path.join(__dirname, "certificates", "PKI/own/private/private_key.pem");



const data = {
    reconnectionCount: 0,
    tokenRenewalCount: 0,
    receivedBytes: 0,
    sentBytes: 0,
    sentChunks: 0,
    receivedChunks: 0,
    backoffCount: 0,
    transactionCount: 0,
};

const client = opcua.OPCUAClient.create({

    endpoint_must_exist: false,

    securityMode: securityMode,
    securityPolicy: securityPolicy,
    //xx serverCertificate: serverCertificate,
    defaultSecureTokenLifetime: 40000,
    certificateFile: certificateFile,
    privateKeyFile: privateKeyFile,

    keepSessionAlive: true

});

client.on("send_request", function () {
    data.transactionCount++;