我正在尝试创建自己的 OPC UA 客户端。我正在使用 Nuget 包 OPCFoundation.NetStandard.Opc.Ua。为此,我使用了以下代码示例:
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Opc.Ua; // Install-Package OPCFoundation.NetStandard.Opc.Ua
using Opc.Ua.Client;
using Opc.Ua.Configuration;
using System.Threading;
namespace Test_OPC_UA
{
public partial class Form1 : Form
{
//creating a object that encapsulates the netire OPC UA Server related work
OPCUAClass myOPCUAServer;
//creating a dictionary of Tags that would be captured from the OPC UA Server
Dictionary<String, Form1.OPCUAClass.TagClass> TagList = new Dictionary<String, Form1.OPCUAClass.TagClass>();
public Form1()
{
InitializeComponent();
//Add tags to the Tag List, For …Run Code Online (Sandbox Code Playgroud)