mikakaraila / node-red-contrib-opcua

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

Strange behavior after calling InitLock() from RasPi Client on SITOP PSU8600 server #732

Open c0nr3f opened 1 month ago

c0nr3f commented 1 month ago

I want to control a Siemens SITOP PSU8600 from a raspberry pi. Reading values works alright, but to write anything to the psu you have to init a lock variable. The function has one input and one output, but you don't need to pass anything afaik. When I do this via UaExpert, everything works fine.

In node red the call takes quite a while and when I look at the output, the locking user is the desired user for around one sec, after that it jumps to anonymous. When I want to write anything, it just returns an error.

In the method configuration I used the right credentials, the data grom PSU8600 as ObjectId (ns=3;i=100000) and the NodeId from the method as the MethodId (ns=3;i=100818)

Does anyone have any experience with this problem?

c0nr3f commented 1 month ago

I have got it working with the method nodes, but they won't support my use case, since they establish a session after injection. Since I want to control the current and the voltage output, I cannot wait 3-5 sec for a method to resolve.

Tried to use the Client Node with METHOD action instead. The method gets executed, but the output is an empty array and nothing happens in the psu.

Added the flow, what did I do wrong?

[ { "id": "7d1385fe8e5a7d0d", "type": "debug", "z": "895a1abe4f989bf5", "name": "debug 1", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 700, "y": 680, "wires": [] }, { "id": "8685c5612cf45d51", "type": "OpcUa-Method", "z": "895a1abe4f989bf5", "endpoint": "818d2b560835cc77", "objectId": "ns=3;i=100813", "methodId": "ns=3;i=100818", "name": "InitLock()", "inputArguments": [], "outputArguments": [], "arg0name": "", "arg0type": "", "arg0typeid": "", "arg0value": "", "arg1name": "", "arg1type": "", "arg1typeid": "", "arg1value": "", "arg2name": "", "arg2type": "", "arg2typeid": "", "arg2value": "", "out0name": "", "out0type": "", "out0typeid": "", "out0value": "", "x": 500, "y": 740, "wires": [ [ "8624803cdf2dc273" ] ] }, { "id": "fc9c655bc4d4fc29", "type": "OpcUa-Method", "z": "895a1abe4f989bf5", "endpoint": "818d2b560835cc77", "objectId": "ns=3;i=100813", "methodId": "ns=3;i=100816", "name": "ExitLock()", "inputArguments": [], "outputArguments": [], "arg0name": "", "arg0type": "", "arg0typeid": "", "arg0value": "", "arg1name": "", "arg1type": "", "arg1typeid": "", "arg1value": "", "arg2name": "", "arg2type": "", "arg2typeid": "", "arg2value": "", "out0name": "", "out0type": "Int32", "out0typeid": "", "out0value": "", "x": 500, "y": 680, "wires": [ [ "7d1385fe8e5a7d0d" ] ] }, { "id": "8624803cdf2dc273", "type": "debug", "z": "895a1abe4f989bf5", "name": "debug 2", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 700, "y": 740, "wires": [] }, { "id": "e2987655c7318c57", "type": "inject", "z": "895a1abe4f989bf5", "name": "VoltageDC1", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 150, "y": 680, "wires": [ [ "fc9c655bc4d4fc29" ] ] }, { "id": "5644d6f29df988d7", "type": "OpcUa-Method", "z": "895a1abe4f989bf5", "endpoint": "818d2b560835cc77", "objectId": "ns=3;i=100000", "methodId": "ns=3;i=100857", "name": "TurnOffOutputs()", "inputArguments": [], "outputArguments": [], "arg0name": "", "arg0type": "", "arg0typeid": "", "arg0value": "", "arg1name": "", "arg1type": "", "arg1typeid": "", "arg1value": "", "arg2name": "", "arg2type": "", "arg2typeid": "", "arg2value": "", "out0name": "", "out0type": "", "out0typeid": "", "out0value": "", "x": 330, "y": 920, "wires": [ [] ] }, { "id": "5ca9342a4f5c086b", "type": "OpcUa-Method", "z": "895a1abe4f989bf5", "endpoint": "818d2b560835cc77", "objectId": "ns=3;i=100000", "methodId": "ns=3;i=100858", "name": "TurnOnOutputs()", "inputArguments": [], "outputArguments": [], "arg0name": "", "arg0type": "", "arg0typeid": "", "arg0value": "", "arg1name": "", "arg1type": "", "arg1typeid": "", "arg1value": "", "arg2name": "", "arg2type": "", "arg2typeid": "", "arg2value": "", "out0name": "", "out0type": "", "out0typeid": "", "out0value": "", "x": 330, "y": 980, "wires": [ [] ] }, { "id": "356acc77eca3651d", "type": "inject", "z": "895a1abe4f989bf5", "name": "VoltageDC1", "props": [], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 110, "y": 920, "wires": [ [ "5644d6f29df988d7" ] ] }, { "id": "e3343fb9781ca081", "type": "inject", "z": "895a1abe4f989bf5", "name": "VoltageDC1", "props": [], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 110, "y": 980, "wires": [ [ "5ca9342a4f5c086b" ] ] }, { "id": "0ca5957866d4c883", "type": "inject", "z": "895a1abe4f989bf5", "name": "VoltageDC1", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 150, "y": 740, "wires": [ [ "8685c5612cf45d51" ] ] }, { "id": "c8815bc2c76e1d61", "type": "OpcUa-Client", "z": "895a1abe4f989bf5", "endpoint": "818d2b560835cc77", "action": "method", "deadbandtype": "a", "deadbandvalue": 1, "time": 10, "timeUnit": "s", "certificate": "n", "localfile": "", "localkeyfile": "", "securitymode": "None", "securitypolicy": "None", "useTransport": false, "maxChunkCount": 1, "maxMessageSize": 8192, "receiveBufferSize": 8192, "sendBufferSize": 8192, "name": "PSU8600 METHOD", "x": 990, "y": 960, "wires": [ [ "b9889538171d9113" ], [] ] }, { "id": "02ae56fdd38bce54", "type": "inject", "z": "895a1abe4f989bf5", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" }, { "p": "objectId", "v": "ns=3;i=100813", "vt": "str" }, { "p": "methodId", "v": "ns=3;i=100818", "vt": "str" }, { "p": "inputArguments[0]", "v": "", "vt": "str" }, { "p": "inputArguments[1]", "v": "", "vt": "str" }, { "p": "outputArguments[0]", "v": "", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "InitLock", "payload": "", "payloadType": "date", "x": 710, "y": 900, "wires": [ [ "c8815bc2c76e1d61" ] ] }, { "id": "b9889538171d9113", "type": "debug", "z": "895a1abe4f989bf5", "name": "debug 3", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 1180, "y": 900, "wires": [] }, { "id": "8ed049461cfa6fe8", "type": "inject", "z": "895a1abe4f989bf5", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" }, { "p": "objectId", "v": "ns=3;i=100000", "vt": "str" }, { "p": "methodId", "v": "ns=3;i=100857", "vt": "str" }, { "p": "inputArguments[0]", "v": "", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "TurnOffOutputs", "payload": "", "payloadType": "date", "x": 730, "y": 960, "wires": [ [ "c8815bc2c76e1d61" ] ] }, { "id": "818d2b560835cc77", "type": "OpcUa-Endpoint", "endpoint": "opc.tcp://192.168.2.211:4840", "secpol": "None", "secmode": "None", "none": false, "login": true, "usercert": false, "usercertificate": "", "userprivatekey": "" } ]