How to use the node-opcua-client.AttributeIds 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 / opcua-commander / index.js View on Github external
function monitor_item(treeItem) {

    const node = treeItem.node;

    g_subscription.monitor({
        nodeId: node.nodeId,
        attributeId: opcua.AttributeIds.Value
        //, dataEncoding: { namespaceIndex: 0, name:null }
    }, {
        samplingInterval: 1000,
        discardOldest: true,
        queueSize: 100
    }, 
    opcua.TimestampsToReturn.Both,
    function (err, monitoredItem) {

        if (err) {
            console.log("cannot create monitored item", err.message);
            return;
        }

        node.monitoredItem = monitoredItem;
github node-opcua / opcua-commander / index.js View on Github external
function toString1(attribute, dataValue) {

    if (!dataValue || !dataValue.value || !dataValue.value.hasOwnProperty("value")) {
        return "";
    }
    switch (attribute) {
        case opcua.AttributeIds.DataType:
            return DataTypeIdsToString[dataValue.value.value.value] + " (" + dataValue.value.value.toString() + ")";
        case opcua.AttributeIds.NodeClass:
            return NodeClass[dataValue.value.value] + " (" + dataValue.value.value + ")";
        case opcua.AttributeIds.IsAbstract:
        case opcua.AttributeIds.Historizing:
        case opcua.AttributeIds.EventNotifier:
            return dataValue.value.value ? "true" : "false"
        case opcua.AttributeIds.WriteMask:
        case opcua.AttributeIds.UserWriteMask:
            return " (" + dataValue.value.value + ")";
        case opcua.AttributeIds.NodeId:
        case opcua.AttributeIds.BrowseName:
        case opcua.AttributeIds.DisplayName:
        case opcua.AttributeIds.Description:
        case opcua.AttributeIds.ValueRank:
        case opcua.AttributeIds.ArrayDimensions:
        case opcua.AttributeIds.Executable:
        case opcua.AttributeIds.UserExecutable:
        case opcua.AttributeIds.MinimumSamplingInterval:
            if (!dataValue.value.value) {
github node-opcua / opcua-commander / index.js View on Github external
return NodeClass[dataValue.value.value] + " (" + dataValue.value.value + ")";
        case opcua.AttributeIds.IsAbstract:
        case opcua.AttributeIds.Historizing:
        case opcua.AttributeIds.EventNotifier:
            return dataValue.value.value ? "true" : "false"
        case opcua.AttributeIds.WriteMask:
        case opcua.AttributeIds.UserWriteMask:
            return " (" + dataValue.value.value + ")";
        case opcua.AttributeIds.NodeId:
        case opcua.AttributeIds.BrowseName:
        case opcua.AttributeIds.DisplayName:
        case opcua.AttributeIds.Description:
        case opcua.AttributeIds.ValueRank:
        case opcua.AttributeIds.ArrayDimensions:
        case opcua.AttributeIds.Executable:
        case opcua.AttributeIds.UserExecutable:
        case opcua.AttributeIds.MinimumSamplingInterval:
            if (!dataValue.value.value) {
                return "null";
            }
            return dataValue.value.value.toString();
        case opcua.AttributeIds.UserAccessLevel:
        case opcua.AttributeIds.AccessLevel:
            if (!dataValue.value.value) {
                return "null";
            }
            return opcua.accessLevelFlagToString(dataValue.value.value) + " (" + dataValue.value.value + ")";
        default:
            return dataValueToString(dataValue);
    }
}
github node-opcua / opcua-commander / index.js View on Github external
return DataTypeIdsToString[dataValue.value.value.value] + " (" + dataValue.value.value.toString() + ")";
        case opcua.AttributeIds.NodeClass:
            return NodeClass[dataValue.value.value] + " (" + dataValue.value.value + ")";
        case opcua.AttributeIds.IsAbstract:
        case opcua.AttributeIds.Historizing:
        case opcua.AttributeIds.EventNotifier:
            return dataValue.value.value ? "true" : "false"
        case opcua.AttributeIds.WriteMask:
        case opcua.AttributeIds.UserWriteMask:
            return " (" + dataValue.value.value + ")";
        case opcua.AttributeIds.NodeId:
        case opcua.AttributeIds.BrowseName:
        case opcua.AttributeIds.DisplayName:
        case opcua.AttributeIds.Description:
        case opcua.AttributeIds.ValueRank:
        case opcua.AttributeIds.ArrayDimensions:
        case opcua.AttributeIds.Executable:
        case opcua.AttributeIds.UserExecutable:
        case opcua.AttributeIds.MinimumSamplingInterval:
            if (!dataValue.value.value) {
                return "null";
            }
            return dataValue.value.value.toString();
        case opcua.AttributeIds.UserAccessLevel:
        case opcua.AttributeIds.AccessLevel:
            if (!dataValue.value.value) {
                return "null";
            }
            return opcua.accessLevelFlagToString(dataValue.value.value) + " (" + dataValue.value.value + ")";
        default:
            return dataValueToString(dataValue);
    }
github node-opcua / opcua-commander / index.js View on Github external
return " (" + dataValue.value.value + ")";
        case opcua.AttributeIds.NodeId:
        case opcua.AttributeIds.BrowseName:
        case opcua.AttributeIds.DisplayName:
        case opcua.AttributeIds.Description:
        case opcua.AttributeIds.ValueRank:
        case opcua.AttributeIds.ArrayDimensions:
        case opcua.AttributeIds.Executable:
        case opcua.AttributeIds.UserExecutable:
        case opcua.AttributeIds.MinimumSamplingInterval:
            if (!dataValue.value.value) {
                return "null";
            }
            return dataValue.value.value.toString();
        case opcua.AttributeIds.UserAccessLevel:
        case opcua.AttributeIds.AccessLevel:
            if (!dataValue.value.value) {
                return "null";
            }
            return opcua.accessLevelFlagToString(dataValue.value.value) + " (" + dataValue.value.value + ")";
        default:
            return dataValueToString(dataValue);
    }
}
github node-opcua / opcua-commander / index.js View on Github external
function toString1(attribute, dataValue) {

    if (!dataValue || !dataValue.value || !dataValue.value.hasOwnProperty("value")) {
        return "";
    }
    switch (attribute) {
        case opcua.AttributeIds.DataType:
            return DataTypeIdsToString[dataValue.value.value.value] + " (" + dataValue.value.value.toString() + ")";
        case opcua.AttributeIds.NodeClass:
            return NodeClass[dataValue.value.value] + " (" + dataValue.value.value + ")";
        case opcua.AttributeIds.IsAbstract:
        case opcua.AttributeIds.Historizing:
        case opcua.AttributeIds.EventNotifier:
            return dataValue.value.value ? "true" : "false"
        case opcua.AttributeIds.WriteMask:
        case opcua.AttributeIds.UserWriteMask:
            return " (" + dataValue.value.value + ")";
        case opcua.AttributeIds.NodeId:
        case opcua.AttributeIds.BrowseName:
        case opcua.AttributeIds.DisplayName:
        case opcua.AttributeIds.Description:
        case opcua.AttributeIds.ValueRank:
        case opcua.AttributeIds.ArrayDimensions:
        case opcua.AttributeIds.Executable:
        case opcua.AttributeIds.UserExecutable:
        case opcua.AttributeIds.MinimumSamplingInterval:
            if (!dataValue.value.value) {
                return "null";
            }
            return dataValue.value.value.toString();
        case opcua.AttributeIds.UserAccessLevel:
github node-opcua / opcua-commander / index.js View on Github external
function toString1(attribute, dataValue) {

    if (!dataValue || !dataValue.value || !dataValue.value.hasOwnProperty("value")) {
        return "";
    }
    switch (attribute) {
        case opcua.AttributeIds.DataType:
            return DataTypeIdsToString[dataValue.value.value.value] + " (" + dataValue.value.value.toString() + ")";
        case opcua.AttributeIds.NodeClass:
            return NodeClass[dataValue.value.value] + " (" + dataValue.value.value + ")";
        case opcua.AttributeIds.IsAbstract:
        case opcua.AttributeIds.Historizing:
        case opcua.AttributeIds.EventNotifier:
            return dataValue.value.value ? "true" : "false"
        case opcua.AttributeIds.WriteMask:
        case opcua.AttributeIds.UserWriteMask:
            return " (" + dataValue.value.value + ")";
        case opcua.AttributeIds.NodeId:
        case opcua.AttributeIds.BrowseName:
        case opcua.AttributeIds.DisplayName:
        case opcua.AttributeIds.Description:
        case opcua.AttributeIds.ValueRank:
        case opcua.AttributeIds.ArrayDimensions:
        case opcua.AttributeIds.Executable:
        case opcua.AttributeIds.UserExecutable:
        case opcua.AttributeIds.MinimumSamplingInterval:
            if (!dataValue.value.value) {
                return "null";
github node-opcua / opcua-commander / index.js View on Github external
case opcua.AttributeIds.IsAbstract:
        case opcua.AttributeIds.Historizing:
        case opcua.AttributeIds.EventNotifier:
            return dataValue.value.value ? "true" : "false"
        case opcua.AttributeIds.WriteMask:
        case opcua.AttributeIds.UserWriteMask:
            return " (" + dataValue.value.value + ")";
        case opcua.AttributeIds.NodeId:
        case opcua.AttributeIds.BrowseName:
        case opcua.AttributeIds.DisplayName:
        case opcua.AttributeIds.Description:
        case opcua.AttributeIds.ValueRank:
        case opcua.AttributeIds.ArrayDimensions:
        case opcua.AttributeIds.Executable:
        case opcua.AttributeIds.UserExecutable:
        case opcua.AttributeIds.MinimumSamplingInterval:
            if (!dataValue.value.value) {
                return "null";
            }
            return dataValue.value.value.toString();
        case opcua.AttributeIds.UserAccessLevel:
        case opcua.AttributeIds.AccessLevel:
            if (!dataValue.value.value) {
                return "null";
            }
            return opcua.accessLevelFlagToString(dataValue.value.value) + " (" + dataValue.value.value + ")";
        default:
            return dataValueToString(dataValue);
    }
}
github node-opcua / opcua-commander / index.js View on Github external
switch (attribute) {
        case opcua.AttributeIds.DataType:
            return DataTypeIdsToString[dataValue.value.value.value] + " (" + dataValue.value.value.toString() + ")";
        case opcua.AttributeIds.NodeClass:
            return NodeClass[dataValue.value.value] + " (" + dataValue.value.value + ")";
        case opcua.AttributeIds.IsAbstract:
        case opcua.AttributeIds.Historizing:
        case opcua.AttributeIds.EventNotifier:
            return dataValue.value.value ? "true" : "false"
        case opcua.AttributeIds.WriteMask:
        case opcua.AttributeIds.UserWriteMask:
            return " (" + dataValue.value.value + ")";
        case opcua.AttributeIds.NodeId:
        case opcua.AttributeIds.BrowseName:
        case opcua.AttributeIds.DisplayName:
        case opcua.AttributeIds.Description:
        case opcua.AttributeIds.ValueRank:
        case opcua.AttributeIds.ArrayDimensions:
        case opcua.AttributeIds.Executable:
        case opcua.AttributeIds.UserExecutable:
        case opcua.AttributeIds.MinimumSamplingInterval:
            if (!dataValue.value.value) {
                return "null";
            }
            return dataValue.value.value.toString();
        case opcua.AttributeIds.UserAccessLevel:
        case opcua.AttributeIds.AccessLevel:
            if (!dataValue.value.value) {
                return "null";
            }
            return opcua.accessLevelFlagToString(dataValue.value.value) + " (" + dataValue.value.value + ")";
        default:
github node-opcua / opcua-commander / index.js View on Github external
}
    switch (attribute) {
        case opcua.AttributeIds.DataType:
            return DataTypeIdsToString[dataValue.value.value.value] + " (" + dataValue.value.value.toString() + ")";
        case opcua.AttributeIds.NodeClass:
            return NodeClass[dataValue.value.value] + " (" + dataValue.value.value + ")";
        case opcua.AttributeIds.IsAbstract:
        case opcua.AttributeIds.Historizing:
        case opcua.AttributeIds.EventNotifier:
            return dataValue.value.value ? "true" : "false"
        case opcua.AttributeIds.WriteMask:
        case opcua.AttributeIds.UserWriteMask:
            return " (" + dataValue.value.value + ")";
        case opcua.AttributeIds.NodeId:
        case opcua.AttributeIds.BrowseName:
        case opcua.AttributeIds.DisplayName:
        case opcua.AttributeIds.Description:
        case opcua.AttributeIds.ValueRank:
        case opcua.AttributeIds.ArrayDimensions:
        case opcua.AttributeIds.Executable:
        case opcua.AttributeIds.UserExecutable:
        case opcua.AttributeIds.MinimumSamplingInterval:
            if (!dataValue.value.value) {
                return "null";
            }
            return dataValue.value.value.toString();
        case opcua.AttributeIds.UserAccessLevel:
        case opcua.AttributeIds.AccessLevel:
            if (!dataValue.value.value) {
                return "null";
            }
            return opcua.accessLevelFlagToString(dataValue.value.value) + " (" + dataValue.value.value + ")";