Skip to content

Enum in Custom Structure #1229

Answered by schroeder-
MatthewBoss96 asked this question in Q&A
Discussion options

You must be logged in to vote

This should work (untested):

    enum_nid = await new_enum(server, idx, name, 
    [
        "TEST1",
        "TEST2",
        "TEST3"
    ]) 
    struct_nid = dawait new_struct(server, idx, name, [
        new_struct_field("Enum", enum_nid, description="Emum test"),
        new_struct_field("String", ua.VariantType.String, description="String test"),
    ])
    await self.server.load_data_type_definitions()
    self.enumStructTest = await self.add_variable(self.Test, self.idx, "my_custom_enum", "Custom Enum Struct Test", ua.Variant([ua.EnumStructTest(ua.EnumerateTest.UNDEFINED, "")], struct_nid ))

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MatthewBoss96
Comment options

Answer selected by MatthewBoss96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants