Пример #1
0
def _create_object(server, parentnodeid, nodeid, qname, objecttype):
    addnode = ua.AddNodesItem()
    addnode.RequestedNewNodeId = nodeid
    addnode.BrowseName = qname
    addnode.ParentNodeId = parentnodeid
    if node.Node(server, parentnodeid).get_type_definition() == ua.NodeId(
            ua.ObjectIds.FolderType):
        addnode.ReferenceTypeId = ua.NodeId(ua.ObjectIds.Organizes)
    else:
        addnode.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasComponent)
    addnode.NodeClass = ua.NodeClass.Object
    if isinstance(objecttype, int):
        addnode.TypeDefinition = ua.NodeId(objecttype)
    else:
        addnode.TypeDefinition = objecttype
    attrs = ua.ObjectAttributes()
    attrs.EventNotifier = 0

    attrs.Description = ua.LocalizedText(qname.Name)
    attrs.DisplayName = ua.LocalizedText(qname.Name)
    attrs.WriteMask = 0
    attrs.UserWriteMask = 0
    addnode.NodeAttributes = attrs
    results = server.add_nodes([addnode])
    results[0].StatusCode.check()
    return results[0].AddedNodeId
Пример #2
0
def _create_object(server, parentnodeid, nodeid, qname, objecttype):
    addnode = ua.AddNodesItem()
    addnode.RequestedNewNodeId = nodeid
    addnode.BrowseName = qname
    addnode.ParentNodeId = parentnodeid
    #TODO: maybe move to address_space.py and implement for all node types?
    if not objecttype:
        addnode.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasSubtype)
        addnode.NodeClass = ua.NodeClass.ObjectType
        attrs = ua.ObjectTypeAttributes()
        attrs.IsAbstract = True
    else:
        if node.Node(
                server,
                parentnodeid).get_type_definition() == ua.ObjectIds.FolderType:
            addnode.ReferenceTypeId = ua.NodeId(ua.ObjectIds.Organizes)
        else:
            addnode.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasComponent)

        addnode.NodeClass = ua.NodeClass.Object
        addnode.TypeDefinition = ua.NodeId(objecttype)
        attrs = ua.ObjectAttributes()
        attrs.EventNotifier = 0

    attrs.Description = ua.LocalizedText(qname.Name)
    attrs.DisplayName = ua.LocalizedText(qname.Name)
    attrs.WriteMask = 0
    attrs.UserWriteMask = 0
    addnode.NodeAttributes = attrs
    results = server.add_nodes([addnode])
    results[0].StatusCode.check()
    return results[0].AddedNodeId
Пример #3
0
def _instantiate_node(server, parentid, rdesc, nodeid, bname, recursive=True):
    """
    instantiate a node type under parent
    """

    addnode = ua.AddNodesItem()
    addnode.RequestedNewNodeId = nodeid
    addnode.BrowseName = bname
    addnode.ParentNodeId = parentid
    addnode.ReferenceTypeId = rdesc.ReferenceTypeId
    addnode.TypeDefinition = rdesc.TypeDefinition

    node_type = Node(server, rdesc.NodeId)
    if rdesc.NodeClass in (ua.NodeClass.Object, ua.NodeClass.ObjectType):
        addnode.NodeClass = ua.NodeClass.Object
        _read_and_copy_attrs(node_type, ua.ObjectAttributes(), addnode)

    elif rdesc.NodeClass in (ua.NodeClass.Variable, ua.NodeClass.VariableType):
        addnode.NodeClass = ua.NodeClass.Variable
        _read_and_copy_attrs(node_type, ua.VariableAttributes(), addnode)
    elif rdesc.NodeClass in (ua.NodeClass.Method,):
        addnode.NodeClass = ua.NodeClass.Method
        _read_and_copy_attrs(node_type, ua.MethodAttributes(), addnode)
    else:
        print("Instantiate: Node class not supported: ", rdesc.NodeClass)
        return

    res = server.add_nodes([addnode])[0]

    if recursive:
        descs = node_type.get_children_descriptions(includesubtypes=False)
        for c_rdesc in descs:
            _instantiate_node(server, res.AddedNodeId, c_rdesc, nodeid=ua.NodeId(namespaceidx=res.AddedNodeId.NamespaceIndex), bname=c_rdesc.BrowseName)
    return Node(server, res.AddedNodeId)
Пример #4
0
 def add_object(self, obj):
     node = self._get_node(obj)
     attrs = ua.ObjectAttributes()
     if obj.desc:
         attrs.Description = ua.LocalizedText(obj.desc)
     attrs.DisplayName = ua.LocalizedText(obj.displayname)
     attrs.EventNotifier = obj.eventnotifier
     node.NodeAttributes = attrs
     self.server.add_nodes([node])
     self._add_refs(obj)
Пример #5
0
def _instantiate_node(server, parentid, rdesc, nodeid, bname, recursive=True):
    """
    instantiate a node type under parent
    """
    node_type = Node(server, rdesc.NodeId)
    refs = node_type.get_referenced_nodes(refs=ua.ObjectIds.HasModellingRule)

    # skip optional elements
    if len(refs) == 1 and refs[0].nodeid == ua.NodeId(
            ua.ObjectIds.ModellingRule_Optional):
        return []

    addnode = ua.AddNodesItem()
    addnode.RequestedNewNodeId = nodeid
    addnode.BrowseName = bname
    addnode.ParentNodeId = parentid
    addnode.ReferenceTypeId = rdesc.ReferenceTypeId
    addnode.TypeDefinition = rdesc.TypeDefinition

    if rdesc.NodeClass in (ua.NodeClass.Object, ua.NodeClass.ObjectType):
        addnode.NodeClass = ua.NodeClass.Object
        _read_and_copy_attrs(node_type, ua.ObjectAttributes(), addnode)

    elif rdesc.NodeClass in (ua.NodeClass.Variable, ua.NodeClass.VariableType):
        addnode.NodeClass = ua.NodeClass.Variable
        _read_and_copy_attrs(node_type, ua.VariableAttributes(), addnode)
    elif rdesc.NodeClass in (ua.NodeClass.Method, ):
        addnode.NodeClass = ua.NodeClass.Method
        _read_and_copy_attrs(node_type, ua.MethodAttributes(), addnode)
    else:
        print("Instantiate: Node class not supported: ", rdesc.NodeClass)
        return

    res = server.add_nodes([addnode])[0]
    added_nodes = [res.AddedNodeId]

    if recursive:
        parents = ua_utils.get_node_supertypes(node_type, includeitself=True)
        node = Node(server, res.AddedNodeId)
        for parent in parents:
            descs = parent.get_children_descriptions(includesubtypes=False)
            for c_rdesc in descs:
                # skip items that already exists, prefer the 'lowest' one in object hierarchy
                if not ua_utils.is_child_present(node, c_rdesc.BrowseName):
                    nodeids = _instantiate_node(
                        server,
                        res.AddedNodeId,
                        c_rdesc,
                        nodeid=ua.NodeId(
                            namespaceidx=res.AddedNodeId.NamespaceIndex),
                        bname=c_rdesc.BrowseName)
                    added_nodes.extend(nodeids)

    return added_nodes
