Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface OpcuaDataSource

Defines characteristics of an OPC UA data source, including its NodeId or browse path, and optional characteristics for monitoring and data value coercion.

Hierarchy

  • OpcuaDataSource

Indexable

[extra: string]: any

Extra application-specific properties (optional).

Index

Properties

Optional browsePath

browsePath: { relativePath: string; rootNode: any }

Identifies the OPC UA data item to be monitored by its browse path (optional).

This property should be used if the NodeID of the data source is not known beforehand. If the NodeId is known, use the nodeIdentifier property instead. Note that exactly one of both properties must be specified.

The browse path consists of a root node, e.g. "RootFolder", and a relative path of BrowseNames to the target item, e.g. "/Objects/Server.ServerStatus.BuildInfo". Note that the final browse name in the path must specify the item to be monitored, it must not be omitted (i.e. no wildcard operation is allowed). A specification of the relative path BNF can be found here.

Note that in addition to this specification, a browse name within a relative path can also be qualified with a namespace URI instead of a namespace index, in the format [<namespace-uri>]:<name>. For example, [urn:MyOPCUA-Server-default]:MyDevice instead of 1:MyDevice. We recommend to always use namespace URIs so that browse paths can be persisted and resolved across OPC UA sessions.

Type declaration

  • relativePath: string
  • rootNode: any

Optional coerceValue

coerceValue: (value: any, timestamp?: Date, forReading?: boolean) => any

A coercion function that coerces a given OPC UA data value to a value used by application or vice versa (optional).

If not specified, no coercion takes place and the original value is used.

The coercion function is applied in all OPC UA related operations, i.e. when reading, writing, and monitoring OPC UA items. If the coercion function throws an error when invoked, the related operation is not executed and the error is signalled to the invoker of the operation.

The forReading parameter determines whether coercion is invoked for reading/monitoring an OPC UA value or for writing the value of an OPC UA item.

remarks

The optional timestamp passed in the coercion function is a Date indicating the last change of the passed-in value. The timestamp is undefined if not provided in the specific OPC UA operation context).

Type declaration

    • (value: any, timestamp?: Date, forReading?: boolean): any
    • Parameters

      • value: any
      • Optional timestamp: Date
      • Optional forReading: boolean

      Returns any

Optional dataType

dataType: string | DataType

The OPC UA data type used for writing the value of an OPC UA variable (optional). Only used by writing methods of OpcuaConnector.

Optional monitoringParameters

monitoringParameters: { discardOldest?: boolean; filter?: DataChangeFilter | ExtensionObject | null; queueSize?: number; samplingInterval?: number }

Monitoring parameters influence which information is delivered to the client (optional). Main monitoring parameters are the data change filter, size of monitored item queue, and sampling interval (in milliseconds; it is the fastest rate at which the monitored items should be accessed and evaluated).

remarks

These parameters only take effect if the data source is monitored, i.e. if shouldMonitorItem property is set to true.

Type declaration

  • Optional discardOldest?: boolean

    Determines whether to discard the oldest value or the latest value from the monitored item queue in case the queue overflows (optional).

    If not specified, the value defaults to true. If queue size is set to 1, the discard policy is ignored.

  • Optional filter?: DataChangeFilter | ExtensionObject | null

    An optional data change filter is used when you are only interested in certain kinds of changes in the monitored item, or need to reduce the amount of incoming notifications by specifying a deadband. The data change filter defines the conditions under which a data change notification should be reported and, optionally, a range or band for value changes where no data change notification is generated (deadband). See type DataChangeFilter of node-opcua-client package.

    If not specified, no data change filter is set.

    For example, to set a data change filter with a deadband trigger:

    import { DataChangeFilter, DataChangeTrigger, DeadbandType } from "node-opcua-client";
    
    filter: new DataChangeFilter({
       trigger: DataChangeTrigger.StatusValue,
       deadbandType: DeadbandType.Absolute,
       deadbandValue: 0.1
    })
  • Optional queueSize?: number

    The queue size for a monitored item, i.e. the maximum number of data samples which can be queued on the server. When the data gets delivered to the client (publish) the queue gets emptied. Each queue has a discard policy in case an overflow occurs, see property discardOldest.

    Value must be a UInt32. If not specified, the value defaults to 1.

  • Optional samplingInterval?: number

    The interval that defines the fastest rate at which MonitoredItem(s) should be accessed and evaluated (optional, for monitored items only).

    This interval is defined in milliseconds. The default is -1, which specifies that the sampling interval is the same as the publishing interval of the subscription.

    • The value 0 indicates that the Server should use the fastest practical rate.
    • The value -1 indicates that the default sampling interval defined by the publishing interval of the Subscription is requested.
    • A different sampling interval is used if the publishing interval is not a supported sampling interval.
    • Any negative number is interpreted as -1.
    • The sampling interval is not changed if the publishing interval is changed by a subsequent call to the ModifySubscription Service.
    • The Server uses this parameter to assign the MonitoredItems to a sampling interval that it supports.
    • The assigned interval is provided in the revisedSamplingInterval parameter.
    • The Server shall always return a revisedSamplingInterval that is equal or higher than the requested samplingInterval.
    • If the requested samplingInterval is higher than the maximum sampling interval supported by the Server, the maximum sampling interval is returned.

Optional nodeIdentifier

nodeIdentifier: OpcuaNodeIdentifier

Identifies the OPC UA item to be monitored by its fully qualified NodeId (optional).

This property should be used if the NodeId of the data item is known beforehand. If only the browse path of the data item is known, use the browsePath property instead. Note that exactly one of both properties must be specified.

Optional samplingInterval

samplingInterval: number
deprecated

since 2.3.0. Use monitoringParameters.samplingInterval instead.

The interval that defines the fastest rate at which MonitoredItem(s) should be accessed and evaluated (optional, for monitored items only).

This interval is defined in milliseconds. The default is -1, which specifies that the sampling interval is the same as the publishing interval of the subscription.

  • The value 0 indicates that the Server should use the fastest practical rate.
  • The value -1 indicates that the default sampling interval defined by the publishing interval of the Subscription is requested.
  • A different sampling interval is used if the publishing interval is not a supported sampling interval.
  • Any negative number is interpreted as -1.
  • The sampling interval is not changed if the publishing interval is changed by a subsequent call to the ModifySubscription Service.
  • The Server uses this parameter to assign the MonitoredItems to a sampling interval that it supports.
  • The assigned interval is provided in the revisedSamplingInterval parameter.
  • The Server shall always return a revisedSamplingInterval that is equal or higher than the requested samplingInterval.
  • If the requested samplingInterval is higher than the maximum sampling interval supported by the Server, the maximum sampling interval is returned.

Optional shouldMonitorItem

shouldMonitorItem: boolean

Determines whether the OPC UA data item should be monitored (optional).

If not specified, the item is not monitored by default.

Generated using TypeDoc