Hello,
I have created a struct on my OPC UA server. I am able to read the struct on NodeRed.
similar to reading I would like to write as well, however I am not sure, how to make the extension object array, or how to do that via the OPC UA Item node. I tried to write a function myself, but no success.
images of some of the results of reading
[
{
"id": "d7484c2f3d9e417d",
"type": "tab",
"label": "testing",
"disabled": false,
"info": "",
"env": []
},
{
"id": "f2252bf27a2a0ff8",
"type": "OpcUa-Item",
"z": "d7484c2f3d9e417d",
"item": "ns=4;i=64",
"datatype": "Extension Object Array",
"value": "",
"name": "",
"x": 800,
"y": 740,
"wires": [
[
"5d802301f082252a"
]
]
},
{
"id": "7899c7728f64b194",
"type": "comment",
"z": "d7484c2f3d9e417d",
"name": "read",
"info": "",
"x": 589.9999542236328,
"y": 696.9999017715454,
"wires": []
},
{
"id": "b24bfdaded79584a",
"type": "inject",
"z": "d7484c2f3d9e417d",
"name": "function",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "function",
"payload": "function",
"payloadType": "str",
"x": 590,
"y": 740,
"wires": [
[
"f2252bf27a2a0ff8"
]
]
},
{
"id": "519ef6042220c162",
"type": "debug",
"z": "d7484c2f3d9e417d",
"name": "debug 5",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1180,
"y": 740,
"wires": []
},
{
"id": "8ecadb13b4a41aeb",
"type": "inject",
"z": "d7484c2f3d9e417d",
"name": "function",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"payload\":{\"intIn0\":5,\"intIn1\":2},\"topic\":\"ns=4;i=11\",\"datatype\":\"ExtensionObjectArray\"}",
"payloadType": "json",
"x": 590,
"y": 880,
"wires": [
[
"f56b0fe6341312de",
"360d8e67e80343c3"
]
]
},
{
"id": "7c5d2414f4f1ccf6",
"type": "debug",
"z": "d7484c2f3d9e417d",
"name": "debug 6",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 980,
"y": 960,
"wires": []
},
{
"id": "f56b0fe6341312de",
"type": "OpcUa-Item",
"z": "d7484c2f3d9e417d",
"item": "ns=4;i=11",
"datatype": "Extension Object Array",
"value": "",
"name": "",
"x": 780,
"y": 880,
"wires": [
[
"7c5d2414f4f1ccf6",
"90c18ec5963f8ab8"
]
]
},
{
"id": "360d8e67e80343c3",
"type": "debug",
"z": "d7484c2f3d9e417d",
"name": "debug 7",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 780,
"y": 1000,
"wires": []
},
{
"id": "90c18ec5963f8ab8",
"type": "OpcUa-Client",
"z": "d7484c2f3d9e417d",
"endpoint": "609a6cdb0940bbae",
"action": "write",
"deadbandtype": "a",
"deadbandvalue": 1,
"time": 10,
"timeUnit": "s",
"certificate": "n",
"localfile": "",
"localkeyfile": "",
"securitymode": "None",
"securitypolicy": "None",
"folderName4PKI": "",
"name": "",
"x": 1020,
"y": 880,
"wires": [
[]
]
},
{
"id": "5d802301f082252a",
"type": "OpcUa-Client",
"z": "d7484c2f3d9e417d",
"endpoint": "609a6cdb0940bbae",
"action": "read",
"deadbandtype": "a",
"deadbandvalue": 1,
"time": 10,
"timeUnit": "s",
"certificate": "n",
"localfile": "",
"localkeyfile": "",
"securitymode": "None",
"securitypolicy": "None",
"folderName4PKI": "",
"name": "",
"x": 1000,
"y": 740,
"wires": [
[
"519ef6042220c162"
]
]
},
{
"id": "958a716b9edc1aac",
"type": "comment",
"z": "d7484c2f3d9e417d",
"name": "write",
"info": "",
"x": 590,
"y": 840,
"wires": []
},
{
"id": "609a6cdb0940bbae",
"type": "OpcUa-Endpoint",
"endpoint": "opc.tcp://192.168.0.1:4840",
"secpol": "None",
"secmode": "None",
"none": true,
"login": false,
"usercert": false,
"usercertificate": "",
"userprivatekey": ""
}
]