How to use the node-opcua.StatusCodes 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 / bin / simple_server_with_no_transferSubscription.js View on Github external
server._on_TransferSubscriptionsRequest =(message /* :Message*/, channel/*: ServerSecureChannelLayer*/) => {
        const response = new opcua.TransferSubscriptionsResponse({
            responseHeader: { serviceResult: opcua.StatusCodes.BadNotImplemented }
        });
        return channel.send_response("MSG", response, message);
    }
github node-opcua / node-opcua / packages / node-opcua-end2end-test / test_helpers / hvac_system.js View on Github external
"use strict";

const chalk = require("chalk");
const _ = require("underscore");
const assert = require("node-opcua-assert").assert;
const opcua = require("node-opcua");
const StatusCodes = opcua.StatusCodes;
const DataType = opcua.DataType;
const standardUnits = opcua.standardUnits;

const doDebug = false;

/**
 * @method createHVACSystem
 *
 * @startuml
 *
 * class HVACModuleType {
 * }
 * HVACModuleType -up-> ObjectType
 * HVACModuleType o-down-> ExteriorTemperatureSensor     << (P,#F0F0FF)TemperatureSensorType >>
 * HVACModuleType o-down-> InteriorTemperatureSensor     << (P,#F0F0FF)TemperatureSensorType >>
 * HVACModuleType o-down-> TargetTemperature     << (P,#F0F0FF)TemperatureSensorType >>
github node-opcua / node-opcua / documentation / server_with_method.js View on Github external
method.bindMethod((inputArguments,context,callback) => {
        
            const nbBarks = inputArguments[0].value;
            const volume =  inputArguments[1].value;
        
            console.log("Hello World ! I will bark ",nbBarks," times");
            console.log("the requested volume is ",volume,"");
            const sound_volume = Array(volume).join("!");
        
            const barks = [];
            for(let i=0; i < nbBarks; i++){
                barks.push("Whaff" + sound_volume);
            }
        
            const callMethodResult = {
                statusCode: opcua.StatusCodes.Good,
                outputArguments: [{
                        dataType: opcua.DataType.String,
                        arrayType: opcua.VariantArrayType.Array,
                        value :barks
                }]
            };
            callback(null,callMethodResult);
        });
github node-opcua / node-opcua / documentation / sample_server.js View on Github external
set: function (variant) {
                    variable2 = parseFloat(variant.value);
                    return opcua.StatusCodes.Good;
                }
            }
github node-opcua / node-opcua / documentation / weather.js View on Github external
function extract_value(dataType,city_name,property) {
    const city = city_data_map[city_name];
    if (!city) {
        return opcua.StatusCodes.BadDataUnavailable
    }

    const value = city[property];
    return new opcua.Variant({dataType, value: value });
}
github PacktPublishing / Industrial-Internet-Application-Development / Chapter03 / opcua / sensor / index.js View on Github external
set: function (variant) {
        variable1 = parseFloat(variant.value);
        return opcua.StatusCodes.Good;
      }
    }
github minaandrawos / OPCModbusUAServer / server.js View on Github external
set: function (variant) {
                        modbushandler.WriteValue(type, StartAddress +i,variant);
                        return opcua.StatusCodes.Good;
                    }
                }
github node-opcua / node-opcua / packages / node-opcua-samples / bin / simple_client.js View on Github external
session.read({ nodeId: nodeId, attributeId: AttributeIds.BrowseName},function(err, dataValue) {
        if (!err) {
            if (dataValue.statusCode === opcua.StatusCodes.Good) {
                assert(dataValue.statusCode === opcua.StatusCodes.Good);
                const browseName = dataValue.value.value.name;
                return callback(null,browseName);
            }
        }
        callback(err,"");
    });
}
github node-opcua / node-opcua / packages / node-opcua-samples / bin / simple_client.js View on Github external
async function getBrowseName(session, nodeId) {
    const dataValue = await session.read({ nodeId: nodeId, attributeId: AttributeIds.BrowseName });
    if (dataValue.statusCode === opcua.StatusCodes.Good) {
        return dataValue.value.value.name;
    }
    return null;
}