Пример #6
0
    def _create_data_type(self, type_name):
        name = _to_camel_case(type_name)
        # apply for new node id
        data_type_node_id = self._nodeid_generator()
        description_node_id = self._nodeid_generator()
        bind_obj_node_id = self._nodeid_generator()

        # create data type node
        dt_node = ua.AddNodesItem()
        dt_node.RequestedNewNodeId = data_type_node_id
        dt_node.BrowseName = ua.QualifiedName(name, self._idx)
        dt_node.NodeClass = ua.NodeClass.DataType
        dt_node.ParentNodeId = ua.NodeId(ua.ObjectIds.Structure, 0)
        dt_node.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasSubtype, 0)
        dt_attributes = ua.DataTypeAttributes()
        dt_attributes.DisplayName = ua.LocalizedText(type_name)
        dt_node.NodeAttributes = dt_attributes

        # create description node
        desc_node = ua.AddNodesItem()
        desc_node.RequestedNewNodeId = description_node_id
        desc_node.BrowseName = ua.QualifiedName(name, self._idx)
        desc_node.NodeClass = ua.NodeClass.Variable
        desc_node.ParentNodeId = self.dict_id
        desc_node.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasComponent, 0)
        desc_node.TypeDefinition = ua.NodeId(
            ua.ObjectIds.DataTypeDescriptionType, 0)
        desc_attributes = ua.VariableAttributes()
        desc_attributes.DisplayName = ua.LocalizedText(type_name)
        desc_attributes.DataType = ua.NodeId(ua.ObjectIds.String)
        desc_attributes.Value = ua.Variant(name, ua.VariantType.String)
        desc_attributes.ValueRank = -1
        desc_node.NodeAttributes = desc_attributes

        # create object node which the loaded python class should link to
        obj_node = ua.AddNodesItem()
        obj_node.RequestedNewNodeId = bind_obj_node_id
        obj_node.BrowseName = ua.QualifiedName('Default Binary', 0)
        obj_node.NodeClass = ua.NodeClass.Object
        obj_node.ParentNodeId = data_type_node_id
        obj_node.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasEncoding, 0)
        obj_node.TypeDefinition = ua.NodeId(ua.ObjectIds.DataTypeEncodingType,
                                            0)
        obj_attributes = ua.ObjectAttributes()
        obj_attributes.DisplayName = ua.LocalizedText('Default Binary')
        obj_attributes.EventNotifier = 0
        obj_node.NodeAttributes = obj_attributes

        self._session_server.add_nodes([dt_node, desc_node, obj_node])
        self._link_nodes(bind_obj_node_id, data_type_node_id,
                         description_node_id)

        self._type_dictionary.append_struct(type_name)
        return StructNode(self, data_type_node_id, type_name)
Пример #7
0
 def add_object(self, obj):
     node = self._get_node(obj)
     attrs = ua.ObjectAttributes()
     if obj.desc:
         attrs.Description = ua.LocalizedText(obj.desc)
     attrs.DisplayName = ua.LocalizedText(obj.displayname)
     attrs.EventNotifier = obj.eventnotifier
     node.NodeAttributes = attrs
     res = self._add_node(node)
     self._add_refs(obj)
     res[0].StatusCode.check()
     return res[0].AddedNodeId
Пример #8
0
def _instanciate_node(server, parentid, rdesc, idx):
    """
    Instanciate a new node under 'parent' using a type
    """

    print("Instanciating: node %s in %s" % (rdesc, parentid))
    addnode = ua.AddNodesItem()
    addnode.RequestedNewNodeId = ua.generate_nodeid(idx)
    addnode.BrowseName = rdesc.BrowseName
    addnode.NodeClass = rdesc.NodeClass
    addnode.ParentNodeId = parentid
    addnode.ReferenceTypeId = ua.TwoByteNodeId(ua.ObjectIds.HasComponent)
    addnode.TypeDefinition = rdesc.TypeDefinition
    print("ADDNODE", addnode)

    node_type = Node(server, rdesc.NodeId)

    if rdesc.NodeClass in (ua.NodeClass.Object, ua.NodeClass.ObjectType):
        print(node_type, " is object")
        _read_and_copy_attrs(node_type, ua.ObjectAttributes(), addnode)
        #_add_object_attrs(addnode, rdesc, node_type)

    elif rdesc.NodeClass in (ua.NodeClass.Variable, ua.NodeClass.VariableType):
        print(node_type, " is variable")
        _read_and_copy_attrs(node_type, ua.VariableAttributes(), addnode)
        #_add_variable_attrs(addnode, rdesc, node_type)

    else:
        print("Node class not supported: ", rdesc.NodeClass)

    print("ADDNODE FINAL ", addnode)
    server.add_nodes([addnode])

    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = addnode.ReferenceTypeId
    ref.SourceNodeId = parentid
    ref.TargetNodeClass = addnode.NodeClass
    ref.TargetNodeId = addnode.RequestedNewNodeId

    refs.append(ref)
    server.add_references(refs)

    descs = node_type.get_children_descriptions(
        includesubtypes=False)  #FIXME: should be false
    print("node is", rdesc.NodeId, node_type, node_type.get_children())
    print("Children are: ", descs)
    for rdesc in descs:
        _instanciate_node(server, addnode.RequestedNewNodeId, rdesc, idx)
    return Node(server, addnode.RequestedNewNodeId)
Пример #9
0
def _create_object(server, parentnodeid, nodeid, qname):
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = nodeid
    node.BrowseName = qname
    node.NodeClass = ua.NodeClass.Object
    node.ParentNodeId = parentnodeid
    node.ReferenceTypeId = ua.NodeId.from_string("i=35")
    node.TypeDefinition = ua.NodeId(ua.ObjectIds.BaseObjectType)
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(qname.Name)
    attrs.DisplayName = ua.LocalizedText(qname.Name)
    attrs.EventNotifier = 0
    attrs.WriteMask = ua.OpenFileMode.Read
    attrs.UserWriteMask = ua.OpenFileMode.Read
    node.NodeAttributes = attrs
    results = server.add_nodes([node])
    results[0].StatusCode.check()
    return nodeid
Пример #10
0
def _create_folder(server, parentnodeid, nodeid, qname):
    addnode = ua.AddNodesItem()
    addnode.RequestedNewNodeId = nodeid
    addnode.BrowseName = qname
    addnode.NodeClass = ua.NodeClass.Object
    addnode.ParentNodeId = parentnodeid
    addnode.ReferenceTypeId = ua.NodeId.from_string("i=35")
    addnode.TypeDefinition = ua.NodeId.from_string("i=61")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(qname.Name)
    attrs.DisplayName = ua.LocalizedText(qname.Name)
    attrs.WriteMask = 0
    attrs.UserWriteMask = 0
    attrs.EventNotifier = 0
    addnode.NodeAttributes = attrs
    results = server.add_nodes([addnode])
    results[0].StatusCode.check()
    return results[0].AddedNodeId
Пример #11
0
def _add_object_attrs(addnode, node_type):
    results = node_type.get_attributes([
        ua.AttributeIds.BrowseName, ua.AttributeIds.Description,
        ua.AttributeIds.WriteMask, ua.AttributeIds.UserWriteMask,
        ua.AttributeIds.EventNotifier
    ])

    attrs = ua.ObjectAttributes()
    _set_attr(attrs.DisplayName, results, 0)
    _set_attr(attrs.Description, results, 0)
    attrs.DisplayName = rdesc.BrowseName
    attrs.Description = rdesc.Description
    if results[0].StatusCode.is_good():
        attrs.Description = results[0].Value.Value
    if results[1].StatusCode.is_good():
        attrs.WriteMask = results[1].Value.Value
    if results[2].StatusCode.is_good():
        attrs.UserWriteMask = results[2].Value.Value
    if results[3].StatusCode.is_good():
        attrs.UserWriteMask = results[3].Value.Value

    addnode.NodeAttributes = attrs
Пример #12
0
def _add_variable_attrs(addnode, rdesc, node_type):
    results = node_type.get_attributes([
        ua.AttributeIds.EventNotifier, ua.AttributeIds.Description,
        ua.AttributeIds.WriteMask, ua.AttributeIds.UserWriteMask,
        ua.AttributeIds.Value, ua.AttributeIds.DataType,
        ua.AttributeIds.ValueRank, ua.AttributeIds.ArrayDimentions,
        ua.AttributeIds.AccessLevel, ua.AttributeIds.UserAccessLevel,
        ua.AttributeIds.MinimumSamplingInterval, ua.AttributeIds.Historizing
    ])

    attrs = ua.ObjectAttributes()
    if results[0].is_good():
        attrs.DisplayName = results[0].Value.Value
    if results[1].is_good():
        attrs.Description = results[1].Value.Value
    if results[2].is_good():
        attrs.WriteMask = results[2].Value.Value
    if results[3].is_good():
        attrs.UserWriteMask = results[3].Value.Value
    #if results[4].is_good():
    #attrs.Value = results[4].Value.Value
    if results[5].is_good():
        attrs.DataType = results[5].Value.Value
    if results[6].is_good():
        attrs.ValueRank = results[6].Value.Value
    if results[7].is_good():
        attrs.ArrayDimensions = results[7].Value.Value
    if results[8].is_good():
        attrs.AccessLevel = results[8].Value.Value
    if results[9].is_good():
        attrs.UserAccessLevel = results[9].Value.Value
    if results[10].is_good():
        attrs.MinimumSamplingInterval = results[10].Value.Value
    if results[11].is_good():
        attrs.Historizing = results[11].Value.Value

    addnode.NodeAttributes = attrs
