NodeOPCUA API Documentation
    Preparing search index...

    Interface UASamplingIntervalDiagnostics<T>

    namespace http://opcfoundation.org/UA/
    nodeClass VariableType
    typedDefinition SamplingIntervalDiagnosticsType i=2165
    dataType ExtensionObject
    dataType Name DTSamplingIntervalDiagnostics i=856
    value rank -1
    isAbstract false
    interface UASamplingIntervalDiagnostics<T extends DTSamplingIntervalDiagnostics> {
        $extensionObject?: any;
        accessLevel: number;
        arrayDimensions: number[] | null;
        browseName: QualifiedName;
        dataType: NodeId;
        dataTypeObj: UADataType;
        disabledMonitoredItemsSamplingCount: UABaseDataVariable<number, UInt32>;
        historizing: boolean;
        maxSampledMonitoredItemsCount: UABaseDataVariable<number, UInt32>;
        minimumSamplingInterval: number;
        nodeClass: Variable;
        nodeId: NodeId;
        onFirstBrowseAction?: (this: BaseNode) => Promise<void>;
        parent: BaseNode<BaseNodeEvents> | null;
        sampledMonitoredItemsCount: UABaseDataVariable<number, UInt32>;
        samplingInterval: UABaseDataVariable<number, Double>;
        semantic_version: number;
        userAccessLevel?: number;
        valueRank: number;
        get accessRestrictions(): AccessRestrictionsFlag | undefined;
        get addressSpace(): IAddressSpace;
        get description(): LocalizedText;
        get displayName(): LocalizedText[];
        get modellingRule(): ModellingRuleType | undefined;
        get namespace(): INamespace;
        get namespaceIndex(): number;
        get namespaceUri(): string;
        get parentNodeId(): NodeId | undefined;
        get rolePermissions(): RolePermissionType[] | undefined;
        get typeDefinition(): NodeId;
        get typeDefinitionObj(): UAVariableType;
        addReference(options: AddReferenceOpts): void;
        allReferences(): UAReference[];
        asyncRefresh(
            oldestDate: PreciseClock,
            callback: CallbackT<DataValue>,
        ): void;
        asyncRefresh(oldestDate: PreciseClock): Promise<DataValue>;
        bindExtensionObject(
            optionalExtensionObject?: ExtensionObject | ExtensionObject[],
            options?: BindExtensionObjectOptions,
        ): ExtensionObject | ExtensionObject[] | null;
        bindExtensionObjectArray(
            optionalExtensionObjectArray?: ExtensionObject[],
            options?: BindExtensionObjectOptions,
        ): ExtensionObject[] | null;
        bindExtensionObjectScalar(
            optionalExtensionObject?: ExtensionObject,
            options?: BindExtensionObjectOptions,
        ): ExtensionObject | null;
        bindVariable(options?: BindVariableOptions, overwrite?: boolean): void;
        browseNode(
            browseDescription: BrowseDescriptionOptions2,
            session?: ISessionContext,
        ): ReferenceDescription[];
        browseNodeByTargetName(
            relativePathElement: RelativePathElement,
            isLast: boolean,
        ): NodeId[];
        changeDataType(newDataType: NodeIdLike, newValue?: VariantOptions): void;
        clone(
            options: CloneOptions,
            optionalFilter?: CloneFilter,
            extraInfo?: CloneExtraInfo,
        ): UAVariable;
        emit<K extends keyof UAVariableEvents>(
            event: K,
            ...args: Parameters<UAVariableEvents[K]>,
        ): boolean;
        findReference(
            referenceType: string | NodeId | UAReferenceType,
            isForward?: boolean,
        ): UAReference | null;
        findReferences(
            referenceType: string | NodeId | UAReferenceType,
            isForward?: boolean,
        ): UAReference[];
        findReferencesAsObject(
            referenceType: string | NodeId | UAReferenceType,
            isForward?: boolean,
        ): BaseNode<BaseNodeEvents>[];
        findReferencesEx(
            referenceType: string | NodeId | UAReferenceType,
            browseDirection?: BrowseDirection,
        ): UAReference[];
        findReferencesExAsObject(
            referenceType: string | NodeId | UAReferenceType,
            browseDirection?: BrowseDirection,
        ): BaseNode<BaseNodeEvents>[];
        fullName(): string;
        getAccessRestrictions(inherited: boolean): AccessRestrictionsFlag;
        getAggregates(): BaseNode<BaseNodeEvents>[];
        getBasicDataType(): DataType;
        getChildByName(
            browseName: QualifiedNameOptions,
        ): BaseNode<BaseNodeEvents> | null;
        getChildByName(
            browseName: string,
            namespaceIndex?: number,
        ): BaseNode<BaseNodeEvents> | null;
        getComponentByName(
            componentName: QualifiedNameOptions,
        ): UAObject<UAObjectEvents> | UAVariable<UAVariableEvents> | null;
        getComponentByName(
            componentName: string,
            namespaceIndex?: number,
        ): UAObject<UAObjectEvents> | UAVariable<UAVariableEvents> | null;
        getComponents(): BaseNode<BaseNodeEvents>[];
        getDisplayName(locale?: string): string;
        getEventSourceOfs(): BaseNode<BaseNodeEvents>[];
        getEventSources(): BaseNode<BaseNodeEvents>[];
        getNodeVersion(): UAProperty<UAString, String> | null;
        getNotifiers(): BaseNode<BaseNodeEvents>[];
        getProperties(): BaseNode<BaseNodeEvents>[];
        getPropertyByName(
            propertyName: QualifiedNameOptions,
        ): UAVariable<UAVariableEvents> | null;
        getPropertyByName(
            propertyName: string,
            namespaceIndex?: number,
        ): UAVariable<UAVariableEvents> | null;
        getRolePermissions(inherited: boolean): RolePermissionType[] | null;
        historyRead(
            context: ISessionContext,
            historyReadDetails:
                | HistoryReadDetails
                | ReadAtTimeDetails
                | ReadEventDetails
                | ReadProcessedDetails
                | ReadRawModifiedDetails,
            indexRange: NumericRange | null,
            dataEncoding: QualifiedNameLike | null,
            continuationData: ContinuationData,
        ): Promise<HistoryReadResult>;
        historyRead(
            context: ISessionContext,
            historyReadDetails:
                | HistoryReadDetails
                | ReadAtTimeDetails
                | ReadEventDetails
                | ReadProcessedDetails
                | ReadRawModifiedDetails,
            indexRange: NumericRange | null,
            dataEncoding: QualifiedNameLike | null,
            continuationData: ContinuationData,
            callback: CallbackT<HistoryReadResult>,
        ): void;
        install_extra_properties(): void;
        installExtensionObjectVariables(): void;
        isDisposed(): boolean;
        isEnumeration(): boolean;
        isExtensionObject(): boolean;
        isReadable(context: ISessionContext): boolean;
        isUserReadable(context: ISessionContext): boolean;
        isUserWritable(context: ISessionContext): boolean;
        isWritable(context: ISessionContext): boolean;
        listenerCount<K extends keyof UAVariableEvents>(event: K): number;
        off<K extends keyof UAVariableEvents>(
            event: K,
            listener: UAVariableEvents[K],
        ): this;
        on<K extends keyof UAVariableEvents>(
            event: K,
            listener: UAVariableEvents[K],
        ): this;
        once<K extends keyof UAVariableEvents>(
            event: K,
            listener: UAVariableEvents[K],
        ): this;
        readAttribute(
            context: ISessionContext | null,
            attributeId: AttributeIds,
            indexRange?: NumericRange,
            dataEncoding?: QualifiedNameLike | null,
        ): DataValue;
        readEnumValue(): EnumValue2;
        readValue(
            context?: ISessionContext | null,
            indexRange?: NumericRange,
            dataEncoding?: QualifiedNameLike | null,
        ): DataValueT<T, ExtensionObject>;
        readValueAsync(
            context: ISessionContext | null,
        ): Promise<DataValueT<T, ExtensionObject>>;
        readValueAsync(
            context: ISessionContext | null,
            callback: CallbackT<DataValueT<T, ExtensionObject>>,
        ): void;
        removeAllListeners(): void;
        removeListener<K extends keyof UAVariableEvents>(
            event: K,
            listener: UAVariableEvents[K],
        ): void;
        removeReference(referenceOpts: AddReferenceOpts): void;
        setAccessRestrictions(accessRestrictions: AccessRestrictionsFlag): void;
        setDescription(value: LocalizedTextLike | null): void;
        setDisplayName(value: LocalizedTextLike | LocalizedTextLike[]): void;
        setMaxListeners(n: number): void;
        setRolePermissions(rolePermissions: RolePermissionTypeOptions[]): void;
        setValueFromSource(
            value: VariantOptions,
            statusCode?: StatusCode,
            sourceTimestamp?: Date,
        ): void;
        touchValue(updateNow?: PreciseClock): void;
        writeAttribute(
            context: ISessionContext | null,
            writeValue: WriteValueOptions,
            callback: StatusCodeCallback,
        ): void;
        writeAttribute(
            context: ISessionContext | null,
            writeValue: WriteValueOptions,
        ): Promise<StatusCode>;
        writeEnumValue(value: string | number): void;
        writeValue(
            context: ISessionContext,
            dataValue: DataValueT<T, ExtensionObject>,
            indexRange: NumericRange | null,
            callback: StatusCodeCallback,
        ): void;
        writeValue(
            context: ISessionContext,
            dataValue: DataValueT<T, ExtensionObject>,
            callback: StatusCodeCallback,
        ): void;
        writeValue(
            context: ISessionContext,
            dataValue: DataValueT<T, ExtensionObject>,
            indexRange?: NumericRange | null,
        ): Promise<StatusCode>;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    $extensionObject?: any
    accessLevel: number

    The AccessLevel Attribute is used to indicate how the Value of a Variable can be accessed (read/write) and if it contains current and/or historic data.

    The AccessLevel does not take any user access rights into account, i.e. although the Variable is writable this may be restricted to a certain user / user group.

    The {{link:AccessLevelType}}

    arrayDimensions: number[] | null

    This Attribute specifies the length of each dimension for an array value.

    • The Attribute is intended to describe the capability of the Variable, not the current size.
    • The number of elements shall be equal to the value of the valueRank Attribute.
    • Shall be null if valueRank <=0.
    • A value of 0 for an individual dimension indicates that the dimension has a variable length.

    example

    For example, if a Variable is defined by the following javascript array with 346 Int32 elements:

    const myArray = new Array(346).fill(0);

    then:

    • DataType would point to an Int32
    • the Variable's valueRank has the value 1 and,
    • the arrayDimensions is an array with one entry having the value 346.
    {
    dataType: "Int32",
    valueRank: 1,
    arrayDimensions: [346]
    }

    Note: the maximum length of an array transferred on the wire is 2147483647 (max Int32) and a multidimensional array is encoded as a one dimensional array.

    browseName: QualifiedName
    dataType: NodeId
    dataTypeObj: UADataType
    disabledMonitoredItemsSamplingCount: UABaseDataVariable<number, UInt32>
    historizing: boolean

    The historizing attribute indicates whether the server is actively collecting data for the history of the variable.

    This differs from the accessLevel Attribute which identifies if the variable has any historical data.

    A value of true indicates that the server is actively collecting data.

    A value of false indicates the server is not actively collecting data.

    Default value is false.

    maxSampledMonitoredItemsCount: UABaseDataVariable<number, UInt32>
    minimumSamplingInterval: number

    The MinimumSamplingInterval Attribute indicates how 'current' the Value of the Variable will be kept.

    It specifies (in milliseconds) how fast the Server can reasonably sample the value for changes (see Part 4 for a detailed description of sampling interval).

    A MinimumSamplingInterval of 0 indicates that the Server is to monitor the item continuously.

    A MinimumSamplingInterval of -1 means indeterminate.

    nodeClass: Variable
    nodeId: NodeId
    onFirstBrowseAction?: (this: BaseNode) => Promise<void>
    parent: BaseNode<BaseNodeEvents> | null
    sampledMonitoredItemsCount: UABaseDataVariable<number, UInt32>
    samplingInterval: UABaseDataVariable<number, Double>
    semantic_version: number
    userAccessLevel?: number

    The UserAccessLevel Attribute is used to indicate how the Value of a Variable can be accessed (read/write) and if it contains current or historic data taking user access rights into account.

    The AccessLevelType is defined in 8.57.

    valueRank: number

    This Attribute indicates whether the Value Attribute of the Variable is an array and how many dimensions the array has. It may have the following values:

    • n > 1 : the Value is an array with the specified number of dimensions.
    • OneDimension (1): The value is an array with one dimension.
    • OneOrMoreDimensions (0): The value is an array with one or more dimensions.
    • Scalar (-1): The value is not an array.
    • Any (-2): The value can be a scalar or an array with any number of dimensions.
    • ScalarOrOneDimension (-3): The value can be a scalar or a one dimensional array.

    NOTE:

    • All DataTypes are considered to be scalar, even if they have array-like semantics like ByteString and String.

    Accessors

    • get accessRestrictions(): AccessRestrictionsFlag | undefined

      Returns AccessRestrictionsFlag | undefined

    • get addressSpace(): IAddressSpace

      Returns IAddressSpace

    • get description(): LocalizedText

      Returns LocalizedText

    • get displayName(): LocalizedText[]

      Returns LocalizedText[]

    • get modellingRule(): ModellingRuleType | undefined

      Returns ModellingRuleType | undefined

    • get namespace(): INamespace

      Returns INamespace

    • get namespaceIndex(): number

      Returns number

    • get namespaceUri(): string

      Returns string

    • get parentNodeId(): NodeId | undefined

      Returns NodeId | undefined

    • get rolePermissions(): RolePermissionType[] | undefined

      Returns RolePermissionType[] | undefined

    • get typeDefinition(): NodeId

      Returns NodeId

    • get typeDefinitionObj(): UAVariableType

      Returns UAVariableType

    Methods

    • find the the references that are strictly of type reference.

      The isForward boolean flag specifies the direction of the references to be looked for.

      Forward direction is implied if omitted.

      • will throw an exception if more than one reference exists with the referenceType.
      • will return null if no reference exists.

      Parameters

      Returns UAReference | null

    • find all the references that are strictly of type reference. The isForward boolean flag specifies the direction of the references to be looked for.

      Forward direction is implied if omitted.

      Parameters

      Returns UAReference[]

    • find all the nodes that are referenced by references strictly of type reference.

      The isForward boolean flag specifies the direction of the references to be looked for.

      Forward direction is implied if omitted.

      • will throw an exception if more than one reference exists with the referenceType.
      • will return null if no reference exists.

      Parameters

      Returns BaseNode<BaseNodeEvents>[]

    • return a complete name of this object by pre-pending name of its parent(s) to its own name

      Returns string

    • get effective accessRestrictions if (inherited is true) and node has no accessRestrictions, then default accessRestriction from namespace is returned if (inherited is false) and node has no accessRestrictions, then AccessRestrictionsFlag.None is returned

      Parameters

      • inherited: boolean

      Returns AccessRestrictionsFlag

    • returns the basic type of the variable that correspond to the dataType, that will be used in the dataValue.value.dataType property.

      Returns DataType

    • Parameters

      • Optionallocale: string

        the locale of the text to return (e.g. en-EN)

      Returns string

    • Returns boolean

    • Returns boolean

    • returns true if the accessLevel flag allows the variable to be readable in the specified context.

      Parameters

      Returns boolean

    • returns true if the userAccessLevel flag allows the variable to be readable in the specified context.

      Parameters

      Returns boolean

    • returns true if the userAccessLevel flag allows the variable to be writeable in the specified context.

      Parameters

      Returns boolean

    • returns true if the accessLevel flag allows the variable to be writeable in the specified context.

      Parameters

      Returns boolean

    • from OPC.UA.Spec 1.02 part 4 5.10.2.4 StatusCodes Table 51 defines values for the operation level statusCode contained in the DataValue structure of each values element. Common StatusCodes are defined in Table 166.

      Read Operation Level Result Codes

      Symbolic Id Description
      BadNodeIdInvalid The syntax of the node id is not valid.
      BadNodeIdUnknown The node id refers to a node that does not exist in the server address space.
      BadAttributeIdInvalid BadAttributeIdInvalid The attribute is not supported for the specified node.
      BadIndexRangeInvalid The syntax of the index range parameter is invalid.
      BadIndexRangeNoData No data exists within the range of indexes specified.
      BadDataEncodingInvalid The data encoding is invalid. This result is used if no dataEncoding can be applied because an Attribute other than Value was requested or the DataType of the Value Attribute is not a subtype of the Structure DataType.
      BadDataEncodingUnsupported The server does not support the requested data encoding for the node. This result is used if a dataEncoding can be applied but the passed data encoding is not known to the Server.
      BadNotReadable The access level does not allow reading or subscribing to the Node.
      BadUserAccessDenied User does not have permission to perform the requested operation. (table 165)
      BadSecurityModeInsufficient The operation is not permitted over the current secure channel.
      BadInsufficientPrivileges The user does not have enough privileges to perform the requested operation.

      Parameters

      Returns DataValueT<T, ExtensionObject>

    • Parameters

      • n: number

      Returns void

    • write a variable attribute (callback version)

      Parameters

      • context: ISessionContext | null
      • writeValue: WriteValueOptions
      • callback: StatusCodeCallback

        example

          const writeValue = {
        attributeId: AttributeIds.Value,
        dataValue: new DataValue({
        statusCode: StatusCodes.Good,
        sourceTimestamp: new Date(),
        value: new Variant({ dataType: DataType.Double, value: 3.14 })
        }),
        nodeId
        };
        myVariable.writeAttribute(context,writeValue,(err, statusCode) => {
        if (err) { console.log("Write has failed"); return; }
        console.log("write statusCode = ",statusCode.toString());
        });

      Returns void

    • write a variable attribute (async/await version)

      Parameters

      • context: ISessionContext | null
      • writeValue: WriteValueOptions

        example

        try {
        const writeValue = {
        attributeId: AttributeIds.Value,
        dataValue: new DataValue({
        statusCode: StatusCodes.Good,
        sourceTimestamp: new Date(),
        value: new Variant({ dataType: DataType.Double, value: 3.14 })
        }),
        nodeId
        };
        const statusCode = await myVariable.writeAttribute(context,writeValue);
        } catch(err) {
        console.log("Write has failed");
        return;
        }
        console.log("write statusCode = ", statusCode.toString());

      Returns Promise<StatusCode>

    • precondition: UAVariable must have a dataType deriving from "Enumeration"

      Parameters

      • value: string | number

      Returns void