Unable to Write Float Array using node-red-contrib-iiot-opcua #297
Unanswered
lucatralli
asked this question in
Q&A
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to write a "Float Array[5]" to an OPC UA Server using node-red-contrib-iiot-opcua (version 4.1.2). While reading works perfectly, writing the array fails with a BadTypeMismatch error.
Current Situation
Reading (Works)
Reading the array works fine and returns:
{"0":0,"1":110,"2":140,"3":200,"4":250}
Writing (Fails)
Attempted payload:
{
"nodetype": "node",
"injectType": "write",
"addressSpaceItems": [{
"name": "",
"nodeId": "ns=4;s=gBatch.set.ds.volt",
"datatypeName": "Float Array[5]"
}],
"valuesToWrite": [{"0":0,"1":109,"2":140,"3":200,"4":250}],
"topic": ""
}
Error response:
{
"nodetype": "write",
"injectType": "write",
"addressSpaceItems": [{
"name": "",
"nodeId": "ns=4;s=gBatch.set.ds.volt",
"datatypeName": "Float Array[5]"
}],
"justValue": true,
"value": {
"statusCodes": [{
"value": 2155085824
}]
}
}
Status code 2155085824 (0x80740000) indicates BadTypeMismatch.
Multiple Write Test (Mixed Results)
When writing multiple tags (a single Float and an Array):
{
"nodetype": "node",
"injectType": "write",
"addressSpaceItems": [
{
"name": "",
"nodeId": "ns=4;s=gBatch.set.ds.curr",
"datatypeName": "Float"
},
{
"name": "",
"nodeId": "ns=4;s=gBatch.set.ds.volt",
"datatypeName": "Float Array[5]"
}
],
"valuesToWrite": [
3.5,
{"0":0,"1":109,"2":140,"3":200,"4":250}
],
"topic": ""
}
Result:
Single Float writes successfully (status 0)
Array fails with BadTypeMismatch (status 2155085824)
OpcUaExpert is able to write the Array
Using Wireshark to capture successful writes from UaExpert shows that the array is being written with:
AttributeId: Value (0x0000000d)
Variant Type: Array of Float (0x8a)
ArraySize: 5
[Wireshark write array captuted.txt]
(https://github.com/user-attachments/files/17660652/Wireshark.write.array.captuted.txt)
Here the attributes of the Item by OpcUaExpert
Beta Was this translation helpful? Give feedback.
All reactions