Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UADataItem

Hierarchy

Implements

  • UAVariable
  • UADataItem

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

Optional $$dataType

$$dataType: any

$$extensionObjectArray

$$extensionObjectArray: any

$$getElementBrowseName

$$getElementBrowseName: any

$$indexPropertyName

$$indexPropertyName: any

Optional $$variableType

$$variableType: any

Optional $extensionObject

$extensionObject: any

Optional $historicalDataConfiguration

$historicalDataConfiguration: HistoricalDataConfiguration

Optional __waiting_callbacks

__waiting_callbacks: any[]

_dataValue

_dataValue: DataValue
internal

_get_func

_get_func: any

_permissions

_permissions: Permissions | null

_set_func

_set_func: any

_timestamped_get_func

_timestamped_get_func: any

_timestamped_set_func

_timestamped_set_func: any

accessLevel

accessLevel: number

Readonly addressSpace

addressSpace: AddressSpace

arrayDimensions

arrayDimensions: null | number[]

Readonly browseName

browseName: QualifiedName

dataType

dataType: NodeId

Optional definition

definition: Property<string, String>

Readonly description

description: LocalizedText

Readonly displayName

displayName: LocalizedText[]

historizing

historizing: boolean

minimumSamplingInterval

minimumSamplingInterval: number

Optional Readonly modellingRule

modellingRule: ModellingRuleType

Readonly namespace

namespace: Namespace

Readonly namespaceIndex

namespaceIndex: number

Readonly namespaceUri

namespaceUri: string

Readonly nodeClass

nodeClass: Variable = NodeClass.Variable

Readonly nodeId

nodeId: NodeId

Optional nodeVersion

nodeVersion: UAVariableT<string, String>

NodeVersion (Optional) String The NodeVersion Property is used to indicate the version of a Node. The NodeVersion Property is updated each time a Reference is added or deleted to the Node the Property belongs to. Attribute value changes do not cause the NodeVersion to change. Clients may read the NodeVersion Property or subscribe to it to determine when the structure of a Node has changed.

Optional onFirstBrowseAction

onFirstBrowseAction: function

Type declaration

    • (this: BaseNode): Promise<void>
    • Parameters

      • this: BaseNode

      Returns Promise<void>

Readonly parent

parent: BaseNode | null

Optional Readonly parentNodeId

parentNodeId: NodeId

Optional refreshFunc

refreshFunc: function

Type declaration

semantic_version

semantic_version: number

typeDefinition

typeDefinition: NodeId

userAccessLevel

userAccessLevel: number

Optional valuePrecision

valuePrecision: Property<number, Double>

valueRank

valueRank: number

Optional varHistorian

varHistorian: IVariableHistorian

Accessors

dataTypeObj

typeDefinitionObj

  • get typeDefinitionObj(): UAVariableType

Methods

_conditionRefresh

  • _conditionRefresh(_cache?: any): void
  • Parameters

    • Optional _cache: any

    Returns void

_getEnumerationInfo

_historyPush

  • _historyPush(newDataValue: DataValue): any
  • Parameters

    • newDataValue: DataValue

    Returns any

_historyRead

  • _historyRead(context: SessionContext, historyReadDetails: ReadRawModifiedDetails | ReadEventDetails | ReadProcessedDetails | ReadAtTimeDetails, indexRange: NumericRange | null, dataEncoding: QualifiedNameLike | null, continuationPoint: ContinuationPoint | null, callback: CallbackT<HistoryReadResult>): any
  • Parameters

    Returns any

_historyReadModify

_historyReadRaw

_historyReadRawAsync

  • _historyReadRawAsync(historyReadRawModifiedDetails: ReadRawModifiedDetails, maxNumberToExtract: number, isReversed: boolean, reverseDataValue: boolean, callback: CallbackT<DataValue[]>): any
  • Parameters

    • historyReadRawModifiedDetails: ReadRawModifiedDetails
    • maxNumberToExtract: number
    • isReversed: boolean
    • reverseDataValue: boolean
    • callback: CallbackT<DataValue[]>

    Returns any

_historyReadRawModify

_internal_set_dataValue

  • _internal_set_dataValue(dataValue: DataValue, indexRange?: NumericRange | null): void
  • Parameters

    • dataValue: DataValue
    • Optional indexRange: NumericRange | null

    Returns void

_update_startOfArchive

  • _update_startOfArchive(newDate: Date): void

_update_startOfOnlineArchive

  • _update_startOfOnlineArchive(newDate: Date): void

_validate_DataType

  • _validate_DataType(variantDataType: DataType): boolean

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

addReference

adjustVariant

  • adjustVariant(variant: Variant): Variant
  • Parameters

    • variant: Variant

    Returns Variant

allReferences

asyncRefresh

  • asyncRefresh(...args: any[]): any

bindExtensionObject

  • bindExtensionObject(optionalExtensionObject?: ExtensionObject): ExtensionObject | null

