OPC UA 云端模型库

        UA 云库(opc ua cloud library)是互联网上可用的中央库,可以在其中上传配套规范 (CS) 并将其提供给其他人。许多CS是由OPC基金会的联合工作组开发和发布的。来自不同行业和应用领域的几位专家共同努力,为许多机器和系统提供了标准化的数据结构。此外,还可以创建和上传单独的随行规范。用户和软件客户端可以访问 UA 云库。

主页:https://uacloudlibrary.opcfoundation.org/

 UA 云库拥有 251 个活跃用户、67 个信息模型,所有 VDMA 配套规范 现已推出。 这使得UA云库成为您下一个工业物联网项目的完美起点 。

为什么需要 UA 云库?  

使用 UA 云库,可以在库中加载和实施所需的配套规范。不仅人类用户,软件客户端也可以将这些技术规范用于各自的系统。在设置过程中,软件客户端将通过 UA 云库接收数据模型。因此,他们可以从库中加载这些CS,并将其用于内部数据交换。UA 云库还提供了将您自己的 CS 包含在库中并使其在云中可用的选项。 

UA 云库适用于谁? 

对于内部机器 数据采集,在交换OPC UA数据时使用标准化的数据结构是合理的。 基于该标准,公司的所有机器和系统都可以分发,处理和评估OPC UA数据。 创建 这种结构可能非常耗时,因此仅建议用于更多的机器和系统。UA 云库 还可以作为 o wn 实例托管,以便在全球范围内共享自己的公司自己的 CS。 

小公司 

UA 云库非常适合小型公司或不希望构建 自己的结构的公司。 它提供了由不同公司在联合工作组 中针对 不同 用例创建的各种数据模型。公司合适的 结构 可以通过 图书馆轻松下载和实施,以实现数据交换的数字化。因此, UA 云库中为每家公司提供了适当的结构。 

大公司 

较大的公司也受益于 UA 云库。 库中已有的配套规范 也适用于具有许多机器和系统的环境。 也可以 建议 创建内部配套规范。投入的时间将得到回报,因为自己的CS将完全符合自己的需求。然后,该数据结构可以发布在 UA云库中,并 可用于 所有机器和系统,甚至全球其他工厂。 

实现

        UA 云库是与 OPC 基金会在其中一个联合工作组内合作开发的。UA 云库基于微软C# 实现。并且在GitHub 上公开了源码:https://github.com/OPCFoundation/UA-CloudLibrary

UA 云库可以通过各种方式查询

  • 浏览器
  • Swagger UI 
  • GraphQL 

使用

使用浏览器可以读取OPCUA 的各种配套规范的XML,但是网络上没有介绍如何使用GraphQL 查询OPCUA 模型

笔者做了一些尝试:

 如何方便系统集成上读取信息模型,应用软件需要有更便捷的方式。

背后的逻辑

无论是工业4.0,还是开放性自动化。其背后的逻辑就是建模。而建模的目的是为了重用,分享和协作。因此,构建模型仓库就显得格外重要。在软件开发领域,有大名鼎鼎的GitHub,也有许多各种代码仓。

   除了OPC UA  基金会制定一些基本的OPC UA 配套规范之外,大量的模型是由行业协会组织制定的。在我国依靠什么机构来构建高质量的信息模型是值得思考的问题。

