Is it possible to write an enumeration value to the OPC UA Server? #1747
tommy-emerson
started this conversation in
General
Replies: 2 comments
-
opcua-asyncio/tests/test_common.py Line 1199 in 302c434 maybe this helps tbh i have not tried it yet but you could share your sample code!? |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can do it like this, replace MyEnum. We use a python enum class for opc ua enums.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I can write ints, floats and strings to the OPC UA server using the opcua-asyncio's sync wrapper client, by simply calling node.set_value(data_value).
However, I stumbled into problems when writing a custom enumeration, because the server did not like that I tried to write an enum-value of type Int32. At least, that is how I understand the problem. So I looked for a way to specify the Enumeration data type after having extracted it from the node using: enum_data_type_id = node.read_data_type(). Unfortunately it seems that the Variant type does not have a DataType accepting enum_data_type_id, neither does DataValue. So, I do not know how to specify that I'm writing a value of a certain Enumeration type - is it possible? How?
Regards,
TommyS
Beta Was this translation helpful? Give feedback.
All reactions