How to use the node-opcua-data-value.apply_timestamps function in node-opcua-data-value

To help you get started, we’ve selected a few node-opcua-data-value 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 / server_engine.ts View on Github external
assert(dataValue.statusCode instanceof StatusCode);
        if (!dataValue.isValid()) {
          console.log("Invalid value for node ", obj.nodeId.toString(), obj.browseName.toString());
        }

      } catch (err) {
        console.log(" Internal error reading  NodeId       ", obj.nodeId.toString());
        console.log("                         AttributeId  ", attributeId.toString());
        console.log("                        ", err.message);
        console.log("                        ", err.stack);
        return new DataValue({ statusCode: StatusCodes.BadInternalError });
      }

      // Xx console.log(dataValue.toString());

      dataValue = apply_timestamps(dataValue, timestampsToReturn, attributeId);

      return dataValue;
    }
  }
github node-opcua / node-opcua / packages / node-opcua-server / src / server_engine.js View on Github external
if(!dataValue.isValid()) {
                console.log("Invalid value for node ",obj.nodeId.toString(),obj.browseName.toString());
            }

        }
        catch (err) {
            console.log(" Internal error reading  NodeId       ", obj.nodeId.toString());
            console.log("                         AttributeId  ", attributeId.toString());
            console.log("                        ", err.message);
            console.log("                        ", err.stack);
            return new DataValue({statusCode: StatusCodes.BadInternalError});
        }

        //Xx console.log(dataValue.toString());

        dataValue = apply_timestamps(dataValue, timestampsToReturn, attributeId);

        return dataValue;
    }
};
github node-opcua / node-opcua / packages / node-opcua-server / source / monitored_item.ts View on Github external
private _makeDataChangeNotification(dataValue: DataValue): MonitoredItemNotification {
    const attributeId = this.itemToMonitor.attributeId;
    dataValue = apply_timestamps(dataValue, this.timestampsToReturn, attributeId);
    return new MonitoredItemNotification({
      clientHandle: this.clientHandle,
      value: dataValue
    });
  }
github node-opcua / node-opcua / packages / node-opcua-server / src / monitored_item.js View on Github external
MonitoredItem.prototype._makeDataChangeNotification = function (dataValue) {
    const self = this;
    const attributeId = self.itemToMonitor.attributeId;
    dataValue = apply_timestamps(dataValue, self.timestampsToReturn, attributeId);
    return new subscription_service.MonitoredItemNotification({clientHandle: self.clientHandle, value: dataValue});
};