How to use the node-opcua-service-subscription.DataChangeFilter function in node-opcua-service-subscription

To help you get started, we’ve selected a few node-opcua-service-subscription 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 / src / monitored_item.js View on Github external
//xx if (newDataValue.sourceTimestamp > self.oldDataValue.sourceTimestamp) {
                self._on_value_changed(newDataValue);
                //xx }
            }
            self._is_sampling = false;
        });

    } else {
        /* istanbul ignore next */
        debugLog("_on_sampling_timer call but MonitoredItem has been terminated !!! ");
    }
};

const extractRange = require("node-opcua-data-value").extractRange;

const DataChangeFilter = subscription_service.DataChangeFilter;
const DataChangeTrigger = subscription_service.DataChangeTrigger;
const DeadbandType = subscription_service.DeadbandType;

function statusCodeHasChanged(newDataValue, oldDataValue) {
    assert(newDataValue instanceof DataValue);
    assert(oldDataValue instanceof DataValue);
    return newDataValue.statusCode !== oldDataValue.statusCode;
}

const checkDeadBand = require("node-opcua-service-subscription").checkDeadBand;


function valueHasChanged(self, newDataValue, oldDataValue, deadbandType, deadbandValue) {

    assert(newDataValue instanceof DataValue);
    assert(oldDataValue instanceof DataValue);
github node-opcua / node-opcua / packages / node-opcua-server / src / server_subscription.js View on Github external
const Enum = require("node-opcua-enum").Enum;
const assert = require("node-opcua-assert").assert;
const NodeClass = require("node-opcua-data-model").NodeClass;
const _ = require("underscore");

const AttributeIds = require("node-opcua-data-model").AttributeIds;

const SequenceNumberGenerator = require("node-opcua-secure-channel").SequenceNumberGenerator;

const EventEmitter = require("events").EventEmitter;
const util = require("util");

const SessionContext = require("node-opcua-address-space").SessionContext;

const EventFilter = require("node-opcua-service-filter").EventFilter;
const DataChangeFilter = require("node-opcua-service-subscription").DataChangeFilter;
const AggregateFilter = require("node-opcua-service-subscription").AggregateFilter;

const UAVariable = require("node-opcua-address-space").UAVariable;
const validateFilter = require("./validate_filter").validateFilter;
const isValidDataEncoding = require("node-opcua-data-model").isValidDataEncoding;


const debugLog = require("node-opcua-debug").make_debugLog(__filename);
const doDebug = require("node-opcua-debug").checkDebugFlag(__filename);


const SubscriptionState = new Enum([
    "CLOSED",   // The Subscription has not yet been created or has terminated.
    "CREATING", // The Subscription is being created
    "NORMAL",   // The Subscription is cyclically checking for Notifications from its MonitoredItems.
                // The keep-alive counter is not used in this state.
github node-opcua / node-opcua / packages / node-opcua-server / src / server_subscription.js View on Github external
function analyseDataChangeFilterResult(node, dataChangeFilter) {
    assert(dataChangeFilter instanceof subscription_service.DataChangeFilter);
    // the opcua specification doesn't provide dataChangeFilterResult
    return null;
}