Exemplo n.º 1
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)
Exemplo n.º 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
Exemplo n.º 3
0
def create_data_type(parent, nodeid, bname, description=None):
    """
    Create a new data type to be used in new variables, etc ..
    arguments are nodeid, browsename
    or namespace index, name
    """
    nodeid, qname = _parse_nodeid_qname(nodeid, bname)

    addnode = ua.AddNodesItem()
    addnode.RequestedNewNodeId = nodeid
    addnode.BrowseName = qname
    addnode.NodeClass = ua.NodeClass.DataType
    addnode.ParentNodeId = parent.nodeid
    addnode.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasSubtype)
    #addnode.TypeDefinition = ua.NodeId(ua.ObjectIds.BaseDataVariableType) # No type definition for types
    attrs = ua.DataTypeAttributes()
    if description is None:
        attrs.Description = ua.LocalizedText(qname.Name)
    else:
        attrs.Description = ua.LocalizedText(description)
    attrs.DisplayName = ua.LocalizedText(qname.Name)
    attrs.WriteMask = 0
    attrs.UserWriteMask = 0
    attrs.IsAbstract = False  # True mean they cannot be instanciated
    addnode.NodeAttributes = attrs
    results = parent.server.add_nodes([addnode])
    results[0].StatusCode.check()
    return node.Node(parent.server, results[0].AddedNodeId)
Exemplo n.º 4
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)
Exemplo n.º 5
0
def _copy_node(server, parent_nodeid, rdesc, nodeid, recursive):
    addnode = ua.AddNodesItem()
    addnode.RequestedNewNodeId = nodeid
    addnode.BrowseName = rdesc.BrowseName
    addnode.ParentNodeId = parent_nodeid
    addnode.ReferenceTypeId = rdesc.ReferenceTypeId
    addnode.TypeDefinition = rdesc.TypeDefinition
    addnode.NodeClass = rdesc.NodeClass

    node_to_copy = Node(server, rdesc.NodeId)

    attrObj = getattr(ua, rdesc.NodeClass.name + "Attributes")
    _read_and_copy_attrs(node_to_copy, attrObj(), addnode)

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

    added_nodes = [res.AddedNodeId]

    if recursive:
        descs = node_to_copy.get_children_descriptions()
        for desc in descs:
            nodes = _copy_node(
                server,
                res.AddedNodeId,
                desc,
                nodeid=ua.NodeId(namespaceidx=desc.NodeId.NamespaceIndex),
                recursive=True)
            added_nodes.extend(nodes)

    return added_nodes
Exemplo n.º 6
0
def _create_variable_type(server,
                          parentnodeid,
                          nodeid,
                          qname,
                          datatype,
                          value=None):
    addnode = ua.AddNodesItem()
    addnode.RequestedNewNodeId = nodeid
    addnode.BrowseName = qname
    addnode.NodeClass = ua.NodeClass.VariableType
    addnode.ParentNodeId = parentnodeid
    addnode.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasSubtype)
    #addnode.TypeDefinition = ua.NodeId(ua.ObjectIds.BaseDataVariableType)
    attrs = ua.VariableTypeAttributes()
    attrs.Description = ua.LocalizedText(qname.Name)
    attrs.DisplayName = ua.LocalizedText(qname.Name)
    attrs.DataType = datatype
    attrs.IsAbstract = False
    if value:
        attrs.Value = value
        if isinstance(value, (list, tuple)):
            attrs.ValueRank = ua.ValueRank.OneDimension
        else:
            attrs.ValueRank = ua.ValueRank.Scalar
    #attrs.ArrayDimensions = None
    attrs.WriteMask = 0
    attrs.UserWriteMask = 0
    addnode.NodeAttributes = attrs
    results = server.add_nodes([addnode])
    results[0].StatusCode.check()
    return results[0].AddedNodeId
Exemplo n.º 7
0
def _create_variable(server,
                     parentnodeid,
                     nodeid,
                     qname,
                     val,
                     isproperty=False):
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = nodeid
    node.BrowseName = qname
    node.NodeClass = ua.NodeClass.Variable
    node.ParentNodeId = parentnodeid
    if isproperty:
        node.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasProperty)
        node.TypeDefinition = ua.NodeId(ua.ObjectIds.PropertyType)
    else:
        node.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasComponent)
        node.TypeDefinition = ua.NodeId(ua.ObjectIds.BaseDataVariableType)
    attrs = ua.VariableAttributes()
    attrs.Description = ua.LocalizedText(qname.Name)
    attrs.DisplayName = ua.LocalizedText(qname.Name)
    attrs.DataType = _guess_uatype(val)
    attrs.Value = val
    if isinstance(val, list) or isinstance(val, tuple):
        attrs.ValueRank = 0
    else:
        attrs.ValueRank = -1
    # attrs.ArrayDimensions = 0
    attrs.WriteMask = ua.OpenFileMode.Read
    attrs.UserWriteMask = ua.OpenFileMode.Read
    attrs.Historizing = 0
    node.NodeAttributes = attrs
    results = server.add_nodes([node])
    results[0].StatusCode.check()
    return nodeid
