How to use the node-opcua-constants.VariableIds.Server_ServerStatus function in node-opcua-constants

To help you get started, we’ve selected a few node-opcua-constants 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-address-space / test_to_fix / test_address_space_construct_extension_object.js View on Github external
it("should bind an xml-preloaded Extension Object Variable : ServerStatus ", function (done) {
        // in this test, we verify that we can easily bind the Server_ServerStatus object
        // the process shall automatically bind variables and substructures recursively
        var VariableIds = require("node-opcua-constants").VariableIds;
        var makeNodeId = require("node-opcua-nodeid").makeNodeId;

        var serverStatus = addressSpace.findNode(makeNodeId(VariableIds.Server_ServerStatus));
        serverStatus.browseName.toString().should.eql("ServerStatus");

        // before bindExtensionObject is called, startTime property exists but is not bound
        serverStatus.should.have.property("startTime");
        serverStatus.startTime.readValue().value.dataType.should.eql(DataType.Null);
        serverStatus.readValue().value.dataType.should.eql(DataType.Null);

        //Xx value.startTime.should.eql(DataType.Null);
        //xx debugLog("serverStatus.startTime =",serverStatus.startTime.readValue().value.toString());


        serverStatus.bindExtensionObject();

        serverStatus.readValue().value.value.startTime.toISOString().should.eql("1601-01-01T00:00:00.000Z");
        serverStatus.startTime.readValue().value.value.toISOString().should.eql("1601-01-01T00:00:00.000Z");
github node-opcua / node-opcua / packages / node-opcua-server / source / server_engine.ts View on Github external
function bindServerStatus() {

        const serverStatusNode =
          addressSpace.findNode(makeNodeId(VariableIds.Server_ServerStatus)) as UAServerStatus;

        if (!serverStatusNode) {
          return;
        }
        if (serverStatusNode) {
          serverStatusNode.bindExtensionObject(engine.serverStatus);
          // xx serverStatusNode.updateExtensionObjectPartial(self.serverStatus);
          // xx self.serverStatus = serverStatusNode.$extensionObject;
          serverStatusNode.minimumSamplingInterval = 1000;
        }

        const currentTimeNode =
          addressSpace.findNode(makeNodeId(VariableIds.Server_ServerStatus_CurrentTime)) as UAVariable;

        if (currentTimeNode) {
          currentTimeNode.minimumSamplingInterval = 1000;
github node-opcua / node-opcua / packages / node-opcua-server / src / server_engine.js View on Github external
function bindServerStatus() {

            const serverStatusNode = engine.addressSpace.findNode(makeNodeId(VariableIds.Server_ServerStatus));
            if (!serverStatusNode) {
                return;
            }
            if (serverStatusNode) {
                serverStatusNode.bindExtensionObject(engine.serverStatus);
                //xx serverStatusNode.updateExtensionObjectPartial(self.serverStatus);
                //xx self.serverStatus = serverStatusNode.$extensionObject;
                serverStatusNode.minimumSamplingInterval = 1000;
            }

            const currentTimeNode = engine.addressSpace.findNode(makeNodeId(VariableIds.Server_ServerStatus_CurrentTime));
            if (currentTimeNode) {
                currentTimeNode.minimumSamplingInterval = 1000;
            }
            const secondsTillShutdown = engine.addressSpace.findNode(makeNodeId(VariableIds.Server_ServerStatus_SecondsTillShutdown));
            if (secondsTillShutdown) {

node-opcua-constants

pure nodejs OPCUA SDK - module constants

MIT
Latest version published 7 months ago

Package Health Score

76 / 100
Full package analysis