bindVariable

  • bind a variable with a get and set functions.

    method

    bindVariable

    example
        ...
        var options =  {
          get : () => {
             return new Variant({...});
          },
          set : function(variant) {
             // store the variant somewhere
             return StatusCodes.Good;
          }
       };
       ...
       engine.bindVariable(nodeId,options):
       ...

    Variation 2:

    This variation can be used when the user wants to specify a specific '''sourceTimestamp''' associated with the current value of the UAVariable.

    The provided timestamped_get function should return an object with three properties:

    • value: containing the variant value or a error StatusCode,
    • sourceTimestamp
    • sourcePicoseconds
    ...
    var myDataValue = new DataValue({
      value: {dataType: DataType.Double , value: 10.0},
      sourceTimestamp : new Date(),
      sourcePicoseconds: 0
    });
    ...
    var options =  {
      timestamped_get : () => { return myDataValue;  }
    };
    ...
    engine.bindVariable(nodeId,options):
    ...
    // record a new value
    myDataValue.value.value = 5.0;
    myDataValue.sourceTimestamp = new Date();
    ...

    Variation 3:

    This variation can be used when the value associated with the variables requires a asynchronous function call to be extracted. In this case, the user should provide an async method refreshFunc.

    The refreshFunc shall do whatever is necessary to fetch the most up to date version of the variable value, and call the callback function when the data is ready.

    The callback function follow the standard callback function signature:

    • the first argument shall be null or Error, depending of the outcome of the fetch operation,
    • the second argument shall be a DataValue with the new UAVariable Value, a StatusCode, and time stamps.

    Optionally, it is possible to pass a sourceTimestamp and a sourcePicoseconds value as a third and fourth arguments of the callback. When sourceTimestamp and sourcePicoseconds are missing, the system will set their default value to the current time..

    ...
    var options =  {
       refreshFunc : function(callback) {
         ... do_some_async_stuff_to_get_the_new_variable_value
         var dataValue = new DataValue({
             value: new Variant({...}),
             statusCode: StatusCodes.Good,
             sourceTimestamp: new Date()
         });
         callback(null,dataValue);
       }
    };
    ...
    variable.bindVariable(nodeId,options):
    ...

    Providing write access to the underlying value

    Variation1 - provide a simple synchronous set function

    Notes

    to do : explain return StatusCodes.GoodCompletesAsynchronously;

    Parameters

    Returns void

    void

    Providing read access to the underlying value

    Variation 1

    In this variation, the user provides a function that returns a Variant with the current value.

    The sourceTimestamp will be set automatically.

    The get function is called synchronously.

browseNode

  • browseNode(browseDescription: BrowseDescriptionOptions, session?: SessionContext): ReferenceDescription[]
  • browse the node to extract information requested in browseDescription

    method

    browseNode

    Parameters

    • browseDescription: BrowseDescriptionOptions
    • Optional session: SessionContext

    Returns ReferenceDescription[]

checkExtensionObjectIsCorrect

  • checkExtensionObjectIsCorrect(extObj: ExtensionObject | ExtensionObject[] | null): boolean
  • Parameters

    • extObj: ExtensionObject | ExtensionObject[] | null

    Returns boolean

checkVariantCompatibility

  • checkVariantCompatibility(value: Variant): StatusCode
  • method

    checkVariantCompatibility note: this method is overridden in address-space-data-access

    Parameters

    • value: Variant

    Returns StatusCode

clone

  • clone(options?: any, optionalFilter?: any, extraInfo?: any): UAVariable
  • Parameters

    • Optional options: any
    • Optional optionalFilter: any
    • Optional extraInfo: any

    Returns UAVariable

constructExtensionObjectFromComponents

  • constructExtensionObjectFromComponents(): any

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

findReference

  • findReference(strReference: string, isForward?: boolean): UAReference | null
  • Parameters

    • strReference: string
    • Optional isForward: boolean

    Returns UAReference | null

findReferences

  • findReferences(referenceType: string | NodeId | UAReferenceType, isForward?: boolean): UAReference[]
  • Parameters

    • referenceType: string | NodeId | UAReferenceType
    • Optional isForward: boolean

    Returns UAReference[]

findReferencesAsObject

  • findReferencesAsObject(strReference: string, isForward: boolean): BaseNode[]
  • Parameters

    • strReference: string
    • isForward: boolean

    Returns BaseNode[]

findReferencesEx

findReferencesExAsObject

  • findReferencesExAsObject(strReference: string, browseDirection?: BrowseDirection): BaseNode[]

fullName

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

    Returns string

getAggregates

  • getAggregates(): BaseNode[]
  • Returns BaseNode[]

getChildByName

  • getChildByName(browseName: string | QualifiedName): BaseNode | null
  • Parameters

    • browseName: string | QualifiedName

    Returns BaseNode | null

getComponentByName

  • getComponentByName(componentName: QualifiedNameLike, namespaceIndex?: number): UAObject | UAVariable | null

getComponents

  • getComponents(): BaseNode[]
  • Returns BaseNode[]

getDataTypeNode

