Skip to content
Discussion options

You must be logged in to vote

I think you mix something up. HasTypeDefinition in the case of a Variable means, you provide a VariableType on the server as Template. In your case you can create a MyStructVariableType and add HasTypeDefinition to your variable.
In the server-custom-structures-and-enums.py like this:

    valtype = server.nodes.base_variable_type.add_variable_type(idx, f"{idx}:MyStructVariableType", snode1)
    val = await server.nodes.objects.add_variable(idx, "my_struct", ua.Variant(ua.MyStruct(), ua.VariantType.ExtensionObject))
    val.add_reference(valnode, ua.ObjectIds.HasTypeDefinition, val)

Replies: 1 comment 1 reply

Comment options

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

Answer selected by danmoser
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