. The following function works to write an array of floats to OPCUA when I pass it to a OPC Write node
var array2D = [90,102,12,13,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];
var payload={
dataType: 10,
nodeId:“ns=4;s=|var|Opto22-Cortex-Linux.Application.GV.TEST”,
value : array2D,
arrayType : 1
};
msg.topic=“ns=4;s=|var|Opto22-Cortex-Linux.Application.GV.TEST”;
msg.datatype=“Float Array”
msg.payload=payload
return msg
Adjusting the code to fit what I think it should be for a 2D array nothing works
var array2D = [
[1, 2, 3, 4, 5, 6],
[7, 8, 9, 0, 0, 0],
[0, 0, 0, 0, 0, 0]
];
var payload={
dataType: 10,
nodeId:“ns=4;s=|var|Opto22-Cortex-Linux.Application.GV.TEST_TWO”,
value : array2D,
arrayType : 2
};
msg.topic=“ns=4;s=|var|Opto22-Cortex-Linux.Application.GV.TEST_TWO”;
msg.datatype=“Float Array[6,3]”;
msg.payload=payload;
return msg;
Let me know you need anything else or if this is not clear