def create_standard_address_space_Part13(server):

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11187")
    node.BrowseName = ua.QualifiedName.from_string(
        "AggregateConfigurationType")
    node.NodeClass = ua.NodeClass.ObjectType
    node.ParentNodeId = ua.NodeId.from_string("i=58")
    node.ReferenceTypeId = ua.NodeId.from_string("i=45")
    attrs = ua.ObjectTypeAttributes()
    attrs.DisplayName = ua.LocalizedText("AggregateConfigurationType")
    attrs.IsAbstract = false
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = true
    ref.ReferenceTypeId = ua.NodeId.from_string("i=46")
    ref.SourceNodeId = ua.NodeId.from_string("i=11187")
    ref.TargetNodeClass = ua.NodeClass.DataType
    ref.TargetNodeId = ua.NodeId.from_string("i=11188")
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = true
    ref.ReferenceTypeId = ua.NodeId.from_string("i=46")
    ref.SourceNodeId = ua.NodeId.from_string("i=11187")
    ref.TargetNodeClass = ua.NodeClass.DataType
    ref.TargetNodeId = ua.NodeId.from_string("i=11189")
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = true
    ref.ReferenceTypeId = ua.NodeId.from_string("i=46")
    ref.SourceNodeId = ua.NodeId.from_string("i=11187")
    ref.TargetNodeClass = ua.NodeClass.DataType
    ref.TargetNodeId = ua.NodeId.from_string("i=11190")
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = true
    ref.ReferenceTypeId = ua.NodeId.from_string("i=46")
    ref.SourceNodeId = ua.NodeId.from_string("i=11187")
    ref.TargetNodeClass = ua.NodeClass.DataType
    ref.TargetNodeId = ua.NodeId.from_string("i=11191")
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11188")
    node.BrowseName = ua.QualifiedName.from_string("TreatUncertainAsBad")
    node.NodeClass = ua.NodeClass.Variable
    node.ParentNodeId = ua.NodeId.from_string("i=11187")
    node.ReferenceTypeId = ua.NodeId.from_string("i=46")
    node.TypeDefinition = ua.NodeId.from_string("i=68")
    attrs = ua.VariableAttributes()
    attrs.DisplayName = ua.LocalizedText("TreatUncertainAsBad")
    attrs.DataType = ua.NodeId(ua.ObjectIds.Boolean)
    attrs.ValueRank = -1
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = true
    ref.ReferenceTypeId = ua.NodeId.from_string("i=37")
    ref.SourceNodeId = ua.NodeId.from_string("i=11188")
    ref.TargetNodeClass = ua.NodeClass.DataType
    ref.TargetNodeId = ua.NodeId.from_string("i=78")
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11189")
    node.BrowseName = ua.QualifiedName.from_string("PercentDataBad")
    node.NodeClass = ua.NodeClass.Variable
    node.ParentNodeId = ua.NodeId.from_string("i=11187")
    node.ReferenceTypeId = ua.NodeId.from_string("i=46")
    node.TypeDefinition = ua.NodeId.from_string("i=68")
    attrs = ua.VariableAttributes()
    attrs.DisplayName = ua.LocalizedText("PercentDataBad")
    attrs.DataType = ua.NodeId(ua.ObjectIds.Byte)
    attrs.ValueRank = -1
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = true
    ref.ReferenceTypeId = ua.NodeId.from_string("i=37")
    ref.SourceNodeId = ua.NodeId.from_string("i=11189")
    ref.TargetNodeClass = ua.NodeClass.DataType
    ref.TargetNodeId = ua.NodeId.from_string("i=78")
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11190")
    node.BrowseName = ua.QualifiedName.from_string("PercentDataGood")
    node.NodeClass = ua.NodeClass.Variable
    node.ParentNodeId = ua.NodeId.from_string("i=11187")
    node.ReferenceTypeId = ua.NodeId.from_string("i=46")
    node.TypeDefinition = ua.NodeId.from_string("i=68")
    attrs = ua.VariableAttributes()
    attrs.DisplayName = ua.LocalizedText("PercentDataGood")
    attrs.DataType = ua.NodeId(ua.ObjectIds.Byte)
    attrs.ValueRank = -1
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = true
    ref.ReferenceTypeId = ua.NodeId.from_string("i=37")
    ref.SourceNodeId = ua.NodeId.from_string("i=11190")
    ref.TargetNodeClass = ua.NodeClass.DataType
    ref.TargetNodeId = ua.NodeId.from_string("i=78")
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11191")
    node.BrowseName = ua.QualifiedName.from_string("UseSlopedExtrapolation")
    node.NodeClass = ua.NodeClass.Variable
    node.ParentNodeId = ua.NodeId.from_string("i=11187")
    node.ReferenceTypeId = ua.NodeId.from_string("i=46")
    node.TypeDefinition = ua.NodeId.from_string("i=68")
    attrs = ua.VariableAttributes()
    attrs.DisplayName = ua.LocalizedText("UseSlopedExtrapolation")
    attrs.DataType = ua.NodeId(ua.ObjectIds.Boolean)
    attrs.ValueRank = -1
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = true
    ref.ReferenceTypeId = ua.NodeId.from_string("i=37")
    ref.SourceNodeId = ua.NodeId.from_string("i=11191")
    ref.TargetNodeClass = ua.NodeClass.DataType
    ref.TargetNodeId = ua.NodeId.from_string("i=78")
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2341")
    node.BrowseName = ua.QualifiedName.from_string("Interpolative")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "At the beginning of each interval, retrieve the calculated value from the data points on either side of the requested timestamp."
    )
    attrs.DisplayName = ua.LocalizedText("Interpolative")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2342")
    node.BrowseName = ua.QualifiedName.from_string("Average")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the average value of the data over the interval.")
    attrs.DisplayName = ua.LocalizedText("Average")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2343")
    node.BrowseName = ua.QualifiedName.from_string("TimeAverage")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the time weighted average data over the interval using Interpolated Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("TimeAverage")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11285")
    node.BrowseName = ua.QualifiedName.from_string("TimeAverage2")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the time weighted average data over the interval using Simple Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("TimeAverage2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2344")
    node.BrowseName = ua.QualifiedName.from_string("Total")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the total (time integral) of the data over the interval using Interpolated Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("Total")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11304")
    node.BrowseName = ua.QualifiedName.from_string("Total2")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the total (time integral) of the data over the interval using Simple Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("Total2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2346")
    node.BrowseName = ua.QualifiedName.from_string("Minimum")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the minimum raw value in the interval with the timestamp of the start of the interval."
    )
    attrs.DisplayName = ua.LocalizedText("Minimum")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2347")
    node.BrowseName = ua.QualifiedName.from_string("Maximum")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the maximum raw value in the interval with the timestamp of the start of the interval."
    )
    attrs.DisplayName = ua.LocalizedText("Maximum")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2348")
    node.BrowseName = ua.QualifiedName.from_string("MinimumActualTime")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the minimum value in the interval and the Timestamp of the minimum value."
    )
    attrs.DisplayName = ua.LocalizedText("MinimumActualTime")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2349")
    node.BrowseName = ua.QualifiedName.from_string("MaximumActualTime")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the maximum value in the interval and the Timestamp of the maximum value."
    )
    attrs.DisplayName = ua.LocalizedText("MaximumActualTime")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2350")
    node.BrowseName = ua.QualifiedName.from_string("Range")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the difference between the minimum and maximum Value over the interval."
    )
    attrs.DisplayName = ua.LocalizedText("Range")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11286")
    node.BrowseName = ua.QualifiedName.from_string("Minimum2")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the minimum value in the interval including the Simple Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("Minimum2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11287")
    node.BrowseName = ua.QualifiedName.from_string("Maximum2")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the maximum value in the interval including the Simple Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("Maximum2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11305")
    node.BrowseName = ua.QualifiedName.from_string("MinimumActualTime2")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the minimum value with the actual timestamp including the Simple Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("MinimumActualTime2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11306")
    node.BrowseName = ua.QualifiedName.from_string("MaximumActualTime2")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the maximum value with the actual timestamp including the Simple Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("MaximumActualTime2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11288")
    node.BrowseName = ua.QualifiedName.from_string("Range2")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the difference between the Minimum2 and Maximum2 value over the interval."
    )
    attrs.DisplayName = ua.LocalizedText("Range2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2351")
    node.BrowseName = ua.QualifiedName.from_string("AnnotationCount")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the number of Annotations in the interval.")
    attrs.DisplayName = ua.LocalizedText("AnnotationCount")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2352")
    node.BrowseName = ua.QualifiedName.from_string("Count")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the number of raw values over the interval.")
    attrs.DisplayName = ua.LocalizedText("Count")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11307")
    node.BrowseName = ua.QualifiedName.from_string("DurationInStateZero")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the time a Boolean or numeric was in a zero state using Simple Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("DurationInStateZero")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11308")
    node.BrowseName = ua.QualifiedName.from_string("DurationInStateNonZero")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the time a Boolean or numeric was in a non-zero state using Simple Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("DurationInStateNonZero")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2355")
    node.BrowseName = ua.QualifiedName.from_string("NumberOfTransitions")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the number of changes between zero and non-zero that a Boolean or Numeric value experienced in the interval."
    )
    attrs.DisplayName = ua.LocalizedText("NumberOfTransitions")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2357")
    node.BrowseName = ua.QualifiedName.from_string("Start")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the value at the beginning of the interval using Interpolated Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("Start")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2358")
    node.BrowseName = ua.QualifiedName.from_string("End")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the value at the end of the interval using Interpolated Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("End")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2359")
    node.BrowseName = ua.QualifiedName.from_string("Delta")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the difference between the Start and End value in the interval."
    )
    attrs.DisplayName = ua.LocalizedText("Delta")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11505")
    node.BrowseName = ua.QualifiedName.from_string("StartBound")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the value at the beginning of the interval using Simple Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("StartBound")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11506")
    node.BrowseName = ua.QualifiedName.from_string("EndBound")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the value at the end of the interval using Simple Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("EndBound")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11507")
    node.BrowseName = ua.QualifiedName.from_string("DeltaBounds")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the difference between the StartBound and EndBound value in the interval."
    )
    attrs.DisplayName = ua.LocalizedText("DeltaBounds")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2360")
    node.BrowseName = ua.QualifiedName.from_string("DurationGood")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the total duration of time in the interval during which the data is good."
    )
    attrs.DisplayName = ua.LocalizedText("DurationGood")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2361")
    node.BrowseName = ua.QualifiedName.from_string("DurationBad")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the total duration of time in the interval during which the data is bad."
    )
    attrs.DisplayName = ua.LocalizedText("DurationBad")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2362")
    node.BrowseName = ua.QualifiedName.from_string("PercentGood")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the percent of data (0 to 100) in the interval which has a good StatusCode."
    )
    attrs.DisplayName = ua.LocalizedText("PercentGood")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2363")
    node.BrowseName = ua.QualifiedName.from_string("PercentBad")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the percent of data (0 to 100) in the interval which has a bad StatusCode."
    )
    attrs.DisplayName = ua.LocalizedText("PercentBad")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=2364")
    node.BrowseName = ua.QualifiedName.from_string("WorstQuality")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the worst StatusCode of data in the interval.")
    attrs.DisplayName = ua.LocalizedText("WorstQuality")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11292")
    node.BrowseName = ua.QualifiedName.from_string("WorstQuality2")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the worst StatusCode of data in the interval including the Simple Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("WorstQuality2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11426")
    node.BrowseName = ua.QualifiedName.from_string("StandardDeviationSample")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the standard deviation for the interval for a sample of the population (n-1)."
    )
    attrs.DisplayName = ua.LocalizedText("StandardDeviationSample")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11427")
    node.BrowseName = ua.QualifiedName.from_string(
        "StandardDeviationPopulation")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the standard deviation for the interval for a complete population (n) which includes Simple Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("StandardDeviationPopulation")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11428")
    node.BrowseName = ua.QualifiedName.from_string("VarianceSample")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the variance for the interval as calculated by the StandardDeviationSample."
    )
    attrs.DisplayName = ua.LocalizedText("VarianceSample")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = ua.NodeId.from_string("i=11429")
    node.BrowseName = ua.QualifiedName.from_string("VariancePopulation")
    node.NodeClass = ua.NodeClass.Object
    node.TypeDefinition = ua.NodeId.from_string("i=2340")
    attrs = ua.ObjectAttributes()
    attrs.Description = ua.LocalizedText(
        "Retrieve the variance for the interval as calculated by the StandardDeviationPopulation which includes Simple Bounding Values."
    )
    attrs.DisplayName = ua.LocalizedText("VariancePopulation")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
