Option Strict Off
Option Explicit On 
Imports System.Runtime.InteropServices
Friend Class Parallel
	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 DelRet As System.Windows.Forms.Button
	Public WithEvents TextRet As System.Windows.Forms.TextBox
	Public WithEvents PollDel As System.Windows.Forms.Button
	Public WithEvents Exit_Renamed As System.Windows.Forms.Button
    Public WithEvents Initialize As System.Windows.Forms.Button
    Public WithEvents YrAdrBox2 As System.Windows.Forms.ComboBox
	Public WithEvents Label5 As System.Windows.Forms.Label
	Public WithEvents Frame3 As System.Windows.Forms.GroupBox
	Public WithEvents PollSts As System.Windows.Forms.TextBox
	Public WithEvents PollGo As System.Windows.Forms.TextBox
	Public WithEvents PollSet As System.Windows.Forms.TextBox
	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 Frame2 As System.Windows.Forms.GroupBox
	Public WithEvents YrAdrBox1 As System.Windows.Forms.ComboBox
	Public WithEvents Label4 As System.Windows.Forms.Label
	Public WithEvents Frame1 As System.Windows.Forms.GroupBox
	Public WithEvents Polling As System.Windows.Forms.Button
	Public WithEvents Label6 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.DelRet = New System.Windows.Forms.Button()
        Me.TextRet = New System.Windows.Forms.TextBox()
        Me.PollDel = New System.Windows.Forms.Button()
        Me.Exit_Renamed = New System.Windows.Forms.Button()
        Me.Initialize = New System.Windows.Forms.Button()
        Me.Frame3 = New System.Windows.Forms.GroupBox()
        Me.YrAdrBox2 = New System.Windows.Forms.ComboBox()
        Me.Label5 = New System.Windows.Forms.Label()
        Me.Frame2 = New System.Windows.Forms.GroupBox()
        Me.PollSts = New System.Windows.Forms.TextBox()
        Me.PollGo = New System.Windows.Forms.TextBox()
        Me.PollSet = New System.Windows.Forms.TextBox()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.Frame1 = New System.Windows.Forms.GroupBox()
        Me.YrAdrBox1 = New System.Windows.Forms.ComboBox()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.Polling = New System.Windows.Forms.Button()
        Me.Label6 = New System.Windows.Forms.Label()
        Me.Frame3.SuspendLayout()
        Me.Frame2.SuspendLayout()
        Me.Frame1.SuspendLayout()
        Me.SuspendLayout()
        '
        '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(456, 200)
        Me.DelRet.Name = "DelRet"
        Me.DelRet.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.DelRet.Size = New System.Drawing.Size(86, 35)
        Me.DelRet.TabIndex = 3
        Me.DelRet.Text = "(&R)"
        '
        '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(66, 202)
        Me.TextRet.MaxLength = 0
        Me.TextRet.Name = "TextRet"
        Me.TextRet.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.TextRet.Size = New System.Drawing.Size(385, 27)
        Me.TextRet.TabIndex = 8
        Me.TextRet.Text = ""
        '
        'PollDel
        '
        Me.PollDel.BackColor = System.Drawing.SystemColors.Control
        Me.PollDel.Cursor = System.Windows.Forms.Cursors.Default
        Me.PollDel.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.PollDel.ForeColor = System.Drawing.SystemColors.ControlText
        Me.PollDel.Location = New System.Drawing.Point(358, 18)
        Me.PollDel.Name = "PollDel"
        Me.PollDel.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.PollDel.Size = New System.Drawing.Size(83, 33)
        Me.PollDel.TabIndex = 4
        Me.PollDel.Text = "(&D)"
        '
        '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(456, 152)
        Me.Exit_Renamed.Name = "Exit_Renamed"
        Me.Exit_Renamed.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Exit_Renamed.Size = New System.Drawing.Size(86, 35)
        Me.Exit_Renamed.TabIndex = 2
        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(456, 16)
        Me.Initialize.Name = "Initialize"
        Me.Initialize.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Initialize.Size = New System.Drawing.Size(86, 35)
        Me.Initialize.TabIndex = 0
        Me.Initialize.Text = "(&I)"
        '
        'Frame3
        '
        Me.Frame3.BackColor = System.Drawing.SystemColors.Control
        Me.Frame3.Controls.AddRange(New System.Windows.Forms.Control() {Me.YrAdrBox2, Me.Label5})
        Me.Frame3.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.Frame3.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame3.Location = New System.Drawing.Point(200, 236)
        Me.Frame3.Name = "Frame3"
        Me.Frame3.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame3.Size = New System.Drawing.Size(191, 53)
        Me.Frame3.TabIndex = 18
        Me.Frame3.TabStop = False
        Me.Frame3.Text = "^[QbgQ"
        '
        'YrAdrBox2
        '
        Me.YrAdrBox2.BackColor = System.Drawing.SystemColors.Window
        Me.YrAdrBox2.Cursor = System.Windows.Forms.Cursors.Default
        Me.YrAdrBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.YrAdrBox2.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.YrAdrBox2.ForeColor = System.Drawing.SystemColors.WindowText
        Me.YrAdrBox2.Location = New System.Drawing.Point(128, 18)
        Me.YrAdrBox2.Name = "YrAdrBox2"
        Me.YrAdrBox2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.YrAdrBox2.Size = New System.Drawing.Size(53, 23)
        Me.YrAdrBox2.TabIndex = 10
        '
        '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(14, 22)
        Me.Label5.Name = "Label5"
        Me.Label5.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label5.Size = New System.Drawing.Size(103, 19)
        Me.Label5.TabIndex = 19
        Me.Label5.Text = "@AhX ="
        '
        'Frame2
        '
        Me.Frame2.BackColor = System.Drawing.SystemColors.Control
        Me.Frame2.Controls.AddRange(New System.Windows.Forms.Control() {Me.PollSts, Me.PollGo, Me.PollSet, Me.Label3, Me.Label2, Me.Label1})
        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(8, 4)
        Me.Frame2.Name = "Frame2"
        Me.Frame2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame2.Size = New System.Drawing.Size(443, 189)
        Me.Frame2.TabIndex = 13
        Me.Frame2.TabStop = False
        Me.Frame2.Text = "p|[̏ڍ(߂l)"
        '
        'PollSts
        '
        Me.PollSts.AcceptsReturn = True
        Me.PollSts.AutoSize = False
        Me.PollSts.BackColor = System.Drawing.SystemColors.Window
        Me.PollSts.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.PollSts.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.PollSts.ForeColor = System.Drawing.SystemColors.WindowText
        Me.PollSts.Location = New System.Drawing.Point(10, 148)
        Me.PollSts.MaxLength = 0
        Me.PollSts.Name = "PollSts"
        Me.PollSts.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.PollSts.Size = New System.Drawing.Size(425, 24)
        Me.PollSts.TabIndex = 7
        Me.PollSts.Text = ""
        '
        'PollGo
        '
        Me.PollGo.AcceptsReturn = True
        Me.PollGo.AutoSize = False
        Me.PollGo.BackColor = System.Drawing.SystemColors.Window
        Me.PollGo.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.PollGo.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.PollGo.ForeColor = System.Drawing.SystemColors.WindowText
        Me.PollGo.Location = New System.Drawing.Point(10, 100)
        Me.PollGo.MaxLength = 0
        Me.PollGo.Name = "PollGo"
        Me.PollGo.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.PollGo.Size = New System.Drawing.Size(425, 24)
        Me.PollGo.TabIndex = 6
        Me.PollGo.Text = ""
        '
        'PollSet
        '
        Me.PollSet.AcceptsReturn = True
        Me.PollSet.AutoSize = False
        Me.PollSet.BackColor = System.Drawing.SystemColors.Window
        Me.PollSet.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.PollSet.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.PollSet.ForeColor = System.Drawing.SystemColors.WindowText
        Me.PollSet.Location = New System.Drawing.Point(10, 52)
        Me.PollSet.MaxLength = 0
        Me.PollSet.Name = "PollSet"
        Me.PollSet.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.PollSet.Size = New System.Drawing.Size(425, 24)
        Me.PollSet.TabIndex = 5
        Me.PollSet.Text = ""
        '
        '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, 130)
        Me.Label3.Name = "Label3"
        Me.Label3.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label3.Size = New System.Drawing.Size(185, 19)
        Me.Label3.TabIndex = 16
        Me.Label3.Text = "p|[Xe[^X"
        '
        '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, 82)
        Me.Label2.Name = "Label2"
        Me.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label2.Size = New System.Drawing.Size(147, 19)
        Me.Label2.TabIndex = 15
        Me.Label2.Text = "p|[s"
        '
        '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(12, 34)
        Me.Label1.Name = "Label1"
        Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label1.Size = New System.Drawing.Size(151, 19)
        Me.Label1.TabIndex = 14
        Me.Label1.Text = "p|[ݒ"
        '
        'Frame1
        '
        Me.Frame1.BackColor = System.Drawing.SystemColors.Control
        Me.Frame1.Controls.AddRange(New System.Windows.Forms.Control() {Me.YrAdrBox1, Me.Label4})
        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, 236)
        Me.Frame1.Name = "Frame1"
        Me.Frame1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame1.Size = New System.Drawing.Size(183, 53)
        Me.Frame1.TabIndex = 12
        Me.Frame1.TabStop = False
        Me.Frame1.Text = "^[QbgP"
        '
        'YrAdrBox1
        '
        Me.YrAdrBox1.BackColor = System.Drawing.SystemColors.Window
        Me.YrAdrBox1.Cursor = System.Windows.Forms.Cursors.Default
        Me.YrAdrBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.YrAdrBox1.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.YrAdrBox1.ForeColor = System.Drawing.SystemColors.WindowText
        Me.YrAdrBox1.Location = New System.Drawing.Point(122, 18)
        Me.YrAdrBox1.Name = "YrAdrBox1"
        Me.YrAdrBox1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.YrAdrBox1.Size = New System.Drawing.Size(53, 23)
        Me.YrAdrBox1.TabIndex = 9
        '
        '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(12, 22)
        Me.Label4.Name = "Label4"
        Me.Label4.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label4.Size = New System.Drawing.Size(103, 19)
        Me.Label4.TabIndex = 17
        Me.Label4.Text = "@AhX ="
        '
        'Polling
        '
        Me.Polling.BackColor = System.Drawing.SystemColors.Control
        Me.Polling.Cursor = System.Windows.Forms.Cursors.Default
        Me.Polling.Font = New System.Drawing.Font("lr oSVbN", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.Polling.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Polling.Location = New System.Drawing.Point(398, 244)
        Me.Polling.Name = "Polling"
        Me.Polling.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Polling.Size = New System.Drawing.Size(141, 45)
        Me.Polling.TabIndex = 11
        Me.Polling.Text = "|[O(&P)"
        '
        '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(8, 210)
        Me.Label6.Name = "Label6"
        Me.Label6.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label6.Size = New System.Drawing.Size(57, 17)
        Me.Label6.TabIndex = 20
        Me.Label6.Text = "߂l"
        '
        'Parallel
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 12)
        Me.ClientSize = New System.Drawing.Size(547, 299)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.DelRet, Me.TextRet, Me.PollDel, Me.Exit_Renamed, Me.Initialize, Me.Frame3, Me.Frame2, Me.Frame1, Me.Polling, Me.Label6})
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.Location = New System.Drawing.Point(183, 168)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "Parallel"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.Manual
        Me.Text = "p|["
        Me.Frame3.ResumeLayout(False)
        Me.Frame2.ResumeLayout(False)
        Me.Frame1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub
#End Region 
#Region "AbvO[h EBU[h̃T|[g R[h"
	Private Shared m_vb6FormDefInstance As Parallel
	Private Shared m_InitializingDefInstance As Boolean
	Public Shared Property DefInstance() As Parallel
		Get
			If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
				m_InitializingDefInstance = True
				m_vb6FormDefInstance = New Parallel()
				m_InitializingDefInstance = False
			End If
			DefInstance = m_vb6FormDefInstance
		End Get
		Set
			m_vb6FormDefInstance = Value
		End Set
	End Property
#End Region 
    Dim Mode As Integer                                     '[h̐ݒ
    Dim Pstb(15) As Integer                                 'Xe[^XoCg̔z
    Dim Pstb2(15) As Integer                                'Qڗp
    Dim PpollData As Integer                                'p|[
    Dim Yradr2 As Integer                                   '@AhXQ
    Dim Cmd2(50) As Integer                                 'bZ[W(R}h)^pŎgp
    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
    Dim gChCmd2 As GCHandle                                 'CmdzpGCHandle
    Dim gChPstb2 As GCHandle                                'PstbzpGCHandle
    Dim pPstb2 As IntPtr                                    'PstbzpIntPtr
    Dim pCmd2 As IntPtr                                     'CmdzpIntPtr
	
	'///// [ tH[[h ] ///////////////////////////////////////////////////////////////////
	Private Sub Parallel_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
		
        For Adrs = 0 To 30                                  '@AhX̍쐬
            YrAdrBox1.Items.Add(CStr(Adrs))
            YrAdrBox2.Items.Add(CStr(Adrs))
        Next Adrs

        YrAdrBox1.Text = CStr(1)                            'ݒ
        YrAdrBox2.Text = CStr(2)                            'ݒ

        'PinnednhCmdɕz
        If gChCmd.IsAllocated = False Then
            gChCmd = GCHandle.Alloc(Cmd, GCHandleType.Pinned)
        End If
        If gChCmd2.IsAllocated = False Then
            gChCmd2 = GCHandle.Alloc(Cmd2, GCHandleType.Pinned)
        End If
        'PinnednhPstbɕz
        If gChPstb.IsAllocated = False Then
            gChPstb = GCHandle.Alloc(Pstb, GCHandleType.Pinned)
        End If
        If gChPstb2.IsAllocated = False Then
            gChPstb2 = GCHandle.Alloc(Pstb2, GCHandleType.Pinned)
        End If
        'PinnednhŃIuWFNg̃AhX擾
        pCmd = gChCmd.AddrOfPinnedObject()
        pCmd2 = gChCmd2.AddrOfPinnedObject()
        pPstb = gChPstb.AddrOfPinnedObject()
        pPstb2 = gChPstb2.AddrOfPinnedObject()
		
	End Sub
	
	'///// [  ] ///////////////////////////////////////////////////////////////////////////
	Private Sub Initialize_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Initialize.Click
		
        Ret = GpibInit(ErrText)                             'SubClassɂ܂B
		If (Ret = 1) Then GoTo Err_Renamed
		Ret = GpBoardsts(&H8s, Mode)
		
        If YrAdrBox1.Items.Count = 31 Then                  '}CAhXXg폜܂B
            YrAdrBox1.Items.RemoveAt((MyAddr))
            YrAdrBox1.SelectedIndex = 0
            YrAdrBox2.Items.RemoveAt((MyAddr))
            YrAdrBox2.SelectedIndex = 1
        End If
        If Mode = 1 Then ErrText = "̋@̓}X^ł͂܂ݒmFĂ"
        GoTo Err_Renamed

Err_Renamed:  'G[oꍇ͕\܂
        TextRet.Text = ErrText
		
	End Sub
	
	'///// [ |[O ] ///////////////////////////////////////////////////////////////////////
	Private Sub Polling_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Polling.Click
		
        Dim Stppu As Integer                                'PPU̐ݒ
		
        PollSet.Text = ""                                   'eLXg̏
		PollGo.Text = ""
		PollSts.Text = ""
		TextRet.Text = ""
		
		For Cnt = 0 To 15
            Pstb(Cnt) = 0                                   'p[^̏
            Pstb2(Cnt) = 0                                  'p[^̏
		Next 
        Cmd(0) = 2                                          'Xi
        Cmd(1) = YrAddr                                     '1ڂ̃Xi
        Cmd(2) = &H69S                                      'C̐U蕪(69H = DIO2)
        Cmd(3) = Yradr2                                     '2ڂ̃Xi
        Cmd(4) = &H6AS                                      'C̐U蕪(6AH = DIO3)
        Stppu = 1                                           'PPU̎gp
		
        Ret = GpStppoll(pCmd, Stppu)                        'p|[̉o͗pC̊t
		If CheckRet("GpStppoll", Ret, ErrText) = 1 Then GoTo Err_Renamed 'GpStppoll̖߂l`FbN
		PollSet.Text = ErrText
		
        Ret = GpExppoll(PpollData)                          'p|[̎s
		If CheckRet("GpExppoll", Ret, ErrText) = 1 Then GoTo Err_Renamed 'GpStppoll̖߂l`FbN
		PollGo.Text = ErrText
		
        Select Case PpollData                               'p|[̌ʂ𕪐
            Case 2                                          'Data Line Bit = 00000010(DIO2)
                Cmd(0) = 1                                  'Xi
                Cmd(1) = YrAddr                             '1ڂ̃Xi
                Ret = GpPoll(pCmd, pPstb)                   'VA|[s
                If CheckRet("GpPoll_1", Ret, ErrText) = 1 Then GoTo Err_Renamed
                PollSts.Text = "g[JAhX=[ " & Cmd(Pstb(0)) & " ]FXe[^XoCg=[ " & Hex(Pstb(Pstb(0))) & " ] H"
            Case 4                                          'Data Line Bit = 00000100(DIO3)
                Cmd(0) = 1                                  'Xi
                Cmd(1) = Yradr2                             '2ڂ̃Xi
                Ret = GpPoll(pCmd, pPstb)                   'VA|[̎s
                If CheckRet("GpPoll_2", Ret, ErrText) = 1 Then GoTo Err_Renamed
                PollSts.Text = "g[JAhX=[ " & Cmd(Pstb(0)) & " ]FXe[^XoCg=[ " & Hex(Pstb(Pstb(0))) & " ] H"
            Case 6                                          'Data Line Bit = 00000110(DIO2 + DIO3)
                Cmd(0) = 1                                  'Xi
                Cmd(1) = YrAddr                             '1ڂ̃AhX
                Ret = GpPoll(pCmd, pPstb)                   'VA|[s
                If CheckRet("GpPoll_1", Ret, ErrText) = 1 Then GoTo Err_Renamed
                Cmd2(0) = 1                                 'Xi
                Cmd2(1) = Yradr2                            '2ڂ̃AhX
                Ret = GpPoll(pCmd2, pPstb2)                 'VA|[̎s
                If CheckRet("GpPoll_2", Ret, ErrText) = 1 Then GoTo Err_Renamed
                PollSts.Text = "g[JAhX=[ " & Cmd(Pstb(0)) & " ]FXe[^XoCg=[ " & Hex(Pstb(Pstb(0))) & " ] H^g[JAhX=[ " & Cmd2(Pstb2(0)) & " ]FXe[^XoCg=[ " & Hex(Pstb2(Pstb2(0))) & " ] H "
            Case Else
                ErrText = "SRQ ͂܂łB"
        End Select

Err_Renamed:
        TextRet.Text = ErrText
		
	End Sub
	
	'///// [ 1ڂ̑@AhX̕ύX ] ////////////////////////////////////////////////////
    Private Sub YrAdrBox1_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles YrAdrBox1.SelectedIndexChanged

        YrAddr = CInt(YrAdrBox1.Text)

    End Sub

    '///// [ 2ڂ̑@AhX̕ύX ] ////////////////////////////////////////////////////
    Private Sub YrAdrBox2_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles YrAdrBox2.SelectedIndexChanged

        Yradr2 = CInt(YrAdrBox2.Text)

    End Sub

    '///// [ |[OeLXg̏ ] /////////////////////////////////////////////////////////
    Private Sub PollDel_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles PollDel.Click

        PollSet.Text = ""
        PollGo.Text = ""
        PollSts.Text = ""

    End Sub

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

        TextRet.Text = ""

    End Sub

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

        Ret = GpibExit()                                    'SubClassɂ܂B
        Me.Close()                                          '̃_CAȌIł

    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
        If gChCmd2.IsAllocated = True Then
            gChCmd2.Free()
        End If
        If gChPstb2.IsAllocated = True Then
            gChPstb2.Free()
        End If
    End Sub

End Class