Overview This OPC UA reference implementation is targeting the .NET Standard Library. .Net Standard allows developing apps that run on all common platforms available today, including Linux, iOS, Android (via Xamarin) and Windows 7/8/8.1/10 (including embedded/IoT editions) without requiring platform-specific modifications. Furthermore, cloud applications and services (such as ASP.Net, DNX, Azure Websites, Azure Webjobs, Azure Nano Server and Azure Service Fabric) are also supported. Features included 1. Fully ported Core UA stack and SDK (Client, Server, Configuration & Sample assemblies) 2. Sample Servers and Clients, including all required controls, for .Net 4.6, .NetCore and UWP. 3. X.509 certificate support for client and server authentication 4. Anonymous, username, X.509 certificate (experimental) and JWT (experimental) user authentication 5. UA-TCP & HTTPS transports (client and server) 6. Folder certificate-store support 7. Sessions (including UI support in the samples) 8. Subscriptions (including UI support in the samples) Getting Started All the tools you need for .Net Standard come with the .Net Core tools. See here for what you need. How to create self signed certificates for the sample applications On Windows 1. Open a command prompt in the root folder of your repository 2. Run the script CreateAllCerts.cmd in the root folder of your repository to create the certificates for all sample applications. 3. Alternatively, you can run the script CreateCert.cmd in each sample project folder to create new self signed certificates for the application. 4. The self signed certificates are stored in OPC Foundation/CertificateStores/MachineDefault in each application project folder On Linux 1. Open a command prompt 2. Navigate to the project folder of the sample app, e.g. SampleApplications/Samples/NetCoreConsoleClient 3. Run the script ./createcert.sh to create the certificates for the sample applications. 4. The self signed certificates are stored in OPC Foundation/CertificateStores/MachineDefault in each application project folder How to build and run the samples in Visual Studio on Windows 1. Create certificates for all sample applications. 2. Open the solution UA-NetStandard.sln with VisualStudio. 3. Choose a project in the Solution Explorer and set it with a right click as Startup Project. 4. Hit F5 to build and execute the sample. How to build and run the console samples on Windows, Linux and iOS This section describes how to run the NetCoreConsoleClient, NetCoreConsolePublisher and NetCoreConsoleServer sample applications. Please follow instructions in this article to setup the dotnet command line environment for your platform. Prerequisites 1. Once the dotnet command is available, navigate to the root folder in your local copy of the repository and execute dotnet restore. This command calls into NuGet to restore the tree of dependencies. Start the server 1. Open a command prompt 2. Now navigate to the folder SampleApplications/Samples/NetCoreConsoleServer. 3. Run the script ./createcert.sh on Linux or CreateCert.cmd on Windows to create the self signed certificate for the command line application. 4. To run the server sample type dotnet run. The server is now running and waiting for connections. In this sample configuration the server always accepts new client certificates. Start the client 1. Open a command prompt 2. Now navigate to the folder SampleApplications/Samples/NetCoreConsoleClient. 3. Run the script ./createcert.sh on Linux or CreateCert.cmd on Windows to create the self signed certificate for the command line application. 4. To execute the sample type dotnet run to connect to the OPC UA console sample server running on the same host. To connect to another OPC UA server specify the server as first argument and type e.g. dotnet run opc.tcp://myserver:51210/UA/SampleServer. How to build and run the OPC UA Web Telemetry sample • Go to the Azure portal and create a new Storage account. • Open the solution OpcUaWebTelemetry.sln with VisualStudio 2015. • Open the MessageProcessing\Configuration.cs file to configure the app to use your Azure resources (Storage account and IoTHub). // {StorageAccountName} is the name of the storage account and could be found // under Settings->Access keys->Storage account name of your storage account on the Azure portal. // {AccessKey} is the access key of the storage account and could be found // under Settings->Access keys->key1 of your storage account on the Azure portal. public static string StorageConnectionString = "DefaultEndpointsProtocol=https;AccountName={StorageAccountName};AccountKey={AccessKey}"; // {ConsumerGroupName} is the name of a aonsumer group of your IoTHub. The IoTHub you use is the // one you have created for use with the OPC UA Publisher sample. // You need to create this consumer group via the messaging settings of your IoTHub in the Azure portal. // We recommend that you do not share this Consumer group with other consumers, nor that you use the $Default consumer group. public static string EventHubConsumerGroup = "{ConsumerGroupName}"; // {EventHubEndpoint} is the Event Hub compatible endpoint of your IoTHub and could be found // under Settings->Messaging->Event Hub-compatible endpoint of your IoTHub in the Azure portal. // {PrimaryKey} is the IoT Hub primary key for access with iothubowner policy and could be found // under Settings->Shared access policies->iothubowner->Primary key of your IoTHub in the Azure portal. public static string EventHubConnectionString = "Endpoint={EventHubEndpoint};SharedAccessKeyName=iothubowner;{PrimaryKey}"; // {HubName} is the Event Hub compatible name of your IoTHub and could be found // under Settings->Messaging->Event Hub-compatible name of your IoTHub in the Azure portal. public static string EventHubName = "{HubName}"; • Save the file, rebuild the solution and start it. This will start a local instance of the application. • The solution can also be deployed into a Azure App service. Please use VisualStudio 2015's Azure publishing functionality for this purpose. • Now run the OPC UA Publisher sample, connect to a OPC UA server and publish a node. • You should see the node value on the web page after a few seconds. License This repository includes the UA .NetStandard Stack, sample libraries, and sample applications. The UA .NetStandard Stack follows a dual-license: • OPC Foundation Corporate Members: RCL • Everybody else: GPL 2.0 • RCL enables OPC Foundation members to deploy their applications using the UA .NetStandard stack without being required to disclose the application code. Non-members must disclose their application code when using the UA .NetStandard Stack. • Note: Dual license applies to this repository only; GPL 2.0 applies to all derived repositories (for example 'forks'). For details check the License section below. • All samples are provided under the MIT license. Contributing We strongly encourage community participation and contribution to this project. First, please fork the repository and commit your changes there. Once happy with your changes you can generate a 'pull request'. You must agree to the contributor license agreement before we can accept your changes. The CLA and "I AGREE" button is automatically displayed when you perform the pull request. You can preview CLA here.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值