Option Strict Off
Option Explicit On 
Imports System.Runtime.InteropServices
Imports VB = Microsoft.VisualBasic
Friend Class Form1
	Inherits System.Windows.Forms.Form
#Region "Windows Form Designer generated code "
	Public Sub New()
		MyBase.New()
		If m_vb6FormDefInstance Is Nothing Then
			If m_InitializingDefInstance Then
				m_vb6FormDefInstance = Me
			Else
				Try 
					'For the start-up form, the first instance created is the default instance.
					If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
						m_vb6FormDefInstance = Me
					End If
				Catch
				End Try
			End If
		End If
		'This call is required by the Windows Form Designer.
		InitializeComponent()
	End Sub
	'Form overrides dispose to clean up the component list.
	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
	'Required by the Windows Form Designer
	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
	'NOTE: The following procedure is required by the Windows Form Designer
	'It can be modified using the Windows Form Designer.
	'Do not modify it using the code editor.
    <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("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.DelimBox.ForeColor = System.Drawing.SystemColors.WindowText
        Me.DelimBox.Items.AddRange(New Object() {"Not Use", "CR+LF", "CR", "LF"})
        Me.DelimBox.Location = New System.Drawing.Point(264, 280)
        Me.DelimBox.Name = "DelimBox"
        Me.DelimBox.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.DelimBox.Size = New System.Drawing.Size(97, 21)
        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("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Exit_Renamed.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Exit_Renamed.Location = New System.Drawing.Point(376, 272)
        Me.Exit_Renamed.Name = "Exit_Renamed"
        Me.Exit_Renamed.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Exit_Renamed.Size = New System.Drawing.Size(167, 29)
        Me.Exit_Renamed.TabIndex = 11
        Me.Exit_Renamed.Text = "Exit(&X)"
        '
        'Initialize
        '
        Me.Initialize.BackColor = System.Drawing.SystemColors.Control
        Me.Initialize.Cursor = System.Windows.Forms.Cursors.Default
        Me.Initialize.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Initialize.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Initialize.Location = New System.Drawing.Point(8, 272)
        Me.Initialize.Name = "Initialize"
        Me.Initialize.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Initialize.Size = New System.Drawing.Size(167, 29)
        Me.Initialize.TabIndex = 10
        Me.Initialize.Text = "Initialize(&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("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.YrDevice.ForeColor = System.Drawing.SystemColors.WindowText
        Me.YrDevice.Location = New System.Drawing.Point(132, 12)
        Me.YrDevice.Name = "YrDevice"
        Me.YrDevice.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.YrDevice.Size = New System.Drawing.Size(411, 21)
        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("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, 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 = 12
        Me.Frame1.TabStop = False
        Me.Frame1.Text = "Information"
        '
        '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("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, 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 = 18
        Me.Frame2.TabStop = False
        Me.Frame2.Text = "Receive Timing"
        '
        'Srq
        '
        Me.Srq.BackColor = System.Drawing.SystemColors.Control
        Me.Srq.Cursor = System.Windows.Forms.Cursors.Default
        Me.Srq.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Srq.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Srq.Location = New System.Drawing.Point(72, 20)
        Me.Srq.Name = "Srq"
        Me.Srq.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Srq.Size = New System.Drawing.Size(77, 19)
        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("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Timer_Renamed.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Timer_Renamed.Location = New System.Drawing.Point(6, 18)
        Me.Timer_Renamed.Name = "Timer_Renamed"
        Me.Timer_Renamed.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Timer_Renamed.Size = New System.Drawing.Size(67, 23)
        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("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, 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, 25)
        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("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, 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, 25)
        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("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, 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, 25)
        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("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, 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, 21)
        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("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, 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 = "Delete ReturnCode(&D)"
        '
        'PStart
        '
        Me.PStart.BackColor = System.Drawing.SystemColors.Control
        Me.PStart.Cursor = System.Windows.Forms.Cursors.Default
        Me.PStart.Enabled = False
        Me.PStart.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, 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 = "Receive Start(&S)"
        '
        'PStop
        '
        Me.PStop.BackColor = System.Drawing.SystemColors.Control
        Me.PStop.Cursor = System.Windows.Forms.Cursors.Default
        Me.PStop.Enabled = False
        Me.PStop.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, 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 = "Receive Stop(&E)"
        '
        'Label4
        '
        Me.Label4.BackColor = System.Drawing.SystemColors.Control
        Me.Label4.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, 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(151, 19)
        Me.Label4.TabIndex = 16
        Me.Label4.Text = "Return Code(Status)"
        '
        'Label3
        '
        Me.Label3.BackColor = System.Drawing.SystemColors.Control
        Me.Label3.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, 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 = 15
        Me.Label3.Text = "Receive Data"
        '
        'Label2
        '
        Me.Label2.BackColor = System.Drawing.SystemColors.Control
        Me.Label2.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, 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(125, 17)
        Me.Label2.TabIndex = 14
        Me.Label2.Text = "Send Data(Initial)"
        '
        'Label1
        '
        Me.Label1.BackColor = System.Drawing.SystemColors.Control
        Me.Label1.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, 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(75, 19)
        Me.Label1.TabIndex = 13
        Me.Label1.Text = "Addressing"
        '
        'Label6
        '
        Me.Label6.BackColor = System.Drawing.SystemColors.Control
        Me.Label6.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label6.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label6.Location = New System.Drawing.Point(192, 280)
        Me.Label6.Name = "Label6"
        Me.Label6.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label6.Size = New System.Drawing.Size(65, 17)
        Me.Label6.TabIndex = 19
        Me.Label6.Text = "Delimiter"
        '
        'Label5
        '
        Me.Label5.BackColor = System.Drawing.SystemColors.Control
        Me.Label5.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label5.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label5.Location = New System.Drawing.Point(10, 16)
        Me.Label5.Name = "Label5"
        Me.Label5.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label5.Size = New System.Drawing.Size(119, 19)
        Me.Label5.TabIndex = 17
        Me.Label5.Text = "Address of Device"
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(554, 313)
        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(55, 117)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "Form1"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.Manual
        Me.Text = "MultiMeter"
        Me.Frame1.ResumeLayout(False)
        Me.Frame2.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub
#End Region 
#Region "Upgrade Support "
	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                   'A receiving buffer
    Dim RecvBuf As New String("", 10000)    'A sending buffer
    Dim bTimerOn As Short                   'At a timer selection
    Dim SrqOn As Short                      'On SRQ is used
    Dim MsgNum As Integer                   'Handle of message
    Dim Pstb(15) As Integer                 'An array of status byte
    Dim Adrs As Integer                     'It is used at the of address making
    Dim ErrText As String                   'For a text
    Dim Srlen As Integer                    'A length of a character string
    Dim Delim As Integer                    'Delimiter
    Dim gChCmd As GCHandle                  'GCHandle for cmd array
    Dim gChPstb As GCHandle                 'GCHandle for Pstb array
    Dim pPstb As IntPtr                     'IntPtr for Pstb array

    Private Sub DelimBox_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles DelimBox.SelectedIndexChanged

        Eoi = 1

        Delim = DelimBox.SelectedIndex
        Ret = GpDelim(Delim, Eoi)

    End Sub


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

        For Adrs = 0 To 30                  'Making address of device
            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 ]")

        DelimBox.Text = "CR+LF"
        YrAdrBox.Text = CStr(2)             'Initial setting
        SendData.Text = "R0"                'Initial setting
        Timer_Renamed.Checked = True        'Initial setting/At a timer selection
        YrDevice.SelectedIndex = 0          'First of all at ADVANTEST a selection

        'Specify Pinned handle to Cmd
        If gChCmd.IsAllocated = False Then
            gChCmd = GCHandle.Alloc(Cmd, GCHandleType.Pinned)
        End If
        'Specify Pinned handle to Pstb
        If gChPstb.IsAllocated = False Then
            gChPstb = GCHandle.Alloc(Pstb, GCHandleType.Pinned)
        End If
        'Get address object by Pinned handle
        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 '[ Initialize ]

        Initialize.Enabled = False

        Ret = GpibInit(ErrText)
        If Ret = 1 Then GoTo Err_Renamed
        If YrAdrBox.Items.Count = 31 Then           'At MyAddress from a list delete
            YrAdrBox.Items.RemoveAt((MyAddr))
            If MyAddr = YrAddr Then
                YrAdrBox.SelectedIndex = 0
            End If
        End If

        PStart.Enabled = True

        SendBuf = SendData.Text
        Srlen = Len(SendBuf)                        'A length of transmit data
        If Srlen = 0 Then
            ErrText = "There is not send data."
            PStart.Enabled = False
            PStop.Enabled = False
            GoTo Err_Renamed
        End If

        Cmd(0) = 2
        Cmd(1) = MyAddr
        Cmd(2) = YrAddr
        Ret = GpTalk(pCmd, Srlen, SendBuf)        'At data sending
        If CheckRet("GpTalk", Ret, ErrText) = 1 Then GoTo Err_Renamed

        ErrText = "Initialize was completed."       'Normal termination

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

Err_Renamed:
        TextRet.Text = ErrText
        Initialize.Enabled = True

    End Sub

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

        PStop.Enabled = True
        PStart.Enabled = False

        MsgNum = &H430S                             'User-defined(&H400 - &H7FFF)

        If Timer_Renamed.Checked = True Then        'At a timer a selection
            If bTimerOn = 0 Then
                Timer1.Enabled = True
                bTimerOn = 1
            End If
        Else
            SrqOn = 1                               'At a On SRQ a selection
            Ret = GpSetEventSrq(Handle.ToInt32, &H430S, 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)                     'At [GET] command performance
            If CheckRet("GpGet", Ret, ErrText) = 1 Then
                SrqOn = 0                           'An event is stop in case of an error
                Ret = GpSetEvent(SrqOn)
                If CheckRet("GpSetEvent", Ret, ErrText) = 1 Then GoTo Err_Renamed
            End If
        End If

Err_Renamed:
        TextRet.Text = ErrText

    End Sub

    Private Sub PStop_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles PStop.Click '[ Polling stop ]

        TextRet.Text = "Data receiving was stopped."

        PStop.Enabled = False
        PStart.Enabled = True

        SrqOn = 0                                   'Event stop
        Ret = GpSetEvent(SrqOn)

        bTimerOn = 0
        Timer1.Enabled = False                      'Timer stop

    End Sub

    Private Sub Timer1_Tick(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Timer1.Tick '[ Timer ]

        Dim ChkSrq As Integer                       'For check of SRQ
        Dim ErrChk As Short                         'For check of error

        For Cnt = 0 To 15                           'Initialize
            Pstb(Cnt) = 0
        Next
        ErrChk = 0                                  'Initial setting


        Ret = GpGet(YrAddr)                         'At [GET] command performance
        If CheckRet("GpGet", Ret, ErrText) = 1 Then
            ErrChk = 1 : GoTo ErrJump
        End If
        ChkSrq = 0                                  'Initialize

        Do
            Cmd(0) = 1                              'Number of command
            Cmd(1) = YrAddr                         'Address of device
            Ret = GpPoll(pCmd, pPstb)           'They carry out polling.
            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
        End If

        Cmd(0) = 2                                  'Number of command
        Cmd(1) = YrAddr                             'Address of device
        Cmd(2) = MyAddr                             'My Address
        Srlen = Len(RecvBuf)                        'A length of RecvBuf is measured
        Ret = GpListen(pCmd, Srlen, RecvBuf)        'Data is receiving
        If CheckRet("GpListen", Ret, ErrText) = 1 Then
            ErrChk = 1 : GoTo ErrJump
        End If
        Cmd(0) = 2                                  'Talker + Listener
        Cmd(1) = &H3FS                              'Unlisten /UNL
        Cmd(2) = &H5FS                              'Untalken /UNT
        Ret = GpComand(pCmd)                        'Command sending
        If CheckRet("GpComand", Ret, ErrText) = 1 Then
            ErrChk = 1 : GoTo ErrJump
        End If

        'n terms of data in the case of 0
        If Srlen = 0 Then GoTo GetData

        ReceiveData.Text = VB.Left(RecvBuf, Srlen)

GetData:
        TextRet.Text = "Data was done [ " & Srlen & " ] byte receiving."

ErrJump:  'When there is an error
        Cmd(0) = 2                  'Number of command
        Cmd(1) = &H3FS              'Unlisten /UNL
        Cmd(2) = &H5FS              'Untalken /UNT
        Ret = GpComand(pCmd)        'Command sending
        'When there is an error, at a time switch stopped
        If ErrChk = 1 Then Timer1.Enabled = False

    End Sub

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

        TextRet.Text = ""

    End Sub

    Private Sub YrAdrBox_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles YrAdrBox.SelectedIndexChanged '[ Address of device change ]

        YrAddr = CInt(YrAdrBox.Text)
        Initialize.Enabled = True

    End Sub

    Private Sub YrDevice_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles YrDevice.SelectedIndexChanged '[ Sending data change ]
        Select Case (YrDevice.SelectedIndex)                'Setting of a receiver vessel
            Case 0
                SendData.Text = "F1R5M2IT1DL0RE7BZ1S0"      'Advantest
            Case 1
                SendData.Text = "F1R0I0C1"                  '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 '[ Exit ]

        Ret = GpibExit()
        Me.Close()

    End Sub

    '[ By SRQ receiving ]
    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)               'Performance of a serial poll
            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)        'Performance of receiving
            If CheckRet("GpListen", Ret, ErrText) = 1 Then ErrOccured = 1 : GoTo JumpEnd
            Cmd(0) = 2                                  'Number of command
            Cmd(1) = &H3FS                              'Unlisten /UNL
            Cmd(2) = &H5FS                              'Untalken /UNT
            Ret = GpComand(pCmd)                        'Command sending
            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)                         'At [GET] command performance
            If CheckRet("GpGet", Ret, ErrText) = 1 Then ErrOccured = 1 : GoTo JumpEnd
            ErrText = "Data was done [ " & Srlen & " ] byte receiving."

JumpEnd:
            If ErrOccured = 1 Then
                SrqOn = 0
                Ret = GpSetEventSrq(handle.ToInt32, &H430S, SrqOn)      'Stop of an event
                Cmd(0) = 2                  'Number of command
                Cmd(1) = &H3FS              'Unlisten /UNL
                Cmd(2) = &H5FS              'Untalken /UNT
                Ret = GpComand(pCmd)        'Command sending
            Else
                Ret = GpEnableNextEvent()   'They make following available
            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 free
        If gChCmd.IsAllocated = True Then
            gChCmd.Free()
        End If
        If gChPstb.IsAllocated = True Then
            gChPstb.Free()
        End If
    End Sub
End Class