interface ClientSessionDataTypeService {
    getBuiltInDataType(nodeId: NodeId): Promise<DataType>;
    getBuiltInDataType(nodeId: NodeId, callback: ((err: null | Error, dataType?: DataType) => void)): void;
}

Hierarchy (view full)

Methods

  • 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

    Parameters

    • nodeId: NodeId

      the node id of the variable to query

    Returns Promise<DataType>

    const session = ...; // ClientSession
    const nodeId = opcua.VariableIds.Server_ServerStatus_CurrentTime;
    session.getBuiltInDataType(nodeId,function(err,dataType) {
    assert(dataType === opcua.DataType.DateTime);
    });
    // or
    nodeId = opcua.coerceNodeId("ns=2;s=Static_Scalar_ImagePNG");
    const dataType: await session.getBuiltInDataType(nodeId);
    assert(dataType === opcua.DataType.ByteString);
  • Parameters

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

          • err: null | Error
          • OptionaldataType: DataType

          Returns void

    Returns void