Closed georges-schutz closed 2 years ago
resolved in c2051c7d942ae347f1c07959aab5c46e8c633441
Thank you for this very rapid reaction. I pulled the latest code base and it does now work out of the box for int and float variables (in my python opcua server environment). But there is still an issue with writing Boolean type variables, I tried typing several entrie-variants as I sow in your commit that several inputs should be handled.
$ sudo docker run --network host -it commander -v -e opc.tcp://localhost:4080
Error: Invalid variant arrayType: Scalar dataType: Boolean value:1 (javascript type = string )
at constructHook (/opt/opcuacommander/node_modules/node-opcua-variant/source/variant.ts:472:19)
at new Variant (/opt/opcuacommander/node_modules/node-opcua-variant/source/variant.ts:112:26)
at Model.writeNode (/opt/opcuacommander/lib/model/model.ts:311:21)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at Form.<anonymous> (/opt/opcuacommander/lib/view/view.ts:238:23)
$ sudo docker run --network host -it commander -v -e opc.tcp://localhost:4080
Error: Invalid variant arrayType: Scalar dataType: Boolean value:true (javascript type = string )
at constructHook (/opt/opcuacommander/node_modules/node-opcua-variant/source/variant.ts:472:19)
at new Variant (/opt/opcuacommander/node_modules/node-opcua-variant/source/variant.ts:112:26)
at Model.writeNode (/opt/opcuacommander/lib/model/model.ts:311:21)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at Form.<anonymous> (/opt/opcuacommander/lib/view/view.ts:238:23)
$ sudo docker run --network host -it commander -v -e opc.tcp://localhost:4080
PKI Folder = /root/.config/opcua-commander-nodejs/pki
Error: Invalid variant arrayType: Scalar dataType: Boolean value:"1" (javascript type = string )
at constructHook (/opt/opcuacommander/node_modules/node-opcua-variant/source/variant.ts:472:19)
at new Variant (/opt/opcuacommander/node_modules/node-opcua-variant/source/variant.ts:112:26)
at Model.writeNode (/opt/opcuacommander/lib/model/model.ts:311:21)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at Form.<anonymous> (/opt/opcuacommander/lib/view/view.ts:238:23)
$ sudo docker run --network host -it commander -v -e opc.tcp://localhost:4080
Error: Invalid variant arrayType: Scalar dataType: Boolean value:"true" (javascript type = string )
at constructHook (/opt/opcuacommander/node_modules/node-opcua-variant/source/variant.ts:472:19)
at new Variant (/opt/opcuacommander/node_modules/node-opcua-variant/source/variant.ts:112:26)
at Model.writeNode (/opt/opcuacommander/lib/model/model.ts:311:21)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at Form.<anonymous> (/opt/opcuacommander/lib/view/view.ts:238:23)
If I connect the OPCUA server with UA-Expert the Boolean variable is correctly identified and it is possible to tick/untick the box to change the value true/false
You may still be using an old version: Here is the intended behavior https://asciinema.org/a/HIZcc20CHFw0Wrv7sSWDukcp4
Hi all and thank you for the fix. I have pulled the 0.18.0 code base and rebuild the docker container. I have tested the same write action and this does produce the following exception
Base on that and my previous research, I have just removed the dimension property at Variant creation.
With that I am back to be able to just write scalar opc-variables. The error in writing Boolean types is still present.
Originally posted by @georges-schutz in https://github.com/node-opcua/opcua-commander/issues/33#issuecomment-1100127720