# Read Multiple OPCUA "node-red-contrib-opcua"

**URL:** <https://discourse.nodered.org/t/read-multiple-opcua-node-red-contrib-opcua/100549>\
**Category:** Industrial\
**Created:** [13 March 2026 09:40 UTC](https://discourse.nodered.org/t/read-multiple-opcua-node-red-contrib-opcua/100549 "2026-03-13T09:40:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vespamike](https://avatars.discourse-cdn.com/v4/letter/v/6f9a4e/32.png) [@Vespamike](https://discourse.nodered.org/u/Vespamike)\
**Post date:** [13 March 2026 09:40 UTC](https://discourse.nodered.org/t/read-multiple-opcua-node-red-contrib-opcua/100549/1 "2026-03-13T09:40:05Z")

</div>

I'm asking for your help. I'm using the "node-red-contrib-opcua" library. I need to read several opcua variables. When read individually, everything works. If I put all the "Opcua-Item" nodes in parallel with the "OPCUA\_CLient\_Node" node in "read multiple" mode, sending a msg.topic="readmultiple" reads the variables at once. Now, what I'd like to do is replace all the "Opcua-Item" blocks, grouping the data in a function block that injects the payload into the "Opcua-Client" node, a block similar to this:

```auto
msg.topic = "readmultiple";
msg.payload = [];
msg.payload.push({ nodeId: "ns=1;s=1.2270.1.0.0.0;datatype=Bool" }); // bool 
msg.payload.push({ nodeId: "ns=1;s=1.1508.1.0.0.0;datatype=Bool" }); // bool 
msg.payload.push({ nodeId: "ns=1;s=1.1243.1.0.0.0;datatype=Bool" }); // bool 
msg.payload.push({ nodeId: "ns=1;s=1.343.1.0.0.0;datatype=Float" }); // float 

return msg;

```

but I can't get it to work..ideas?

---

<div class="post-metadata">

**Author:** ![Vespamike](https://avatars.discourse-cdn.com/v4/letter/v/6f9a4e/32.png) [@Vespamike](https://discourse.nodered.org/u/Vespamike)\
**Post date:** [13 March 2026 09:55 UTC](https://discourse.nodered.org/t/read-multiple-opcua-node-red-contrib-opcua/100549/2 "2026-03-13T09:55:57Z")

</div>

combined with this function:

```auto
const nodes = [
    "ns=1;s=1.2270.1.0.0.0", // bool 
    "ns=1;s=1.1508.1.0.0.0", // bool 
    "ns=1;s=1.1243.1.0.0.0", // bool 
    "ns=1;s=1.343.1.0.0.0" // float 
];

// Registra i nodeId nel client
for (const nodeId of nodes) {
    node.send({ topic: nodeId });
}

// Scatena la lettura
node.send({ topic: "readmultiple", payload: "ALL" });

return null;

```

I hope it can be useful to others..

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 May 2026 09:56 UTC](https://discourse.nodered.org/t/read-multiple-opcua-node-red-contrib-opcua/100549/3 "2026-05-12T09:56:21Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