getEventSourceOfs

  • getEventSourceOfs(): BaseNode[]
  • return a array of the objects for which this node is an EventSource nodes = HasEventSource => self

    Returns BaseNode[]

getEventSources

  • getEventSources(): BaseNode[]
  • return a array with the event source of this object. self = HasEventSource => nodes

    Returns BaseNode[]

getMaxListeners

  • getMaxListeners(): number

getNotifiers

  • getNotifiers(): BaseNode[]
  • Returns BaseNode[]

getProperties

  • getProperties(): BaseNode[]
  • Returns BaseNode[]

getPropertyByName

  • getPropertyByName(browseName: string, namespaceIndex?: number): UAVariable | null
  • Parameters

    • browseName: string
    • Optional namespaceIndex: number

    Returns UAVariable | null

getUserWriteMask

  • getUserWriteMask(): number

getWriteMask

  • getWriteMask(): number
  • Returns number

handle_semantic_changed

  • handle_semantic_changed(): void

historyRead

  • historyRead(context: SessionContext, historyReadDetails: ReadRawModifiedDetails | ReadEventDetails | ReadProcessedDetails | ReadAtTimeDetails, indexRange: NumericRange | null, dataEncoding: QualifiedNameLike | null, continuationPoint?: ContinuationPoint | null, callback?: CallbackT<HistoryReadResult>): any

incrementExtensionObjectPartial

  • incrementExtensionObjectPartial(path: any): void

install_extra_properties

  • install_extra_properties(): void

isEnumeration

  • isEnumeration(): boolean

isExtensionObject

  • isExtensionObject(): boolean

isReadable

isUserReadable

isUserWritable

isWritable

listenerCount

  • listenerCount(event: string | symbol): number
  • Parameters

    • event: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(eventName: "semantic_changed", eventHandler: function): this
  • on(eventName: "value_changed", eventHandler: function): this
  • Parameters

    • eventName: "semantic_changed"
    • eventHandler: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • eventName: "value_changed"
    • eventHandler: function
        • (dataValue: DataValue): void
        • Parameters

          • dataValue: DataValue

          Returns void

    Returns this

once

  • once(eventName: "semantic_changed", eventHandler: function): this
  • once(eventName: "value_changed", eventHandler: function): this
  • Parameters

    • eventName: "semantic_changed"
    • eventHandler: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • eventName: "value_changed"
    • eventHandler: function
        • (dataValue: DataValue): void
        • Parameters

          • dataValue: DataValue

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

propagate_back_references

  • propagate_back_references(): void
  • this methods propagates the forward references to the pointed node by inserting backward references to the counter part node

    Returns void

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

readAttribute

  • readAttribute(context: SessionContext | null, attributeId: AttributeIds, indexRange?: NumericRange, dataEncoding?: string): DataValue

readEnumValue

readValue

  • readValue(context?: SessionContext | null, indexRange?: NumericRange, dataEncoding?: string): DataValue
  • 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.

    Table 51 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)

    Parameters

    • Optional context: SessionContext | null
    • Optional indexRange: NumericRange
    • Optional dataEncoding: string

    Returns DataValue

readValueAsync

removeAllListeners

  • removeAllListeners(event?: string | symbol): this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

removeReference

setMaxListeners

  • setMaxListeners(n: number): this

setPermissions

  • setPermissions set the role and permissions

    example

    const permissions = { CurrentRead: [ "" ], // all users can read CurrentWrite: [ "!", "Administrator" ] // no one except administrator can write }; node.setPermissions(permissions);

    Parameters

    Returns void

setValueFromSource

  • setValueFromSource(variant: VariantLike, statusCode?: StatusCode, sourceTimestamp?: Date): void
  • setValueFromSource is used to let the device sets the variable values this method also records the current time as sourceTimestamp and serverTimestamp. the method broadcasts an "value_changed" event

    method

    setValueFromSource

    Parameters

    • variant: VariantLike
    • Optional statusCode: StatusCode
    • Optional sourceTimestamp: Date

    Returns void

toString

  • toString(): string
  • Returns string

touchValue

  • touchValue(optionalNow?: PreciseClock): void
  • method

    touchValue touch the source timestamp of a Variable and cascade up the change to the parent variable if any.

    Parameters

    • Optional optionalNow: PreciseClock

    Returns void

updateExtensionObjectPartial

  • updateExtensionObjectPartial(partialExtensionObject: any): any

writeAttribute

  • writeAttribute(context: SessionContext, writeValueOptions: WriteValueOptions | WriteValue, callback?: function): any
  • Parameters

    • context: SessionContext
    • writeValueOptions: WriteValueOptions | WriteValue
    • Optional callback: function
        • (err: Error | null, statusCode?: StatusCode): void
        • Parameters

          • err: Error | null
          • Optional statusCode: StatusCode

          Returns void

    Returns any

writeEnumValue

  • writeEnumValue(value: string | number): void

writeValue

  • writeValue(context: SessionContext, dataValue: DataValue, ...args: any[]): any

Generated using TypeDoc