using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using CgpibCs;

namespace Master
{
	/// <summary>
	/// Form1 ̊Tv̐łB
	/// </summary>
	public class Form_master : System.Windows.Forms.Form
	{
		public System.Windows.Forms.Button cmdExit;
		public System.Windows.Forms.GroupBox Frame6;
		public System.Windows.Forms.Button cmdPPoll;
		public System.Windows.Forms.Button cmdSetPPoll;
		public System.Windows.Forms.Button cmdSPoll;
		public System.Windows.Forms.Button cmdRetDel;
		public System.Windows.Forms.Button cmdDataDel;
		public System.Windows.Forms.GroupBox Frame4;
		public System.Windows.Forms.ListBox lstRet;
		public System.Windows.Forms.GroupBox Frame3;
		public System.Windows.Forms.TextBox txtAddr;
		public System.Windows.Forms.Button cmdSearch;
		public System.Windows.Forms.ComboBox cboEoi;
		public System.Windows.Forms.ComboBox cboDelim;
		public System.Windows.Forms.ComboBox cboAddr;
		public System.Windows.Forms.Label Label4;
		public System.Windows.Forms.Label Label3;
		public System.Windows.Forms.Label Label2;
		public System.Windows.Forms.GroupBox Frame2;
		public System.Windows.Forms.TextBox txtMyAddr;
		public System.Windows.Forms.TextBox txtDevName;
		public System.Windows.Forms.Label Label5;
		public System.Windows.Forms.Label Label1;
		public System.Windows.Forms.GroupBox Frame1;
		public System.Windows.Forms.Button cmdRec;
		public System.Windows.Forms.TextBox txtRec;
		public System.Windows.Forms.Button cmdSend;
		public System.Windows.Forms.TextBox txtSend;
		public System.Windows.Forms.Button cmdInit;
		public System.Windows.Forms.GroupBox Frame5;
		public System.Windows.Forms.Button cmdLlo;
		public System.Windows.Forms.Button cmdGtl;
		public System.Windows.Forms.Button cmdDcl;
		public System.Windows.Forms.Button cmdSdc;
		public System.Windows.Forms.Button cmdGet;
		public System.Windows.Forms.Label Line1;
		/// <summary>
		/// KvȃfUCiϐłB
		/// </summary>
		private System.ComponentModel.Container components = null;

		/// <summary>
		/// NXCgpibCX^X쐬
		/// </summary>
		Cgpib  gpib = new Cgpib();

		short	m_Id;
		short[]	m_EqpId = new short[32];
		short	m_SelectEqpId;

		public Form_master()
		{
			//
			// Windows tH[ fUCi T|[gɕKvłB
			//
			InitializeComponent();

			//
			// TODO: InitializeComponent ĂяǒɁARXgN^ R[hǉĂB
			//
		}

		/// <summary>
		/// gpĂ郊\[XɌ㏈s܂B
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// fUCi T|[gɕKvȃ\bhłB̃\bh̓e
		/// R[h GfB^ŕύXȂłB
		/// </summary>
		private void InitializeComponent()
		{
			this.cmdExit = new System.Windows.Forms.Button();
			this.Frame6 = new System.Windows.Forms.GroupBox();
			this.cmdPPoll = new System.Windows.Forms.Button();
			this.cmdSetPPoll = new System.Windows.Forms.Button();
			this.cmdSPoll = new System.Windows.Forms.Button();
			this.cmdRetDel = new System.Windows.Forms.Button();
			this.cmdDataDel = new System.Windows.Forms.Button();
			this.Frame4 = new System.Windows.Forms.GroupBox();
			this.lstRet = new System.Windows.Forms.ListBox();
			this.Frame3 = new System.Windows.Forms.GroupBox();
			this.txtAddr = new System.Windows.Forms.TextBox();
			this.cmdSearch = new System.Windows.Forms.Button();
			this.cboEoi = new System.Windows.Forms.ComboBox();
			this.cboDelim = new System.Windows.Forms.ComboBox();
			this.cboAddr = new System.Windows.Forms.ComboBox();
			this.Label4 = new System.Windows.Forms.Label();
			this.Label3 = new System.Windows.Forms.Label();
			this.Label2 = new System.Windows.Forms.Label();
			this.Frame2 = new System.Windows.Forms.GroupBox();
			this.txtMyAddr = new System.Windows.Forms.TextBox();
			this.txtDevName = new System.Windows.Forms.TextBox();
			this.Label5 = new System.Windows.Forms.Label();
			this.Label1 = new System.Windows.Forms.Label();
			this.Frame1 = new System.Windows.Forms.GroupBox();
			this.cmdRec = new System.Windows.Forms.Button();
			this.txtRec = new System.Windows.Forms.TextBox();
			this.cmdSend = new System.Windows.Forms.Button();
			this.txtSend = new System.Windows.Forms.TextBox();
			this.cmdInit = new System.Windows.Forms.Button();
			this.Frame5 = new System.Windows.Forms.GroupBox();
			this.cmdLlo = new System.Windows.Forms.Button();
			this.cmdGtl = new System.Windows.Forms.Button();
			this.cmdDcl = new System.Windows.Forms.Button();
			this.cmdSdc = new System.Windows.Forms.Button();
			this.cmdGet = new System.Windows.Forms.Button();
			this.Line1 = new System.Windows.Forms.Label();
			this.Frame6.SuspendLayout();
			this.Frame4.SuspendLayout();
			this.Frame3.SuspendLayout();
			this.Frame2.SuspendLayout();
			this.Frame1.SuspendLayout();
			this.Frame5.SuspendLayout();
			this.SuspendLayout();
			// 
			// cmdExit
			// 
			this.cmdExit.BackColor = System.Drawing.SystemColors.Control;
			this.cmdExit.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdExit.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdExit.Location = new System.Drawing.Point(448, 24);
			this.cmdExit.Name = "cmdExit";
			this.cmdExit.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdExit.Size = new System.Drawing.Size(113, 25);
			this.cmdExit.TabIndex = 55;
			this.cmdExit.Text = "I(&X)";
			this.cmdExit.Click += new System.EventHandler(this.cmdExit_Click);
			// 
			// Frame6
			// 
			this.Frame6.BackColor = System.Drawing.SystemColors.Control;
			this.Frame6.Controls.AddRange(new System.Windows.Forms.Control[] {
																				 this.cmdPPoll,
																				 this.cmdSetPPoll,
																				 this.cmdSPoll});
			this.Frame6.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Frame6.Location = new System.Drawing.Point(576, 200);
			this.Frame6.Name = "Frame6";
			this.Frame6.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Frame6.Size = new System.Drawing.Size(129, 121);
			this.Frame6.TabIndex = 54;
			this.Frame6.TabStop = false;
			this.Frame6.Text = "|[O";
			// 
			// cmdPPoll
			// 
			this.cmdPPoll.BackColor = System.Drawing.SystemColors.Control;
			this.cmdPPoll.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdPPoll.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdPPoll.Location = new System.Drawing.Point(8, 88);
			this.cmdPPoll.Name = "cmdPPoll";
			this.cmdPPoll.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdPPoll.Size = new System.Drawing.Size(113, 25);
			this.cmdPPoll.TabIndex = 21;
			this.cmdPPoll.Text = "p|[s";
			this.cmdPPoll.Click += new System.EventHandler(this.cmdPPoll_Click);
			// 
			// cmdSetPPoll
			// 
			this.cmdSetPPoll.BackColor = System.Drawing.SystemColors.Control;
			this.cmdSetPPoll.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdSetPPoll.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdSetPPoll.Location = new System.Drawing.Point(8, 56);
			this.cmdSetPPoll.Name = "cmdSetPPoll";
			this.cmdSetPPoll.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdSetPPoll.Size = new System.Drawing.Size(113, 25);
			this.cmdSetPPoll.TabIndex = 20;
			this.cmdSetPPoll.Text = "p|[\";
			this.cmdSetPPoll.Click += new System.EventHandler(this.cmdSetPPoll_Click);
			// 
			// cmdSPoll
			// 
			this.cmdSPoll.BackColor = System.Drawing.SystemColors.Control;
			this.cmdSPoll.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdSPoll.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdSPoll.Location = new System.Drawing.Point(8, 16);
			this.cmdSPoll.Name = "cmdSPoll";
			this.cmdSPoll.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdSPoll.Size = new System.Drawing.Size(113, 25);
			this.cmdSPoll.TabIndex = 19;
			this.cmdSPoll.Text = "VA|[(&P)";
			this.cmdSPoll.Click += new System.EventHandler(this.cmdSPoll_Click);
			// 
			// cmdRetDel
			// 
			this.cmdRetDel.BackColor = System.Drawing.SystemColors.Control;
			this.cmdRetDel.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdRetDel.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdRetDel.Location = new System.Drawing.Point(144, 336);
			this.cmdRetDel.Name = "cmdRetDel";
			this.cmdRetDel.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdRetDel.Size = new System.Drawing.Size(113, 25);
			this.cmdRetDel.TabIndex = 52;
			this.cmdRetDel.Text = "߂l";
			this.cmdRetDel.Click += new System.EventHandler(this.cmdRetDel_Click);
			// 
			// cmdDataDel
			// 
			this.cmdDataDel.BackColor = System.Drawing.SystemColors.Control;
			this.cmdDataDel.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdDataDel.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdDataDel.Location = new System.Drawing.Point(24, 336);
			this.cmdDataDel.Name = "cmdDataDel";
			this.cmdDataDel.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdDataDel.Size = new System.Drawing.Size(113, 25);
			this.cmdDataDel.TabIndex = 51;
			this.cmdDataDel.Text = "f[^";
			this.cmdDataDel.Click += new System.EventHandler(this.cmdDataDel_Click);
			// 
			// Frame4
			// 
			this.Frame4.BackColor = System.Drawing.SystemColors.Control;
			this.Frame4.Controls.AddRange(new System.Windows.Forms.Control[] {
																				 this.lstRet});
			this.Frame4.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Frame4.Location = new System.Drawing.Point(8, 248);
			this.Frame4.Name = "Frame4";
			this.Frame4.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Frame4.Size = new System.Drawing.Size(545, 81);
			this.Frame4.TabIndex = 50;
			this.Frame4.TabStop = false;
			this.Frame4.Text = "߂l";
			// 
			// lstRet
			// 
			this.lstRet.BackColor = System.Drawing.SystemColors.Window;
			this.lstRet.Cursor = System.Windows.Forms.Cursors.Default;
			this.lstRet.ForeColor = System.Drawing.SystemColors.WindowText;
			this.lstRet.ItemHeight = 12;
			this.lstRet.Location = new System.Drawing.Point(8, 16);
			this.lstRet.Name = "lstRet";
			this.lstRet.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.lstRet.Size = new System.Drawing.Size(529, 52);
			this.lstRet.TabIndex = 33;
			// 
			// Frame3
			// 
			this.Frame3.BackColor = System.Drawing.SystemColors.Control;
			this.Frame3.Controls.AddRange(new System.Windows.Forms.Control[] {
																				 this.txtAddr,
																				 this.cmdSearch,
																				 this.cboEoi,
																				 this.cboDelim,
																				 this.cboAddr,
																				 this.Label4,
																				 this.Label3,
																				 this.Label2});
			this.Frame3.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Frame3.Location = new System.Drawing.Point(8, 72);
			this.Frame3.Name = "Frame3";
			this.Frame3.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Frame3.Size = new System.Drawing.Size(545, 81);
			this.Frame3.TabIndex = 49;
			this.Frame3.TabStop = false;
			this.Frame3.Text = "@";
			// 
			// txtAddr
			// 
			this.txtAddr.AcceptsReturn = true;
			this.txtAddr.AutoSize = false;
			this.txtAddr.BackColor = System.Drawing.SystemColors.Window;
			this.txtAddr.Cursor = System.Windows.Forms.Cursors.IBeam;
			this.txtAddr.ForeColor = System.Drawing.SystemColors.WindowText;
			this.txtAddr.Location = new System.Drawing.Point(88, 16);
			this.txtAddr.MaxLength = 0;
			this.txtAddr.Name = "txtAddr";
			this.txtAddr.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.txtAddr.Size = new System.Drawing.Size(81, 18);
			this.txtAddr.TabIndex = 34;
			this.txtAddr.Text = "";
			// 
			// cmdSearch
			// 
			this.cmdSearch.BackColor = System.Drawing.SystemColors.Control;
			this.cmdSearch.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdSearch.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdSearch.Location = new System.Drawing.Point(424, 48);
			this.cmdSearch.Name = "cmdSearch";
			this.cmdSearch.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdSearch.Size = new System.Drawing.Size(113, 25);
			this.cmdSearch.TabIndex = 31;
			this.cmdSearch.Text = "@팟(&F)";
			this.cmdSearch.Click += new System.EventHandler(this.cmdSearch_Click);
			// 
			// cboEoi
			// 
			this.cboEoi.BackColor = System.Drawing.SystemColors.Window;
			this.cboEoi.Cursor = System.Windows.Forms.Cursors.Default;
			this.cboEoi.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.cboEoi.ForeColor = System.Drawing.SystemColors.WindowText;
			this.cboEoi.Items.AddRange(new object[] {
														"o͂Ȃ",
														"o͂"});
			this.cboEoi.Location = new System.Drawing.Point(288, 48);
			this.cboEoi.Name = "cboEoi";
			this.cboEoi.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cboEoi.Size = new System.Drawing.Size(105, 20);
			this.cboEoi.TabIndex = 25;
			// 
			// cboDelim
			// 
			this.cboDelim.BackColor = System.Drawing.SystemColors.Window;
			this.cboDelim.Cursor = System.Windows.Forms.Cursors.Default;
			this.cboDelim.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.cboDelim.ForeColor = System.Drawing.SystemColors.WindowText;
			this.cboDelim.Items.AddRange(new object[] {
														  "gpȂ",
														  "CR+LF",
														  "CR",
														  "LF"});
			this.cboDelim.Location = new System.Drawing.Point(88, 48);
			this.cboDelim.Name = "cboDelim";
			this.cboDelim.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cboDelim.Size = new System.Drawing.Size(105, 20);
			this.cboDelim.TabIndex = 24;
			// 
			// cboAddr
			// 
			this.cboAddr.BackColor = System.Drawing.SystemColors.Window;
			this.cboAddr.Cursor = System.Windows.Forms.Cursors.Default;
			this.cboAddr.ForeColor = System.Drawing.SystemColors.WindowText;
			this.cboAddr.ImeMode = System.Windows.Forms.ImeMode.Disable;
			this.cboAddr.Location = new System.Drawing.Point(184, 16);
			this.cboAddr.Name = "cboAddr";
			this.cboAddr.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cboAddr.Size = new System.Drawing.Size(353, 20);
			this.cboAddr.TabIndex = 23;
			// 
			// Label4
			// 
			this.Label4.BackColor = System.Drawing.SystemColors.Control;
			this.Label4.Cursor = System.Windows.Forms.Cursors.Default;
			this.Label4.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Label4.Location = new System.Drawing.Point(8, 48);
			this.Label4.Name = "Label4";
			this.Label4.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Label4.Size = new System.Drawing.Size(73, 17);
			this.Label4.TabIndex = 28;
			this.Label4.Text = "f~^ =";
			// 
			// Label3
			// 
			this.Label3.BackColor = System.Drawing.SystemColors.Control;
			this.Label3.Cursor = System.Windows.Forms.Cursors.Default;
			this.Label3.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Label3.Location = new System.Drawing.Point(8, 16);
			this.Label3.Name = "Label3";
			this.Label3.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Label3.Size = new System.Drawing.Size(81, 17);
			this.Label3.TabIndex = 27;
			this.Label3.Text = "@AhX =";
			// 
			// Label2
			// 
			this.Label2.BackColor = System.Drawing.SystemColors.Control;
			this.Label2.Cursor = System.Windows.Forms.Cursors.Default;
			this.Label2.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Label2.Location = new System.Drawing.Point(232, 48);
			this.Label2.Name = "Label2";
			this.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Label2.Size = new System.Drawing.Size(33, 17);
			this.Label2.TabIndex = 26;
			this.Label2.Text = "EOI =";
			// 
			// Frame2
			// 
			this.Frame2.BackColor = System.Drawing.SystemColors.Control;
			this.Frame2.Controls.AddRange(new System.Windows.Forms.Control[] {
																				 this.txtMyAddr,
																				 this.txtDevName,
																				 this.Label5,
																				 this.Label1});
			this.Frame2.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Frame2.Location = new System.Drawing.Point(8, 16);
			this.Frame2.Name = "Frame2";
			this.Frame2.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Frame2.Size = new System.Drawing.Size(313, 49);
			this.Frame2.TabIndex = 48;
			this.Frame2.TabStop = false;
			this.Frame2.Text = "@";
			// 
			// txtMyAddr
			// 
			this.txtMyAddr.AcceptsReturn = true;
			this.txtMyAddr.AutoSize = false;
			this.txtMyAddr.BackColor = System.Drawing.SystemColors.Window;
			this.txtMyAddr.Cursor = System.Windows.Forms.Cursors.IBeam;
			this.txtMyAddr.ForeColor = System.Drawing.SystemColors.WindowText;
			this.txtMyAddr.Location = new System.Drawing.Point(256, 16);
			this.txtMyAddr.MaxLength = 0;
			this.txtMyAddr.Name = "txtMyAddr";
			this.txtMyAddr.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.txtMyAddr.Size = new System.Drawing.Size(33, 25);
			this.txtMyAddr.TabIndex = 32;
			this.txtMyAddr.Text = "";
			// 
			// txtDevName
			// 
			this.txtDevName.AcceptsReturn = true;
			this.txtDevName.AutoSize = false;
			this.txtDevName.BackColor = System.Drawing.SystemColors.Window;
			this.txtDevName.Cursor = System.Windows.Forms.Cursors.IBeam;
			this.txtDevName.ForeColor = System.Drawing.SystemColors.WindowText;
			this.txtDevName.Location = new System.Drawing.Point(80, 16);
			this.txtDevName.MaxLength = 0;
			this.txtDevName.Name = "txtDevName";
			this.txtDevName.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.txtDevName.Size = new System.Drawing.Size(73, 26);
			this.txtDevName.TabIndex = 30;
			this.txtDevName.Text = "";
			// 
			// Label5
			// 
			this.Label5.BackColor = System.Drawing.SystemColors.Control;
			this.Label5.Cursor = System.Windows.Forms.Cursors.Default;
			this.Label5.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Label5.Location = new System.Drawing.Point(8, 24);
			this.Label5.Name = "Label5";
			this.Label5.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Label5.Size = new System.Drawing.Size(73, 17);
			this.Label5.TabIndex = 29;
			this.Label5.Text = "foCX =";
			// 
			// Label1
			// 
			this.Label1.BackColor = System.Drawing.SystemColors.Control;
			this.Label1.Cursor = System.Windows.Forms.Cursors.Default;
			this.Label1.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Label1.Location = new System.Drawing.Point(168, 24);
			this.Label1.Name = "Label1";
			this.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Label1.Size = new System.Drawing.Size(81, 17);
			this.Label1.TabIndex = 3;
			this.Label1.Text = "@AhX =";
			// 
			// Frame1
			// 
			this.Frame1.BackColor = System.Drawing.SystemColors.Control;
			this.Frame1.Controls.AddRange(new System.Windows.Forms.Control[] {
																				 this.cmdRec,
																				 this.txtRec,
																				 this.cmdSend,
																				 this.txtSend});
			this.Frame1.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Frame1.Location = new System.Drawing.Point(8, 160);
			this.Frame1.Name = "Frame1";
			this.Frame1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Frame1.Size = new System.Drawing.Size(545, 81);
			this.Frame1.TabIndex = 47;
			this.Frame1.TabStop = false;
			this.Frame1.Text = "Mf[^";
			// 
			// cmdRec
			// 
			this.cmdRec.BackColor = System.Drawing.SystemColors.Control;
			this.cmdRec.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdRec.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdRec.Location = new System.Drawing.Point(424, 48);
			this.cmdRec.Name = "cmdRec";
			this.cmdRec.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdRec.Size = new System.Drawing.Size(113, 25);
			this.cmdRec.TabIndex = 7;
			this.cmdRec.Text = "M(&R)";
			this.cmdRec.Click += new System.EventHandler(this.cmdRec_Click);
			// 
			// txtRec
			// 
			this.txtRec.AcceptsReturn = true;
			this.txtRec.AutoSize = false;
			this.txtRec.BackColor = System.Drawing.SystemColors.Window;
			this.txtRec.Cursor = System.Windows.Forms.Cursors.IBeam;
			this.txtRec.ForeColor = System.Drawing.SystemColors.WindowText;
			this.txtRec.Location = new System.Drawing.Point(8, 48);
			this.txtRec.MaxLength = 0;
			this.txtRec.Name = "txtRec";
			this.txtRec.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.txtRec.Size = new System.Drawing.Size(409, 25);
			this.txtRec.TabIndex = 6;
			this.txtRec.Text = "";
			// 
			// cmdSend
			// 
			this.cmdSend.BackColor = System.Drawing.SystemColors.Control;
			this.cmdSend.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdSend.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdSend.Location = new System.Drawing.Point(424, 16);
			this.cmdSend.Name = "cmdSend";
			this.cmdSend.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdSend.Size = new System.Drawing.Size(113, 25);
			this.cmdSend.TabIndex = 5;
			this.cmdSend.Text = "M(&S)";
			this.cmdSend.Click += new System.EventHandler(this.cmdSend_Click);
			// 
			// txtSend
			// 
			this.txtSend.AcceptsReturn = true;
			this.txtSend.AutoSize = false;
			this.txtSend.BackColor = System.Drawing.SystemColors.Window;
			this.txtSend.Cursor = System.Windows.Forms.Cursors.IBeam;
			this.txtSend.ForeColor = System.Drawing.SystemColors.WindowText;
			this.txtSend.Location = new System.Drawing.Point(8, 16);
			this.txtSend.MaxLength = 0;
			this.txtSend.Name = "txtSend";
			this.txtSend.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.txtSend.Size = new System.Drawing.Size(409, 25);
			this.txtSend.TabIndex = 4;
			this.txtSend.Text = "";
			// 
			// cmdInit
			// 
			this.cmdInit.BackColor = System.Drawing.SystemColors.Control;
			this.cmdInit.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdInit.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdInit.Location = new System.Drawing.Point(328, 24);
			this.cmdInit.Name = "cmdInit";
			this.cmdInit.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdInit.Size = new System.Drawing.Size(113, 25);
			this.cmdInit.TabIndex = 46;
			this.cmdInit.Text = "(&I)";
			this.cmdInit.Click += new System.EventHandler(this.cmdInit_Click);
			// 
			// Frame5
			// 
			this.Frame5.BackColor = System.Drawing.SystemColors.Control;
			this.Frame5.Controls.AddRange(new System.Windows.Forms.Control[] {
																				 this.cmdLlo,
																				 this.cmdGtl,
																				 this.cmdDcl,
																				 this.cmdSdc,
																				 this.cmdGet});
			this.Frame5.ForeColor = System.Drawing.SystemColors.ControlText;
			this.Frame5.Location = new System.Drawing.Point(576, 16);
			this.Frame5.Name = "Frame5";
			this.Frame5.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.Frame5.Size = new System.Drawing.Size(129, 177);
			this.Frame5.TabIndex = 53;
			this.Frame5.TabStop = false;
			this.Frame5.Text = "GPIBR}h";
			// 
			// cmdLlo
			// 
			this.cmdLlo.BackColor = System.Drawing.SystemColors.Control;
			this.cmdLlo.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdLlo.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdLlo.Location = new System.Drawing.Point(8, 144);
			this.cmdLlo.Name = "cmdLlo";
			this.cmdLlo.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdLlo.Size = new System.Drawing.Size(113, 25);
			this.cmdLlo.TabIndex = 17;
			this.cmdLlo.Text = "LLO(&O)";
			this.cmdLlo.Click += new System.EventHandler(this.cmdLlo_Click);
			// 
			// cmdGtl
			// 
			this.cmdGtl.BackColor = System.Drawing.SystemColors.Control;
			this.cmdGtl.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdGtl.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdGtl.Location = new System.Drawing.Point(8, 80);
			this.cmdGtl.Name = "cmdGtl";
			this.cmdGtl.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdGtl.Size = new System.Drawing.Size(113, 25);
			this.cmdGtl.TabIndex = 16;
			this.cmdGtl.Text = "GTL(&T)";
			this.cmdGtl.Click += new System.EventHandler(this.cmdGtl_Click);
			// 
			// cmdDcl
			// 
			this.cmdDcl.BackColor = System.Drawing.SystemColors.Control;
			this.cmdDcl.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdDcl.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdDcl.Location = new System.Drawing.Point(8, 112);
			this.cmdDcl.Name = "cmdDcl";
			this.cmdDcl.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdDcl.Size = new System.Drawing.Size(113, 25);
			this.cmdDcl.TabIndex = 15;
			this.cmdDcl.Text = "DCL(&L)";
			this.cmdDcl.Click += new System.EventHandler(this.cmdDcl_Click);
			// 
			// cmdSdc
			// 
			this.cmdSdc.BackColor = System.Drawing.SystemColors.Control;
			this.cmdSdc.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdSdc.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdSdc.Location = new System.Drawing.Point(8, 48);
			this.cmdSdc.Name = "cmdSdc";
			this.cmdSdc.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdSdc.Size = new System.Drawing.Size(113, 25);
			this.cmdSdc.TabIndex = 14;
			this.cmdSdc.Text = "SDC(&C)";
			this.cmdSdc.Click += new System.EventHandler(this.cmdSdc_Click);
			// 
			// cmdGet
			// 
			this.cmdGet.BackColor = System.Drawing.SystemColors.Control;
			this.cmdGet.Cursor = System.Windows.Forms.Cursors.Default;
			this.cmdGet.ForeColor = System.Drawing.SystemColors.ControlText;
			this.cmdGet.Location = new System.Drawing.Point(8, 16);
			this.cmdGet.Name = "cmdGet";
			this.cmdGet.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.cmdGet.Size = new System.Drawing.Size(113, 25);
			this.cmdGet.TabIndex = 13;
			this.cmdGet.Text = "GET(&G)";
			this.cmdGet.Click += new System.EventHandler(this.cmdGet_Click);
			// 
			// Line1
			// 
			this.Line1.BackColor = System.Drawing.SystemColors.WindowText;
			this.Line1.Location = new System.Drawing.Point(568, 16);
			this.Line1.Name = "Line1";
			this.Line1.Size = new System.Drawing.Size(1, 320);
			this.Line1.TabIndex = 56;
			// 
			// Form_master
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 12);
			this.ClientSize = new System.Drawing.Size(712, 382);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.cmdExit,
																		  this.Frame6,
																		  this.cmdRetDel,
																		  this.cmdDataDel,
																		  this.Frame4,
																		  this.Frame3,
																		  this.Frame2,
																		  this.Frame1,
																		  this.cmdInit,
																		  this.Frame5,
																		  this.Line1});
			this.Name = "Form_master";
			this.Text = "Master";
			this.Load += new System.EventHandler(this.Form_master_Load);
			this.Frame6.ResumeLayout(false);
			this.Frame4.ResumeLayout(false);
			this.Frame3.ResumeLayout(false);
			this.Frame2.ResumeLayout(false);
			this.Frame1.ResumeLayout(false);
			this.Frame5.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// AvP[ṼC Gg |CgłB
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form_master());
		}
		//**************************************************************************************************
		//   nꂽ߂lXg{bNXɔf܂(Tu[`)
		//**************************************************************************************************
		private void funcSetlstRet(string strRet)
		{
			//Xg{bNX̍Ōɍڂǉ܂
			//256ڂ𒴂ƍڂSč폜܂
			if (lstRet.Items.Count >= 256)
			{
				lstRet.Items.RemoveAt(0);
				lstRet.Items.Add(strRet);
			}
			else
			{
				lstRet.Items.Add(strRet);
			}
			lstRet.SelectedIndex = lstRet.Items.Count - 1;
		}

		//**************************************************************************************************
		//   @̐ݒ(Tu[`)
		//   @\FEquipent IDEf~^EEOI̐ݒs܂
		//   ߂lF    TRUE(), FALSE(ُ)
		//**************************************************************************************************
		private bool funcSetParam()
		{
			short	Delim;
			short	PrmAddr;
			short	Eoi;
			short	Eos;
			int		Ret;
			string	strRet;

			//@킪oĂ΁AoĂ@w
			if (cboAddr.Items.Count != 0)
			{
				//R{{bNXŎw肳Ă@̃CNEBbvgID擾
				m_SelectEqpId = m_EqpId[cboAddr.SelectedIndex];
			}
			else
			{
				//GfBbg{bNXŎw肳Ă@AhX̃CNEBbvgID擾
				Delim	= (short)cboDelim.SelectedIndex;
				PrmAddr	= short.Parse(txtAddr.Text);
				Ret = gpib.SetEquipment(	m_Id,				//Device ID
											out m_SelectEqpId,	//擾Equipent ID
											PrmAddr,			//ꎟAhX
											0,					//񎟃AhX
											Delim);				//f~^ݒ
				if (Ret != 0)
				{
					//G[̏ꍇ
					gpib.GetErrorString(Ret, out strRet);
					funcSetlstRet(strRet);		//Xgɕ\
					return false;
				}
			}
			//f~^R[hEOIC̐ݒ
			Delim	= (short)cboDelim.SelectedIndex;
			Eoi		= (short)cboEoi.SelectedIndex;
			Eos		= 0;
			Ret	= gpib.SetDelim(	m_SelectEqpId,
									Delim,			//f~^R[h̐ݒ
									Eoi,			//EOIC̐ݒ
									Eos);			//EOS̐ݒi\j
			if (Ret != 0)
			{
				//G[̏ꍇ
				gpib.GetErrorString(Ret, out strRet);
				funcSetlstRet(strRet);			//Xgɕ\
			}
			else
			{
				funcSetlstRet("u@̐ݒvI");	//Xgɕ\
			}
			return true;
		}

		//**************************************************************************************************
		//   lݒ
		//**************************************************************************************************
		private void Form_master_Load(object sender, System.EventArgs e)
		{
			txtDevName.Text = "GPIB000";
			txtAddr.Text = "1";
			cboDelim.SelectedIndex = 1;	//CR+LF
			cboEoi.SelectedIndex = 1;	//o͂
			txtSend.Text = "*IDN?";
		}

		//**************************************************************************************************
		//   
		//   @\FfoCXfoCXID擾
		//**************************************************************************************************
		private void cmdInit_Click(object sender, System.EventArgs e)
		{
			int		Ret;
			int		Data;
			string	strRet;

			//֐s
			Ret = gpib.Init(txtDevName.Text, out m_Id);
			if (Ret != 0)
			{
				//G[̏ꍇ
				gpib.GetErrorString(Ret, out strRet);
				funcSetlstRet(strRet);	//Xgɕ\
			}
			else 
			{
				//ɃfoCXID擾łꍇ
				strRet = "GpibInit : foCXID = " + m_Id;
				funcSetlstRet(strRet);	//Xgɕ\
				//@AhX̎擾
				Ret = gpib.GetStatus(m_Id, 0x08, out Data);
				if (Ret == 0)
				{
					txtMyAddr.Text = Data.ToString();
				}
				//}X^ɐݒ肳Ă邩ǂ̊mF
				Ret = gpib.GetStatus(m_Id, 0x0A, out Data);
				if ((Ret == 0) && (Data == 1)) 
				{
					MessageBox.Show("}X^ɐݒ肳Ă܂BvpeBŃ}X^ɐݒ肵ĂB");
				} 
				else 
				{
					strRet = "uvI";
					funcSetlstRet(strRet);	//Xgɕ\
				}
			}

			gpib.SendIFC(m_Id, 1);	//IFC𑗏o
		}

		//**************************************************************************************************
		//   I
		//   @\FfoCXID𖳌ɂ
		//**************************************************************************************************
		private void cmdExit_Click(object sender, System.EventArgs e)
		{
			int	Ret;
			string	strRet;

			Ret = gpib.Exit(m_Id);
			if (Ret != 0) 
			{
				//G[̏ꍇ
				gpib.GetErrorString(Ret, out strRet);
				funcSetlstRet(strRet);	//Xgɕ\
			}
			this.Close();
		}

		//**************************************************************************************************
		//   @̌
		//   @\FfoCXIDɑ@ACNEBbvgID擾B
		//         ܂ACNEBbvgID̑@IEEE488.2ʃR}hu*IDN?v𑗐M
		//         @IDi[JAfԍj擾
		//**************************************************************************************************
		private void cmdSearch_Click(object sender, System.EventArgs e)
		{
			short	PrmAddr;
			short	ScdAddr;
			short	ArraySize;
			short	ArrayCount;
			short[]	AddrArray =new short[32];
			int		Ret;
			int		SendLen;
			int		RecLen;	
			string	RecBuf;
			string	strRet;
			string	SendBuf;
			string	EqpInforBuf;

			PrmAddr		= -1;	//SĂ̈ꎟAhX
			ScdAddr		= 0;	//񎟃AhXȂ
			ArraySize	= 32;	//o@퐔w
			Ret = gpib.FindListener(m_Id, PrmAddr, ScdAddr, ref ArraySize, AddrArray);
			if (Ret != 0) 
			{
				//G[̏ꍇ
				gpib.GetErrorString(Ret, out strRet);
				funcSetlstRet(strRet);	//Xgɕ\
				return;
			} 
			//ɌłꍇA o@퐔̕\s
			strRet = "GpibFindListener : o@퐔 = " + ArraySize;
			funcSetlstRet(strRet);	//Xgɕ\

			//oꂽ@̋@擾
			cboAddr.ResetText();	//R{{bNX̍ڂ
			for (ArrayCount = 0; ArrayCount < ArraySize; ArrayCount++) 
			{
				//Equipent ID̎擾
				Ret = gpib.SetEquipment(
										m_Id,							//Device ID
										out m_EqpId[ArrayCount],		//擾Equipent ID
										AddrArray[ArrayCount],			//ꎟAhX
										0,								//񎟃AhX
										(short)cboDelim.SelectedIndex	//f~^ݒ
										);
				if (Ret != 0) 
				{
					//G[̏ꍇ
					gpib.GetErrorString(Ret, out strRet);
					funcSetlstRet(strRet);	//Xgɕ\
					continue;
				}
		
				//@₢킹iMj
				SendBuf = "*IDN?";	//Mf[^
				SendLen = SendBuf.Length;	//Mf[^
				Ret = gpib.SendData(m_EqpId[ArrayCount], ref SendLen, SendBuf);
				if (Ret != 0) 
				{
					//G[̏ꍇ
					gpib.GetErrorString(Ret, out strRet);
					funcSetlstRet(strRet);	//Xgɕ\
					continue;
				}

				//@₢킹iMj
				RecLen = 256;	//Mobt@TCYw
				Ret = gpib.RecData(m_EqpId[ArrayCount], ref RecLen, out RecBuf);
				if (Ret != 0) 
				{
					//G[̏ꍇ
					gpib.GetErrorString(Ret, out strRet);
					funcSetlstRet(strRet);	//Xgɕ\
					continue;
				}

				//Mf[^IEEE488.2KimF
				if (RecBuf.IndexOf(",") != -1) 
				{
					//AhX
					EqpInforBuf = "Address:" + AddrArray[ArrayCount] + RecBuf;
				} 
				else 
				{
					//Mf[^IEEE488.2KiłȂꍇAAhX̂
					EqpInforBuf = "Address:" + AddrArray[ArrayCount];
				}
				//oς݂̋@탊Xgɒǉ
				cboAddr.Items.Insert(ArrayCount, EqpInforBuf);
				cboAddr.SelectedIndex = ArrayCount;
			}

			//oς݂̋@R{{bNXAGfBbg{bNXɔf
			if(cboAddr.SelectedIndex != -1)
			{
				txtAddr.Text = AddrArray[cboAddr.SelectedIndex].ToString();
			}
		}

		//**************************************************************************************************
		//   f[^̑M
		//   @\FX[u@Ƀf[^𑗐M
		//**************************************************************************************************
		private void cmdSend_Click(object sender, System.EventArgs e)
		{
			int		SendLen;
			int		Ret;
			string	strRet;
			string	SendBuf;

			//Equipent IDEf~^EEOI̐ݒ
			if (funcSetParam() == false) return;

			//GfBbg{bNX瑗Mf[^擾
			SendBuf = txtSend.Text;
			SendLen = SendBuf.Length;
			if (SendLen == 0) 
			{
				strRet = "GpibSendData : Mf[^܂";
				funcSetlstRet(strRet);	//Xgɕ\
				return;
			}

			funcSetlstRet("GpibSendData : M...");	//Xgɕ\
			//Ms
			Ret = gpib.SendData(m_SelectEqpId, ref SendLen, SendBuf);
			if (Ret != 0) 
			{
				//G[̏ꍇ
				gpib.GetErrorString(Ret, out strRet);
				funcSetlstRet(strRet);	//Xgɕ\
			} 
			else  
			{
				//ɑMłꍇ
				strRet = "GpibSendData : Mf[^ = " + SendLen;
				funcSetlstRet(strRet);	//Xgɕ\
				funcSetlstRet("uf[^̑MvI");	//Xgɕ\
			}
		}

		//**************************************************************************************************
		//   f[^̎M
		//   @\FX[u@킩f[^M
		//**************************************************************************************************
		private void cmdRec_Click(object sender, System.EventArgs e)
		{
			int		RecLen;
			int		Ret;
			string	strRet;
			string	RecBuf;

			//Equipent IDEf~^EEOI̐ݒ
			if (funcSetParam() == false) return;

			RecLen = 256;	//Mobt@TCYw
			funcSetlstRet("GpibRecData : M...");	//Xgɕ\
			//Ms
			Ret = gpib.RecData(m_SelectEqpId, ref RecLen, out RecBuf);
			if (Ret != 0) 
			{
				//G[̏ꍇ
				gpib.GetErrorString(Ret, out strRet);
				funcSetlstRet(strRet);	//Xgɕ\
			} 
			else 
			{
				//ɎMłꍇ
				txtRec.Text = RecBuf.Substring(0,RecLen);
				strRet = "GpibRecData : Mf[^ = " + RecLen;
				funcSetlstRet(strRet);	//Xgɕ\
				strRet = "uf[^̎MvI";
				funcSetlstRet(strRet);	//Xgɕ\
			}

		
		}

		//**************************************************************************************************
		//   GETR}h̑M
		//   @\FX[u@Ɍ߂ꂽNR}h(GET)𑗐M
		//**************************************************************************************************
		private void cmdGet_Click(object sender, System.EventArgs e)
		{
			int		Ret;
			string	strRet;

			if (funcSetParam() == false) return;

			//GETR}hM֐̎s
			Ret = gpib.SendTrigger(m_SelectEqpId);
			if (Ret != 0) 
			{
				//G[̏ꍇ
				gpib.GetErrorString(Ret, out strRet);
				funcSetlstRet(strRet);	//Xgɕ\
			} 
			else 
			{
				funcSetlstRet("uGETR}h̑MvI");	//Xgɕ\
			}	
		}

		//**************************************************************************************************
		//   SDCR}h̑M
		//   @\FX[u@ԁidjɂR}h(SDC)𑗐M
		//**************************************************************************************************
		private void cmdSdc_Click(object sender, System.EventArgs e)
		{
			int		Ret;
			string	strRet;

			if (funcSetParam() == false) return;

			//SDCR}hM֐̎s
			Ret = gpib.SendDeviceClear(m_SelectEqpId);
			if (Ret != 0) 
			{
				//G[̏ꍇ
				gpib.GetErrorString(Ret, out strRet);
				funcSetlstRet(strRet);	//Xgɕ\
			} 
			else 
			{
				funcSetlstRet("uSDCR}h̑MvI");	//Xgɕ\
			}	
		}

		//**************************************************************************************************
		//   GTLR}h̑M
		//   @\FX[u@Ƀ[J[hɖ߂R}h(GTL)𑗐M
		//**************************************************************************************************
		private void cmdGtl_Click(object sender, System.EventArgs e)
		{
			int		Ret;
			string	strRet;

			if (funcSetParam() == false) return;

			//GTLR}hM֐̎s
			Ret = gpib.ChangeLocal(m_SelectEqpId);
			if (Ret != 0) 
			{
				//G[̏ꍇ
				gpib.GetErrorString(Ret, out strRet);
				funcSetlstRet(strRet);	//Xgɕ\
			} 
			else 
			{
				funcSetlstRet("uGTLR}h̑MvI");	//Xgɕ\
			}	
		}

		//**************************************************************************************************
		//   DCLR}h̑M
		//   @\FSX[u@ԁidjɂR}h(DCL)𑗐M
		//**************************************************************************************************
		private void cmdDcl_Click(object sender, System.EventArgs e)
		{
			int		Ret;
			string	strRet;

			//DCLR}hM֐̎s
			Ret = gpib.SendDeviceClear(m_Id);
			if (Ret != 0) 
			{
				//G[̏ꍇ
				gpib.GetErrorString(Ret, out strRet);
				funcSetlstRet(strRet);	//Xgɕ\
			} 
			else 
			{
				funcSetlstRet("uDCLR}h̑MvI");	//Xgɕ\
			}
		}

		//**************************************************************************************************
		//   LLOR}h̑M
		//   @\FSX[u@킪@̃XCb`ɂ郍[J[hւ̈ڍs֎~R}h(LLO)𑗐M
		//**************************************************************************************************
		private void cmdLlo_Click(object sender, System.EventArgs e)
		{
			int		Ret;
			string	strRet;

			//LLOR}hM֐̎s
			Ret = gpib.SendLocalLockout(m_Id);
			if (Ret != 0) 
			{
				//G[̏ꍇ
				gpib.GetErrorString(Ret, out strRet);
				funcSetlstRet(strRet);	//Xgɕ\
			} 
			else 
			{
				funcSetlstRet("uLLOR}h̑MvI");	//Xgɕ\
			}	
		}

		//**************************************************************************************************
		//   VA|[̎s
		//   @\FX[u@̃Xe[^XoCg擾
		//**************************************************************************************************
		private void cmdSPoll_Click(object sender, System.EventArgs e)
		{
			short	Stb;
			short	Srq;
			int		Ret;
			string	strRet;

			if (funcSetParam() == false) return;
		
			funcSetlstRet("GpibSPoll : VA|[...");	//Xgɕ\

			//VA|[֐̎s
			Ret = gpib.SPoll(m_SelectEqpId, out Stb, out Srq);
			if (Ret != 0) 
			{
				//G[̏ꍇ
				gpib.GetErrorString(Ret, out strRet);
				funcSetlstRet(strRet);	//Xgɕ\
			} 
			else 
			{
				strRet = string.Format("GpibSPoll : Xe[^XoCg = {0:X2}(H) SRQ C = {1:X2}(H)" ,Stb, Srq);
				funcSetlstRet(strRet);	//Xgɕ\
				funcSetlstRet("uVA|[̎svI");	//Xgɕ\
			}
		}

		//**************************************************************************************************
		//   p|[̍\
		//   @\Fp|[̃Cݒ肷
		//**************************************************************************************************
		private void cmdSetPPoll_Click(object sender, System.EventArgs e)
		{
			short[]	AddrArray		= new short[9];
			short[]	DataLineArray	= new short[9];
			short[]	PolarityArray	= new short[9];
			int		i;
			int		Ret;
			string	strRet;

			//GfBbg{bNX̋@AhXŐݒ
			i = 0;
			AddrArray[i]		= short.Parse(txtAddr.Text);	//@AhX
			DataLineArray[i]	= (short)(i + 1);				//DIOCԍ
			PolarityArray[i]	= 1;							//Őݒ
			i++;

			//z̖ݒ
			AddrArray[i]		= -1;
			DataLineArray[i]	= -1;
			PolarityArray[i]	= -1;

			//p|[\֐s
			Ret = gpib.SetPPoll(m_Id, AddrArray, DataLineArray, PolarityArray);
			if (Ret != 0) 
			{
				//G[̏ꍇ
				gpib.GetErrorString(Ret, out strRet);
				funcSetlstRet(strRet);	//Xgɕ\
			} 
			else 
			{
				funcSetlstRet("up|[̍\vI");	//Xgɕ\
			}
		
		}

		//**************************************************************************************************
		//   p|[̎s
		//   @\Fp|[sDIOCf[^擾
		//**************************************************************************************************
		private void cmdPPoll_Click(object sender, System.EventArgs e)
		{
			short	Ppr;
			int		Ret;
			string	strRet;

			//p|[֐s
			Ret = gpib.PPoll(m_Id, out Ppr);
			if (Ret != 0) 
			{
				//G[̏ꍇ
				gpib.GetErrorString(Ret, out strRet);
				funcSetlstRet(strRet);	//Xgɕ\
			} 
			else 
			{
				strRet = string.Format("GpibPPoll : DIOCf[^ = {0:X2}(H)", Ppr);
				funcSetlstRet(strRet);	//Xgɕ\
				funcSetlstRet("up|[̎svI");	//Xgɕ\
			}
		}

		//**************************************************************************************************
		//   MeLXgf[^
		//**************************************************************************************************
		private void cmdDataDel_Click(object sender, System.EventArgs e)
		{
			txtSend.Text = "";
			txtRec.Text = "";
		}

		//**************************************************************************************************
		//   ߂lf[^
		//**************************************************************************************************
		private void cmdRetDel_Click(object sender, System.EventArgs e)
		{
	        lstRet.Items.Clear();
		}
	}
}
