Options
All
  • Public
  • Public/Protected
  • All
Menu

  subscribe now with sterfive to access the online-user manual

Hierarchy

Index

Methods

getBuiltInDataType

  • getBuiltInDataType(nodeId: NodeId): Promise<DataType>
  • getBuiltInDataType(nodeId: NodeId, callback: (err: Error, dataType?: DataType) => void): void
  • retrieve the built-in DataType of a Variable, from its DataType attribute.

    this method is useful to determine which DataType to use when constructing a Variant

    async
    example
    const session = ...; // ClientSession
    const nodeId = opcua.VariableIds.Server_ServerStatus_CurrentTime;
    session.getBuildInDataType(nodeId,function(err,dataType) {
      assert(dataType === opcua.DataType.DateTime);
    });
    // or
    nodeId = opcua.coerceNodeId("ns=2;s=Scalar_Static_ImagePNG");
    const dataType: await session.getBuildInDataType(nodeId);
    assert(dataType === opcua.DataType.ByteString);
    

    Parameters

    • nodeId: NodeId

      the node id of the variable to query

    Returns Promise<DataType>

  • Parameters

    • nodeId: NodeId
    • callback: (err: Error, dataType?: DataType) => void
        • (err: Error, dataType?: DataType): void
        • Parameters

          • err: Error
          • Optional dataType: DataType

          Returns void

    Returns void

Generated using TypeDoc