How to get Enum value in OPC #1221
Answered
by
schroeder-
MatthewBoss96
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
schroeder-
Feb 21, 2023
Replies: 1 comment 6 replies
-
You need to pass the nodeid of your enumtype to add_variable: async def EnumTest(self, server, idx:int, name:str) -> Struct:
enum_node = await new_enum(server, idx, name, [ "UNDEFINED", "GOOD", "BAD", ])
self.EnumTest(self.server, self.idx, "EnumerateTest")
await self.server.load_data_type_definitions()
await self.add_variable(self.Test, self.idx, "EnumTest", "Test for enumerate", ua.EnumerateTest.UNDEFINED, enum_node) |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
MatthewBoss96
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to pass the nodeid of your enumtype to add_variable: