mikakaraila / node-red-contrib-opcua

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

Can read but can't write an r/w var defined with an alpha namespace, with error: BadNodeIdUnknown (0x80340000) (namespace with 2 digits) #358

Closed ppontre closed 2 years ago

ppontre commented 2 years ago

Hi Mika, I'm using the latest version of the node, and I found this strange behaviour. I can read regularly variables defines by strings, but can't write them. For example, a var defined like this: ns=10;s=::AsGlobalPV:IPRRZP.batch When I try to write it, I receive always this error: BadNodeIdUnknown (0x80340000) I checked that they're RW, and with UAExpert I can write them flawlessly. The OPC-UA server is a Maplan Press controller When data are coming from other OPC-UA servers (Siemens PLC S7-1200 or S7-1500) with variables defined by numbers, all works well.

Any Idea ? Thanks in advance Paolo

mikakaraila commented 2 years ago

Check nodeId: ns=10;s=::AsGlobalPV:IPRRZP.batch with the UaExpert.

I remember that sometimes nodeId contains space and it can make it difficult to see it sometimes. Or namespace index has changed.

ppontre commented 2 years ago

Thanks Mika, We've just checked the nodeid with UAExpert and it works well: we can read and write it. Is there some way to get a deep log to see what happens in Nodered ? Thx Paolo

mikakaraila commented 2 years ago

There is extra logging that you can activate with option -v like this: node-red -v flow.json

mikakaraila commented 2 years ago

Another case can be that namespace index is with 2 digits. Most probably my code does not calculate it... I will check later today.

This is most probably the case for this issue.

ppontre commented 2 years ago

ok, i'll check the extra log option in the afternoon.....

mikakaraila commented 2 years ago

Not needed, I found and fixed it already.

I will publish new version after some testing.

ppontre commented 2 years ago

Great Mika ! I offer my scenario as a guinea pig, 🙂 if you tell me what to do.....

mikakaraila commented 2 years ago

New fixed to v0.2.246 published, please test

ppontre commented 2 years ago

THX, I'll do it ASAP..... Regards Paolo

ppontre commented 2 years ago

Thanks Mika, now it works OK ! GREAT work ! Regards Paolo