BiancoRoyal / node-red-contrib-iiot-opcua

deprecated - very new developed by PLUS for Node-RED - https://plus4nodered.com
https://www.npmjs.com/package/node-red-contrib-iiot-opcua
BSD 3-Clause "New" or "Revised" License
34 stars 8 forks source link

Listener - Output an array #219

Closed dpatel2016 closed 1 year ago

dpatel2016 commented 1 year ago

Which node-red-contrib-iiot-opcua version are you using?

4.1.2

What happened?

I have about 50 variables I am trying to read. I am using a listener to update the variables within the flow, but I would like to get an array of all 50 variables if any variable has a change, similar to output from read node . Currently, it only outputs the node that has a change.

Server

Other/External server

How can this be reproduced?

  1. add Inject node
  2. add listen node
  3. add debug node
  4. configure them all to read tags from the server.

What did you expect to happen?

I was expecting an array of all the tags with its values such as the output from read node

Other Information

No response

biancode commented 1 year ago

The listen mode is the monitored item of OPC UA. If you need such a function, then it has to be done in your flow. It is not a bug or part of the package at the moment.

Our new PLUS for Node-RED OPC UA nodes will provide such features, soon.

dpatel2016 commented 1 year ago

That makes sense, thank you. Any suggestion on how to do it in the flow?

biancode commented 1 year ago

@dpatel2016 you can use the flow context to store all changes in an easy to use array or dictionary structure and if it has a changed event, then you can send out all data after the change of your context model right out of the context model see Working with the Node-RED Context

dpatel2016 commented 1 year ago

@biancode that's what I was doing with the read node initially. The benefit I had with the read node's output of an array was that I can connect one function node to the read node and set up all context variables using array index such as msg.payload.value[32].

With the current output from the listener node, the path to the value is very vague such as msg.payload.value.value.value. Now I have to set up conditions to make sure the correct context variable gets updated.

biancode commented 1 year ago

I'm sorry for that state. We are working since last year September to provide very new OPC UA packages for Node-RED to make all those points much easier soon, but it takes some time. Watch for the plus4nodered packages inside Node-RED in April!

biancode commented 1 year ago

Follow us on LinkedIn or join our Group or Feed

dpatel2016 commented 1 year ago

@biancode No worries. The current features are great and very helpful but I wanted to see if there was an easier way than what I had in mind. Thank you for creating and supporting this library