How to use the node-opcua.nodesets function in node-opcua

To help you get started, we’ve selected a few node-opcua 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-end2end-test / test_helpers / build_server_with_temperature_device.js View on Github external
function build_server_with_temperature_device(options, done) {

    assert(_.isFunction(done, "expecting a callback function"));
    assert(typeof opcua.nodesets.standard_nodeset_file === "string");

    //xx console.log("xxx building server with temperature device");

    // use mini_nodeset_filename for speed up if not otherwise specified
    options.nodeset_filename = options.nodeset_filename ||
        [
            opcua.nodesets.standard_nodeset_file
        ];

    options.userManager = userManager;

    const server = new OPCUAServer(options);
    // we will connect to first server end point

    server.on("session_closed", function (session, reason) {
        //xx console.log(" server_with_temperature_device has closed a session :",reason);
        //xx console.log(chalk.cyan("              session name: "),session.sessionName.toString());
    });

    server.on("post_initialize", function () {

        const addressSpace = server.engine.addressSpace;
github node-opcua / node-opcua / packages / node-opcua-end2end-test / test_helpers / build_server_with_temperature_device.js View on Github external
function build_server_with_temperature_device(options, done) {

    assert(_.isFunction(done, "expecting a callback function"));
    assert(typeof opcua.nodesets.standard_nodeset_file === "string");

    //xx console.log("xxx building server with temperature device");

    // use mini_nodeset_filename for speed up if not otherwise specified
    options.nodeset_filename = options.nodeset_filename ||
        [
            opcua.nodesets.standard_nodeset_file
        ];

    options.userManager = userManager;

    const server = new OPCUAServer(options);
    // we will connect to first server end point

    server.on("session_closed", function (session, reason) {
        //xx console.log(" server_with_temperature_device has closed a session :",reason);
github node-opcua / node-opcua / packages / node-opcua-samples / bin / demo_server_with_alarm.js View on Github external
#!/usr/bin/env node
"use strict";
 /*global require,setInterval,console */
const path = require("path");
const opcua = require("node-opcua");
function constructFilename(filename) {
    return path.join(__dirname,"../",filename);
}
const server_certificate_file            = constructFilename("certificates/server_selfsigned_cert_2048.pem");
const server_certificate_privatekey_file = constructFilename("certificates/server_key_2048.pem");

const nodeset_filenames = [ opcua.nodesets.standard_nodeset_file ];

const server = new opcua.OPCUAServer({
    certificateFile: server_certificate_file,
    privateKeyFile: server_certificate_privatekey_file,

    port: 4334, // the port of the listening socket of the server
    resourcePath: "/UA/MyLittleServer", // this path will be added to the endpoint resource name
    buildInfo : {
        productName: "DemoAlarmServer",
        buildNumber: "1",
        buildDate: new Date(2016,9,27)
    },
    nodeset_filename: nodeset_filenames
});
github node-opcua / node-opcua / packages / node-opcua-end2end-test / test_helpers / bin / simple_server_with_no_transferSubscription.js View on Github external
Error.stackTraceLimit = Infinity;

const argv = require("yargs")
    .wrap(132)
    .string("port")
    .describe("port")
    .alias('p', 'port')
    .argv;

const rootFolder = path.join(__dirname,"../");
function constructFilename(pathname) {
    return path.join(__dirname,"../../",pathname);
}

const OPCUAServer = opcua.OPCUAServer;
const standard_nodeset_file = opcua.nodesets.standard_nodeset_file;


const port = parseInt(argv.port) || 26555;

const server_certificate_file            = constructFilename("certificates/server_cert_2048.pem");
const server_certificate_privatekey_file = constructFilename("certificates/server_key_2048.pem");

const server_options = {
    certificateFile: server_certificate_file,
    privateKeyFile: server_certificate_privatekey_file,
    port: port,
    nodeset_filename: [
        standard_nodeset_file,
        path.join(rootFolder,"modeling/my_data_type.xml")
    ]
};
github node-opcua / node-opcua / packages / node-opcua-end2end-test / test_helpers / bin / simple_server_with_custom_extension_objects.js View on Github external
Error.stackTraceLimit = Infinity;

const argv = require("yargs")
    .wrap(132)
    .string("port")
    .describe("port")
    .alias('p', 'port')
    .argv;

const rootFolder = path.join(__dirname,"../");
function constructFilename(pathname) {
    return path.join(__dirname,"../../",pathname);
}

const OPCUAServer = opcua.OPCUAServer;
const standard_nodeset_file = opcua.nodesets.standard_nodeset_file;


const port = parseInt(argv.port) || 26555;

const server_certificate_file            = constructFilename("certificates/server_cert_1024.pem");
const server_certificate_privatekey_file = constructFilename("certificates/server_key_1024.pem");

const server_options = {
    certificateFile: server_certificate_file,
    privateKeyFile: server_certificate_privatekey_file,
    port: port,
    nodeset_filename: [
        standard_nodeset_file,
        path.join(rootFolder,"modeling/my_data_type.xml")
    ]
};
github node-opcua / node-opcua / test / test_aggregates.ts View on Github external
beforeEach((done) => {

        addressSpace = opcua.AddressSpace.create();

        const nodesets: string[] = [
            opcua.nodesets.standard_nodeset_file
        ];
        opcua.generateAddressSpace(addressSpace, nodesets, (err?: Error) => {
            done(err);
        });
    });
github node-opcua / node-opcua / packages / node-opcua-end2end-test / test_helpers / bin / simple_server_that_terminate_session_too_early.js View on Github external
Error.stackTraceLimit = Infinity;

const argv = require("yargs")
    .wrap(132)
    .string("port")
    .describe("port")
    .alias('p', 'port')
    .argv;

const rootFolder = path.join(__dirname,"../");
function constructFilename(pathname) {
    return path.join(__dirname,"../../",pathname);
}

const OPCUAServer = opcua.OPCUAServer;
const standard_nodeset_file = opcua.nodesets.standard_nodeset_file;


const port = parseInt(argv.port) || 26555;

const server_certificate_file            = constructFilename("certificates/server_cert_2048.pem");
const server_certificate_privatekey_file = constructFilename("certificates/server_key_2048.pem");

const server_options = {
    certificateFile: server_certificate_file,
    privateKeyFile: server_certificate_privatekey_file,
    port: port,
    nodeset_filename: [
        standard_nodeset_file,
        path.join(rootFolder,"modeling/my_data_type.xml")
    ]
};
github node-opcua / node-opcua / test / test_aggregates.ts View on Github external
before((done: (err: Error | null) => void) => {

        addressSpace = opcua.AddressSpace.create();

        const nodesets: string[] = [
            opcua.nodesets.standard_nodeset_file
        ];
        opcua.generateAddressSpace(addressSpace, nodesets, (err?: Error) => {

            const namespace = addressSpace.registerNamespace("PRIVATENAMESPACE");
            namespace.index.should.eql(1);
            should.exist(addressSpace.getOwnNamespace());

            addAggregateSupport(addressSpace);

            h1 = createHistorian1(addressSpace);
            h2 = createHistorian2(addressSpace);
            h3 = createHistorian3(addressSpace);
            h4 = createHistorian4(addressSpace);

            done(err!);
        });
github node-opcua / node-opcua / packages / node-opcua-samples / bin / simple_server.js View on Github external
console.log(" server certificate : ", server_certificate_file);

const productUri = argv.applicationName || "NodeOPCUA-Server";
const server_options = {

  certificateFile: server_certificate_file,
  privateKeyFile: server_certificate_privatekey_file,

  port: port,
  //xx (not used: causes UAExpert to get confused) resourcePath: "UA/Server",

  maxAllowedSessionNumber: maxAllowedSessionNumber,
  maxConnectionsPerEndpoint: maxConnectionsPerEndpoint,

  nodeset_filename: [
    opcua.nodesets.standard_nodeset_file,
    opcua.nodesets.di_nodeset_filename
  ],

  serverInfo: {
    applicationName: { text: "NodeOPCUA", locale: "en" },
    applicationUri: makeApplicationUrn("%FQDN%", productUri),
    gatewayServerUri: null,
    productUri: productUri,
    discoveryProfileUri: null,
    discoveryUrls: []
  },
  buildInfo: {
    buildNumber: "1234"
  },
  serverCapabilities: {
    maxBrowseContinuationPoints: 10,
github node-opcua / node-opcua / packages / node-opcua-samples / bin / simple_server.js View on Github external
const productUri = argv.applicationName || "NodeOPCUA-Server";
const server_options = {

  certificateFile: server_certificate_file,
  privateKeyFile: server_certificate_privatekey_file,

  port: port,
  //xx (not used: causes UAExpert to get confused) resourcePath: "UA/Server",

  maxAllowedSessionNumber: maxAllowedSessionNumber,
  maxConnectionsPerEndpoint: maxConnectionsPerEndpoint,

  nodeset_filename: [
    opcua.nodesets.standard_nodeset_file,
    opcua.nodesets.di_nodeset_filename
  ],

  serverInfo: {
    applicationName: { text: "NodeOPCUA", locale: "en" },
    applicationUri: makeApplicationUrn("%FQDN%", productUri),
    gatewayServerUri: null,
    productUri: productUri,
    discoveryProfileUri: null,
    discoveryUrls: []
  },
  buildInfo: {
    buildNumber: "1234"
  },
  serverCapabilities: {
    maxBrowseContinuationPoints: 10,
    maxHistoryContinuationPoints: 10,