How to use the node-opcua-service-read.AttributeIds.EventNotifier 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 / source / alarms_and_conditions / client_alarm_tools_acknowledge_all_conditions.ts View on Github external
export async function findActiveConditions(session: ClientSession): Promise {

    const request: CreateSubscriptionRequestOptions = {
        maxNotificationsPerPublish: 10000,
        priority: 6,
        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);