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

TypeError in OPCUA-IIoT-Write Node #156

Closed AHyduchak closed 1 year ago

AHyduchak commented 2 years ago

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

4.0.1

What happened?

I am unable to write a value to an OPC item.

I have tried structuring the message where the valuesToWrite is msg.valuesToWrite and msg.payload.valuesToWrite as indicated in the General Changes of the description page.

The Write node returns: TypeError: nodeItem.indexOf is not a function

Server

Other/External server

How can this be reproduced?

The problem can be reproduced with my flow as well the provided example flows flows.txt .

What did you expect to happen?

No response

Other Information

No response

AHyduchak commented 2 years ago

node-red-screenshot

The output of the debug node showing the msg contents.

ouinouin commented 2 years ago

hi, same error here, i m trying to find more details on this, the error lies probably on the : parseNamspaceFromItemNodeId function line 503 of the opcua-iiot-core.js , the function receives an item wich is a single value and tries to get the namespace from the nodeitem (wich contains the value) instead of the item.nodeId

i edited https://github.com/BiancoRoyal/node-red-contrib-iiot-opcua/blob/master/src/core/opcua-iiot-core.ts

(in fact locally i edited the equivalent javascript file (i dont know js enough to understand what are ts files ) line 513 nodeNamespace = item.nodeId.substring(3, item.nodeId.indexOf(';'));

ghost commented 2 years ago

This should be fixed with the changes from #157.

(in fact locally i edited the equivalent javascript file (i dont know js enough to understand what are ts files )

.ts files are TypeScript, a superset of JavaScript that adds types. We compile those into JavaScript for distribution.

biancode commented 2 years ago

E2E tests were disabled in TypeScript migration and is now active again see #177 - works since tag v4.0.7

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 60 days with no activity. It will be closed in 15 days, but can be saved by removing the stale label or commenting.