Exemplo n.º 8
0
def create_variable_type(parent, nodeid, bname, datatype):
    """
    Create a new variable type
    args are nodeid, browsename and datatype
    or idx, name and data type
    """
    nodeid, qname = _parse_nodeid_qname(nodeid, bname)
    if datatype and not isinstance(datatype, ua.NodeId):
        raise RuntimeError(
            "Data type should be nodeid, got {}".format(datatype))
    addnode = ua.AddNodesItem()
    addnode.RequestedNewNodeId = nodeid
    addnode.BrowseName = qname
    addnode.NodeClass = ua.NodeClass.Variable
    addnode.ParentNodeId = parent.nodeid
    addnode.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasSubtype)
    attrs = ua.VariableTypeAttributes()
    attrs.Description = ua.LocalizedText(qname.Name)
    attrs.DisplayName = ua.LocalizedText(qname.Name)
    attrs.DataType = datatype
    attrs.IsAbstract = False
    attrs.WriteMask = 0
    attrs.UserWriteMask = 0
    addnode.NodeAttributes = attrs
    results = parent.server.add_nodes([addnode])
    results[0].StatusCode.check()
    return results[0].AddedNodeId
Exemplo n.º 9
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
Exemplo n.º 10
0
 def _add_dictionary(self, name):
     try:
         node = self._server.nodes.opc_binary.get_child("{}:{}".format(
             self._idx, name))
     except ua.uaerrors.BadNoMatch:
         node = ua.AddNodesItem()
         node.RequestedNewNodeId = ua.NodeId(0, self._idx)
         node.BrowseName = ua.QualifiedName(name, self._idx)
         node.NodeClass = ua.NodeClass.Variable
         node.ParentNodeId = ua.NodeId(
             ua.ObjectIds.OPCBinarySchema_TypeSystem, 0)
         node.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasComponent, 0)
         node.TypeDefinition = ua.NodeId(
             ua.ObjectIds.DataTypeDictionaryType, 0)
         attrs = ua.VariableAttributes()
         attrs.DisplayName = ua.LocalizedText(name)
         attrs.DataType = ua.NodeId(ua.ObjectIds.ByteString)
         # Value should be set after all data types created by calling set_dict_byte_string
         attrs.Value = ua.Variant(None, ua.VariantType.Null)
         attrs.ValueRank = -1
         node.NodeAttributes = attrs
         res = self._session_server.add_nodes([node])
         return res[0].AddedNodeId
     logger.warning(
         "Making %s object for node %s which already exist, its data will be overriden",
         self, node)
     #FIXME: we have an issue
     return node.nodeid
Exemplo n.º 11
0
def _create_method(parent, nodeid, qname, callback, inputs, outputs):
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = nodeid
    node.BrowseName = qname
    node.NodeClass = ua.NodeClass.Method
    node.ParentNodeId = parent.nodeid
    node.ReferenceTypeId = ua.NodeId.from_string("i=47")
    #node.TypeDefinition = ua.NodeId(ua.ObjectIds.BaseObjectType)
    attrs = ua.MethodAttributes()
    attrs.Description = ua.LocalizedText(qname.Name)
    attrs.DisplayName = ua.LocalizedText(qname.Name)
    attrs.WriteMask = ua.OpenFileMode.Read
    attrs.UserWriteMask = ua.OpenFileMode.Read
    attrs.Executable = True
    attrs.UserExecutable = True
    node.NodeAttributes = attrs
    results = parent.server.add_nodes([node])
    results[0].StatusCode.check()
    method = Node(parent.server, nodeid)
    if inputs:
        create_property(method, ua.generate_nodeid(qname.NamespaceIndex),
                        ua.QualifiedName("InputArguments", 0),
                        [_vtype_to_argument(vtype) for vtype in inputs])
    if outputs:
        create_property(method, ua.generate_nodeid(qname.NamespaceIndex),
                        ua.QualifiedName("OutputArguments", 0),
                        [_vtype_to_argument(vtype) for vtype in outputs])
    parent.server.add_method_callback(method.nodeid, callback)
    return nodeid
