How to use the node-opcua-service-read.ReadValueId 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-client / src / client_session.js View on Github external
function coerceReadValueId(node) {

        if (typeof node === "string" || node instanceof NodeId) {
            return new read_service.ReadValueId({
                nodeId: resolveNodeId(node),
                attributeId: read_service.AttributeIds.Value,
                indexRange: null,
                dataEncoding: {namespaceIndex: 0, name: null}
            });

        } else {
            assert(node instanceof Object);
            return new read_service.ReadValueId(node);
        }
    }
github node-opcua / node-opcua / packages / node-opcua-client / src / client_session.js View on Github external
function coerceReadValueId(node) {

        if (typeof node === "string" || node instanceof NodeId) {
            return new read_service.ReadValueId({
                nodeId: resolveNodeId(node),
                attributeId: read_service.AttributeIds.Value,
                indexRange: null,
                dataEncoding: {namespaceIndex: 0, name: null}
            });

        } else {
            assert(node instanceof Object);
            return new read_service.ReadValueId(node);
        }
    }
github node-opcua / node-opcua / packages / node-opcua-client / src / client_monitored_item_base.js View on Github external
function ClientMonitoredItemBase(subscription, itemToMonitor, monitoringParameters) {
    assert(subscription.constructor.name === "ClientSubscription");
    const self = this;
    self.itemToMonitor = new read_service.ReadValueId(itemToMonitor);
    self.monitoringParameters = new subscription_service.MonitoringParameters(monitoringParameters);
    self.subscription = subscription;
    self.monitoringMode = subscription_service.MonitoringMode.Reporting;
    assert(self.monitoringParameters.clientHandle === 4294967295, "should not have a client handle yet");
}
util.inherits(ClientMonitoredItemBase, EventEmitter);
github node-opcua / node-opcua / packages / node-opcua-server / source / monitored_item.ts View on Github external
MonitoredItemModifyResult, MonitoredItemNotification, MonitoringMode,
  MonitoringParameters
} from "node-opcua-service-subscription";
import {
  DataChangeFilter, DataChangeTrigger, DeadbandType,
  isOutsideDeadbandAbsolute, isOutsideDeadbandNone, isOutsideDeadbandPercent,
  PseudoRange
} from "node-opcua-service-subscription";
import { StatusCode, StatusCodes } from "node-opcua-status-code";
import { EventFieldList, MonitoringFilter, ReadValueIdOptions, SimpleAttributeOperand } from "node-opcua-types";
import { sameVariant, Variant } from "node-opcua-variant";

import { appendToTimer, removeFromTimer } from "./node_sampler";
import { validateFilter } from "./validate_filter";

const defaultItemToMonitor: ReadValueIdOptions = new ReadValueId({
  attributeId: AttributeIds.Value,
  indexRange: undefined,
});

const debugLog = make_debugLog(__filename);
const doDebug = checkDebugFlag(__filename);

function _adjust_sampling_interval(samplingInterval: number, node_minimumSamplingInterval: number): number {

  assert(_.isNumber(node_minimumSamplingInterval), "expecting a number");

  if (samplingInterval === 0) {
    return (node_minimumSamplingInterval === 0)
      ? samplingInterval
      : Math.max(MonitoredItem.minimumSamplingInterval, node_minimumSamplingInterval);
  }