mikakaraila / node-red-contrib-opcua

A Node-RED node to communicate OPC UA. Uses node-opcua library.
Other
216 stars 197 forks source link

Write multiple no longer works with 0.2.331 #723

Closed Eldarion85 closed 1 month ago

Eldarion85 commented 3 months ago

After upgrading to 0.2.331, Write multiple no longer works. With every input I get the message "Write multiple as array session is not active!", which unfortunately doesn't help me.

After downgrading to 0.2.330, it works again straight away.

Write_Multiple

mikakaraila commented 2 months ago

Can you attach you flow or simplified one? I would check it and use it to debug my nodes (action).

mikakaraila commented 2 months ago

To write values msg.topic should be "writemultiple"

Eldarion85 commented 1 month ago

Hello Mika, I was on vacation for three weeks and just read your message. I will upgrade to the latest version later and change my topic from "multiple" to "writemultiple". If that doesn't change anything, I'll send you a sample flow.

Eldarion85 commented 1 month ago

Unfortunately, it still doesn't work after I changed the topic to "writemultiple". However, I have a different message in version 0.2.332 than in the last test with version 0.2.331. Instead of "Write multiple as array session is not active!" I now get the information in the debug and under the node that there are no items to write. In the screenshot you can see how all my write multiple arrays are structured that go to the OpcUa client node. The action in the node is set to "WRITE MULTIPLE". It can't be the certificates, because the other client nodes with "Read", "Write" and "Subscribe" also run with the new version without any problems with the same certificates and even after a downgrade the "Write Multiple" runs again with the same certificates. What else could be the reason that it works again immediately with the old version and this message appears with the new one?

Node

Debug

Einstellungen

Eldarion85 commented 1 month ago

I saw that in the new version you register the subscription individually on the server. Here is a screenshot from the Siemens PLC. Before, there was only one entry (yellow frame) with the total number of all variables (173). Now I can also see the individual subscriptions in the server (green frame), which is a very good improvement. Thank you very much for that! Now I just have to solve the problem with Writemultiple :).

Subscription

apbrauer73 commented 1 month ago

@mikakaraila How did this get resolved? I have the same issue, if I downgrade to 0.2.330 it works. I upgraded to version 0.2.332. Then based on this thread I changed my topic to "writemultiple", but now I get the error "Client node error on: Kepware Write error: ["Kepware Write no items to write"]". Not sure why the OpcUa client node reports no items to write when the debug message shows items in the payload. What am I missing?

image

This is the payload in my function node and is passed into the OPC UA Client node....

`msg.payload = []; msg.topic = "writemultiple";

msg.payload[0] = { nodeId: "ns=2;s=RCV_CC394SPS.RCV_CC394_SPS.CC394_U452050_PE_FD", datatype: "Boolean", value: false };

msg.payload[1] = { nodeId: "ns=2;s=RCV_CC394SPS.RCV_CC394_SPS.CC394_U452010_PE_FD", datatype: "Boolean", value: false };

msg.payload[2] = { nodeId: "ns=2;s=RCV_CC394SPS.RCV_CC394_SPS.CC394_U451700_PE_FD", datatype: "Boolean", value: false };

msg.payload[3] = { nodeId: "ns=2;s=RCV_CC394SPS.RCV_CC394_SPS.CC394_U452020_PE_FD", datatype: "Boolean", value: false };

msg.payload[4] = { nodeId: "ns=2;s=RCV_CC394SPS.RCV_CC394_SPS.CC394_DEV_ENET", datatype: "UInt16", value: 0 };

return msg;`

This is my OPC UA Client config node

image

Does this align with what is expected for write multiple?

mikakaraila commented 1 month ago

I find time to look this and some stupid error done by me (merge or other fault). Got this fixed easily...

apbrauer73 commented 1 month ago

@mikakaraila I tried the latest version 0.2.333. I restarted Node Red after the updating the "node-red-contrib-opcua" palette. I triggered my flow and it failed again for the same error.

image

Eldarion85 commented 1 month ago

@apbrauer73 Thanks for the test, I'll stick with the old version for now. I saw today that a new version was released and wanted to test it tomorrow as well.