Exemplo n.º 12
0
def _create_method(parent, nodeid, qname, callback, inputs, outputs):
    addnode = ua.AddNodesItem()
    addnode.RequestedNewNodeId = nodeid
    addnode.BrowseName = qname
    addnode.NodeClass = ua.NodeClass.Method
    addnode.ParentNodeId = parent.nodeid
    addnode.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasComponent)
    #node.TypeDefinition = ua.NodeId(ua.ObjectIds.BaseObjectType)
    attrs = ua.MethodAttributes()
    attrs.Description = ua.LocalizedText(qname.Name)
    attrs.DisplayName = ua.LocalizedText(qname.Name)
    attrs.WriteMask = 0
    attrs.UserWriteMask = 0
    attrs.Executable = True
    attrs.UserExecutable = True
    addnode.NodeAttributes = attrs
    results = parent.server.add_nodes([addnode])
    results[0].StatusCode.check()
    method = node.Node(parent.server, results[0].AddedNodeId)
    create_property(method,
                    ua.NodeId(),
                    ua.QualifiedName("InputArguments", 0),
                    [_vtype_to_argument(vtype) for vtype in inputs],
                    varianttype=ua.VariantType.ExtensionObject,
                    datatype=ua.ObjectIds.Argument)
    create_property(method,
                    ua.NodeId(),
                    ua.QualifiedName("OutputArguments", 0),
                    [_vtype_to_argument(vtype) for vtype in outputs],
                    varianttype=ua.VariantType.ExtensionObject,
                    datatype=ua.ObjectIds.Argument)
    parent.server.add_method_callback(method.nodeid, callback)
    return results[0].AddedNodeId
Exemplo n.º 13
0
    def provision_node_instance(self, instance_id: str, service_id: str, plan_id: str,
                                parameters: dict=None) -> ProvisionedServiceSpec:
        url = parameters.get("url")
        if not url:
            print("Error: {0}\n".format("url not contained in provision parameters!"))
            return ProvisionedServiceSpec(state="failed")
        nodes_to_add = parameters.get("nodesToAdd")
        if not nodes_to_add:
            print("Error: {0}\n".format("nodes_to_add not contained in provision parameters!"))
            return ProvisionedServiceSpec(state="failed")

        add_nodes_items = []
        for node_to_add in nodes_to_add:
            add_nodes_item = ua.AddNodesItem()

            if "parentNodeId" in node_to_add:
                add_nodes_item.ParentNodeId = ua.ExpandedNodeId(node_to_add.get("parentNodeId"))
            if "referenceTypeId" in node_to_add:
                add_nodes_item.ReferenceTypeId = ua.NodeId(node_to_add.get("referenceTypeId"))
            if "requestedNewNodeId" in node_to_add:
                add_nodes_item.RequestedNewNodeId = ua.ExpandedNodeId(node_to_add.get("requestedNewNodeId"))
            if "browseName" in node_to_add:
                add_nodes_item.BrowseName = ua.QualifiedName(node_to_add.get("browseName"))
            if "nodeClass" in node_to_add:
                add_nodes_item.NodeClass = ua.NodeClass(node_to_add.get("nodeClass"))
            add_nodes_items.append(add_nodes_item)

        print(add_nodes_items)
        client = Client(url)
        try:
            client.connect()
            nodes = []
            for add_nodes_item in add_nodes_items:
                parent_node = client.get_node(add_nodes_item.ParentNodeId)
                if add_nodes_item.NodeClass == 1:
                    obj = parent_node.add_object(add_nodes_item.RequestedNewNodeId, add_nodes_item.BrowseName)
                    nodes.append(obj)
                elif add_nodes_item.NodeClass == 2:
                    var = parent_node.add_variable(add_nodes_item.RequestedNewNodeId, add_nodes_item.BrowseName)
                    nodes.append(var)
                elif add_nodes_item.NodeClass == 4:
                    method = parent_node.add_method()
                    nodes.append(method)
                else:
                    folder = parent_node.add_folder(add_nodes_item.RequestedNewNodeId, add_nodes_item.BrowseName)
                    nodes.append(folder)

            service_instance = OpcuaServiceInstance(instance_id, service_id, plan_id, parameters)
            service_instance.params["nodes"] = nodes

            service_instance_map = dict()
            service_instance_map[instance_id] = service_instance
            self.service_instance_map = service_instance_map
        except Exception as e:
            print("Error: {0}\n".format(e))
            return ProvisionedServiceSpec(state="failed")

        print("Node management service instance {0} is provisioned successfully\n".format(instance_id))
        return ProvisionedServiceSpec()
Exemplo n.º 14
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
Exemplo n.º 15
0
 def _get_node(self, obj):
     node = ua.AddNodesItem()
     node.RequestedNewNodeId = ua.NodeId.from_string(obj.nodeid)
     node.BrowseName = ua.QualifiedName.from_string(obj.browsename)
     node.NodeClass = getattr(ua.NodeClass, obj.nodetype[2:])
     if obj.parent:
         node.ParentNodeId = ua.NodeId.from_string(obj.parent)
     if obj.parentlink:
         node.ReferenceTypeId = self.to_nodeid(obj.parentlink)
     if obj.typedef:
         node.TypeDefinition = ua.NodeId.from_string(obj.typedef)
     return node
Exemplo n.º 16
0
 def _get_node(self, obj):
     node = ua.AddNodesItem()
     node.RequestedNewNodeId = self._migrate_ns(obj.nodeid)
     node.BrowseName = self._migrate_ns(obj.browsename)
     self.logger.info("Importing xml node (%s, %s) as (%s %s)", obj.browsename, obj.nodeid, node.BrowseName, node.RequestedNewNodeId)
     node.NodeClass = getattr(ua.NodeClass, obj.nodetype[2:])
     if obj.parent and obj.parentlink:
         node.ParentNodeId = self._migrate_ns(obj.parent)
         node.ReferenceTypeId = self._migrate_ns(obj.parentlink)
     if obj.typedef:
         node.TypeDefinition = self._migrate_ns(obj.typedef)
     return node
Exemplo n.º 17
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)
Exemplo n.º 18
0
def _create_object_type(server, parentnodeid, nodeid, qname):
    addnode = ua.AddNodesItem()
    addnode.RequestedNewNodeId = nodeid
    addnode.BrowseName = qname
    addnode.ParentNodeId = parentnodeid
    addnode.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasSubtype)
    addnode.NodeClass = ua.NodeClass.ObjectType
    attrs = ua.ObjectTypeAttributes()
    attrs.IsAbstract = False
    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
Exemplo n.º 19
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
Exemplo n.º 20
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
Exemplo n.º 21
0
def _create_variable(server,
                     parentnodeid,
                     nodeid,
                     qname,
                     var,
                     datatype=None,
                     isproperty=False):
    addnode = ua.AddNodesItem()
    addnode.RequestedNewNodeId = nodeid
    addnode.BrowseName = qname
    addnode.NodeClass = ua.NodeClass.Variable
    addnode.ParentNodeId = parentnodeid
    if isproperty:
        addnode.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasProperty)
        addnode.TypeDefinition = ua.NodeId(ua.ObjectIds.PropertyType)
    else:
        addnode.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasComponent)
        addnode.TypeDefinition = ua.NodeId(ua.ObjectIds.BaseDataVariableType)
    attrs = ua.VariableAttributes()
    attrs.Description = ua.LocalizedText(qname.Name)
    attrs.DisplayName = ua.LocalizedText(qname.Name)
    if datatype:
        attrs.DataType = datatype
    else:
        attrs.DataType = _guess_datatype(var)

    attrs.Value = var
    if not isinstance(var.Value, (list, tuple)):
        attrs.ValueRank = ua.ValueRank.Scalar
    else:
        if var.Dimensions:
            attrs.ValueRank = len(var.Dimensions)
            attrs.ArrayDimensions = var.Dimensions
    attrs.WriteMask = 0
    attrs.UserWriteMask = 0
    attrs.Historizing = 0
    attrs.AccessLevel = ua.AccessLevel.CurrentRead.mask
    attrs.UserAccessLevel = ua.AccessLevel.CurrentRead.mask
    addnode.NodeAttributes = attrs
    results = server.add_nodes([addnode])
    results[0].StatusCode.check()
    return results[0].AddedNodeId
Exemplo n.º 22
0
    def _add_dictionary(self, name):
        dictionary_node_id = self._nodeid_generator()
        node = ua.AddNodesItem()
        node.RequestedNewNodeId = dictionary_node_id
        node.BrowseName = ua.QualifiedName(name, self._idx)
        node.NodeClass = ua.NodeClass.Variable
        node.ParentNodeId = ua.NodeId(ua.ObjectIds.OPCBinarySchema_TypeSystem,
                                      0)
        node.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasComponent, 0)
        node.TypeDefinition = ua.NodeId(ua.ObjectIds.DataTypeDictionaryType, 0)
        attrs = ua.VariableAttributes()
        attrs.DisplayName = ua.LocalizedText(name)
        attrs.DataType = ua.NodeId(ua.ObjectIds.ByteString)
        # Value should be set after all data types created by calling set_dict_byte_string
        attrs.Value = ua.Variant(None, ua.VariantType.Null)
        attrs.ValueRank = -1
        node.NodeAttributes = attrs
        self._session_server.add_nodes([node])

        return dictionary_node_id
Exemplo n.º 23
0
def create_reference_type(parent, nodeid, bname):
    """
    Create a new reference type
    args are nodeid and browsename
    or idx and name
    """
    nodeid, qname = _parse_nodeid_qname(nodeid, bname)
    addnode = ua.AddNodesItem()
    addnode.RequestedNewNodeId = nodeid
    addnode.BrowseName = qname
    addnode.NodeClass = ua.NodeClass.Variable
    addnode.ParentNodeId = parent.nodeid
    addnode.ReferenceTypeId = ua.NodeId(ua.ObjectIds.HasSubtype)
    attrs = ua.ReferenceTypeAttributes()
    attrs.IsAbstract = False
    attrs.Description = ua.LocalizedText(qname.Name)
    attrs.DisplayName = ua.LocalizedText(qname.Name)
    attrs.AccessLevel = ua.AccessLevel.CurrentRead.mask
    attrs.UserAccessLevel = ua.AccessLevel.CurrentRead.mask
    addnode.NodeAttributes = attrs
    results = parent.server.add_nodes([addnode])
    results[0].StatusCode.check()
    return results[0].AddedNodeId
Exemplo n.º 24
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_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)
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)
Exemplo n.º 27
0
def create_standard_address_space_Part19(server):
  
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(19077, 0)
    node.BrowseName = QualifiedName('MultiStateDictionaryEntryDiscreteBaseType', 0)
    node.NodeClass = NodeClass.VariableType
    node.ParentNodeId = NumericNodeId(11238, 0)
    node.ReferenceTypeId = NumericNodeId(45, 0)
    attrs = ua.VariableTypeAttributes()
    attrs.DisplayName = LocalizedText("MultiStateDictionaryEntryDiscreteBaseType")
    attrs.DisplayName = LocalizedText("MultiStateDictionaryEntryDiscreteBaseType")
    attrs.DataType = ua.NodeId(ua.ObjectIds.Number)
    attrs.ValueRank = -1
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(19077, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(19082, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(19077, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(19083, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(45, 0)
    ref.SourceNodeId = NumericNodeId(19077, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11238, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(19082, 0)
    node.BrowseName = QualifiedName('EnumDictionaryEntries', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(19077, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("EnumDictionaryEntries")
    attrs.DataType = ua.NodeId(ua.ObjectIds.NodeId)
    attrs.ValueRank = 2
    attrs.ArrayDimensions = [0, 0]
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(19082, 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(19082, 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(19082, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(19077, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(19083, 0)
    node.BrowseName = QualifiedName('ValueAsDictionaryEntries', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(19077, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("ValueAsDictionaryEntries")
    attrs.DataType = ua.NodeId(ua.ObjectIds.NodeId)
    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(19083, 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(19083, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(80, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(19083, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(19077, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(19084, 0)
    node.BrowseName = QualifiedName('MultiStateDictionaryEntryDiscreteType', 0)
    node.NodeClass = NodeClass.VariableType
    node.ParentNodeId = NumericNodeId(19077, 0)
    node.ReferenceTypeId = NumericNodeId(45, 0)
    attrs = ua.VariableTypeAttributes()
    attrs.DisplayName = LocalizedText("MultiStateDictionaryEntryDiscreteType")
    attrs.DisplayName = LocalizedText("MultiStateDictionaryEntryDiscreteType")
    attrs.DataType = ua.NodeId(ua.ObjectIds.Number)
    attrs.ValueRank = -1
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = ua.AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(19084, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(19090, 0)
    refs.append(ref)
    ref = ua.AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(45, 0)
    ref.SourceNodeId = NumericNodeId(19084, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(19077, 0)
    refs.append(ref)
    server.add_references(refs)
   
    node = ua.AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(19090, 0)
    node.BrowseName = QualifiedName('ValueAsDictionaryEntries', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(19084, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = ua.VariableAttributes()
    attrs.DisplayName = LocalizedText("ValueAsDictionaryEntries")
    attrs.DataType = ua.NodeId(ua.ObjectIds.NodeId)
    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(19090, 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(19090, 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(19090, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(19084, 0)
    refs.append(ref)
    server.add_references(refs)
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])