1

Current behavior

In a client, when monitoring multiple nodes using a forEach loop, only two nodes get monitored on version 2.30.0 and only one in 2.72.2 while the array that generates the loop contains 5 items.

Behaviour in 2.30.0

image

Bahaviour in 2.72.2

image

UA Expert screenshot for reference ua_expert screenshot

Expected behavior

The expected behavior is that all the item nodes get processed.

Code source for the reproduction of the problem

const idsToMonitor = ["ns=4;i=16", "ns=4;i=17", "ns=4;i=11", "ns=4;i=12", "ns=4;i=18"]
const monitoringParamaters = {
        samplingInterval: 100,
        discardOldest: true,
        queueSize: 10,
    };
    idsToMonitor.forEach((nodeId) => {
        opc_subscription.monitor({
            nodeId: resolveNodeId(nodeId),
            attributeId: AttributeIds.Value,
        },
        monitoringParamaters,
        TimestampsToReturn.Both,
        (err, monitoredItem) => {
            monitoredItem.on("changed", function (dataValue) {
            var Node = {nodeId: nodeId, nodeName: "111" , nodeValue: dataValue.value.value , nodeTimestamp: dataValue.sourceTimestamp.toISOString()};
            console.log(JSON.stringify(Node));
        });
    });
});

Please tell us about your environment:

  • [X] my request is related to node-opcua acting as a OPCUA CLIENT

  • [X] I have installed node-opcua as a package ( using npm install )

  • OS version: Windows 10

  • Node: node --version = 16.16.0

0 Answers0