node-red-contrib-opcua icon indicating copy to clipboard operation
node-red-contrib-opcua copied to clipboard

Error with OPC UA node types (expand)

Open piyush-gupt opened this issue 5 years ago • 8 comments

I'm currently developing some dashboards where we have to fetch data from OPC UA server. Although I'm able to establish the connection, I'm getting the following error in receiving data from some specific nodes in the OPC UA server. #getConstructor : cannot find constructor for expandedId ns=2; i=15004 #getConstructor : cannot find constructor for expandedId ns=2; i=15004

I'm expecting an array of structures giving x,y&z coordinate values. Since the array has 2 elements, I think I'm getting this error twice.

I also talked to OPC UA server provider and got the following info. The OPC UA server is based on 62541 OPC standard. The Id 15004 refers to the structure which is not getting deserialized in node red. OPC UA server uses binary encoding to encode this structure. Hence I'm getting the values as an array of null i.e. [null, null]. I'm able to get other information like server status, timestamp etc.

I tried it using node-red-contrib-iiot-opcua & node-red-contrib-opcua.

I saw a similar issue opened in node-red-contrib-iiot-opcua but it is not working with normal opc ua contribs also. Is there an alternative solution to this for what can be done in order to retrieve this data? Thanks in advance.

piyush-gupt avatar Oct 09 '19 12:10 piyush-gupt

I expect node is custom, but can you attach screenshot from UaExpert that shows structure?

mikakaraila avatar Oct 09 '19 17:10 mikakaraila

Current version supports only basic types.

mikakaraila avatar Oct 09 '19 17:10 mikakaraila

Here is the screenshot of UA export. It shows an array with two structure elements. I'm only getting null in array values in node red UAexpertScreenshot

piyush-gupt avatar Oct 11 '19 12:10 piyush-gupt

Is it possible to deserialize the structures if we import it as a data type in node red. Then may be we can retrieve its values

piyush-gupt avatar Oct 11 '19 12:10 piyush-gupt

Hmm, it should be loaded somehow into the code. At the moment this is not possible. There should be a way to expand types and load them into the runtime. Perhaps extra node that could do it, no time to implement now.

mikakaraila avatar Oct 14 '19 07:10 mikakaraila

Can you suggest how can I load the data types in the runtime? Is there a place where I can define them and then give its reference to the actual node?

piyush-gupt avatar Oct 14 '19 12:10 piyush-gupt

One way would be to add them as own separate XML. This could be loaded with own namespace and added as own types. Then those could be used as I have done earlier, but not with node-red.

mikakaraila avatar Oct 14 '19 13:10 mikakaraila

I have done some progress with this, code is not yet complete and example use missing.

mikakaraila avatar Jun 10 '21 18:06 mikakaraila

Please test with new v0.2.295 as it uses now node-opcua v2.89 that contains fixes to extension objects.

mikakaraila avatar Jan 24 '23 18:01 mikakaraila

No activity or test result provided => closed. Reopen with new test results.

mikakaraila avatar Jul 04 '23 10:07 mikakaraila