APIs

Show:

AddressSpace is a collection of UA nodes.

const addressSpace = new AddressSpace();

Constructor

AddressSpace

(
  • conditionTypeId
  • options
  • data
)
UAConditionBase

Parameters:

  • conditionTypeId Object
  • options Object
  • data Object

Returns:

Methods

_coerceNode

(
  • node
)
private

Parameters:

  • node Object

Returns:

:

_isFolder

(
  • addressSpace
  • folder
)
Boolean private

return true if nodeId is a Folder

Parameters:

  • addressSpace Object
  • folder Object

Returns:

Boolean:

addAlias

(
  • alias_name
  • nodeId
)

Parameters:

  • alias_name String

    the alias name

  • nodeId NodeId

addEnumerationType

(
  • options
)

Parameters:

  • options Object
    • browseName String
    • enumeration Array
    • enumeration[].displayName String | LocalizedText
    • enumeration[].value Number
    • enumeration[].description String | LocalizedText | Null

addEnumerationType

(
  • options
)

Parameters:

  • options Object
    • browseName String
    • enumeration Array
    • enumeration[].displayName String | LocalizedText
    • enumeration[].value Number
    • enumeration[].description String | LocalizedText | Null

addFolder

(
  • parentFolder
  • options
)
BaseNode

Parameters:

  • parentFolder Object
  • options String | Object
    • browseName String

      the name of the folder

    • [nodeId] NodeId optional

      . An optional nodeId for this object

Returns:

addMethod

(
  • parentObject
  • options
)
Object

Parameters:

  • parentObject Object
  • options Object
    • [nodeId=null] NodeId optional

      the object nodeid.

    • [browseName=""] String optional

      the object browse name.

    • [description=""] String optional

      the object description.

    • inputArguments Array
    • outputArguments Array

Returns:

Object:

addMultiStateValueDiscrete

