Commit d27dbfb9 authored by gstvg's avatar gstvg Committed by oroulet

use union base type when creating new union

parent 56869ea2
...@@ -62,7 +62,12 @@ async def new_struct( ...@@ -62,7 +62,12 @@ async def new_struct(
simple way to create a new structure simple way to create a new structure
return the created data type node and the list of encoding nodes return the created data type node and the list of encoding nodes
""" """
dtype = await create_data_type(server.nodes.base_structure_type, idx, name)
type_name = server.nodes.base_structure_type
if is_union:
type_name = server.nodes.base_union_type
dtype = await create_data_type(type_name, idx, name)
if isinstance(idx, ua.NodeId): if isinstance(idx, ua.NodeId):
# user has provided a node id, we cannot reuse it # user has provided a node id, we cannot reuse it
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment