(x) bug report (might be related to #51, it does not work in v3 even if it seems like it should have been fixed)
Information
Current behaviour
Writing an array produces an invalid message where only a value of 0 is send instead of the array. For this reason the OPC server responds with an error.
Response from the OPC server:
description: "The value supplied for the attribute is not of the same type as the attribute's value."
name: "BadTypeMismatch"
Reason for this behaviour is the following code sequence:
opcua-iiot-write.js: node.on('input', ...) is called
opcua-iiot-write.js: node.bianco.iiot.writeToSession is called to initiate the write request.
opcua-iiot-write.js: coreClient.core.buildNodesToWrite is called to create the request
core/opcua-iiot-core.js: de.biancoroyal.opcua.iiot.core.buildNodesToWrite tries to create a request for each listed node and calls de.biancoroyal.opcua.iiot.core.buildNewVariant
core/opcua-iiot-core.js: de.biancoroyal.opcua.iiot.core.buildNewVariant tries to convert the value type and does not respect arrayType, it tries to parse the array as integer with results in a value of zero instead of an array
The message is send to the OPC-UA Server which responds with a BadTypeMismatch failure because it expects an array and not a value.
Expected behaviour
Instead of a single value the whole array should be passed to the node-opcua library and the OPC server. The write operation should then suceed.
Minimal reproduction of the problem with instructions
Setup a flow and try to write an array (see the attached demo flow)
I'm submitting a ...
Problem
Information
Current behaviour
Writing an array produces an invalid message where only a value of 0 is send instead of the array. For this reason the OPC server responds with an error.
Response from the OPC server:
name: "BadTypeMismatch"
Reason for this behaviour is the following code sequence:
Expected behaviour Instead of a single value the whole array should be passed to the node-opcua library and the OPC server. The write operation should then suceed.
Minimal reproduction of the problem with instructions
Minimal Demo Flow flows.txt
Your Environment
Please tell us about your environment:
node --version
= v8.11.3