• 大小: 2.55MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-16
  • 语言: 其他
  • 标签: OPC  840DSL  828D  

资源简介

OPC 读取西门子 840DSL 828D 数控系统变量 及数量系统操作说明

资源截图

代码片段和文件信息

using System;
using System.Collections;
using System.Security.Cryptography.X509Certificates;

using Opc.Ua;
using Opc.Ua.Client;
using Siemens.OpcUA.Helper;

namespace Siemens.OpcUA
{
    /// 
    /// Event handler for the event that the client received a value change.
    /// 

    public delegate void valueChanged(object clientHandle DataValue value);

    /// 
    /// Event handler for the event that the client received a untrusted server certificate.
    /// 

    public delegate void certificateValidation(CertificateValidator validator CertificateValidationEventArgs e);

    /// 
    /// This class encapsulates a connection to an OPC UA server and access to particular Services of it.
    /// 

    public class Server
    {
        #region Construction
        public Server()
        { }
        #endregion

        #region Fields
        ///  
        /// Keeps a session with an UA server. 
        /// 

        private Session m_Session = null;

        ///  
        /// Interface which encapsulates the use of the browse service of an UA server. 
        /// 

        private Browser m_Browser = null;

        ///  
        /// Keeps a hash table for attribute names. 
        /// 

        private Hashtable m_hashAttributeNames = null;
        #endregion
                
        #region Properties
        /// 
        /// Use the certificateValidation delegate as event.
        /// 

        public event certificateValidation CertificateEvent = null;

        /// 
        /// Provides the session being established with an OPC UA server.
        /// 

        public Session Session
        {
            get { return m_Session; }
        }
        #endregion
             
        #region Connect
        /// Establishes the connection to an OPC UA server.
        /// The Url of the endpoint.
        /// Result code.
        /// Throws and forwards any exception with short error description.
        public void Connect(string Url)
        {
            try
            {
                // Create the configuration.     
                ApplicationConfiguration configuration = Helpers.CreateClientConfiguration();

                // Create the endpoint description.
                EndpointDescription endpointDescription = Helpers.CreateEndpointDescription(Url);

                // Create the endpoint configuration (use the application configuration to provide default values).
                EndpointConfiguration endpointConfiguration = EndpointConfiguration.Create(configuration);

                // The default timeout for a requests sent using the channel.
                endpointConfiguration.OperationTimeout = 300000;

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-11-30 09:26  OPC\
     文件     1280254  2015-11-30 09:31  OPC\45SP3_840Dsl_828D_commissioningmanual_OPCUA_released_V02_en-US.pdf
     目录           0  2015-07-21 10:25  OPC\OPC_UA_CODE_v10\
     目录           0  2015-07-21 10:25  OPC\OPC_UA_CODE_v10\bin\
     文件       90112  2009-07-03 14:39  OPC\OPC_UA_CODE_v10\bin\Opc.Ua.Client.dll
     文件     2589184  2009-07-03 14:39  OPC\OPC_UA_CODE_v10\bin\Opc.Ua.Core.dll
     文件       55296  2010-04-30 11:12  OPC\OPC_UA_CODE_v10\bin\Siemens.OpcUA.Client.exe
     文件       18944  2010-04-30 11:12  OPC\OPC_UA_CODE_v10\bin\Siemens.OpcUA.dll
     文件       22528  2010-04-30 11:12  OPC\OPC_UA_CODE_v10\bin\Siemens.OpcUA.SimpleClient.exe
     目录           0  2015-07-21 10:25  OPC\OPC_UA_CODE_v10\src\
     目录           0  2015-07-21 10:25  OPC\OPC_UA_CODE_v10\src\bin\
     文件       90112  2009-07-03 14:39  OPC\OPC_UA_CODE_v10\src\bin\Opc.Ua.Client.dll
     文件     2589184  2009-07-03 14:39  OPC\OPC_UA_CODE_v10\src\bin\Opc.Ua.Core.dll
     目录           0  2015-07-21 10:25  OPC\OPC_UA_CODE_v10\src\ClientAPI\
     文件         120  2009-08-18 08:48  OPC\OPC_UA_CODE_v10\src\ClientAPI\app.config
     文件       40444  2010-04-30 11:03  OPC\OPC_UA_CODE_v10\src\ClientAPI\ClientAPI.cs
     文件        3087  2010-02-16 09:40  OPC\OPC_UA_CODE_v10\src\ClientAPI\ClientAPI.csproj
     文件        1727  2010-04-30 11:03  OPC\OPC_UA_CODE_v10\src\ClientAPI\ClientDiscovery.cs
     文件        4351  2010-04-30 11:03  OPC\OPC_UA_CODE_v10\src\ClientAPI\ClientSubscription.cs
     目录           0  2015-07-21 10:25  OPC\OPC_UA_CODE_v10\src\ClientAPI\Properties\
     文件         841  2010-04-30 10:56  OPC\OPC_UA_CODE_v10\src\ClientAPI\Properties\AssemblyInfo.cs
     文件        8472  2009-12-14 10:49  OPC\OPC_UA_CODE_v10\src\ClientAPI\Properties\Helpers.cs
     目录           0  2015-07-21 10:25  OPC\OPC_UA_CODE_v10\src\SimpleClient\
     文件       21097  2010-02-28 23:51  OPC\OPC_UA_CODE_v10\src\SimpleClient\MainForm.cs
     文件       23609  2010-02-28 23:51  OPC\OPC_UA_CODE_v10\src\SimpleClient\MainForm.Designer.cs
     文件        5814  2010-02-28 23:51  OPC\OPC_UA_CODE_v10\src\SimpleClient\MainForm.resx
     文件         521  2010-02-08 15:27  OPC\OPC_UA_CODE_v10\src\SimpleClient\Program.cs
     目录           0  2015-07-21 10:25  OPC\OPC_UA_CODE_v10\src\SimpleClient\Properties\
     文件        1482  2010-04-30 10:56  OPC\OPC_UA_CODE_v10\src\SimpleClient\Properties\AssemblyInfo.cs
     文件        2879  2010-02-08 15:27  OPC\OPC_UA_CODE_v10\src\SimpleClient\Properties\Resources.Designer.cs
     文件        5612  2010-02-08 11:40  OPC\OPC_UA_CODE_v10\src\SimpleClient\Properties\Resources.resx
............此处省略56个文件信息

评论

共有 条评论