OPCUa write not writing

Hello,

I am trying to write boolean value to my plc with OPCUa write node. but its not writing
looks like there is issue with the OPCUa write node because even other bits are not writable.
I have also readed many bits and variable with OPCUa read.

These error are seen in debug window when I am trying to inject write

  1. "TypeError: Cannot read property 'match' of undefined

  2. "Error connecting to PLC: Error: getaddrinfo ENOTFOUND tcp://10.1.0.100" ( this error is always there even I am reading the values from plc)

please someone have alook into this issue

Thanking you
Vishal

Hello,

Can someone help me this thing, I am not able to write with OPCUa , I just want to change a boolen value from Node Red (false to true)

See if this helps you.

1 Like

Hello ,

@seth350 OPc ua iiot connector node is not present in my node red
node red version v1.1.3
windows 10 enterprise
plc siemens simatic cpu et 200sp
I am able to read data with opc ua node but write is still not possible. I want to write boolen bit
. please check the flow added below

[{"id":"1bc6d776.298aa9","type":"tab","label":"Simatic_ Reset Resistance OPC UA write","disabled":false,"info":""},{"id":"9d7af013.0a95c","type":"debug","z":"1bc6d776.298aa9","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":910,"y":100,"wires":[]},{"id":"7e44d1fe.abd39","type":"debug","z":"1bc6d776.298aa9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":570,"y":300,"wires":[]},{"id":"c0937674.2b0628","type":"ui_button","z":"1bc6d776.298aa9","name":"Reset R1","group":"d72d1774.546678","order":1,"width":0,"height":0,"passthru":true,"label":"Reset R1","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"ns=3;s=\"resistMonit8ChanDB\".Channels[1].Reset,datatype=Bool","x":280,"y":240,"wires":[["7e44d1fe.abd39","5017fc4b.877c64"]]},{"id":"fa70362d.54e3d8","type":"ui_button","z":"1bc6d776.298aa9","name":"Reset R2","group":"d72d1774.546678","order":2,"width":0,"height":0,"passthru":true,"label":"Reset R2","tooltip":"","color":"","bgcolor":"","icon":"","payload":"99","payloadType":"num","topic":"ns=3;s=\"Logging_DB\".uStep,datatype=Double","x":280,"y":280,"wires":[["5017fc4b.877c64","621a559c.83e8ac"]]},{"id":"8d8e796f.4cba78","type":"ui_button","z":"1bc6d776.298aa9","name":"Reset R3","group":"d72d1774.546678","order":3,"width":0,"height":0,"passthru":false,"label":"Reset R3","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"ns=3;s=\"resistMonit8ChanDB\".Channels[3].Reset,datatype=Bool","x":280,"y":340,"wires":[["5017fc4b.877c64"]]},{"id":"6db7d235.25957c","type":"ui_button","z":"1bc6d776.298aa9","name":"Reset R4","group":"d72d1774.546678","order":4,"width":0,"height":0,"passthru":false,"label":"Reset R4","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"\"resistMonit8ChanDB\".Channels[1].Reset,datatype=Bool","x":280,"y":420,"wires":[["5017fc4b.877c64"]]},{"id":"beb674bd.60a948","type":"ui_button","z":"1bc6d776.298aa9","name":"Reset R5","group":"d72d1774.546678","order":5,"width":0,"height":0,"passthru":false,"label":"Reset R5","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"","x":280,"y":460,"wires":[["5017fc4b.877c64"]]},{"id":"76b4414b.f4689","type":"ui_button","z":"1bc6d776.298aa9","name":"Reset R6","group":"d72d1774.546678","order":7,"width":0,"height":0,"passthru":false,"label":"Reset R6","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"","x":280,"y":500,"wires":[["5017fc4b.877c64"]]},{"id":"b14542f2.dce0f","type":"ui_button","z":"1bc6d776.298aa9","name":"Reset R7","group":"d72d1774.546678","order":6,"width":0,"height":0,"passthru":false,"label":"Reset R7","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"","x":280,"y":540,"wires":[["5017fc4b.877c64"]]},{"id":"c4394e07.cc238","type":"ui_button","z":"1bc6d776.298aa9","name":"Reset R8","group":"d72d1774.546678","order":8,"width":0,"height":0,"passthru":false,"label":"Reset R8","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"","x":280,"y":600,"wires":[["5017fc4b.877c64"]]},{"id":"5017fc4b.877c64","type":"OpcUa-Client","z":"1bc6d776.298aa9","endpoint":"475e6bdc.3f8934","action":"write","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","name":"","x":540,"y":140,"wires":[["9d7af013.0a95c"]]},{"id":"5dc59de0.278ce4","type":"inject","z":"1bc6d776.298aa9","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":110,"y":240,"wires":[["c0937674.2b0628"]]},{"id":"64591751.0a5448","type":"inject","z":"1bc6d776.298aa9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":300,"wires":[["fa70362d.54e3d8"]]},{"id":"621a559c.83e8ac","type":"debug","z":"1bc6d776.298aa9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":550,"y":400,"wires":[]},{"id":"d72d1774.546678","type":"ui_group","z":"","name":"Reset buttons","tab":"94c477d0.885058","order":1,"disp":true,"width":"3","collapse":false},{"id":"475e6bdc.3f8934","type":"OpcUa-Endpoint","z":"","endpoint":"","secpol":"None","secmode":"None","login":false},{"id":"94c477d0.885058","type":"ui_tab","z":"","name":"Monitor and reset","icon":"dashboard","disabled":false,"hidden":false}]

Thanks
Vishal Kaushik

@vishalk,

You are missing an OPCUA Item node in your flow.
image

Also, the node address you have does not seem to be correct.
ns=3;s="resistMonit8ChanDB".Channels[1].Reset,datatype=Bool

Have you connected to the PLC using UA-Expert software to see where exactly the variable is located?
UA-Expert Software Download

The Siemens PLC should have an OPCUA Server Interface created where you add variables to be available to a client.
image

Once you browse it using UA-Expert, you will see the server interface name that you created and inside will be all of the variables that are available.

From the OPCUA Client node info:

1 Like

Hello @seth350

Thanks for the reply, my syntax was wrong in topic maybe. Now write works.
Also,I will try to use opc ua item. I changed the inject to ui_button to give topic to the opc ua node.
I do have opc ua expert in use.

Regards
Vishal

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.