具有模型导入功能的免费 opc ua 服务器 [英] Free opc ua server with model import feature

查看:69
本文介绍了具有模型导入功能的免费 opc ua 服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I want to implement OPC UA communication for my application (c#)

我发现一些 OPC UA 服务器模拟(Prosys 和 Softing OPC UA)我可以毫无问题地连接和读取数据.我想要的是实施欧洲地图 77 标准.http://www.euromap.org/euromap77

I found some OPC UA server simulations (Prosys and Softing OPC UA) I can connect and read data without problem. What I want is to implement euromap 77 standards. http://www.euromap.org/euromap77

据我所知,通过 OPC 访问数据时必须使用模型结构.我想将此模型加载到 OPC UA 服务器并处理该数据结构是否可以导入此 http://www.euromap.org/files/Opc_Ua.EUROMAP77.RC1_00.NodeSet2.xml 模型到任何免费的 OPC UA 服务器?

As far as I understand I must use model structure when accessing data via OPC. I want to load this model to OPC UA server and work on that data structure is it possible to import this http://www.euromap.org/files/Opc_Ua.EUROMAP77.RC1_00.NodeSet2.xml model to any free OPC UA server ?

推荐答案

OPC Foundation 拥有带有节点管理器的示例服务器,这些节点管理器可以导入 NodeStateCollections,也就是预定义的节点.

The OPC Foundation has sample servers with node managers that import NodeStateCollections, aka predefined nodes.

查看 GitHub 上的此存储库

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

You can use the "UaNodeSetHelpers" class to convert from NodeSet2 files to 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);

```

https://github.com/OPCFoundation/UA-.NETStandard/blob/3c1159ec712db4403d2dc9840b3e9525f56610b3/Stack/Opc.Ua.Core/Schema/UANodeSetHelpers.cs#L113

https://github.com/OPCFoundation/UA-.NETStandard/blob/cd4173aa95abd296578b976be67485c299473a70/Stack/Opc.Ua.Core/Schema/UANodeSetHelpers.cs#L113

这篇关于具有模型导入功能的免费 opc ua 服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