Option Strict Off
Option Explicit On
Imports System.Runtime.InteropServices
Imports VB = Microsoft.VisualBasic
Friend Class Form1
	Inherits System.Windows.Forms.Form
#Region "Windows tH[ fUCiɂĐꂽR[h"
	Public Sub New()
		MyBase.New()
		If m_vb6FormDefInstance Is Nothing Then
			If m_InitializingDefInstance Then
				m_vb6FormDefInstance = Me
			Else
				Try 
					'X^[gAbv tH[ɂẮAŏɍ쐬ꂽCX^XCX^XɂȂ܂B
					If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
						m_vb6FormDefInstance = Me
					End If
				Catch
				End Try
			End If
		End If
		'̌ĂяóAWindows tH[ fUCiŕKvłB
		InitializeComponent()
	End Sub
	'Form ́AR|[lgꗗɌ㏈s邽߂ dispose I[o[Ch܂B
	Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)
		If Disposing Then
			If Not components Is Nothing Then
				components.Dispose()
			End If
		End If
		MyBase.Dispose(Disposing)
	End Sub
	'Windows tH[ fUCiŕKvłB
	Private components As System.ComponentModel.IContainer
	Public ToolTip1 As System.Windows.Forms.ToolTip
	Public WithEvents DelimBox As System.Windows.Forms.ComboBox
	Public WithEvents Exit_Renamed As System.Windows.Forms.Button
    Public WithEvents Initialize As System.Windows.Forms.Button
    Public WithEvents Timer1 As System.Windows.Forms.Timer
	Public WithEvents YrDevice As System.Windows.Forms.ComboBox
	Public WithEvents Srq As System.Windows.Forms.RadioButton
	Public WithEvents Timer_Renamed As System.Windows.Forms.RadioButton
	Public WithEvents Frame2 As System.Windows.Forms.GroupBox
	Public WithEvents TextRet As System.Windows.Forms.TextBox
	Public WithEvents ReceiveData As System.Windows.Forms.TextBox
	Public WithEvents SendData As System.Windows.Forms.TextBox
	Public WithEvents YrAdrBox As System.Windows.Forms.ComboBox
	Public WithEvents DelRet As System.Windows.Forms.Button
	Public WithEvents PStart As System.Windows.Forms.Button
	Public WithEvents PStop As System.Windows.Forms.Button
	Public WithEvents Label4 As System.Windows.Forms.Label
	Public WithEvents Label3 As System.Windows.Forms.Label
	Public WithEvents Label2 As System.Windows.Forms.Label
	Public WithEvents Label1 As System.Windows.Forms.Label
	Public WithEvents Frame1 As System.Windows.Forms.GroupBox
	Public WithEvents Label6 As System.Windows.Forms.Label
	Public WithEvents Label5 As System.Windows.Forms.Label
	' : ȉ̃vV[W Windows tH[ fUCiŕKvłB
	'Windows tH[ fUCigĕύXł܂B
	'R[hGfB^gďCȂłB


	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
        Me.DelimBox = New System.Windows.Forms.ComboBox()
        Me.Exit_Renamed = New System.Windows.Forms.Button()
        Me.Initialize = New System.Windows.Forms.Button()
        Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
        Me.YrDevice = New System.Windows.Forms.ComboBox()
        Me.Frame1 = New System.Windows.Forms.GroupBox()
        Me.Frame2 = New System.Windows.Forms.GroupBox()
        Me.Srq = New System.Windows.Forms.RadioButton()
        Me.Timer_Renamed = New System.Windows.Forms.RadioButton()
        Me.TextRet = New System.Windows.Forms.TextBox()
        Me.ReceiveData = New System.Windows.Forms.TextBox()
        Me.SendData = New System.Windows.Forms.TextBox()
        Me.YrAdrBox = New System.Windows.Forms.ComboBox()
        Me.DelRet = New System.Windows.Forms.Button()
        Me.PStart = New System.Windows.Forms.Button()
        Me.PStop = New System.Windows.Forms.Button()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.Label6 = New System.Windows.Forms.Label()
        Me.Label5 = New System.Windows.Forms.Label()
        Me.Frame1.SuspendLayout()
        Me.Frame2.SuspendLayout()
        Me.SuspendLayout()
        '
        'DelimBox
        '
        Me.DelimBox.BackColor = System.Drawing.SystemColors.Window
        Me.DelimBox.Cursor = System.Windows.Forms.Cursors.Default
        Me.DelimBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.DelimBox.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.DelimBox.ForeColor = System.Drawing.SystemColors.WindowText
        Me.DelimBox.Items.AddRange(New Object() {"gp", "CR+LF", "CR", "LF"})
        Me.DelimBox.Location = New System.Drawing.Point(200, 280)
        Me.DelimBox.Name = "DelimBox"
        Me.DelimBox.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.DelimBox.Size = New System.Drawing.Size(105, 23)
        Me.DelimBox.TabIndex = 20
        '
        'Exit_Renamed
        '
        Me.Exit_Renamed.BackColor = System.Drawing.SystemColors.Control
        Me.Exit_Renamed.Cursor = System.Windows.Forms.Cursors.Default
        Me.Exit_Renamed.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.Exit_Renamed.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Exit_Renamed.Location = New System.Drawing.Point(440, 280)
        Me.Exit_Renamed.Name = "Exit_Renamed"
        Me.Exit_Renamed.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Exit_Renamed.Size = New System.Drawing.Size(103, 29)
        Me.Exit_Renamed.TabIndex = 12
        Me.Exit_Renamed.Text = "I(&X)"
        '
        'Initialize
        '
        Me.Initialize.BackColor = System.Drawing.SystemColors.Control
        Me.Initialize.Cursor = System.Windows.Forms.Cursors.Default
        Me.Initialize.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.Initialize.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Initialize.Location = New System.Drawing.Point(8, 280)
        Me.Initialize.Name = "Initialize"
        Me.Initialize.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Initialize.Size = New System.Drawing.Size(105, 29)
        Me.Initialize.TabIndex = 10
        Me.Initialize.Text = "(&I)"
        '
        'Timer1
        '
        '
        'YrDevice
        '
        Me.YrDevice.BackColor = System.Drawing.SystemColors.Window
        Me.YrDevice.Cursor = System.Windows.Forms.Cursors.Default
        Me.YrDevice.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.YrDevice.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.YrDevice.ForeColor = System.Drawing.SystemColors.WindowText
        Me.YrDevice.Location = New System.Drawing.Point(106, 12)
        Me.YrDevice.Name = "YrDevice"
        Me.YrDevice.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.YrDevice.Size = New System.Drawing.Size(437, 23)
        Me.YrDevice.TabIndex = 0
        '
        'Frame1
        '
        Me.Frame1.BackColor = System.Drawing.SystemColors.Control
        Me.Frame1.Controls.AddRange(New System.Windows.Forms.Control() {Me.Frame2, Me.TextRet, Me.ReceiveData, Me.SendData, Me.YrAdrBox, Me.DelRet, Me.PStart, Me.PStop, Me.Label4, Me.Label3, Me.Label2, Me.Label1})
        Me.Frame1.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.Frame1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame1.Location = New System.Drawing.Point(8, 44)
        Me.Frame1.Name = "Frame1"
        Me.Frame1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame1.Size = New System.Drawing.Size(535, 221)
        Me.Frame1.TabIndex = 13
        Me.Frame1.TabStop = False
        Me.Frame1.Text = "MJn^~"
        '
        'Frame2
        '
        Me.Frame2.BackColor = System.Drawing.SystemColors.Control
        Me.Frame2.Controls.AddRange(New System.Windows.Forms.Control() {Me.Srq, Me.Timer_Renamed})
        Me.Frame2.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.Frame2.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame2.Location = New System.Drawing.Point(12, 160)
        Me.Frame2.Name = "Frame2"
        Me.Frame2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame2.Size = New System.Drawing.Size(153, 49)
        Me.Frame2.TabIndex = 19
        Me.Frame2.TabStop = False
        Me.Frame2.Text = "M^C~O"
        '
        'Srq
        '
        Me.Srq.BackColor = System.Drawing.SystemColors.Control
        Me.Srq.Cursor = System.Windows.Forms.Cursors.Default
        Me.Srq.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.Srq.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Srq.Location = New System.Drawing.Point(72, 14)
        Me.Srq.Name = "Srq"
        Me.Srq.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Srq.Size = New System.Drawing.Size(77, 31)
        Me.Srq.TabIndex = 7
        Me.Srq.TabStop = True
        Me.Srq.Text = "On SRQ"
        '
        'Timer_Renamed
        '
        Me.Timer_Renamed.BackColor = System.Drawing.SystemColors.Control
        Me.Timer_Renamed.Cursor = System.Windows.Forms.Cursors.Default
        Me.Timer_Renamed.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.Timer_Renamed.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Timer_Renamed.Location = New System.Drawing.Point(8, 16)
        Me.Timer_Renamed.Name = "Timer_Renamed"
        Me.Timer_Renamed.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Timer_Renamed.Size = New System.Drawing.Size(67, 25)
        Me.Timer_Renamed.TabIndex = 6
        Me.Timer_Renamed.TabStop = True
        Me.Timer_Renamed.Text = "Timer"
        '
        'TextRet
        '
        Me.TextRet.AcceptsReturn = True
        Me.TextRet.AutoSize = False
        Me.TextRet.BackColor = System.Drawing.SystemColors.Window
        Me.TextRet.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.TextRet.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.TextRet.ForeColor = System.Drawing.SystemColors.WindowText
        Me.TextRet.Location = New System.Drawing.Point(180, 92)
        Me.TextRet.MaxLength = 0
        Me.TextRet.Name = "TextRet"
        Me.TextRet.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.TextRet.Size = New System.Drawing.Size(343, 24)
        Me.TextRet.TabIndex = 3
        Me.TextRet.Text = ""
        '
        'ReceiveData
        '
        Me.ReceiveData.AcceptsReturn = True
        Me.ReceiveData.AutoSize = False
        Me.ReceiveData.BackColor = System.Drawing.SystemColors.Window
        Me.ReceiveData.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.ReceiveData.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.ReceiveData.ForeColor = System.Drawing.SystemColors.WindowText
        Me.ReceiveData.Location = New System.Drawing.Point(180, 56)
        Me.ReceiveData.MaxLength = 0
        Me.ReceiveData.Name = "ReceiveData"
        Me.ReceiveData.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.ReceiveData.Size = New System.Drawing.Size(343, 24)
        Me.ReceiveData.TabIndex = 2
        Me.ReceiveData.Text = ""
        '
        'SendData
        '
        Me.SendData.AcceptsReturn = True
        Me.SendData.AutoSize = False
        Me.SendData.BackColor = System.Drawing.SystemColors.Window
        Me.SendData.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.SendData.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.SendData.ForeColor = System.Drawing.SystemColors.WindowText
        Me.SendData.Location = New System.Drawing.Point(180, 20)
        Me.SendData.MaxLength = 0
        Me.SendData.Name = "SendData"
        Me.SendData.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.SendData.Size = New System.Drawing.Size(343, 24)
        Me.SendData.TabIndex = 1
        Me.SendData.Text = ""
        '
        'YrAdrBox
        '
        Me.YrAdrBox.BackColor = System.Drawing.SystemColors.Window
        Me.YrAdrBox.Cursor = System.Windows.Forms.Cursors.Default
        Me.YrAdrBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.YrAdrBox.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.YrAdrBox.ForeColor = System.Drawing.SystemColors.WindowText
        Me.YrAdrBox.Location = New System.Drawing.Point(180, 126)
        Me.YrAdrBox.Name = "YrAdrBox"
        Me.YrAdrBox.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.YrAdrBox.Size = New System.Drawing.Size(53, 23)
        Me.YrAdrBox.TabIndex = 4
        '
        'DelRet
        '
        Me.DelRet.BackColor = System.Drawing.SystemColors.Control
        Me.DelRet.Cursor = System.Windows.Forms.Cursors.Default
        Me.DelRet.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.DelRet.ForeColor = System.Drawing.SystemColors.ControlText
        Me.DelRet.Location = New System.Drawing.Point(356, 124)
        Me.DelRet.Name = "DelRet"
        Me.DelRet.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.DelRet.Size = New System.Drawing.Size(169, 29)
        Me.DelRet.TabIndex = 5
        Me.DelRet.Text = "߂l(&D)"
        '
        'PStart
        '
        Me.PStart.BackColor = System.Drawing.SystemColors.Control
        Me.PStart.Cursor = System.Windows.Forms.Cursors.Default
        Me.PStart.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.PStart.ForeColor = System.Drawing.SystemColors.ControlText
        Me.PStart.Location = New System.Drawing.Point(180, 160)
        Me.PStart.Name = "PStart"
        Me.PStart.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.PStart.Size = New System.Drawing.Size(169, 51)
        Me.PStart.TabIndex = 8
        Me.PStart.Text = "f[^MJn(&S)"
        '
        'PStop
        '
        Me.PStop.BackColor = System.Drawing.SystemColors.Control
        Me.PStop.Cursor = System.Windows.Forms.Cursors.Default
        Me.PStop.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.PStop.ForeColor = System.Drawing.SystemColors.ControlText
        Me.PStop.Location = New System.Drawing.Point(356, 160)
        Me.PStop.Name = "PStop"
        Me.PStop.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.PStop.Size = New System.Drawing.Size(169, 51)
        Me.PStop.TabIndex = 9
        Me.PStop.Text = "f[^M~(&E)"
        '
        'Label4
        '
        Me.Label4.BackColor = System.Drawing.SystemColors.Control
        Me.Label4.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label4.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.Label4.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label4.Location = New System.Drawing.Point(14, 96)
        Me.Label4.Name = "Label4"
        Me.Label4.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label4.Size = New System.Drawing.Size(131, 19)
        Me.Label4.TabIndex = 17
        Me.Label4.Text = "߂l(Xe[^X)"
        '
        'Label3
        '
        Me.Label3.BackColor = System.Drawing.SystemColors.Control
        Me.Label3.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label3.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.Label3.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label3.Location = New System.Drawing.Point(12, 60)
        Me.Label3.Name = "Label3"
        Me.Label3.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label3.Size = New System.Drawing.Size(113, 15)
        Me.Label3.TabIndex = 16
        Me.Label3.Text = "Mf[^"
        '
        'Label2
        '
        Me.Label2.BackColor = System.Drawing.SystemColors.Control
        Me.Label2.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label2.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.Label2.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label2.Location = New System.Drawing.Point(12, 24)
        Me.Label2.Name = "Label2"
        Me.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label2.Size = New System.Drawing.Size(156, 15)
        Me.Label2.TabIndex = 15
        Me.Label2.Text = "Mf[^(e)"
        '
        'Label1
        '
        Me.Label1.BackColor = System.Drawing.SystemColors.Control
        Me.Label1.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label1.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.Label1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label1.Location = New System.Drawing.Point(14, 132)
        Me.Label1.Name = "Label1"
        Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label1.Size = New System.Drawing.Size(153, 19)
        Me.Label1.TabIndex = 14
        Me.Label1.Text = "@̃AhX"
        '
        'Label6
        '
        Me.Label6.BackColor = System.Drawing.SystemColors.Control
        Me.Label6.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label6.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.Label6.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label6.Location = New System.Drawing.Point(128, 280)
        Me.Label6.Name = "Label6"
        Me.Label6.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label6.Size = New System.Drawing.Size(57, 17)
        Me.Label6.TabIndex = 21
        Me.Label6.Text = "f~^"
        '
        'Label5
        '
        Me.Label5.BackColor = System.Drawing.SystemColors.Control
        Me.Label5.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label5.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.Label5.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label5.Location = New System.Drawing.Point(20, 16)
        Me.Label5.Name = "Label5"
        Me.Label5.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label5.Size = New System.Drawing.Size(85, 19)
        Me.Label5.TabIndex = 18
        Me.Label5.Text = "@햼"
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 12)
        Me.ClientSize = New System.Drawing.Size(554, 315)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.DelimBox, Me.Exit_Renamed, Me.Initialize, Me.YrDevice, Me.Frame1, Me.Label6, Me.Label5})
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.Location = New System.Drawing.Point(179, 103)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "Form1"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.Manual
        Me.Text = "}`[^"
        Me.Frame1.ResumeLayout(False)
        Me.Frame2.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub
#End Region 
#Region "AbvO[h EBU[h̃T|[g R[h"
	Private Shared m_vb6FormDefInstance As Form1
	Private Shared m_InitializingDefInstance As Boolean
	Public Shared Property DefInstance() As Form1
		Get
			If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
				m_InitializingDefInstance = True
				m_vb6FormDefInstance = New Form1()
				m_InitializingDefInstance = False
			End If
			DefInstance = m_vb6FormDefInstance
		End Get
		Set
			m_vb6FormDefInstance = Value
		End Set
	End Property
#End Region 
	Dim SendBuf As String								'Mobt@
	Dim RecvBuf As New String("", 10000)				'Mobt@
	Dim bTimerOn As Short								'^C}Iꂽ
	Dim SrqOn As Short									'On SRQŎs
	Dim MsgNum As Integer								'bZ[W̃nh
	Dim Pstb(15) As Integer								'Xe[^XoCg̔z
	Dim Adrs As Integer									'AhX쐬Ɏgp
	Dim ErrText As String								'eLXg\p
	Dim Srlen As Integer								'̒
	Dim Delim As Integer								'f~^
	Dim gChCmd As GCHandle								'CmdzpGCHandle
	Dim gChPstb As GCHandle								'PstbzpGCHandle
	Dim pPstb As IntPtr									'PstbzpIntPtr
	Private Sub DelimBox_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles DelimBox.SelectedIndexChanged

		Eoi = 1											'Eoi = 0:gpȂ/1:gp

		Delim = DelimBox.SelectedIndex
		Ret = GpDelim(Delim, Eoi)						'f~^R[h(EOI)o̎w܂B(w肵ȂĂł)

	End Sub


	'///// [ tH[[h ] /////////////////////////////////////////////////////////////////
	Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load

		For Adrs = 0 To 30								'@AhX̍쐬
			YrAdrBox.Items.Add(CStr(Adrs))
		Next Adrs

		YrDevice.Items.Add("[ ADVANTEST R6871E Digital MultiMeter ]")
		YrDevice.Items.Add("[ Sanwa Digital Multimeter 9300MF ]")
		YrDevice.Items.Add("[ Iwatsu Digital Multimeter SC-7404 ]")

		YrAdrBox.Text = CStr(2)							'ݒ
		SendData.Text = "R0"							'ݒ
		Timer_Renamed.Checked = True					'ݒ.WI{^[Timer]I
		YrDevice.SelectedIndex = 0						'߂ADVANTESTI
		DelimBox.SelectedIndex = 1						'ݒ

		'PinnednhCmdɕz
		If gChCmd.IsAllocated = False Then
			gChCmd = GCHandle.Alloc(Cmd, GCHandleType.Pinned)
		End If
		'PinnednhPstbɕz
		If gChPstb.IsAllocated = False Then
			gChPstb = GCHandle.Alloc(Pstb, GCHandleType.Pinned)
		End If
		'PinnednhŃIuWFNg̃AhX擾
		pCmd = gChCmd.AddrOfPinnedObject()
		pPstb = gChPstb.AddrOfPinnedObject()

	End Sub

	'///// [  ] /////////////////////////////////////////////////////////////////////////
	Private Sub Initialize_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Initialize.Click

		Ret = GpibInit(ErrText)
		If (Ret = 1) Then GoTo Err_Renamed
		If YrAdrBox.Items.Count = 31 Then				'}CAhXXg폜܂B
			YrAdrBox.Items.RemoveAt((MyAddr))
			If MyAddr = YrAddr Then
				YrAdrBox.SelectedIndex = 0
			End If
		End If

		SendBuf = SendData.Text
		Srlen = Len(SendBuf)							'Mf[^̒
		If Srlen = 0 Then
			ErrText = "Mf[^܂B"
			GoTo Err_Renamed
		End If

		Cmd(0) = 2
		Cmd(1) = MyAddr
		Cmd(2) = YrAddr
		Ret = GpTalk(pCmd, Srlen, SendBuf)				'f[^𑗐M
		If CheckRet("GpTalk", Ret, ErrText) = 1 Then GoTo Err_Renamed

		ErrText = "f[^M܂B"			'I

		Call DelimBox_SelectedIndexChanged(DelimBox, New System.EventArgs())

Err_Renamed:
		TextRet.Text = ErrText

	End Sub


	'///// [ |[OJn ] /////////////////////////////////////////////////////////////////
	Private Sub PStart_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles PStart.Click

		MsgNum = &H430S		   '[U[`ł̂(&H400 - &H7FFF)łB
		If Timer_Renamed.Checked = True Then		 '^C}I
			If bTimerOn = 0 Then
				Timer1.Enabled = True
				bTimerOn = 1
			End If
		Else
			SrqOn = 1			   'ON SRQI
			Ret = GpSetEventSrq(Handle.ToInt32, MsgNum, SrqOn)
			If CheckRet("GpSetEventSrq", Ret, ErrText) = 1 Then GoTo Err_Renamed
			Ret = GpSetEvent(SrqOn)
			If CheckRet("GpSetEvent", Ret, ErrText) = 1 Then GoTo Err_Renamed
			Ret = GpGet(YrAddr)			 '@ɑ΂ĢGET𑗏o
			If CheckRet("GpGet", Ret, ErrText) = 1 Then
				SrqOn = 0				 'G[̏ꍇCxg~܂B
				Ret = GpSetEvent(SrqOn)
				If CheckRet("GpSetEvent", Ret, ErrText) = 1 Then GoTo Err_Renamed
			End If
		End If

Err_Renamed:
		TextRet.Text = ErrText

	End Sub

	'///// [ |[O~ ] /////////////////////////////////////////////////////////////////
	Private Sub PStop_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles PStop.Click

		TextRet.Text = "f[^M~܂B"
		SrqOn = 0										'Cxg̒~
		Ret = GpSetEvent(SrqOn)

		bTimerOn = 0
		Timer1.Enabled = False							'^C}̒~

	End Sub

	'///// [ ^C} ] /////////////////////////////////////////////////////////////////////////
	Private Sub Timer1_Tick(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Timer1.Tick
		'^C}̑x̓vpeBEBhEIntervalς邱Ƃɂđς܂

		Dim ChkSrq As Integer							'SRQ̃`FbNp
		Dim ErrChk As Short								'G[̃`FbNp

		For Cnt = 0 To 15								'KĂB
			Pstb(Cnt) = 0								'p[^
		Next
		ErrChk = 0										'ݒ

		Ret = GpGet(YrAddr)								'@ɑ΂ĢGetR}h܂B
		If CheckRet("GpGet", Ret, ErrText) = 1 Then ErrChk = 1 : GoTo ErrJump
		ChkSrq = 0										'ChkSrq܂B
		While (ChkSrq = 0)								'ChkSrqO͖̎[vɂȂ܂B
			If (EscCheck() = 1) Then					'[ESC]L[oꍇ̓[v𔲂܂B
				ErrChk = 1 : ErrText = "[ESC]L[܂B"
				GoTo ErrJump
			End If
			Ret = GpBoardsts(&H12S, ChkSrq)				'ChkSrq̏(SRQoĂ邩)擾܂B
			If CheckRet("GpBoardsts", Ret, ErrText) = 1 Then ErrChk = 1 : GoTo ErrJump
		End While

		Do
			Cmd(0) = 1									'R}h
			Cmd(1) = YrAddr								'@AhX
			Ret = GpPoll(pCmd, pPstb)					'|[O܂B
			GpWaittime(10)
			If Timer1.Enabled = False Then
				Exit Do
			End If
		Loop While Ret = 128

		If CheckRet("GpPoll", Ret, ErrText) = 1 Then ErrChk = 1 : GoTo ErrJump

		Cmd(0) = 2										'R}h
		Cmd(1) = YrAddr									'@AhX
		Cmd(2) = MyAddr									'}CAhX
		Srlen = Len(RecvBuf)							'RecvBuf̃f[^𑪂Ă܂
		Ret = GpListen(pCmd, Srlen, RecvBuf)			'f[^M܂B
		If CheckRet("GpListen", Ret, ErrText) = 1 Then ErrChk = 1 : GoTo ErrJump
		Cmd(0) = 2										'g[J{Xi̐
		Cmd(1) = &H3FS									'AX^UNL
		Cmd(2) = &H5FS									'Ag[N^UNT
		Ret = GpComand(pCmd)							'R}h𑗐M
		If CheckRet("GpComand", Ret, ErrText) = 1 Then ErrChk = 1 : GoTo ErrJump
		If Srlen = 0 Then GoTo GetData 'f[^Ȍꍇ
		ReceiveData.Text = VB.Left(RecvBuf, Srlen)		'Mf[^\܂B

GetData:
		TextRet.Text = "f[^ [ " & Srlen & " ] oCgM܂B"

ErrJump:  'G[Ƃ̏
		Cmd(0) = 2										'R}h
		Cmd(1) = &H3FS									'AX^UNL
		Cmd(2) = &H5FS									'Ag[N^UNT
		Ret = GpComand(pCmd)							'R}hM
		If ErrChk = 1 Then								'G[΃^C}~
			Call PStop_Click(PStop, New System.EventArgs())
			TextRet.Text = ErrText : TextRet.Refresh()
		End If

	End Sub

	Private Sub DelRet_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles DelRet.Click	'[ ߂l ]

		TextRet.Text = ""

	End Sub

	Private Sub YrAdrBox_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles YrAdrBox.SelectedIndexChanged	'[ @ύX ]

		YrAddr = CInt(YrAdrBox.Text)

	End Sub

	Private Sub YrDevice_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles YrDevice.SelectedIndexChanged	'[ @햼ɂđMf[^ύX ]
		Select Case (YrDevice.SelectedIndex)			'M@̐ݒ
			Case 0
				SendData.Text = "F1R5M2IT1DL0RE7BZ1S0"	'AhoeXg/Advantest
			Case 1
				SendData.Text = "F1R0I0C1"				'T/Sanwa
			Case 2
				SendData.Text = "R0"					'/Iwatsu
		End Select

	End Sub

	Private Sub Exit_Renamed_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Exit_Renamed.Click	'[ I ]

		Ret = GpibExit()
		Me.Close()										'̃vOI܂

	End Sub

	'///// [ SRQŎM ] //////////////////////////////////////////////////////////////////
	Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)

		If m.Msg = MsgNum Then
			Dim ErrOccured As Short

			ReceiveData.Text = ""
			For Cnt = 0 To 15
				Pstb(Cnt) = 0
			Next
			ErrOccured = 0

			Cmd(0) = 1
			Cmd(1) = YrAddr
			Ret = GpPoll(pCmd, pPstb)					'VA|[̎s
			If CheckRet("GpPoll", Ret, ErrText) = 1 Then ErrOccured = 1 : GoTo JumpEnd
			Cmd(0) = 2
			Cmd(1) = YrAddr
			Cmd(2) = MyAddr
			Srlen = 10000
			Ret = GpListen(pCmd, Srlen, RecvBuf)		'M̎s
			If CheckRet("GpListen", Ret, ErrText) = 1 Then ErrOccured = 1 : GoTo JumpEnd
			Cmd(0) = 2									'R}h
			Cmd(1) = &H3FS								'AX^UNL
			Cmd(2) = &H5FS								'Ag[N^UNT
			Ret = GpComand(pCmd)						'R}hM
			If CheckRet("GpComand", Ret, ErrText) = 1 Then ErrOccured = 1 : GoTo JumpEnd
			If Srlen <> 0 Then
				ReceiveData.Text = VB.Left(RecvBuf, Srlen)
			End If
			Ret = GpGet(YrAddr)							'@ɢGET
			If CheckRet("GpGet", Ret, ErrText) = 1 Then ErrOccured = 1 : GoTo JumpEnd
			ErrText = "f[^ [ " & Srlen & " ] oCgM܂B"

JumpEnd:
			If ErrOccured = 1 Then
				SrqOn = 0
				Ret = GpSetEventSrq(Handle.ToInt32, &H430S, SrqOn)	'Cxg̒~
				Cmd(0) = 2								'R}h
				Cmd(1) = &H3FS							'AX^UNL
				Cmd(2) = &H5FS							'Ag[N^UNT
				Ret = GpComand(pCmd)					'R}hM
			Else
				Ret = GpEnableNextEvent()				'̃CxgLɂ
			End If

			TextRet.Text = ErrText
		End If

		MyBase.WndProc(m)
	End Sub

	Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed

		'GCHandlẻ
		If gChCmd.IsAllocated = True Then
			gChCmd.Free()
		End If
		If gChPstb.IsAllocated = True Then
			gChPstb.Free()
		End If

	End Sub
End Class