Hi guys,
i've problem with OpcUa write, in the PLC the data is int32Array[201],
with the OpcUa-Cliet READ i've add a payload.range and the result is OK, read only 3° value of the PLC int32Array
[
{
"id": "51ab919daee71d28",
"type": "OpcUa-Item",
"z": "441eefb194c6bb17",
"item": "ns=4;s=OPC_UA.diVAR",
"datatype": "Int32 Array",
"value": "",
"name": "",
"x": 360,
"y": 60,
"wires": [
[
"1c5f199d0907cf65"
]
]
},
{
"id": "1c5f199d0907cf65",
"type": "OpcUa-Client",
"z": "441eefb194c6bb17",
"endpoint": "0480335b7ee5b194",
"action": "read",
"deadbandtype": "a",
"deadbandvalue": 1,
"time": 10,
"timeUnit": "s",
"certificate": "n",
"localfile": "",
"localkeyfile": "",
"folderName4PKI": "",
"name": "READ",
"x": 550,
"y": 60,
"wires": [
[
"eb6dba8e85f20a76"
]
]
},
{
"id": "eb6dba8e85f20a76",
"type": "debug",
"z": "441eefb194c6bb17",
"name": "READxx",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 730,
"y": 60,
"wires": []
},
{
"id": "7ba5d4a44f4f31ef",
"type": "inject",
"z": "441eefb194c6bb17",
"name": "READ RANGE 3",
"props": [
{
"p": "payload.range",
"v": "3",
"vt": "num"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 120,
"y": 60,
"wires": [
[
"51ab919daee71d28"
]
]
},
{
"id": "0480335b7ee5b194",
"type": "OpcUa-Endpoint",
"endpoint": "opc.tcp://192.168.3.98:4840",
"secpol": "Basic256Sha256",
"secmode": "Sign",
"none": true,
"login": false,
"usercert": false,
"usercertificate": "",
"userprivatekey": ""
}
]
but i've need to write only this Value (not all array)
i've try this solution but not send to PLC anything
[
{
"id": "1d36543af421357f",
"type": "OpcUa-Item",
"z": "441eefb194c6bb17",
"item": "ns=4;s=OPC_UA.diVAR",
"datatype": "Int32 Array",
"value": "201",
"name": "",
"x": 360,
"y": 120,
"wires": [
[
"abd3c695794ccf40"
]
]
},
{
"id": "abd3c695794ccf40",
"type": "OpcUa-Client",
"z": "441eefb194c6bb17",
"endpoint": "0480335b7ee5b194",
"action": "write",
"deadbandtype": "a",
"deadbandvalue": 1,
"time": 10,
"timeUnit": "s",
"certificate": "n",
"localfile": "",
"localkeyfile": "",
"folderName4PKI": "",
"name": "WRITE",
"x": 550,
"y": 120,
"wires": [
[
"8b7c9778a4109563"
]
]
},
{
"id": "8b7c9778a4109563",
"type": "debug",
"z": "441eefb194c6bb17",
"name": "WRITExx",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 720,
"y": 120,
"wires": []
},
{
"id": "a6fba8e66b34e16b",
"type": "inject",
"z": "441eefb194c6bb17",
"name": "WRITE",
"props": [
{
"p": "payload.range",
"v": "3",
"vt": "num"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 90,
"y": 120,
"wires": [
[
"1d36543af421357f"
]
]
},
{
"id": "0480335b7ee5b194",
"type": "OpcUa-Endpoint",
"endpoint": "opc.tcp://192.168.3.98:4840",
"secpol": "Basic256Sha256",
"secmode": "Sign",
"none": true,
"login": false,
"usercert": false,
"usercertificate": "",
"userprivatekey": ""
}
]
The PLC have enable to write, (with UaExpert i write correctly only single array value)
if i send a value msg.payload=200 without payload.range Write the value to plc but wrong and confusing about all array values
I've been using Node-red for a while now, I probably don't really understand how the payload works
Thanks in advance for any help...