Пример #14
0
def _instantiate_node(server,
                      node_type,
                      parentid,
                      rdesc,
                      nodeid,
                      bname,
                      dname=None,
                      recursive=True,
                      instantiate_optional=True):
    """
    instantiate a node type under parent
    """
    addnode = ua.AddNodesItem()
    addnode.RequestedNewNodeId = nodeid
    addnode.BrowseName = bname
    addnode.ParentNodeId = parentid
    addnode.ReferenceTypeId = rdesc.ReferenceTypeId
    addnode.TypeDefinition = rdesc.TypeDefinition

    if rdesc.NodeClass in (ua.NodeClass.Object, ua.NodeClass.ObjectType):
        addnode.NodeClass = ua.NodeClass.Object
        _read_and_copy_attrs(node_type, ua.ObjectAttributes(), addnode)

    elif rdesc.NodeClass in (ua.NodeClass.Variable, ua.NodeClass.VariableType):
        addnode.NodeClass = ua.NodeClass.Variable
        _read_and_copy_attrs(node_type, ua.VariableAttributes(), addnode)
    elif rdesc.NodeClass in (ua.NodeClass.Method, ):
        addnode.NodeClass = ua.NodeClass.Method
        _read_and_copy_attrs(node_type, ua.MethodAttributes(), addnode)
    elif rdesc.NodeClass in (ua.NodeClass.DataType, ):
        addnode.NodeClass = ua.NodeClass.DataType
        _read_and_copy_attrs(node_type, ua.DataTypeAttributes(), addnode)
    else:
        logger.error("Instantiate: Node class not supported: %s",
                     rdesc.NodeClass)
        raise RuntimeError("Instantiate: Node class not supported")
        return
    if dname is not None:
        addnode.NodeAttributes.DisplayName = dname

    res = server.add_nodes([addnode])[0]
    added_nodes = [res.AddedNodeId]

    if recursive:
        parents = ua_utils.get_node_supertypes(node_type, includeitself=True)
        node = Node(server, res.AddedNodeId)
        for parent in parents:
            descs = parent.get_children_descriptions(includesubtypes=False)
            for c_rdesc in descs:
                # skip items that already exists, prefer the 'lowest' one in object hierarchy
                if not ua_utils.is_child_present(node, c_rdesc.BrowseName):

                    c_node_type = Node(server, c_rdesc.NodeId)
                    refs = c_node_type.get_referenced_nodes(
                        refs=ua.ObjectIds.HasModellingRule)
                    if not refs:
                        # spec says to ignore nodes without modelling rules
                        logger.info(
                            "Instantiate: Skip node without modelling rule %s as part of %s",
                            c_rdesc.BrowseName, addnode.BrowseName)
                        continue
                        # exclude nodes with optional ModellingRule if requested
                    if not instantiate_optional and refs[0].nodeid == ua.NodeId(
                            ua.ObjectIds.ModellingRule_Optional):
                        logger.info(
                            "Instantiate: Skip optional node %s as part of %s",
                            c_rdesc.BrowseName, addnode.BrowseName)
                        continue

                    # if root node being instantiated has a String NodeId, create the children with a String NodeId
                    if res.AddedNodeId.NodeIdType is ua.NodeIdType.String:
                        inst_nodeid = res.AddedNodeId.Identifier + "." + c_rdesc.BrowseName.Name
                        nodeids = _instantiate_node(
                            server,
                            c_node_type,
                            res.AddedNodeId,
                            c_rdesc,
                            nodeid=ua.NodeId(
                                identifier=inst_nodeid,
                                namespaceidx=res.AddedNodeId.NamespaceIndex),
                            bname=c_rdesc.BrowseName)
                    else:
                        nodeids = _instantiate_node(
                            server,
                            c_node_type,
                            res.AddedNodeId,
                            c_rdesc,
                            nodeid=ua.NodeId(
                                namespaceidx=res.AddedNodeId.NamespaceIndex),
                            bname=c_rdesc.BrowseName)
                    added_nodes.extend(nodeids)

    return added_nodes