(
  • options
  • [options.value
)
Object | UAVariable

Parameters:

  • options Object
  • [options.value UInt32

    = 0 }

Returns:

Object | UAVariable:

Example:

 namespace.addMultiStateValueDiscrete({
                          componentOf:parentObj,
                          browseName: "myVar",
                          enumValues: {
                              "Red":    0xFF0000,
                              "Green":  0x00FF00,
                              "Blue":   0x0000FF
                          }
                      });
                      addMultiStateValueDiscrete(parentObj,{
                          browseName: "myVar",
                          enumValues: [
                              {
                                 value: 0xFF0000,
                                 displayName: "Red",
                                 description: " The color Red"
                              },
                              {
                                 value: 0x00FF000,
                                 displayName: "Green",
                                 description: " The color Green"
                              },
                              {
                                 value: 0x0000FF,
                                 displayName: "Blue",
                                 description: " The color Blue"
                              }
                         ]
                      });

addTransition

(
  • component
  • fromState
  • toState
  • transitionNumber
)
UAObject

Parameters:

  • component UAObject
  • fromState StateType | InitialStateType
  • toState StateType | InitialStateType
  • transitionNumber Number

Returns:

UAObject:

TransitionType

addTwoStateDiscrete

(
  • options
  • [options.value
  • [options.trueState
  • [options.falseState
)
Object | UAVariable

Parameters:

  • options Object
    • browseName String
    • [nodeId] NodeId optional
  • [options.value Boolean

    }

  • [options.trueState String

    = "ON" }

  • [options.falseState String

    = "OFF" }

Returns:

Object | UAVariable:

addYArrayItem

(
  • options
)

Parameters:

  • options Object
    • componentOf NodeId
    • browseName String
    • title String
    • [instrumentRange] optional
      • [low] Double optional
      • [high] Double optional
    • engineeringUnitsRange.low Double
    • engineeringUnitsRange.high Double
    • engineeringUnits String
    • [nodeId] NodeId optional
    • accessLevel
    • userAccessLevel
    • title String
    • axisScaleType AxisScaleEnumeration
    • xAxisDefinition AxisInformation
      • engineeringUnits EURange
      • range
      • range.low
      • range.high
      • title LocalizedText
      • axisScaleType AxisScaleEnumeration
      • axisSteps Array
        =
    • value

browsePath

(
  • browsePath
)
BrowsePathResult

browse some path.

Parameters:

Returns:

BrowsePathResult:

This service can be used translates one or more browse paths into NodeIds. A browse path is constructed of a starting Node and a RelativePath. The specified starting Node identifies the Node from which the RelativePath is based. The RelativePath contains a sequence of ReferenceTypes and BrowseNames.

StatusCode
BadNodeIdUnknown
BadNodeIdInvalid
BadNothingToDo - the relative path contains an empty list )
BadBrowseNameInvalid - target name is missing in relative path
UncertainReferenceOutOfServer - The path element has targets which are in another server.
BadTooManyMatches
BadQueryTooComplex
BadNoMatch

browseSingleNode

(
  • nodeId
  • browseDescription
  • [session]
)
BrowseResult

Parameters:

Returns:

constructExtensionObject

(
  • dataType
  • [options =null]
)
Object

Parameters:

  • dataType UADataType
  • [options =null] Object optional

Returns:

Object:

Example:

        // example 1
                            var extObj = addressSpace.constructExtensionObject("BuildInfo",{ productName: "PRODUCTNAME"});
                    
                            // example 2
                            serverStatusDataType.should.be.instanceOf(UADataType);
                            serverStatusDataType.browseName.toString().should.eql("ServerStatusDataType");
                            var serverStatus  = addressSpace.constructExtensionObject(serverStatusDataType);
                            serverStatus.constructor.name.should.eql("ServerStatus");

dispose

()

cleanup all resources maintained by this addressSpace.

extractRootViews

(
  • node
)
BaseNode[]

walk up the hierarchy of objects until a view is found objects may belong to multiples views. Note: this method doesn't return the main view => Server object.

Parameters:

Returns:

findCorrespondingBasicDataType

(
  • dataTypeNode
)

Parameters:

  • dataTypeNode Object

Example:

const dataType = addressSpace.findDataType("ns=0;i=12");
                    addressSpace.findCorrespondingBasicDataType(dataType).should.eql(DataType.String);
                    
                    const dataType = addressSpace.findDataType("ServerStatus"); // ServerStatus
                    addressSpace.findCorrespondingBasicDataType(dataType).should.eql(DataType.ExtensionObject);
                    

findDataType

(
  • dataType
  • [namespaceIndex=0]
)
DataType | Null

Find the DataType node from a NodeId or a browseName

Parameters:

  • dataType String | NodeId
  • [namespaceIndex=0] Number optional

    an optional namespace index

Returns:

DataType | Null:

Example:

 const dataDouble = addressSpace.findDataType("Double");
                    
                     const dataDouble = addressSpace.findDataType(resolveNodeId("ns=0;i=3"));

findNode

(
  • nodeId
)
BaseNode | Null

find an node by node Id

Parameters:

  • nodeId NodeId | String

    a nodeId or a string coerce-able to nodeID, representing the object to find.

Returns:

BaseNode | Null:

findObjectType

(
  • objectType
  • [namespaceIndex=0]
)
UAObjectType | Null

Parameters:

  • objectType String | NodeId | QualifiedName
  • [namespaceIndex=0] Number optional

    an optional namespace index

Returns:

UAObjectType | Null:

Example:

const objectType = addressSpace.findObjectType("ns=0;i=58");
                     objectType.browseName.toString().should.eql("BaseObjectType");
                    const objectType = addressSpace.findObjectType("BaseObjectType");
                     objectType.browseName.toString().should.eql("BaseObjectType");
                    const objectType = addressSpace.findObjectType(resolveNodeId("ns=0;i=58"));
                     objectType.browseName.toString().should.eql("BaseObjectType");
                    const objectType = addressSpace.findObjectType("CustomObjectType",36);
                     objectType.nodeId.namespace.should.eql(36);
                     objectType.browseName.toString().should.eql("BaseObjectType");
                    const objectType = addressSpace.findObjectType("36:CustomObjectType");
                     objectType.nodeId.namespace.should.eql(36);
                     objectType.browseName.toString().should.eql("BaseObjectType");

findReferenceType

(
  • refType
  • [namespace=0]
)
ReferenceType | Null

Parameters:

  • refType String | NodeId
  • [namespace=0] Number optional

    an optional namespace index

Returns:

ReferenceType | Null:

refType could be a string representing a nodeid : e.g. 'i=9004' or ns=1;i=6030 a string representing a browse name : e.g 'HasTypeDefinition' in this case it should be in the alias list

findReferenceTypeFromInverseName

(
  • inverseName
)
ReferenceType

find a ReferenceType by its inverse name.

Parameters:

  • inverseName String

    the inverse name of the ReferenceType to find

Returns:

findTransitionNode

(
  • fromStateNode
  • toStateNode
)
UAObject

Parameters:

Returns:

findVariableType

(
  • variableType
  • [namespaceIndex=0]
)
UAObjectType | Null

Parameters:

  • variableType String | NodeId
  • [namespaceIndex=0] Number optional

    an optional namespace index

Returns:

UAObjectType | Null:

Example:

const objectType = addressSpace.findVariableType("ns=0;i=62");
                    objectType.browseName.toString().should.eql("BaseVariableType");
                    
                    const objectType = addressSpace.findVariableType("BaseVariableType");
                    objectType.browseName.toString().should.eql("BaseVariableType");
                    
                    const objectType = addressSpace.findVariableType(resolveNodeId("ns=0;i=62"));
                    objectType.browseName.toString().should.eql("BaseVariableType");

getCurrentState

() String

Returns:

String:

getStateByName

(
  • name
)
Null | UAObject

Parameters:

  • name String

Returns:

Null | UAObject:

historyRead

(
  • context
  • historyReadDetails
  • indexRange
  • dataEncoding
  • continuationPoint
  • callback
)

Parameters:

installHistoricalDataNode

(
  • node
  • [options]
)

Parameters:

  • node Object

    UAVariable

  • [options] Object optional
    • [maxOnlineValues= 1000] optional

inverseReferenceType

(
  • referenceType
)
String

returns the inverse name of the referenceType.

Parameters:

  • referenceType String

    : the reference type name

Returns:

String:

the name of the inverse reference type.

Example:

addressSpace.inverseReferenceType("OrganizedBy").should.eql("Organizes");
                    addressSpace.inverseReferenceType("Organizes").should.eql("OrganizedBy");
                    

isNodeIdString

(
  • str
)

returns true if str matches a nodeID, e.g i=123 or ns=...

Parameters:

  • str Object

isValidTransition

(
  • toStateNode
)
Boolean

Parameters:

  • toStateNode Object

Returns:

Boolean:

make_back_references

(
  • addressSpace
)

Parameters:

normalizeReferenceType

(
  • params.referenceType
  • params.isForward
)
Object

Parameters:

  • params.referenceType String | NodeId
  • params.isForward Boolean

    default value: true;

Returns:

Object:

a new reference object with the normalized name { referenceType: , isForward: }

registerShutdownTask

()

register a function that will be called when the server will perform its shut down.

resolveNodeId

(
  • nodeId
)
NodeId

resolved a string or a nodeId to a nodeID

Parameters:

Returns:

setState

(
  • toStateNode
)

Parameters: