C# 带有模型导入功能的免费opc ua服务器

C# 带有模型导入功能的免费opc ua服务器,c#,xml,opc,opc-ua,C#,Xml,Opc,Opc Ua,我想为我的应用程序c实现OPC UA通信 我发现一些OPC UA服务器模拟Prosys和软件OPC UA我可以连接和读取数据没有问题。我想要的是实施euromap 77标准。 据我所知,通过OPC访问数据时,我必须使用模型结构。 我想将此模型加载到OPC UA服务器并处理该数据结构。是否可以将此模型导入任何免费的OPC UA服务器 OPC基金会具有节点服务器的示例服务器,这些节点管理器导入NoDeStCeCube,也就是预定义的节点。 看看 您可以使用UaNodeSetHelpers类将No

我想为我的应用程序c实现OPC UA通信

我发现一些OPC UA服务器模拟Prosys和软件OPC UA我可以连接和读取数据没有问题。我想要的是实施euromap 77标准。

据我所知,通过OPC访问数据时,我必须使用模型结构。
我想将此模型加载到OPC UA服务器并处理该数据结构。是否可以将此模型导入任何免费的OPC UA服务器

OPC基金会具有节点服务器的示例服务器,这些节点管理器导入NoDeStCeCube,也就是预定义的节点。 看看

您可以使用UaNodeSetHelpers类将NodeSet2文件转换为NodeStateCollections

// First, read a NodeSet2.xml file from a stream.
var nodeSet = UANodeSet.Read(istrm); 

// Then create an empty NodeStateCollection.
var nodes = new NodeStateCollection();

// Update namespace table
if (nodeSet.NamespaceUris != null && context.NamespaceUris != null)
{
   for (int ii = 0; ii < nodeSet.NamespaceUris.Length; ii++)
   {
       context.NamespaceUris.GetIndexOrAppend(nodeSet.NamespaceUris[ii]);
       namespaceUris.Add(nodeSet.NamespaceUris[ii]);
    }
}

// Update server table
if (nodeSet.ServerUris != null && context.ServerUris != null)
{
    for (int ii = 0; ii < nodeSet.ServerUris.Length; ii++)
    {
        context.ServerUris.GetIndexOrAppend(nodeSet.ServerUris[ii]);
    }
}

// Convert the nodeset to nodeState collection, aka predefinedNodes. 
nodeSet.Import(context, nodes);
```


谢谢你,安德鲁。我现在就试试。我将不得不用我自己的权利取代nodeset?仅此而已?据我所知,SampleServer只能从ModelCompiler加载预定义的nodes.xml,但不能从OPCUAModeler加载NodeSet2.xml,具体取决于两个xml文件的不同结构感谢@Houve提醒我修复我的答案。锅炉示例不是从nodeset2文件加载的。你认为助手功能对你有用吗?@Andrew Cullen是的,代码对我有用,非常感谢!为了将opcua modeler.xml文件直接加载到opcua服务器,搜索了数天的解决方案。