def create_standard_address_space_Part17(server):
  
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23455, 0)
    node.BrowseName = QualifiedName('AliasNameType', 0)
    node.NodeClass = NodeClass.ObjectType
    node.ParentNodeId = NumericNodeId(58, 0)
    node.ReferenceTypeId = NumericNodeId(45, 0)
    attrs = ua.ObjectTypeAttributes()
    attrs.DisplayName = LocalizedText("AliasNameType")
    attrs.IsAbstract = False
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(45, 0)
    ref.SourceNodeId = NumericNodeId(23455, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(58, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23456, 0)
    node.BrowseName = QualifiedName('AliasNameCategoryType', 0)
    node.NodeClass = NodeClass.ObjectType
    node.ParentNodeId = NumericNodeId(61, 0)
    node.ReferenceTypeId = NumericNodeId(45, 0)
    attrs = ua.ObjectTypeAttributes()
    attrs.DisplayName = LocalizedText("AliasNameCategoryType")
    attrs.IsAbstract = False
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(47, 0)
    ref.SourceNodeId = NumericNodeId(23456, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23457, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(47, 0)
    ref.SourceNodeId = NumericNodeId(23456, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23458, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(47, 0)
    ref.SourceNodeId = NumericNodeId(23456, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23462, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(45, 0)
    ref.SourceNodeId = NumericNodeId(23456, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(61, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23457, 0)
    node.BrowseName = QualifiedName('<Alias>', 0)
    node.NodeClass = NodeClass.Object
    node.ParentNodeId = NumericNodeId(23456, 0)
    node.ReferenceTypeId = NumericNodeId(47, 0)
    node.TypeDefinition = NumericNodeId(23455, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("<Alias>")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23457, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23455, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(37, 0)
    ref.SourceNodeId = NumericNodeId(23457, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11508, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(47, 0)
    ref.SourceNodeId = NumericNodeId(23457, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23456, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23458, 0)
    node.BrowseName = QualifiedName('<SubAliasNameCategories>', 0)
    node.NodeClass = NodeClass.Object
    node.ParentNodeId = NumericNodeId(23456, 0)
    node.ReferenceTypeId = NumericNodeId(47, 0)
    node.TypeDefinition = NumericNodeId(23456, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("<SubAliasNameCategories>")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(47, 0)
    ref.SourceNodeId = NumericNodeId(23458, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23459, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23458, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23456, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(37, 0)
    ref.SourceNodeId = NumericNodeId(23458, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11508, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(47, 0)
    ref.SourceNodeId = NumericNodeId(23458, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23456, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23459, 0)
    node.BrowseName = QualifiedName('FindAlias', 0)
    node.NodeClass = NodeClass.Method
    node.ParentNodeId = NumericNodeId(23458, 0)
    node.ReferenceTypeId = NumericNodeId(47, 0)
    attrs = ua.MethodAttributes()
    attrs.DisplayName = LocalizedText("FindAlias")
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23459, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23460, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23459, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23461, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(37, 0)
    ref.SourceNodeId = NumericNodeId(23459, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(78, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(47, 0)
    ref.SourceNodeId = NumericNodeId(23459, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23458, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23460, 0)
    node.BrowseName = QualifiedName('InputArguments', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(23459, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("InputArguments")
    attrs.DataType = NumericNodeId(296, 0)
    value = []
    extobj = ua.Argument()
    extobj.Name = 'AliasNameSearchPattern'
    extobj.DataType = NumericNodeId(12, 0)
    extobj.ValueRank = -1
    value.append(extobj)
    extobj = ua.Argument()
    extobj.Name = 'ReferenceTypeFilter'
    extobj.DataType = NumericNodeId(17, 0)
    extobj.ValueRank = -1
    value.append(extobj)
    attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject)
    attrs.ValueRank = 1
    attrs.ArrayDimensions = [0]
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23460, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(37, 0)
    ref.SourceNodeId = NumericNodeId(23460, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(78, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23460, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23459, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23461, 0)
    node.BrowseName = QualifiedName('OutputArguments', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(23459, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("OutputArguments")
    attrs.DataType = NumericNodeId(296, 0)
    value = []
    extobj = ua.Argument()
    extobj.Name = 'AliasNodeList'
    extobj.DataType = NumericNodeId(23468, 0)
    extobj.ValueRank = 1
    extobj.ArrayDimensions = 0
    value.append(extobj)
    attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject)
    attrs.ValueRank = 1
    attrs.ArrayDimensions = [0]
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23461, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(37, 0)
    ref.SourceNodeId = NumericNodeId(23461, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(78, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23461, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23459, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23462, 0)
    node.BrowseName = QualifiedName('FindAlias', 0)
    node.NodeClass = NodeClass.Method
    node.ParentNodeId = NumericNodeId(23456, 0)
    node.ReferenceTypeId = NumericNodeId(47, 0)
    attrs = ua.MethodAttributes()
    attrs.DisplayName = LocalizedText("FindAlias")
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23462, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23463, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23462, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23464, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(37, 0)
    ref.SourceNodeId = NumericNodeId(23462, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(78, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(47, 0)
    ref.SourceNodeId = NumericNodeId(23462, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23456, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23463, 0)
    node.BrowseName = QualifiedName('InputArguments', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(23462, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("InputArguments")
    attrs.DataType = NumericNodeId(296, 0)
    value = []
    extobj = ua.Argument()
    extobj.Name = 'AliasNameSearchPattern'
    extobj.DataType = NumericNodeId(12, 0)
    extobj.ValueRank = -1
    value.append(extobj)
    extobj = ua.Argument()
    extobj.Name = 'ReferenceTypeFilter'
    extobj.DataType = NumericNodeId(17, 0)
    extobj.ValueRank = -1
    value.append(extobj)
    attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject)
    attrs.ValueRank = 1
    attrs.ArrayDimensions = [0]
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23463, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(37, 0)
    ref.SourceNodeId = NumericNodeId(23463, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(78, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23463, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23462, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23464, 0)
    node.BrowseName = QualifiedName('OutputArguments', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(23462, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("OutputArguments")
    attrs.DataType = NumericNodeId(296, 0)
    value = []
    extobj = ua.Argument()
    extobj.Name = 'AliasNodeList'
    extobj.DataType = NumericNodeId(23468, 0)
    extobj.ValueRank = 1
    extobj.ArrayDimensions = 0
    value.append(extobj)
    attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject)
    attrs.ValueRank = 1
    attrs.ArrayDimensions = [0]
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23464, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(37, 0)
    ref.SourceNodeId = NumericNodeId(23464, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(78, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23464, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23462, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23468, 0)
    node.BrowseName = QualifiedName('AliasNameDataType', 0)
    node.NodeClass = NodeClass.DataType
    node.ParentNodeId = NumericNodeId(22, 0)
    node.ReferenceTypeId = NumericNodeId(45, 0)
    attrs = ua.DataTypeAttributes()
    attrs.DisplayName = LocalizedText("AliasNameDataType")
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(45, 0)
    ref.SourceNodeId = NumericNodeId(23468, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(22, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23469, 0)
    node.BrowseName = QualifiedName('AliasFor', 0)
    node.NodeClass = NodeClass.ReferenceType
    node.ParentNodeId = NumericNodeId(32, 0)
    node.ReferenceTypeId = NumericNodeId(45, 0)
    attrs = ua.ReferenceTypeAttributes()
    attrs.DisplayName = LocalizedText("AliasFor")
    attrs.InverseName = LocalizedText("HasAlias")
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(45, 0)
    ref.SourceNodeId = NumericNodeId(23469, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(32, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23470, 0)
    node.BrowseName = QualifiedName('Aliases', 0)
    node.NodeClass = NodeClass.Object
    node.ParentNodeId = NumericNodeId(85, 0)
    node.ReferenceTypeId = NumericNodeId(35, 0)
    node.TypeDefinition = NumericNodeId(23456, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Aliases")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(47, 0)
    ref.SourceNodeId = NumericNodeId(23470, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23476, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(35, 0)
    ref.SourceNodeId = NumericNodeId(23470, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(85, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23470, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23456, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23476, 0)
    node.BrowseName = QualifiedName('FindAlias', 0)
    node.NodeClass = NodeClass.Method
    node.ParentNodeId = NumericNodeId(23470, 0)
    node.ReferenceTypeId = NumericNodeId(47, 0)
    attrs = ua.MethodAttributes()
    attrs.DisplayName = LocalizedText("FindAlias")
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23476, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23477, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23476, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23478, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(47, 0)
    ref.SourceNodeId = NumericNodeId(23476, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23470, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23477, 0)
    node.BrowseName = QualifiedName('InputArguments', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(23476, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("InputArguments")
    attrs.DataType = NumericNodeId(296, 0)
    value = []
    extobj = ua.Argument()
    extobj.Name = 'AliasNameSearchPattern'
    extobj.DataType = NumericNodeId(12, 0)
    extobj.ValueRank = -1
    value.append(extobj)
    extobj = ua.Argument()
    extobj.Name = 'ReferenceTypeFilter'
    extobj.DataType = NumericNodeId(17, 0)
    extobj.ValueRank = -1
    value.append(extobj)
    attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject)
    attrs.ValueRank = 1
    attrs.ArrayDimensions = [0]
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23477, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23477, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23476, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23478, 0)
    node.BrowseName = QualifiedName('OutputArguments', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(23476, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("OutputArguments")
    attrs.DataType = NumericNodeId(296, 0)
    value = []
    extobj = ua.Argument()
    extobj.Name = 'AliasNodeList'
    extobj.DataType = NumericNodeId(23468, 0)
    extobj.ValueRank = 1
    extobj.ArrayDimensions = 0
    value.append(extobj)
    attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject)
    attrs.ValueRank = 1
    attrs.ArrayDimensions = [0]
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23478, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23478, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23476, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23479, 0)
    node.BrowseName = QualifiedName('Tags', 0)
    node.NodeClass = NodeClass.Object
    node.ParentNodeId = NumericNodeId(23470, 0)
    node.ReferenceTypeId = NumericNodeId(35, 0)
    node.TypeDefinition = NumericNodeId(23456, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Tags")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(47, 0)
    ref.SourceNodeId = NumericNodeId(23479, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23485, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(35, 0)
    ref.SourceNodeId = NumericNodeId(23479, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23470, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23479, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23456, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23485, 0)
    node.BrowseName = QualifiedName('FindAlias', 0)
    node.NodeClass = NodeClass.Method
    node.ParentNodeId = NumericNodeId(23479, 0)
    node.ReferenceTypeId = NumericNodeId(47, 0)
    attrs = ua.MethodAttributes()
    attrs.DisplayName = LocalizedText("FindAlias")
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23485, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23486, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23485, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23487, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(47, 0)
    ref.SourceNodeId = NumericNodeId(23485, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23479, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23486, 0)
    node.BrowseName = QualifiedName('InputArguments', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(23485, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("InputArguments")
    attrs.DataType = NumericNodeId(296, 0)
    value = []
    extobj = ua.Argument()
    extobj.Name = 'AliasNameSearchPattern'
    extobj.DataType = NumericNodeId(12, 0)
    extobj.ValueRank = -1
    value.append(extobj)
    extobj = ua.Argument()
    extobj.Name = 'ReferenceTypeFilter'
    extobj.DataType = NumericNodeId(17, 0)
    extobj.ValueRank = -1
    value.append(extobj)
    attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject)
    attrs.ValueRank = 1
    attrs.ArrayDimensions = [0]
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23486, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23486, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23485, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23487, 0)
    node.BrowseName = QualifiedName('OutputArguments', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(23485, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("OutputArguments")
    attrs.DataType = NumericNodeId(296, 0)
    value = []
    extobj = ua.Argument()
    extobj.Name = 'AliasNodeList'
    extobj.DataType = NumericNodeId(23468, 0)
    extobj.ValueRank = 1
    extobj.ArrayDimensions = 0
    value.append(extobj)
    attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject)
    attrs.ValueRank = 1
    attrs.ArrayDimensions = [0]
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23487, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23487, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23485, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23488, 0)
    node.BrowseName = QualifiedName('Topics', 0)
    node.NodeClass = NodeClass.Object
    node.ParentNodeId = NumericNodeId(23470, 0)
    node.ReferenceTypeId = NumericNodeId(35, 0)
    node.TypeDefinition = NumericNodeId(23456, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Topics")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(47, 0)
    ref.SourceNodeId = NumericNodeId(23488, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23494, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(35, 0)
    ref.SourceNodeId = NumericNodeId(23488, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23470, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23488, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23456, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23494, 0)
    node.BrowseName = QualifiedName('FindAlias', 0)
    node.NodeClass = NodeClass.Method
    node.ParentNodeId = NumericNodeId(23488, 0)
    node.ReferenceTypeId = NumericNodeId(47, 0)
    attrs = ua.MethodAttributes()
    attrs.DisplayName = LocalizedText("FindAlias")
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23494, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23495, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23494, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23496, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(47, 0)
    ref.SourceNodeId = NumericNodeId(23494, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23488, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23495, 0)
    node.BrowseName = QualifiedName('InputArguments', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(23494, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("InputArguments")
    attrs.DataType = NumericNodeId(296, 0)
    value = []
    extobj = ua.Argument()
    extobj.Name = 'AliasNameSearchPattern'
    extobj.DataType = NumericNodeId(12, 0)
    extobj.ValueRank = -1
    value.append(extobj)
    extobj = ua.Argument()
    extobj.Name = 'ReferenceTypeFilter'
    extobj.DataType = NumericNodeId(17, 0)
    extobj.ValueRank = -1
    value.append(extobj)
    attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject)
    attrs.ValueRank = 1
    attrs.ArrayDimensions = [0]
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23495, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23495, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23494, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23496, 0)
    node.BrowseName = QualifiedName('OutputArguments', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(23494, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("OutputArguments")
    attrs.DataType = NumericNodeId(296, 0)
    value = []
    extobj = ua.Argument()
    extobj.Name = 'AliasNodeList'
    extobj.DataType = NumericNodeId(23468, 0)
    extobj.ValueRank = 1
    extobj.ArrayDimensions = 0
    value.append(extobj)
    attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject)
    attrs.ValueRank = 1
    attrs.ArrayDimensions = [0]
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23496, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(23496, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23494, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23499, 0)
    node.BrowseName = QualifiedName('Default Binary', 0)
    node.NodeClass = NodeClass.Object
    node.ParentNodeId = NumericNodeId(23468, 0)
    node.ReferenceTypeId = NumericNodeId(38, 0)
    node.TypeDefinition = NumericNodeId(76, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Default Binary")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(38, 0)
    ref.SourceNodeId = NumericNodeId(23499, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23468, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(39, 0)
    ref.SourceNodeId = NumericNodeId(23499, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23502, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23499, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(76, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23505, 0)
    node.BrowseName = QualifiedName('Default XML', 0)
    node.NodeClass = NodeClass.Object
    node.ParentNodeId = NumericNodeId(23468, 0)
    node.ReferenceTypeId = NumericNodeId(38, 0)
    node.TypeDefinition = NumericNodeId(76, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Default XML")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(38, 0)
    ref.SourceNodeId = NumericNodeId(23505, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23468, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(39, 0)
    ref.SourceNodeId = NumericNodeId(23505, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23508, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23505, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(76, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(23511, 0)
    node.BrowseName = QualifiedName('Default JSON', 0)
    node.NodeClass = NodeClass.Object
    node.ParentNodeId = NumericNodeId(23468, 0)
    node.ReferenceTypeId = NumericNodeId(38, 0)
    node.TypeDefinition = NumericNodeId(76, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Default JSON")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(38, 0)
    ref.SourceNodeId = NumericNodeId(23511, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(23468, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(23511, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(76, 0)
    refs.append(ref)
    server.add_references(refs)
def create_standard_address_space_Part13(server):

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11187, 0)
    node.BrowseName = QualifiedName('AggregateConfigurationType', 0)
    node.NodeClass = NodeClass.ObjectType
    node.ParentNodeId = NumericNodeId(58, 0)
    node.ReferenceTypeId = NumericNodeId(45, 0)
    attrs = ua.ObjectTypeAttributes()
    attrs.DisplayName = LocalizedText("AggregateConfigurationType")
    attrs.IsAbstract = False
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(11187, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11188, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(11187, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11189, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(11187, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11190, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(11187, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11191, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(45, 0)
    ref.SourceNodeId = NumericNodeId(11187, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(58, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11188, 0)
    node.BrowseName = QualifiedName('TreatUncertainAsBad', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(11187, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("TreatUncertainAsBad")
    attrs.DataType = ua.NodeId(ua.ObjectIds.Boolean)
    attrs.ValueRank = -1
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11188, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(37, 0)
    ref.SourceNodeId = NumericNodeId(11188, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(78, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(11188, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11187, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11189, 0)
    node.BrowseName = QualifiedName('PercentDataBad', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(11187, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("PercentDataBad")
    attrs.DataType = ua.NodeId(ua.ObjectIds.Byte)
    attrs.ValueRank = -1
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11189, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(37, 0)
    ref.SourceNodeId = NumericNodeId(11189, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(78, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(11189, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11187, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11190, 0)
    node.BrowseName = QualifiedName('PercentDataGood', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(11187, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("PercentDataGood")
    attrs.DataType = ua.NodeId(ua.ObjectIds.Byte)
    attrs.ValueRank = -1
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11190, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(37, 0)
    ref.SourceNodeId = NumericNodeId(11190, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(78, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(11190, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11187, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11191, 0)
    node.BrowseName = QualifiedName('UseSlopedExtrapolation', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(11187, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("UseSlopedExtrapolation")
    attrs.DataType = ua.NodeId(ua.ObjectIds.Boolean)
    attrs.ValueRank = -1
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11191, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(37, 0)
    ref.SourceNodeId = NumericNodeId(11191, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(78, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(11191, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11187, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2341, 0)
    node.BrowseName = QualifiedName('Interpolative', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Interpolative")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2341, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2342, 0)
    node.BrowseName = QualifiedName('Average', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Average")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2342, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2343, 0)
    node.BrowseName = QualifiedName('TimeAverage', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("TimeAverage")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2343, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11285, 0)
    node.BrowseName = QualifiedName('TimeAverage2', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("TimeAverage2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11285, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2344, 0)
    node.BrowseName = QualifiedName('Total', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Total")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2344, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11304, 0)
    node.BrowseName = QualifiedName('Total2', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Total2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11304, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2346, 0)
    node.BrowseName = QualifiedName('Minimum', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Minimum")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2346, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2347, 0)
    node.BrowseName = QualifiedName('Maximum', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Maximum")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2347, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2348, 0)
    node.BrowseName = QualifiedName('MinimumActualTime', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("MinimumActualTime")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2348, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2349, 0)
    node.BrowseName = QualifiedName('MaximumActualTime', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("MaximumActualTime")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2349, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2350, 0)
    node.BrowseName = QualifiedName('Range', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Range")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2350, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11286, 0)
    node.BrowseName = QualifiedName('Minimum2', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Minimum2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11286, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11287, 0)
    node.BrowseName = QualifiedName('Maximum2', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Maximum2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11287, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11305, 0)
    node.BrowseName = QualifiedName('MinimumActualTime2', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("MinimumActualTime2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11305, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11306, 0)
    node.BrowseName = QualifiedName('MaximumActualTime2', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("MaximumActualTime2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11306, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11288, 0)
    node.BrowseName = QualifiedName('Range2', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Range2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11288, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2351, 0)
    node.BrowseName = QualifiedName('AnnotationCount', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("AnnotationCount")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2351, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2352, 0)
    node.BrowseName = QualifiedName('Count', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Count")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2352, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11307, 0)
    node.BrowseName = QualifiedName('DurationInStateZero', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("DurationInStateZero")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11307, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11308, 0)
    node.BrowseName = QualifiedName('DurationInStateNonZero', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("DurationInStateNonZero")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11308, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2355, 0)
    node.BrowseName = QualifiedName('NumberOfTransitions', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("NumberOfTransitions")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2355, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2357, 0)
    node.BrowseName = QualifiedName('Start', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Start")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2357, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2358, 0)
    node.BrowseName = QualifiedName('End', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("End")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2358, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2359, 0)
    node.BrowseName = QualifiedName('Delta', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("Delta")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2359, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11505, 0)
    node.BrowseName = QualifiedName('StartBound', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("StartBound")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11505, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11506, 0)
    node.BrowseName = QualifiedName('EndBound', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("EndBound")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11506, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11507, 0)
    node.BrowseName = QualifiedName('DeltaBounds', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("DeltaBounds")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11507, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2360, 0)
    node.BrowseName = QualifiedName('DurationGood', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("DurationGood")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2360, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2361, 0)
    node.BrowseName = QualifiedName('DurationBad', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("DurationBad")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2361, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2362, 0)
    node.BrowseName = QualifiedName('PercentGood', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("PercentGood")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2362, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2363, 0)
    node.BrowseName = QualifiedName('PercentBad', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("PercentBad")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2363, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2364, 0)
    node.BrowseName = QualifiedName('WorstQuality', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("WorstQuality")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2364, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11292, 0)
    node.BrowseName = QualifiedName('WorstQuality2', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("WorstQuality2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11292, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11426, 0)
    node.BrowseName = QualifiedName('StandardDeviationSample', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("StandardDeviationSample")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11426, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11427, 0)
    node.BrowseName = QualifiedName('StandardDeviationPopulation', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("StandardDeviationPopulation")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11427, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11428, 0)
    node.BrowseName = QualifiedName('VarianceSample', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("VarianceSample")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11428, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11429, 0)
    node.BrowseName = QualifiedName('VariancePopulation', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ua.ObjectAttributes()
    attrs.DisplayName = LocalizedText("VariancePopulation")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11429, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)