How to use the node-opcua-service-read.TimestampsToReturn.Neither function in node-opcua-service-read

To help you get started, we’ve selected a few node-opcua-service-read examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-opcua / node-opcua / packages / node-opcua-server / source / monitored_item.ts View on Github external
this._samplingId = undefined;

    this.filter = null;
    this._set_parameters(options);

    this.monitoredItemId = options.monitoredItemId; // ( known as serverHandle)

    this.queue = [];
    this.overflow = false;

    this.oldDataValue = new DataValue({ statusCode: StatusCodes.BadDataUnavailable }); // unset initially

    // user has to call setMonitoringMode
    this.monitoringMode = MonitoringMode.Invalid;

    this.timestampsToReturn = options.timestampsToReturn || TimestampsToReturn.Neither;

    this.itemToMonitor = options.itemToMonitor;

    this._node = null;
    this._semantic_version = 0;

    if (doDebug) {
      debugLog("Monitoring ", options.itemToMonitor.toString());
    }

    this._on_node_disposed_listener = null;

    MonitoredItem.registry.register(this);
  }
github node-opcua / node-opcua / packages / node-opcua-server / source / server_engine.ts View on Github external
nodeToRead: ReadValueIdOptions,
    timestampsToReturn?: TimestampsToReturn
  ): DataValue {

    assert(context instanceof SessionContext);
    const engine = this;
    const nodeId = nodeToRead.nodeId!;
    const attributeId = nodeToRead.attributeId!;
    const indexRange = nodeToRead.indexRange;
    const dataEncoding = nodeToRead.dataEncoding;

    if (timestampsToReturn === TimestampsToReturn.Invalid) {
      return new DataValue({ statusCode: StatusCodes.BadTimestampsToReturnInvalid });
    }

    timestampsToReturn = (timestampsToReturn !== undefined) ? timestampsToReturn : TimestampsToReturn.Neither;

    const obj = engine.__findObject(nodeId!);

    let dataValue;
    if (!obj) {
      // may be return BadNodeIdUnknown in dataValue instead ?
      // Object Not Found
      return new DataValue({ statusCode: StatusCodes.BadNodeIdUnknown });
    } else {

      // check access
      //    BadUserAccessDenied
      //    BadNotReadable
      //    invalid attributes : BadNodeAttributesInvalid
      //    invalid range      : BadIndexRangeInvalid
      try {