• 大小: 4.87M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-06-15
  • 语言: C#
  • 标签: OPCUA  opc  Pc  UA  

资源简介

OPCUA:C#使用OpcUaHelper开源库开发客Monitor户端

第三方OPC开源源码,便于熟悉OPC UA 的开发过程,代码包含服务器、客户端及使用帮助

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Opc.Ua;
using Opc.Ua.Client;

namespace OpcUaHelper
{
    /// 
    /// Defines numerous re-useable utility functions.
    /// 

    public partial class ClientUtils
    {
        /// 
        /// Handles an exception.
        /// 

        public static void HandleException( string caption Exception e )
        {
            ExceptionDlg.Show( caption e );
        }

        /// 
        /// Returns the application icon.
        /// 

        public static System.Drawing.Icon GetAppIcon()
        {
            try
            {
                return new Icon( “App.ico“ );
            }
            catch (Exception)
            {
                return null;
            }
        }

        #region DisplayText Lookup
        /// 
        /// Gets the display text for the access level attribute.
        /// 

        /// The access level.
        /// The access level formatted as a string.
        public static string GetAccessLevelDisplayText( byte accessLevel )
        {
            StringBuilder buffer = new StringBuilder( );

            if (accessLevel == AccessLevels.None)
            {
                buffer.Append( “None“ );
            }

            if ((accessLevel & AccessLevels.CurrentRead) == AccessLevels.CurrentRead)
            {
                buffer.Append( “Read“ );
            }

            if ((accessLevel & AccessLevels.CurrentWrite) == AccessLevels.CurrentWrite)
            {
                if (buffer.Length > 0)
                {
                    buffer.Append( “ | “ );
                }

                buffer.Append( “Write“ );
            }

            if ((accessLevel & AccessLevels.HistoryRead) == AccessLevels.HistoryRead)
            {
                if (buffer.Length > 0)
                {
                    buffer.Append( “ | “ );
                }

                buffer.Append( “HistoryRead“ );
            }

            if ((accessLevel & AccessLevels.HistoryWrite) == AccessLevels.HistoryWrite)
            {
                if (buffer.Length > 0)
                {
                    buffer.Append( “ | “ );
                }

                buffer.Append( “HistoryWrite“ );
            }

            if ((accessLevel & AccessLevels.SemanticChange) == AccessLevels.SemanticChange)
            {
                if (buffer.Length > 0)
                {
                    buffer.Append( “ | “ );
                }

                buffer.Append( “SemanticChange“ );
            }

            return buffer.ToString( );
        }

        /// 
        /// Gets the display text for the event notifier attribute.
        /// 

        /// The event notifier.
        /// The event notifi

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2021-04-22 00:01  OpcUaHelper-master\
     文件        2518  2021-04-22 00:01  OpcUaHelper-master\.gitattributes
     文件        4305  2021-04-22 00:01  OpcUaHelper-master\.gitignore
     目录           0  2021-04-22 00:01  OpcUaHelper-master\Imgs\
     文件       45857  2021-04-22 00:01  OpcUaHelper-master\Imgs\Monitor.png
     文件       87793  2021-04-22 00:01  OpcUaHelper-master\Imgs\support.png
     文件        7651  2021-04-22 00:01  OpcUaHelper-master\LICENSE
     目录           0  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Demo\
     文件        3247  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Demo\App.config
     文件       14065  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Demo\Form1.Designer.cs
     文件       13538  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Demo\Form1.cs
     文件        5698  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Demo\Form1.resx
     文件       26850  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Demo\OpcUaHelper.Demo.csproj
     文件         513  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Demo\Program.cs
     目录           0  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Demo\Properties\
     文件        1318  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Demo\Properties\AssemblyInfo.cs
     文件        2789  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Demo\Properties\Resources.Designer.cs
     文件        5496  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Demo\Properties\Resources.resx
     文件        1079  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Demo\Properties\Settings.Designer.cs
     文件         242  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Demo\Properties\Settings.settings
     文件         193  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Demo\SampleUse.cs
     文件        9982  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Demo\packages.config
     目录           0  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.NetCoreDemo\
     文件         469  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.NetCoreDemo\OpcUaHelper.NetCoreDemo.csproj
     文件        1296  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.NetCoreDemo\Program.cs
     目录           0  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.NetCoreDemo\Properties\
     目录           0  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.NetCoreDemo\Properties\PublishProfiles\
     文件         479  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.NetCoreDemo\Properties\PublishProfiles\FolderProfile.pubxml
     目录           0  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Standard\
     文件        1719  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Standard\OpcUaHelper.Standard.csproj
     目录           0  2021-04-22 00:01  OpcUaHelper-master\OpcUaHelper.Standard\Properties\
............此处省略132个文件信息

评论

共有 条评论