资源简介
OPC UA C# 示例,使用C#语言 ,OPC UA client,实现与PLC通信,数据采集,紧提供开发示例及思路。

代码片段和文件信息
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 2018-01-16 11:24 OPC_UA_Client_Core\
目录 0 2018-01-16 11:24 OPC_UA_Client_Core\bin\
文件 90112 2009-07-03 14:39 OPC_UA_Client_Core\bin\Opc.Ua.Client.dll
文件 2589184 2009-07-03 14:39 OPC_UA_Client_Core\bin\Opc.Ua.Core.dll
文件 55296 2010-04-30 11:12 OPC_UA_Client_Core\bin\Siemens.OpcUA.Client.exe
文件 18944 2010-04-30 11:12 OPC_UA_Client_Core\bin\Siemens.OpcUA.dll
文件 22528 2010-04-30 11:12 OPC_UA_Client_Core\bin\Siemens.OpcUA.SimpleClient.exe
目录 0 2018-01-16 11:24 OPC_UA_Client_Core\src\
目录 0 2018-01-16 11:24 OPC_UA_Client_Core\src\.vs\
目录 0 2018-01-16 11:24 OPC_UA_Client_Core\src\.vs\UaClient\
目录 0 2018-01-16 11:33 OPC_UA_Client_Core\src\.vs\UaClient\v14\
文件 23552 2018-01-16 11:33 OPC_UA_Client_Core\src\.vs\UaClient\v14\.suo
目录 0 2018-01-16 11:24 OPC_UA_Client_Core\src\Backup\
目录 0 2018-01-16 11:24 OPC_UA_Client_Core\src\Backup\ClientAPI\
文件 40444 2010-04-30 11:03 OPC_UA_Client_Core\src\Backup\ClientAPI\ClientAPI.cs
文件 3087 2010-02-16 09:40 OPC_UA_Client_Core\src\Backup\ClientAPI\ClientAPI.csproj
文件 1727 2010-04-30 11:03 OPC_UA_Client_Core\src\Backup\ClientAPI\ClientDiscovery.cs
文件 4351 2010-04-30 11:03 OPC_UA_Client_Core\src\Backup\ClientAPI\ClientSubsc
目录 0 2018-01-16 11:24 OPC_UA_Client_Core\src\Backup\ClientAPI\Properties\
文件 841 2010-04-30 10:56 OPC_UA_Client_Core\src\Backup\ClientAPI\Properties\AssemblyInfo.cs
文件 8472 2009-12-14 10:49 OPC_UA_Client_Core\src\Backup\ClientAPI\Properties\Helpers.cs
目录 0 2018-01-16 11:24 OPC_UA_Client_Core\src\Backup\SimpleClient\
文件 21097 2010-02-28 23:51 OPC_UA_Client_Core\src\Backup\SimpleClient\MainForm.cs
文件 23609 2010-02-28 23:51 OPC_UA_Client_Core\src\Backup\SimpleClient\MainForm.Designer.cs
文件 5814 2010-02-28 23:51 OPC_UA_Client_Core\src\Backup\SimpleClient\MainForm.resx
文件 521 2010-02-08 15:27 OPC_UA_Client_Core\src\Backup\SimpleClient\Program.cs
目录 0 2018-01-16 11:24 OPC_UA_Client_Core\src\Backup\SimpleClient\Properties\
文件 1482 2010-04-30 10:56 OPC_UA_Client_Core\src\Backup\SimpleClient\Properties\AssemblyInfo.cs
文件 2879 2010-02-08 15:27 OPC_UA_Client_Core\src\Backup\SimpleClient\Properties\Resources.Designer.cs
文件 5612 2010-02-08 11:40 OPC_UA_Client_Core\src\Backup\SimpleClient\Properties\Resources.resx
文件 1107 2010-02-08 15:27 OPC_UA_Client_Core\src\Backup\SimpleClient\Properties\Settings.Designer.cs
............此处省略142个文件信息
相关资源
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
- C#指纹识别系统程序 报告
评论
共有 条评论