AttributeError: 'str' object has no attribute 'write_value' #1515
-
Hi, Im trying to write with my Client to the Server Struct. I know how to read the struct and how to change each object inside the struct with the opcua-client, but when I try to do it with the python program I can't. The codes are the minimal server and minimal client changed a bit to do what I need. Here is the server code, in theory its doing what I want:
And in the client, I can read each one of the objects inside de structure, but I can't write, I tried to write to the structure, to one of the objects, but nothing.
To try, the first "version" was the same but only 1 variable and write in that variable and with only this it worked, but now with the structure I don't know what to do. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You are in the wrong repo. But you can only write the total structure. In your case: old_struct = await mystruct.get_value()
old_struct.MyBool = 'Text'
await mystruct.write_value(old_struct) or this way: val = ua.MyStruct(MyBool='Text')
await mystruct.write_value(val) |
Beta Was this translation helpful? Give feedback.
You are in the wrong repo. But you can only write the total structure. In your case:
or this way: