⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clearitemdeadbandsampleform.cs

📁 利用OpcNet控件(包含源码)进行OPC通讯的开发样例
💻 CS
📖 第 1 页 / 共 2 页
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Runtime.InteropServices;

using HaiGrang.Package.OpcNetApiChs.Opc;
using HaiGrang.Package.OpcNetApiChs.Da;
using HaiGrang.Package.OpcNetApiChs.DaNet;

namespace ClearItemDeadbandSample
{
	/// <summary>
	/// ClearItemDeadbandSample 的摘要说明。
	/// </summary>
	
	public class ClearItemDeadbandSampleForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label OpcRemoveItemName;
		private System.Windows.Forms.Button RemoveOpcItem;
		private System.Windows.Forms.Label OpcItemName;
		private System.Windows.Forms.Button AddOpcItem;
		private System.Windows.Forms.Label OpcRemoveGroupName;
		private System.Windows.Forms.Button RemoveOpcGroup;
		private System.Windows.Forms.Label OpcGroupName;
		private System.Windows.Forms.Button AddOpcGroup;
		private System.Windows.Forms.Button OpcServerDisConnect;
		private System.Windows.Forms.Label OpcServerRemove;
		private System.Windows.Forms.Label bOpcServerName;
		private System.Windows.Forms.Button bOpcServerConnect;
		private System.Windows.Forms.Button ClearItemDeadband;
		private System.Windows.Forms.Label OpcItemDeadband;
		private System.Windows.Forms.Label OpcItemServerHandle;
		private System.Windows.Forms.Label ClearItemDeadbandOut;

		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		
		private System.ComponentModel.Container components = null;

