How to use the node-opcua-service-filter.constructEventFilter function in node-opcua-service-filter

To help you get started, we’ve selected a few node-opcua-service-filter 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 / source / alarms_and_conditions / client_alarm_tools_acknowledge_all_conditions.ts View on Github external
publishingEnabled: true,
        requestedLifetimeCount: 1000,
        requestedMaxKeepAliveCount: 100,
        requestedPublishingInterval: 100,
    };

    const subscription = await session.createSubscription2(request);

    const itemToMonitor: ReadValueIdOptions = {
        attributeId: AttributeIds.EventNotifier,
        nodeId: resolveNodeId("Server"), // i=2253
    };

    const fields = await extractConditionFields(session, "AcknowledgeableConditionType");

    const eventFilter = constructEventFilter(fields, [resolveNodeId("AcknowledgeableConditionType")]);

    const monitoringParameters: MonitoringParametersOptions = {
        discardOldest: false,
        filter: eventFilter,
        queueSize: 100,
        samplingInterval: 0,
    };

    const event_monitoringItem =
        await subscription.monitor(itemToMonitor, monitoringParameters, TimestampsToReturn.Both);

    const acknowledgeableConditions: EventStuff[] = [];

    let refreshStartEventHasBeenReceived = false;
    let RefreshEndEventHasBeenReceived = false;
github node-opcua / node-opcua / packages / node-opcua-client / source / alarms_and_conditions / client_alarm_tools.ts View on Github external
publishingEnabled: true,
        requestedLifetimeCount: 10000,
        requestedMaxKeepAliveCount: 1000,
        requestedPublishingInterval: 10,
    };
    const subscription = await session.createSubscription2(request);
    _sessionPriv.$subscriptionforAlarmList = subscription;

    const itemToMonitor: ReadValueIdOptions = {
        attributeId: AttributeIds.EventNotifier,
        nodeId: resolveNodeId("Server"), // i=2253
    };

    const fields = await extractConditionFields(session, "AlarmConditionType");

    const eventFilter = constructEventFilter(fields, [resolveNodeId("AcknowledgeableConditionType")]);

    const monitoringParameters: MonitoringParametersOptions = {
        discardOldest: false,
        filter: eventFilter,
        queueSize: 10000,
        samplingInterval: 0,
    };

    // now create a event monitored Item
    const event_monitoringItem = ClientMonitoredItem.create(subscription, itemToMonitor, monitoringParameters, TimestampsToReturn.Both);

    const RefreshStartEventType = resolveNodeId("RefreshStartEventType").toString();
    const RefreshEndEventType = resolveNodeId("RefreshEndEventType").toString();

    event_monitoringItem.on("changed", (eventFields: Variant[]) => {
        const pojo = fieldsToJson(fields, eventFields) as EventStuff;

node-opcua-service-filter

pure nodejs OPCUA SDK - module service-filter

MIT
Latest version published 7 days ago

Package Health Score

83 / 100
Full package analysis