NodeOPCUA API Documentation
    Preparing search index...

    Interface ClientSessionDataTypeService

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

    Hierarchy (View Summary)

    Index

    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: Error | null, dataType?: DataType) => void

      Returns void