		public ClearItemDeadbandSampleForm()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		
		protected override void Dispose( bool disposing )
		{
			if(tOpcServer != null)
			{
				tOpcServer.Disconnect() ;
			}
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.OpcItemServerHandle = new System.Windows.Forms.Label();
			this.ClearItemDeadband = new System.Windows.Forms.Button();
			this.OpcItemDeadband = new System.Windows.Forms.Label();
			this.OpcRemoveItemName = new System.Windows.Forms.Label();
			this.RemoveOpcItem = new System.Windows.Forms.Button();
			this.OpcItemName = new System.Windows.Forms.Label();
			this.AddOpcItem = new System.Windows.Forms.Button();
			this.OpcRemoveGroupName = new System.Windows.Forms.Label();
			this.RemoveOpcGroup = new System.Windows.Forms.Button();
			this.OpcGroupName = new System.Windows.Forms.Label();
			this.AddOpcGroup = new System.Windows.Forms.Button();
			this.OpcServerDisConnect = new System.Windows.Forms.Button();
			this.OpcServerRemove = new System.Windows.Forms.Label();
			this.bOpcServerName = new System.Windows.Forms.Label();
			this.bOpcServerConnect = new System.Windows.Forms.Button();
			this.ClearItemDeadbandOut = new System.Windows.Forms.Label();
			this.SuspendLayout();
			// 
			// OpcItemServerHandle
			// 
			this.OpcItemServerHandle.BackColor = System.Drawing.Color.Yellow;
			this.OpcItemServerHandle.Location = new System.Drawing.Point(536, 40);
			this.OpcItemServerHandle.Name = "OpcItemServerHandle";
			this.OpcItemServerHandle.Size = new System.Drawing.Size(216, 32);
			this.OpcItemServerHandle.TabIndex = 177;
			this.OpcItemServerHandle.Text = "Opc Item Server Handle";
			this.OpcItemServerHandle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// ClearItemDeadband
			// 
			this.ClearItemDeadband.Location = new System.Drawing.Point(536, 232);
			this.ClearItemDeadband.Name = "ClearItemDeadband";
			this.ClearItemDeadband.Size = new System.Drawing.Size(216, 32);
			this.ClearItemDeadband.TabIndex = 173;
			this.ClearItemDeadband.Text = "Clear Item Deadband";
			this.ClearItemDeadband.Click += new System.EventHandler(this.ClearItemDeadband_Click);
			// 
			// OpcItemDeadband
			// 
			this.OpcItemDeadband.BackColor = System.Drawing.Color.Yellow;
			this.OpcItemDeadband.Location = new System.Drawing.Point(536, 104);
			this.OpcItemDeadband.Name = "OpcItemDeadband";
			this.OpcItemDeadband.Size = new System.Drawing.Size(216, 32);
			this.OpcItemDeadband.TabIndex = 168;
			this.OpcItemDeadband.Text = "Opc Item Deadband";
			this.OpcItemDeadband.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// OpcRemoveItemName
			// 
			this.OpcRemoveItemName.BackColor = System.Drawing.Color.Yellow;
			this.OpcRemoveItemName.Location = new System.Drawing.Point(24, 232);
			this.OpcRemoveItemName.Name = "OpcRemoveItemName";
			this.OpcRemoveItemName.Size = new System.Drawing.Size(216, 32);
			this.OpcRemoveItemName.TabIndex = 167;
			this.OpcRemoveItemName.Text = "Opc Remove Item Name";
			this.OpcRemoveItemName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// RemoveOpcItem
			// 
			this.RemoveOpcItem.Location = new System.Drawing.Point(256, 232);
			this.RemoveOpcItem.Name = "RemoveOpcItem";
			this.RemoveOpcItem.Size = new System.Drawing.Size(216, 32);
			this.RemoveOpcItem.TabIndex = 166;
			this.RemoveOpcItem.Text = "Remove Opc Item";
			this.RemoveOpcItem.Click += new System.EventHandler(this.RemoveOpcItem_Click);
			// 
			// OpcItemName
			// 
			this.OpcItemName.BackColor = System.Drawing.Color.Yellow;
			this.OpcItemName.Location = new System.Drawing.Point(24, 168);
			this.OpcItemName.Name = "OpcItemName";
			this.OpcItemName.Size = new System.Drawing.Size(216, 32);
			this.OpcItemName.TabIndex = 165;
			this.OpcItemName.Text = "Opc Item Name";
			this.OpcItemName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// AddOpcItem
			// 
			this.AddOpcItem.Location = new System.Drawing.Point(256, 168);
			this.AddOpcItem.Name = "AddOpcItem";
			this.AddOpcItem.Size = new System.Drawing.Size(216, 32);
			this.AddOpcItem.TabIndex = 164;
			this.AddOpcItem.Text = "Add Opc Item";
			this.AddOpcItem.Click += new System.EventHandler(this.AddOpcItem_Click);
			// 
			// OpcRemoveGroupName
			// 
			this.OpcRemoveGroupName.BackColor = System.Drawing.Color.Yellow;
			this.OpcRemoveGroupName.Location = new System.Drawing.Point(24, 296);
			this.OpcRemoveGroupName.Name = "OpcRemoveGroupName";
			this.OpcRemoveGroupName.Size = new System.Drawing.Size(216, 32);
			this.OpcRemoveGroupName.TabIndex = 163;
			this.OpcRemoveGroupName.Text = "Opc Remove Group Name";
			this.OpcRemoveGroupName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// RemoveOpcGroup
			// 
			this.RemoveOpcGroup.Location = new System.Drawing.Point(256, 296);
			this.RemoveOpcGroup.Name = "RemoveOpcGroup";
			this.RemoveOpcGroup.Size = new System.Drawing.Size(216, 32);
			this.RemoveOpcGroup.TabIndex = 162;
			this.RemoveOpcGroup.Text = "Remove Opc Group";
			this.RemoveOpcGroup.Click += new System.EventHandler(this.RemoveOpcGroup_Click);
			// 
			// OpcGroupName
			// 
			this.OpcGroupName.BackColor = System.Drawing.Color.Yellow;
			this.OpcGroupName.Location = new System.Drawing.Point(24, 104);
			this.OpcGroupName.Name = "OpcGroupName";
			this.OpcGroupName.Size = new System.Drawing.Size(216, 32);
			this.OpcGroupName.TabIndex = 161;
			this.OpcGroupName.Text = "Opc Group Name";
			this.OpcGroupName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// AddOpcGroup
			// 
			this.AddOpcGroup.Location = new System.Drawing.Point(256, 104);
			this.AddOpcGroup.Name = "AddOpcGroup";
			this.AddOpcGroup.Size = new System.Drawing.Size(216, 32);
			this.AddOpcGroup.TabIndex = 160;
			this.AddOpcGroup.Text = "Add Opc Group";
			this.AddOpcGroup.Click += new System.EventHandler(this.AddOpcGroup_Click);
			// 
			// OpcServerDisConnect
			// 
			this.OpcServerDisConnect.Location = new System.Drawing.Point(256, 360);
			this.OpcServerDisConnect.Name = "OpcServerDisConnect";
			this.OpcServerDisConnect.Size = new System.Drawing.Size(216, 32);
			this.OpcServerDisConnect.TabIndex = 159;
			this.OpcServerDisConnect.Text = "Opc Server DisConnect";
			this.OpcServerDisConnect.Click += new System.EventHandler(this.OpcServerDisConnect_Click);
			// 
			// OpcServerRemove
			// 
			this.OpcServerRemove.BackColor = System.Drawing.Color.Yellow;
			this.OpcServerRemove.Location = new System.Drawing.Point(24, 360);
			this.OpcServerRemove.Name = "OpcServerRemove";
			this.OpcServerRemove.Size = new System.Drawing.Size(216, 32);
			this.OpcServerRemove.TabIndex = 158;
			this.OpcServerRemove.Text = "Opc Server Remove";
			this.OpcServerRemove.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// bOpcServerName
			// 
			this.bOpcServerName.BackColor = System.Drawing.Color.Yellow;
			this.bOpcServerName.Location = new System.Drawing.Point(24, 40);
			this.bOpcServerName.Name = "bOpcServerName";
			this.bOpcServerName.Size = new System.Drawing.Size(216, 32);
			this.bOpcServerName.TabIndex = 157;
			this.bOpcServerName.Text = "Opc Server Name";
			this.bOpcServerName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// bOpcServerConnect
			// 
			this.bOpcServerConnect.Location = new System.Drawing.Point(256, 40);
			this.bOpcServerConnect.Name = "bOpcServerConnect";
			this.bOpcServerConnect.Size = new System.Drawing.Size(216, 32);
			this.bOpcServerConnect.TabIndex = 156;
			this.bOpcServerConnect.Text = "Opc Server Connect";
			this.bOpcServerConnect.Click += new System.EventHandler(this.bOpcServerConnect_Click);
			// 
			// ClearItemDeadbandOut
			// 
			this.ClearItemDeadbandOut.BackColor = System.Drawing.Color.Yellow;
			this.ClearItemDeadbandOut.Location = new System.Drawing.Point(536, 168);
			this.ClearItemDeadbandOut.Name = "ClearItemDeadbandOut";

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -