OPC UA node can't be written to
Show older comments
Greetings everyone,
my problem occurs in using a Bachmann M1-Device to set up a robot control. The control is implemented in Simulink and built to the device using automatic code generation, which works flawlessly. In order to test some things out, i wrote a .m-file to basically simulate the robot. Im using the OPC UA commands to read from and write to the control-programm on the device. Therefore, i specified SVI-Read and SVI-Write Blocks in the Simulink file.
I establish a connection using
uaClient = opcua(IPAdress,Port)
connect(uaClient)
Im then creating the node-objects to read and write values with
node_q_lin = findNodeByName(Namespace,'hOPCUAq_lin','-once')
.
AccessLevelCurrent: read/write
.
In Simulink, hOPCUAq_lin is a SVI-Read Block. Data type is specified as inherited, initial value is set to [0 0 0 0 0]. Reading from the node delivers
readValue(uaClient,hOPCUAq_lin)
=[0 0 0 0 0].
So far, so good. But if i try to write a value into the node with, the following error occurs
writeValue(uaClient,node_q_lin,[0 0 0 0 0])
Error using opc.ua.Client/writeValue (line 1268)
The value supplied for the attribute is not of the same type as the attribute's value.
This seems quite strange to me, and i don't really have a clue to what went wrong here. I have not found a similar scenario in the documentation so far, but i will keep on looking. I would greatly appreciate any suggestions.
Accepted Answer
More Answers (0)
Categories
Find more on Unified Architecture in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!