How to use the node-opcua-variant.DataType.UInt32 function in node-opcua-variant

To help you get started, we’ve selected a few node-opcua-variant 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-client / source / alarms_and_conditions / client_tools.ts View on Github external
(innerCallback: ErrorCallback) => {

            const methodToCall: CallMethodRequestLike = {
                inputArguments: [
                    new Variant({ dataType: DataType.UInt32, value: subscriptionId })
                ],
                methodId: conditionRefreshId,
                objectId: conditionTypeNodeId
            };

            debugLog("xxxxx Calling method ", methodToCall.toString());
            theSession.call(methodToCall, (err: Error | null, result?: CallMethodResult) => {
                if (err) {
                    return innerCallback(err);
                }
                result = result!;

                // istanbul ignore next
                if (result.statusCode !== StatusCodes.Good) {
                    return innerCallback(new Error("Error " + result.statusCode.toString()));
                }
github node-opcua / node-opcua / packages / node-opcua-server / source / server_engine.ts View on Github external
return engine.serverCapabilities.maxHistoryContinuationPoints;
          });

        // added by DI : Server-specific period of time in milliseconds until the Server will revoke a lock.
        // TODO bindStandardScalar(VariableIds.Server_ServerCapabilities_MaxInactiveLockTime,
        // TODO     DataType.UInt16, function () {
        // TODO         return self.serverCapabilities.maxInactiveLockTime;
        // TODO });

        bindStandardArray(VariableIds.Server_ServerCapabilities_SoftwareCertificates,
          DataType.ExtensionObject, "SoftwareCertificates", () => {
            return engine.serverCapabilities.softwareCertificates;
          });

        bindStandardScalar(VariableIds.Server_ServerCapabilities_MaxArrayLength,
          DataType.UInt32, () => {
            return engine.serverCapabilities.maxArrayLength;
          });

        bindStandardScalar(VariableIds.Server_ServerCapabilities_MaxStringLength,
          DataType.UInt32, () => {
            return engine.serverCapabilities.maxStringLength;
          });

        bindStandardScalar(VariableIds.Server_ServerCapabilities_MaxByteStringLength,
          DataType.UInt32, () => {
            return engine.serverCapabilities.maxByteStringLength;
          });

        function bindOperationLimits(operationLimits: OperationLimits) {

          assert(_.isObject(operationLimits));
github node-opcua / node-opcua / packages / node-opcua-address-space / src / base_node.js View on Github external
case AttributeIds.BrowseName: // QualifiedName
            assert(this.browseName instanceof QualifiedName);
            options.value = {dataType: DataType.QualifiedName, value: this.browseName};
            break;

        case AttributeIds.DisplayName: // LocalizedText
            options.value = {dataType: DataType.LocalizedText, value: this.displayName[0]};
            break;

        case AttributeIds.Description: // LocalizedText
            options.value = {dataType: DataType.LocalizedText, value: this.description};
            break;

        case AttributeIds.WriteMask:
            options.value = {dataType: DataType.UInt32, value: this.getWriteMask()};
            break;

        case AttributeIds.UserWriteMask:
            options.value = {dataType: DataType.UInt32, value: this.getUserWriteMask()};
            break;

        default:
            options.value = null;
            //xx debugLog("class Name ", this.constructor.name, (" BaseNode : '" + this.browseName + "' nodeid=" + this.nodeId.toString()).yellow, " cannot get attribute ", AttributeNameById[attributeId], "(", attributeId, ")");
            options.statusCode = StatusCodes.BadAttributeIdInvalid;
            break;
    }
    //xx options.serverTimestamp = new Date();
    return new DataValue(options);
};
github node-opcua / node-opcua / packages / node-opcua-client / src / client_session.js View on Github external
ClientSession.prototype.getMonitoredItems = function (subscriptionId, callback) {

    // 
    // 
    // 
    const self = this;
    const methodsToCall =
        new call_service.CallMethodRequest({
            objectId: coerceNodeId("ns=0;i=2253"),  // ObjectId.Server
            methodId: coerceNodeId("ns=0;i=11492"), // MethodIds.Server_GetMonitoredItems;
            inputArguments: [
                // BaseDataType
                {dataType: DataType.UInt32, value: subscriptionId}
            ]
        });

    self.call([methodsToCall], function (err, result) {

            /* istanbul ignore next */
            if (err) {
                return callback(err);
            }

            result = result[0];

            if (result.statusCode.isNot(StatusCodes.Good)) {

                callback(new Error(result.statusCode.toString()), result);
github node-opcua / node-opcua / packages / node-opcua-address-space-for-conformance-testing / src / address_space_for_conformance_testing.js View on Github external
const setFunc = function(variant) {

            value = variant.value;

            const server = addressSpace.rootFolder.objects.server;

            server.raiseEvent("3:MyEventType", {
                message: {
                    dataType: DataType.LocalizedText,
                    value: { text: "Hello World" }
                },
                severity: {
                    dataType: DataType.UInt32,
                    value: 32
                }

            });
        };
github node-opcua / node-opcua / packages / node-opcua-vendor-diagnostic / source / vendor_diagnostic_nodes.ts View on Github external
get: () => {
                    if (!usage_result) {
                        return StatusCodes.BadResourceUnavailable;
                    }
                    return new Variant({dataType: DataType.UInt32, value: usage_result.memory});
                }
            }
github node-opcua / node-opcua / packages / node-opcua-address-space / src / view.js View on Github external
View.prototype.readAttribute = function (context, attributeId) {

    assert(context instanceof SessionContext);

    const options = {};

    switch (attributeId) {
        case AttributeIds.EventNotifier:
            options.value = {dataType: DataType.UInt32, value: this.eventNotifier};
            options.statusCode = StatusCodes.Good;
            break;
        case AttributeIds.ContainsNoLoops:
            options.value = {dataType: DataType.Boolean, value: this.containsNoLoops};
            options.statusCode = StatusCodes.Good;
            break;
        default:
            return BaseNode.prototype.readAttribute.call(this, context, attributeId);
    }
    return new DataValue(options);
};
exports.View = View;
github node-opcua / node-opcua / packages / node-opcua-file-transfer / source / client / client_file.ts View on Github external
public async getPosition(): Promise {
        await this.ensureInitialized();
        if (!this.fileHandle) {
            throw new Error("File has node been opened yet");
        }

        const result = await this.session.call({
            inputArguments: [
                { dataType: DataType.UInt32, value: this.fileHandle }
            ],
            methodId: this.getPositionNodeId,
            objectId: this.fileNodeId
        });
        if (result.statusCode !== StatusCodes.Good) {
            throw new Error("Error " + result.statusCode.toString());
        }
        return result.outputArguments![0].value as UInt64;
    }
github node-opcua / node-opcua / packages / node-opcua-address-space / src / ua_variable.js View on Github external
function prepareVariantValue(dataType, value) {
        if ((dataType === DataType.Int32 || dataType === DataType.UInt32) && value && value.key) {
            value = value.value;
        }
        return value;
    }