Option Strict Off
Option Explicit On 

Imports VB = Microsoft.VisualBasic

Public Class Master
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    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

    '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.
    Public WithEvents cmdExit As System.Windows.Forms.Button
    Public WithEvents Frame6 As System.Windows.Forms.GroupBox
    Public WithEvents cmdPPoll As System.Windows.Forms.Button
    Public WithEvents cmdSetPPoll As System.Windows.Forms.Button
    Public WithEvents cmdSPoll As System.Windows.Forms.Button
    Public WithEvents Frame3 As System.Windows.Forms.GroupBox
    Public WithEvents txtAddr As System.Windows.Forms.TextBox
    Public WithEvents cmdSearch As System.Windows.Forms.Button
    Public WithEvents cboEoi As System.Windows.Forms.ComboBox
    Public WithEvents cboDelim As System.Windows.Forms.ComboBox
    Public WithEvents cboAddr As System.Windows.Forms.ComboBox
    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 cmdInit As System.Windows.Forms.Button
    Public WithEvents Frame5 As System.Windows.Forms.GroupBox
    Public WithEvents cmdLlo As System.Windows.Forms.Button
    Public WithEvents cmdGtl As System.Windows.Forms.Button
    Public WithEvents cmdDcl As System.Windows.Forms.Button
    Public WithEvents cmdSdc As System.Windows.Forms.Button
    Public WithEvents cmdGet As System.Windows.Forms.Button
    Public WithEvents cmdDataDel As System.Windows.Forms.Button
    Public WithEvents Frame2 As System.Windows.Forms.GroupBox
    Public WithEvents txtMyAddr As System.Windows.Forms.TextBox
    Public WithEvents txtDevName As System.Windows.Forms.TextBox
    Public WithEvents Label5 As System.Windows.Forms.Label
    Public WithEvents Label1 As System.Windows.Forms.Label
    Public WithEvents Frame4 As System.Windows.Forms.GroupBox
    Public WithEvents lstRet As System.Windows.Forms.ListBox
    Public WithEvents Frame1 As System.Windows.Forms.GroupBox
    Public WithEvents cmdRec As System.Windows.Forms.Button
    Public WithEvents txtRec As System.Windows.Forms.TextBox
    Public WithEvents cmdSend As System.Windows.Forms.Button
    Public WithEvents txtSend As System.Windows.Forms.TextBox
    Public WithEvents cmdRetDel As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.cmdExit = New System.Windows.Forms.Button()
        Me.Frame6 = New System.Windows.Forms.GroupBox()
        Me.cmdPPoll = New System.Windows.Forms.Button()
        Me.cmdSetPPoll = New System.Windows.Forms.Button()
        Me.cmdSPoll = New System.Windows.Forms.Button()
        Me.Frame3 = New System.Windows.Forms.GroupBox()
        Me.txtAddr = New System.Windows.Forms.TextBox()
        Me.cmdSearch = New System.Windows.Forms.Button()
        Me.cboEoi = New System.Windows.Forms.ComboBox()
        Me.cboDelim = New System.Windows.Forms.ComboBox()
        Me.cboAddr = New System.Windows.Forms.ComboBox()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.cmdInit = New System.Windows.Forms.Button()
        Me.Frame5 = New System.Windows.Forms.GroupBox()
        Me.cmdLlo = New System.Windows.Forms.Button()
        Me.cmdGtl = New System.Windows.Forms.Button()
        Me.cmdDcl = New System.Windows.Forms.Button()
        Me.cmdSdc = New System.Windows.Forms.Button()
        Me.cmdGet = New System.Windows.Forms.Button()
        Me.cmdDataDel = New System.Windows.Forms.Button()
        Me.Frame2 = New System.Windows.Forms.GroupBox()
        Me.txtMyAddr = New System.Windows.Forms.TextBox()
        Me.txtDevName = New System.Windows.Forms.TextBox()
        Me.Label5 = New System.Windows.Forms.Label()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.Frame4 = New System.Windows.Forms.GroupBox()
        Me.lstRet = New System.Windows.Forms.ListBox()
        Me.Frame1 = New System.Windows.Forms.GroupBox()
        Me.cmdRec = New System.Windows.Forms.Button()
        Me.txtRec = New System.Windows.Forms.TextBox()
        Me.cmdSend = New System.Windows.Forms.Button()
        Me.txtSend = New System.Windows.Forms.TextBox()
        Me.cmdRetDel = New System.Windows.Forms.Button()
        Me.Frame6.SuspendLayout()
        Me.Frame3.SuspendLayout()
        Me.Frame5.SuspendLayout()
        Me.Frame2.SuspendLayout()
        Me.Frame4.SuspendLayout()
        Me.Frame1.SuspendLayout()
        Me.SuspendLayout()
        '
        'cmdExit
        '
        Me.cmdExit.BackColor = System.Drawing.SystemColors.Control
        Me.cmdExit.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdExit.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdExit.Location = New System.Drawing.Point(436, 40)
        Me.cmdExit.Name = "cmdExit"
        Me.cmdExit.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdExit.Size = New System.Drawing.Size(113, 27)
        Me.cmdExit.TabIndex = 1
        Me.cmdExit.Text = "Exit"
        '
        'Frame6
        '
        Me.Frame6.BackColor = System.Drawing.SystemColors.Control
        Me.Frame6.Controls.AddRange(New System.Windows.Forms.Control() {Me.cmdPPoll, Me.cmdSetPPoll, Me.cmdSPoll})
        Me.Frame6.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame6.Location = New System.Drawing.Point(568, 274)
        Me.Frame6.Name = "Frame6"
        Me.Frame6.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame6.Size = New System.Drawing.Size(144, 134)
        Me.Frame6.TabIndex = 42
        Me.Frame6.TabStop = False
        Me.Frame6.Text = "Polling"
        '
        'cmdPPoll
        '
        Me.cmdPPoll.BackColor = System.Drawing.SystemColors.Control
        Me.cmdPPoll.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdPPoll.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdPPoll.Location = New System.Drawing.Point(12, 97)
        Me.cmdPPoll.Name = "cmdPPoll"
        Me.cmdPPoll.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdPPoll.Size = New System.Drawing.Size(120, 27)
        Me.cmdPPoll.TabIndex = 20
        Me.cmdPPoll.Text = "Exe Parallel poll"
        '
        'cmdSetPPoll
        '
        Me.cmdSetPPoll.BackColor = System.Drawing.SystemColors.Control
        Me.cmdSetPPoll.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdSetPPoll.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdSetPPoll.Location = New System.Drawing.Point(12, 60)
        Me.cmdSetPPoll.Name = "cmdSetPPoll"
        Me.cmdSetPPoll.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdSetPPoll.Size = New System.Drawing.Size(120, 27)
        Me.cmdSetPPoll.TabIndex = 19
        Me.cmdSetPPoll.Text = "Set parallel poll"
        '
        'cmdSPoll
        '
        Me.cmdSPoll.BackColor = System.Drawing.SystemColors.Control
        Me.cmdSPoll.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdSPoll.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdSPoll.Location = New System.Drawing.Point(12, 23)
        Me.cmdSPoll.Name = "cmdSPoll"
        Me.cmdSPoll.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdSPoll.Size = New System.Drawing.Size(120, 27)
        Me.cmdSPoll.TabIndex = 18
        Me.cmdSPoll.Text = "Serial poll"
        '
        'Frame3
        '
        Me.Frame3.BackColor = System.Drawing.SystemColors.Control
        Me.Frame3.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtAddr, Me.cmdSearch, Me.cboEoi, Me.cboDelim, Me.cboAddr, Me.Label4, Me.Label3, Me.Label2})
        Me.Frame3.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame3.Location = New System.Drawing.Point(11, 69)
        Me.Frame3.Name = "Frame3"
        Me.Frame3.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame3.Size = New System.Drawing.Size(545, 95)
        Me.Frame3.TabIndex = 37
        Me.Frame3.TabStop = False
        Me.Frame3.Text = "Target information"
        '
        'txtAddr
        '
        Me.txtAddr.AcceptsReturn = True
        Me.txtAddr.AutoSize = False
        Me.txtAddr.BackColor = System.Drawing.SystemColors.Window
        Me.txtAddr.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.txtAddr.ForeColor = System.Drawing.SystemColors.WindowText
        Me.txtAddr.Location = New System.Drawing.Point(120, 24)
        Me.txtAddr.MaxLength = 0
        Me.txtAddr.Name = "txtAddr"
        Me.txtAddr.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.txtAddr.Size = New System.Drawing.Size(81, 21)
        Me.txtAddr.TabIndex = 5
        Me.txtAddr.Text = ""
        '
        'cmdSearch
        '
        Me.cmdSearch.BackColor = System.Drawing.SystemColors.Control
        Me.cmdSearch.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdSearch.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdSearch.Location = New System.Drawing.Point(424, 55)
        Me.cmdSearch.Name = "cmdSearch"
        Me.cmdSearch.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdSearch.Size = New System.Drawing.Size(113, 27)
        Me.cmdSearch.TabIndex = 4
        Me.cmdSearch.Text = "Find listener"
        '
        'cboEoi
        '
        Me.cboEoi.BackColor = System.Drawing.SystemColors.Window
        Me.cboEoi.Cursor = System.Windows.Forms.Cursors.Default
        Me.cboEoi.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboEoi.ForeColor = System.Drawing.SystemColors.WindowText
        Me.cboEoi.Items.AddRange(New Object() {"Not use", "Use"})
        Me.cboEoi.Location = New System.Drawing.Point(288, 57)
        Me.cboEoi.Name = "cboEoi"
        Me.cboEoi.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cboEoi.Size = New System.Drawing.Size(96, 24)
        Me.cboEoi.TabIndex = 8
        '
        'cboDelim
        '
        Me.cboDelim.BackColor = System.Drawing.SystemColors.Window
        Me.cboDelim.Cursor = System.Windows.Forms.Cursors.Default
        Me.cboDelim.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboDelim.ForeColor = System.Drawing.SystemColors.WindowText
        Me.cboDelim.Items.AddRange(New Object() {"Not use", "CR+LF", "CR", "LF"})
        Me.cboDelim.Location = New System.Drawing.Point(120, 57)
        Me.cboDelim.Name = "cboDelim"
        Me.cboDelim.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cboDelim.Size = New System.Drawing.Size(105, 24)
        Me.cboDelim.TabIndex = 7
        '
        'cboAddr
        '
        Me.cboAddr.BackColor = System.Drawing.SystemColors.Window
        Me.cboAddr.Cursor = System.Windows.Forms.Cursors.Default
        Me.cboAddr.ForeColor = System.Drawing.SystemColors.WindowText
        Me.cboAddr.ImeMode = System.Windows.Forms.ImeMode.Disable
        Me.cboAddr.Location = New System.Drawing.Point(241, 23)
        Me.cboAddr.Name = "cboAddr"
        Me.cboAddr.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cboAddr.Size = New System.Drawing.Size(296, 24)
        Me.cboAddr.TabIndex = 6
        '
        'Label4
        '
        Me.Label4.BackColor = System.Drawing.SystemColors.Control
        Me.Label4.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label4.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label4.Location = New System.Drawing.Point(8, 58)
        Me.Label4.Name = "Label4"
        Me.Label4.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label4.Size = New System.Drawing.Size(73, 20)
        Me.Label4.TabIndex = 28
        Me.Label4.Text = "Delimiter ="
        '
        'Label3
        '
        Me.Label3.BackColor = System.Drawing.SystemColors.Control
        Me.Label3.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label3.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label3.Location = New System.Drawing.Point(8, 25)
        Me.Label3.Name = "Label3"
        Me.Label3.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label3.Size = New System.Drawing.Size(112, 19)
        Me.Label3.TabIndex = 27
        Me.Label3.Text = "Target address ="
        '
        'Label2
        '
        Me.Label2.BackColor = System.Drawing.SystemColors.Control
        Me.Label2.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label2.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label2.Location = New System.Drawing.Point(240, 58)
        Me.Label2.Name = "Label2"
        Me.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label2.Size = New System.Drawing.Size(40, 20)
        Me.Label2.TabIndex = 26
        Me.Label2.Text = "EOI ="
        '
        'cmdInit
        '
        Me.cmdInit.BackColor = System.Drawing.SystemColors.Control
        Me.cmdInit.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdInit.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdInit.Location = New System.Drawing.Point(436, 7)
        Me.cmdInit.Name = "cmdInit"
        Me.cmdInit.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdInit.Size = New System.Drawing.Size(113, 27)
        Me.cmdInit.TabIndex = 0
        Me.cmdInit.Text = "Initialize"
        '
        'Frame5
        '
        Me.Frame5.BackColor = System.Drawing.SystemColors.Control
        Me.Frame5.Controls.AddRange(New System.Windows.Forms.Control() {Me.cmdLlo, Me.cmdGtl, Me.cmdDcl, Me.cmdSdc, Me.cmdGet})
        Me.Frame5.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame5.Location = New System.Drawing.Point(568, 4)
        Me.Frame5.Name = "Frame5"
        Me.Frame5.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame5.Size = New System.Drawing.Size(144, 206)
        Me.Frame5.TabIndex = 41
        Me.Frame5.TabStop = False
        Me.Frame5.Text = "GPIB Command"
        '
        'cmdLlo
        '
        Me.cmdLlo.BackColor = System.Drawing.SystemColors.Control
        Me.cmdLlo.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdLlo.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdLlo.Location = New System.Drawing.Point(12, 169)
        Me.cmdLlo.Name = "cmdLlo"
        Me.cmdLlo.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdLlo.Size = New System.Drawing.Size(120, 27)
        Me.cmdLlo.TabIndex = 17
        Me.cmdLlo.Text = "LLO"
        '
        'cmdGtl
        '
        Me.cmdGtl.BackColor = System.Drawing.SystemColors.Control
        Me.cmdGtl.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdGtl.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdGtl.Location = New System.Drawing.Point(12, 97)
        Me.cmdGtl.Name = "cmdGtl"
        Me.cmdGtl.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdGtl.Size = New System.Drawing.Size(120, 27)
        Me.cmdGtl.TabIndex = 16
        Me.cmdGtl.Text = "GTL"
        '
        'cmdDcl
        '
        Me.cmdDcl.BackColor = System.Drawing.SystemColors.Control
        Me.cmdDcl.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdDcl.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdDcl.Location = New System.Drawing.Point(12, 133)
        Me.cmdDcl.Name = "cmdDcl"
        Me.cmdDcl.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdDcl.Size = New System.Drawing.Size(120, 27)
        Me.cmdDcl.TabIndex = 15
        Me.cmdDcl.Text = "DCL"
        '
        'cmdSdc
        '
        Me.cmdSdc.BackColor = System.Drawing.SystemColors.Control
        Me.cmdSdc.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdSdc.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdSdc.Location = New System.Drawing.Point(12, 61)
        Me.cmdSdc.Name = "cmdSdc"
        Me.cmdSdc.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdSdc.Size = New System.Drawing.Size(120, 27)
        Me.cmdSdc.TabIndex = 14
        Me.cmdSdc.Text = "SDC"
        '
        'cmdGet
        '
        Me.cmdGet.BackColor = System.Drawing.SystemColors.Control
        Me.cmdGet.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdGet.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdGet.Location = New System.Drawing.Point(12, 25)
        Me.cmdGet.Name = "cmdGet"
        Me.cmdGet.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdGet.Size = New System.Drawing.Size(120, 27)
        Me.cmdGet.TabIndex = 13
        Me.cmdGet.Text = "GET"
        '
        'cmdDataDel
        '
        Me.cmdDataDel.BackColor = System.Drawing.SystemColors.Control
        Me.cmdDataDel.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdDataDel.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdDataDel.Location = New System.Drawing.Point(11, 381)
        Me.cmdDataDel.Name = "cmdDataDel"
        Me.cmdDataDel.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdDataDel.Size = New System.Drawing.Size(128, 27)
        Me.cmdDataDel.TabIndex = 21
        Me.cmdDataDel.Text = "Clear data"
        '
        'Frame2
        '
        Me.Frame2.BackColor = System.Drawing.SystemColors.Control
        Me.Frame2.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtMyAddr, Me.txtDevName, Me.Label5, Me.Label1})
        Me.Frame2.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame2.Location = New System.Drawing.Point(11, 4)
        Me.Frame2.Name = "Frame2"
        Me.Frame2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame2.Size = New System.Drawing.Size(413, 57)
        Me.Frame2.TabIndex = 36
        Me.Frame2.TabStop = False
        Me.Frame2.Text = "Self information"
        '
        'txtMyAddr
        '
        Me.txtMyAddr.AcceptsReturn = True
        Me.txtMyAddr.AutoSize = False
        Me.txtMyAddr.BackColor = System.Drawing.SystemColors.Window
        Me.txtMyAddr.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.txtMyAddr.ForeColor = System.Drawing.SystemColors.WindowText
        Me.txtMyAddr.Location = New System.Drawing.Point(328, 22)
        Me.txtMyAddr.MaxLength = 0
        Me.txtMyAddr.Name = "txtMyAddr"
        Me.txtMyAddr.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.txtMyAddr.Size = New System.Drawing.Size(72, 25)
        Me.txtMyAddr.TabIndex = 3
        Me.txtMyAddr.Text = ""
        '
        'txtDevName
        '
        Me.txtDevName.AcceptsReturn = True
        Me.txtDevName.AutoSize = False
        Me.txtDevName.BackColor = System.Drawing.SystemColors.Window
        Me.txtDevName.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.txtDevName.ForeColor = System.Drawing.SystemColors.WindowText
        Me.txtDevName.Location = New System.Drawing.Point(120, 21)
        Me.txtDevName.MaxLength = 256
        Me.txtDevName.Name = "txtDevName"
        Me.txtDevName.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.txtDevName.Size = New System.Drawing.Size(80, 25)
        Me.txtDevName.TabIndex = 2
        Me.txtDevName.Text = ""
        '
        'Label5
        '
        Me.Label5.BackColor = System.Drawing.SystemColors.Control
        Me.Label5.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label5.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label5.Location = New System.Drawing.Point(8, 26)
        Me.Label5.Name = "Label5"
        Me.Label5.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label5.Size = New System.Drawing.Size(104, 20)
        Me.Label5.TabIndex = 29
        Me.Label5.Text = "Device name ="
        '
        'Label1
        '
        Me.Label1.BackColor = System.Drawing.SystemColors.Control
        Me.Label1.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label1.Location = New System.Drawing.Point(216, 26)
        Me.Label1.Name = "Label1"
        Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label1.Size = New System.Drawing.Size(104, 20)
        Me.Label1.TabIndex = 3
        Me.Label1.Text = "GPIB address ="
        '
        'Frame4
        '
        Me.Frame4.BackColor = System.Drawing.SystemColors.Control
        Me.Frame4.Controls.AddRange(New System.Windows.Forms.Control() {Me.lstRet})
        Me.Frame4.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame4.Location = New System.Drawing.Point(11, 274)
        Me.Frame4.Name = "Frame4"
        Me.Frame4.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame4.Size = New System.Drawing.Size(545, 94)
        Me.Frame4.TabIndex = 38
        Me.Frame4.TabStop = False
        Me.Frame4.Text = "Return code"
        '
        'lstRet
        '
        Me.lstRet.BackColor = System.Drawing.SystemColors.Window
        Me.lstRet.Cursor = System.Windows.Forms.Cursors.Default
        Me.lstRet.ForeColor = System.Drawing.SystemColors.WindowText
        Me.lstRet.ItemHeight = 16
        Me.lstRet.Location = New System.Drawing.Point(8, 19)
        Me.lstRet.Name = "lstRet"
        Me.lstRet.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.lstRet.Size = New System.Drawing.Size(529, 52)
        Me.lstRet.TabIndex = 33
        '
        'Frame1
        '
        Me.Frame1.BackColor = System.Drawing.SystemColors.Control
        Me.Frame1.Controls.AddRange(New System.Windows.Forms.Control() {Me.cmdRec, Me.txtRec, Me.cmdSend, Me.txtSend})
        Me.Frame1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame1.Location = New System.Drawing.Point(11, 172)
        Me.Frame1.Name = "Frame1"
        Me.Frame1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame1.Size = New System.Drawing.Size(545, 94)
        Me.Frame1.TabIndex = 35
        Me.Frame1.TabStop = False
        Me.Frame1.Text = "Send / Receive data"
        '
        'cmdRec
        '
        Me.cmdRec.BackColor = System.Drawing.SystemColors.Control
        Me.cmdRec.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdRec.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdRec.Location = New System.Drawing.Point(424, 57)
        Me.cmdRec.Name = "cmdRec"
        Me.cmdRec.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdRec.Size = New System.Drawing.Size(113, 27)
        Me.cmdRec.TabIndex = 10
        Me.cmdRec.Text = "Receive"
        '
        'txtRec
        '
        Me.txtRec.AcceptsReturn = True
        Me.txtRec.AutoSize = False
        Me.txtRec.BackColor = System.Drawing.SystemColors.Window
        Me.txtRec.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.txtRec.ForeColor = System.Drawing.SystemColors.WindowText
        Me.txtRec.Location = New System.Drawing.Point(8, 56)
        Me.txtRec.MaxLength = 256
        Me.txtRec.Name = "txtRec"
        Me.txtRec.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.txtRec.Size = New System.Drawing.Size(409, 29)
        Me.txtRec.TabIndex = 12
        Me.txtRec.Text = ""
        '
        'cmdSend
        '
        Me.cmdSend.BackColor = System.Drawing.SystemColors.Control
        Me.cmdSend.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdSend.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdSend.Location = New System.Drawing.Point(424, 20)
        Me.cmdSend.Name = "cmdSend"
        Me.cmdSend.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdSend.Size = New System.Drawing.Size(113, 27)
        Me.cmdSend.TabIndex = 9
        Me.cmdSend.Text = "Send"
        '
        'txtSend
        '
        Me.txtSend.AcceptsReturn = True
        Me.txtSend.AutoSize = False
        Me.txtSend.BackColor = System.Drawing.SystemColors.Window
        Me.txtSend.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.txtSend.ForeColor = System.Drawing.SystemColors.WindowText
        Me.txtSend.Location = New System.Drawing.Point(8, 19)
        Me.txtSend.MaxLength = 256
        Me.txtSend.Name = "txtSend"
        Me.txtSend.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.txtSend.Size = New System.Drawing.Size(409, 29)
        Me.txtSend.TabIndex = 11
        Me.txtSend.Text = ""
        '
        'cmdRetDel
        '
        Me.cmdRetDel.BackColor = System.Drawing.SystemColors.Control
        Me.cmdRetDel.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdRetDel.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdRetDel.Location = New System.Drawing.Point(160, 381)
        Me.cmdRetDel.Name = "cmdRetDel"
        Me.cmdRetDel.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdRetDel.Size = New System.Drawing.Size(128, 27)
        Me.cmdRetDel.TabIndex = 22
        Me.cmdRetDel.Text = "Clear return code"
        '
        'Master
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 15)
        Me.ClientSize = New System.Drawing.Size(722, 416)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.cmdRetDel, Me.cmdExit, Me.Frame6, Me.Frame3, Me.cmdInit, Me.Frame5, Me.cmdDataDel, Me.Frame2, Me.Frame4, Me.Frame1})
        Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "Master"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Master"
        Me.Frame6.ResumeLayout(False)
        Me.Frame3.ResumeLayout(False)
        Me.Frame5.ResumeLayout(False)
        Me.Frame2.ResumeLayout(False)
        Me.Frame4.ResumeLayout(False)
        Me.Frame1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private mlngRet As Integer
    Private mintDevId As Short
    Private mintEqpId(32) As Short
    Private mintSelectEqpId As Short
    Private mintAddrArray(32) As Short

    '**************************************************************************************************
    '   Display transmitted string to list box of "Return code"(sub routine)
    '   Return value: TRUE(normally), FALSE(abnormally)
    '**************************************************************************************************
    Private Function funcSetlstRet(ByRef strRet As String) As Boolean
        Dim blnRet As Boolean
        blnRet = False 'Return value

        If Len(strRet) = 0 Then 'Check the number of the string
            blnRet = True
        Else
            If lstRet.Items.Count >= 256 Then 'Set the maximum number of list box
                lstRet.Items.RemoveAt(0)
                lstRet.Items.Add(strRet)
            Else
                lstRet.Items.Add(strRet)
            End If
            lstRet.SelectedIndex = lstRet.Items.Count - 1
        End If
        funcSetlstRet = blnRet
    End Function

    '**************************************************************************************************
    '   Set the target (sub routine)
    '   Function: Set Equipment ID, Delimiter and EOI
    '   Return value: TRUE(normally), FALSE(abnormally)
    '**************************************************************************************************
    Private Function funcSetParam() As Boolean
        Dim strTmp As System.Text.StringBuilder
        Dim blnRet As Boolean
        blnRet = False 'Return value


        'Specify the partner apparatus being detected
        If cboAddr.Items.Count <> 0 Then
            'Get Equipment ID of the device specified in combo box
            mintSelectEqpId = mintEqpId(cboAddr.SelectedIndex)
        Else
            'Get Equipment ID of device address specified in text box
            mlngRet = GpibSetEquipment(mintDevId, mintSelectEqpId, Val(txtAddr.Text), 0, cboDelim.SelectedIndex)
            'Process return value
            If mlngRet <> 0 Then
                strTmp = New System.Text.StringBuilder("", 256)
                Call GpibGetErrorString(mlngRet, strTmp)
                Call funcSetlstRet(strTmp.ToString)
                blnRet = True
            End If
        End If
        'Set delimiter and EOI
        If blnRet = False Then
            mlngRet = GpibSetDelim(mintSelectEqpId, cboDelim.SelectedIndex, cboEoi.SelectedIndex, 0)
            'Process return value
            If mlngRet <> 0 Then
                strTmp = New System.Text.StringBuilder("", 256)
                Call GpibGetErrorString(mlngRet, strTmp)
                Call funcSetlstRet(strTmp.ToString)
                blnRet = True
            Else
                'Display
                strTmp = New System.Text.StringBuilder("[Partner apparatus setting] completed normally")
                Call funcSetlstRet(strTmp.ToString)
            End If
        End If
        funcSetParam = blnRet
    End Function

    '**************************************************************************************************
    '   Initialization
    '   Function: Get Device ID from device name
    '**************************************************************************************************
    Private Sub cmdInit_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdInit.Click
        Dim strTmp As System.Text.StringBuilder
        Dim lngData As Integer

        'Perform initialization function
        mlngRet = GpibInit(txtDevName.Text, mintDevId)
        'Process return value
        If mlngRet <> 0 Then
            strTmp = New System.Text.StringBuilder("", 256)
            Call GpibGetErrorString(mlngRet, strTmp)
            Call funcSetlstRet(strTmp.ToString)
        Else 'When got Device ID normally
            strTmp = New System.Text.StringBuilder("GpibInit : Device ID = " & mintDevId)
            Call funcSetlstRet(strTmp.ToString)
            'Get devive address
            mlngRet = GpibGetStatus(mintDevId, &H8S, lngData)
            If mlngRet = 0 Then txtMyAddr.Text = CStr(lngData)
            'Confirm whether it is set to master in property page
            mlngRet = GpibGetStatus(mintDevId, &HAS, lngData)
            'Confirm whether it is set to master
            If (mlngRet = 0) And (lngData = 1) Then Call MsgBox("It is not a master. Please set it to master in property page.", MsgBoxStyle.OKOnly)
            'Display
            strTmp = New System.Text.StringBuilder("[Initialize] completed normally")
            Call funcSetlstRet(strTmp.ToString)
        End If
        
        GpibSendIFC(mintDevId, 1)	'Send IFC
    End Sub
    '**************************************************************************************************
    '   Exit
    '   Function: Disable Device ID
    '**************************************************************************************************
    Private Sub cmdExit_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdExit.Click
        Dim strTmp As System.Text.StringBuilder

        'Proform exit function
        mlngRet = GpibExit(mintDevId)
        'Process return value
        If mlngRet <> 0 Then
            strTmp = New System.Text.StringBuilder("", 256)
            Call GpibGetErrorString(mlngRet, strTmp)
            Call funcSetlstRet(strTmp.ToString)
        End If

        End
    End Sub
    '**************************************************************************************************
    '   Detect partner apparatus
    '   FuntionF Detect partner apparatus from Device ID and get Equipment ID.
    '         Send the [*IDN?] command according with IEEE488.2 standard to partner apparatus with
    '         the Equipment ID and get Device ID(maker and module number etc.).
    '**************************************************************************************************
    Private Sub cmdSearch_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdSearch.Click
        Dim strTmp As System.Text.StringBuilder
        Dim intPrmAddr As Short
        Dim intScdAddr As Short
        Dim intArraySize As Short
        Dim i As Short
        Dim lngSendLen As Integer
        Dim strSendBuf As System.Text.StringBuilder
        Dim lngRecLen As Integer
        Dim strRecBuf As System.Text.StringBuilder
        Dim strItemText As String

        intPrmAddr = -1 'Search all primary address
        intScdAddr = 0 'Do not search secondary address 
        intArraySize = 32 'Specify array size
        'Perform the function of detecting partner apparatus
        mlngRet = GpibFindListener(mintDevId, intPrmAddr, intScdAddr, intArraySize, mintAddrArray)
        'Process return value
        If mlngRet <> 0 Then
            strTmp = New System.Text.StringBuilder("", 256)
            Call GpibGetErrorString(mlngRet, strTmp)
            Call funcSetlstRet(strTmp.ToString)
        Else
            'Display
            strTmp = New System.Text.StringBuilder("GpibFindListener : the number of detected partner apparatus(es) = " & intArraySize)
            Call funcSetlstRet(strTmp.ToString)
            'Initialize the list
            cboAddr.Items.Clear()
            For i = 0 To intArraySize - 1
                'Perform the function of getting Equipment ID
                mlngRet = GpibSetEquipment(mintDevId, mintEqpId(i), mintAddrArray(i), 0, cboDelim.SelectedIndex)
                'Process return value
                If mlngRet <> 0 Then
                    strTmp = New System.Text.StringBuilder("", 256)
                    Call GpibGetErrorString(mlngRet, strTmp)
                    Call funcSetlstRet(strTmp.ToString)
                Else
                    '---------------------------------------
                    'Inquiry device information(data sending)
                    '---------------------------------------
                    strSendBuf = New System.Text.StringBuilder("*IDN?")
                    lngSendLen = Len(strSendBuf.ToString)
                    mlngRet = GpibSendData(mintEqpId(i), lngSendLen, strSendBuf)
                    'Process return value
                    If mlngRet <> 0 Then
                        strTmp = New System.Text.StringBuilder("", 256)
                        Call GpibGetErrorString(mlngRet, strTmp)
                        Call funcSetlstRet(strTmp.ToString)
                    Else
                        '---------------------------------------
                        'Inquiry device information(data receiving)
                        '---------------------------------------
                        lngRecLen = 256
                        strRecBuf = New System.Text.StringBuilder("", 256)
                        mlngRet = GpibRecData(mintEqpId(i), lngRecLen, strRecBuf)
                        strRecBuf.Length = lngRecLen
                        'Process return value
                        If mlngRet <> 0 Then
                            strTmp = New System.Text.StringBuilder("", 256)
                            Call GpibGetErrorString(mlngRet, strTmp)
                            Call funcSetlstRet(strTmp.ToString)
                        Else
                            '---------------------------------------
                            'Confirm whether receiving data accords with IEEE488.2 standard
                            '---------------------------------------
                            mlngRet = InStr(1, strRecBuf.ToString, ",", CompareMethod.Text)
                            If mlngRet > 0 Then
                                'Combine with address information
                                strItemText = "Address: " & Val(CStr(mintAddrArray(i))) & " " & strRecBuf.ToString
                            Else
                                strItemText = "Address: " & mintAddrArray(i)
                            End If
                            'Add to list
                            cboAddr.Items.Insert(i, strItemText)
                            cboAddr.SelectedIndex = i
                        End If
                    End If
                End If
            Next i
            'Display
            strTmp = New System.Text.StringBuilder("[Partner apparatus setting] completed normally")
            Call funcSetlstRet(strTmp.ToString)
            If cboAddr.SelectedIndex <> -1 Then
                txtAddr.Text = CStr(Val(CStr(mintAddrArray(cboAddr.SelectedIndex))))
            End If
        End If
    End Sub
    '**************************************************************************************************
    '   Send Data
    '   Function: Send data to slave device
    '**************************************************************************************************
    Private Sub cmdSend_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdSend.Click
        Dim strTmp As System.Text.StringBuilder
        Dim lngSendLen As Integer
        Dim strSendBuf As System.Text.StringBuilder
        'Set partner apparatus
        If funcSetParam() = True Then Exit Sub

        strSendBuf = New System.Text.StringBuilder(txtSend.Text)
        lngSendLen = Len(strSendBuf.ToString)
        If lngSendLen = 0 Then
            strTmp = New System.Text.StringBuilder("GpibSendData : there is no data")
            Call funcSetlstRet(strTmp.ToString)
            Exit Sub
        End If
        strTmp = New System.Text.StringBuilder("GpibSendData : sending data...")
        Call funcSetlstRet(strTmp.ToString)
        'Send data
        mlngRet = GpibSendData(mintSelectEqpId, lngSendLen, strSendBuf)
        'Process return value
        If mlngRet <> 0 Then
            strTmp = New System.Text.StringBuilder("", 256)
            Call GpibGetErrorString(mlngRet, strTmp)
            Call funcSetlstRet(strTmp.ToString)
        Else
            'Display
            strTmp = New System.Text.StringBuilder("GpibSendData : the number of sent data = " & lngSendLen)
            Call funcSetlstRet(strTmp.ToString)
            strTmp = New System.Text.StringBuilder("[Send data] completed normally")
            Call funcSetlstRet(strTmp.ToString)
        End If
    End Sub
    '**************************************************************************************************
    '   Receive data
    '   Function: Receive data from slave device
    '**************************************************************************************************
    Private Sub cmdRec_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdRec.Click
        Dim strTmp As System.Text.StringBuilder
        Dim lngRecLen As Integer
        Dim strRecBuf As System.Text.StringBuilder
        'Set partner apparatus
        If funcSetParam() = True Then Exit Sub
        strTmp = New System.Text.StringBuilder("GpibRecData : receiving data...")
        Call funcSetlstRet(strTmp.ToString)
        lngRecLen = 256
        'Receive data
        strRecBuf = New System.Text.StringBuilder("", 256)
        mlngRet = GpibRecData(mintSelectEqpId, lngRecLen, strRecBuf)
        strRecBuf.Length = lngRecLen
        'Process return value
        If mlngRet <> 0 Then
            strTmp = New System.Text.StringBuilder("", 256)
            Call GpibGetErrorString(mlngRet, strTmp)
            Call funcSetlstRet(strTmp.ToString)
        Else
            'Display
            strRecBuf.Length = lngRecLen
            txtRec.Text = VB.Left(strRecBuf.ToString, lngRecLen) 'Display received data
            strTmp = New System.Text.StringBuilder("GpibRecData : the number of received data = " & lngRecLen)
            Call funcSetlstRet(strTmp.ToString)
            strTmp = New System.Text.StringBuilder("[Receive data] completed normally")
            Call funcSetlstRet(strTmp.ToString)
        End If
    End Sub
    '**************************************************************************************************
    '   Send GET Command
    '   Function: Performs transfer of command (GET) starts the matter decided by slave device.
    '**************************************************************************************************
    Private Sub cmdGet_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdGet.Click
        Dim strTmp As System.Text.StringBuilder
        'Set partner apparatus
        If funcSetParam() = True Then Exit Sub
        'Perform the funtion of sending GET command
        mlngRet = GpibSendTrigger(mintSelectEqpId)
        'Process return value
        If mlngRet <> 0 Then
            strTmp = New System.Text.StringBuilder("", 256)
            Call GpibGetErrorString(mlngRet, strTmp)
            Call funcSetlstRet(strTmp.ToString)
        Else
            'Display
            strTmp = New System.Text.StringBuilder("[Send GET command] completed normally")
            Call funcSetlstRet(strTmp.ToString)
        End If
    End Sub
    '**************************************************************************************************
    '   Send SDC Command
    '   Function: Perform transfer of commands (SDC) that make slave device to initial states (when power is supplied)
    '**************************************************************************************************
    Private Sub cmdSdc_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdSdc.Click
        Dim strTmp As System.Text.StringBuilder
        'Set partner apparatus
        If funcSetParam() = True Then Exit Sub
        'Perform the funtion of sending SDC command
        mlngRet = GpibSendDeviceClear(mintSelectEqpId)
        'Process return value
        If mlngRet <> 0 Then
            strTmp = New System.Text.StringBuilder("", 256)
            Call GpibGetErrorString(mlngRet, strTmp)
            Call funcSetlstRet(strTmp.ToString)
        Else
            'Display
            strTmp = New System.Text.StringBuilder("[Send SDC command] completed normally")
            Call funcSetlstRet(strTmp.ToString)
        End If
    End Sub
    '**************************************************************************************************
    '   Send GTL command
    '   Function: Transmit the command(GTL) that make slave device return to local mode
    '**************************************************************************************************
    Private Sub cmdGtl_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdGtl.Click
        Dim strTmp As System.Text.StringBuilder
        'Set partner apparatus
        If funcSetParam() = True Then Exit Sub
        'Perform the funtion of sending GTL command
        mlngRet = GpibChangeLocal(mintSelectEqpId)
        'Process return value
        If mlngRet <> 0 Then
            strTmp = New System.Text.StringBuilder("", 256)
            Call GpibGetErrorString(mlngRet, strTmp)
            Call funcSetlstRet(strTmp.ToString)
        Else
            'Display
            strTmp = New System.Text.StringBuilder("[Send GTL command] completed normally")
            Call funcSetlstRet(strTmp.ToString)
        End If
    End Sub
    '**************************************************************************************************
    '   Send DCL command
    '   Function: Perform transfer of command (DCL) that make all slave devices to initial states (when power is supplied)
    '**************************************************************************************************
    Private Sub cmdDcl_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdDcl.Click
        Dim strTmp As System.Text.StringBuilder
        'Perform the funtion of sending DCL command
        mlngRet = GpibSendDeviceClear(mintDevId)
        'Process return value
        If mlngRet <> 0 Then
            strTmp = New System.Text.StringBuilder("", 256)
            Call GpibGetErrorString(mlngRet, strTmp)
            Call funcSetlstRet(strTmp.ToString)
        Else
            'Display
            strTmp = New System.Text.StringBuilder("[Send DCL command] completed normally")
            Call funcSetlstRet(strTmp.ToString)
        End If
    End Sub
    '**************************************************************************************************
    '   Send LLO command
    '   Function: Perform transfer of command (LLO) that disables the transition to local mode by switch on device of all slave devices
    '**************************************************************************************************
    Private Sub cmdLlo_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdLlo.Click
        Dim strTmp As System.Text.StringBuilder
        'Perform the funtion of sending LLO command
        mlngRet = GpibSendLocalLockout(mintDevId)
        'Process return value
        If mlngRet <> 0 Then
            strTmp = New System.Text.StringBuilder("", 256)
            Call GpibGetErrorString(mlngRet, strTmp)
            Call funcSetlstRet(strTmp.ToString)
        Else
            'Display
            strTmp = New System.Text.StringBuilder("[Send LLO command] completed normally")
            Call funcSetlstRet(strTmp.ToString)
        End If
    End Sub
    '**************************************************************************************************
    '   Perform serial poll
    '   Function: Get status byte of slave device
    '**************************************************************************************************
    Private Sub cmdSPoll_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdSPoll.Click
        Dim strTmp As System.Text.StringBuilder
        Dim intStb As Short
        Dim intSrqLine As Short

        'Set partner apparatus
        If funcSetParam() = True Then Exit Sub

        strTmp = New System.Text.StringBuilder("GpibSPoll : serial polling...")
        Call funcSetlstRet(strTmp.ToString)

        'Perform the function of serial poll
        mlngRet = GpibSPoll(mintSelectEqpId, intStb, intSrqLine)
        'Process return value
        If mlngRet <> 0 Then
            strTmp = New System.Text.StringBuilder("", 256)
            Call GpibGetErrorString(mlngRet, strTmp)
            Call funcSetlstRet(strTmp.ToString)
        Else
            'Display
            strTmp = New System.Text.StringBuilder("GpibSPoll : status byte = " & VB.Right("0" & Hex(intStb), 2) & "(H) SRQ line = " & VB.Right("0" & Hex(intSrqLine), 2) & "(H)")
            Call funcSetlstRet(strTmp.ToString)
            strTmp = New System.Text.StringBuilder("[Serial poll] completed normally")
            Call funcSetlstRet(strTmp.ToString)
        End If
    End Sub
    '**************************************************************************************************
    '   Set parallel poll
    '   Function: set the line of parallel poll response
    '**************************************************************************************************
    Private Sub cmdSetPPoll_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdSetPPoll.Click
        Dim strTmp As System.Text.StringBuilder
        Dim intAddrArray(9) As Short
        Dim intDataLineArray(9) As Short
        Dim intIstArray(9) As Short
        Dim i As Short

        'Set by device address in text box
        i = 0
        intAddrArray(i) = Short.Parse(Me.txtAddr.Text) 'Device address
        intDataLineArray(i) = i + 1 'DIO line number
        intIstArray(i) = 1 'Inphase
        i = i + 1

        'Set the end of the array
        intAddrArray(i) = -1
        intDataLineArray(i) = -1
        intIstArray(i) = -1

        'Perform the function of setting parallel poll
        mlngRet = GpibSetPPoll(mintDevId, intAddrArray, intDataLineArray, intIstArray)
        'Process return value
        If mlngRet <> 0 Then
            strTmp = New System.Text.StringBuilder("", 256)
            Call GpibGetErrorString(mlngRet, strTmp)
            Call funcSetlstRet(strTmp.ToString)
        Else
            'Display
            strTmp = New System.Text.StringBuilder("[Set parallel poll] completed normally")
            Call funcSetlstRet(strTmp.ToString)
        End If
    End Sub
    '**************************************************************************************************
    '   Perform parallel poll
    '   Function: Perform parallel poll and get DIO line data
    '**************************************************************************************************
    Private Sub cmdPPoll_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdPPoll.Click
        Dim strTmp As System.Text.StringBuilder
        Dim intPpr As Short
        'Perform the function of parallel poll
        mlngRet = GpibPPoll(mintDevId, intPpr)
        'Process return value
        If mlngRet <> 0 Then
            strTmp = New System.Text.StringBuilder("", 256)
            Call GpibGetErrorString(mlngRet, strTmp)
            Call funcSetlstRet(strTmp.ToString)
        Else
            'Display
            strTmp = New System.Text.StringBuilder("GpibPPoll : DIO line data = " & intPpr)
            Call funcSetlstRet(strTmp.ToString)
            strTmp = New System.Text.StringBuilder("[Parallel poll] completed normally")
            Call funcSetlstRet(strTmp.ToString)
        End If
    End Sub
    '**************************************************************************************************
    '   Clear send/receive text data
    '**************************************************************************************************
    Private Sub cmdDataDel_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdDataDel.Click
        txtSend.Text = ""
        txtRec.Text = ""
    End Sub
    '**************************************************************************************************
    '   Clear return code
    '**************************************************************************************************
    Private Sub cmdRetDel_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdRetDel.Click
        lstRet.Items.Clear()
    End Sub

    '**************************************************************************************************
    '   Set initial value
    '**************************************************************************************************
    Private Sub Master_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
        txtMyAddr.Text = CStr(0)
        txtDevName.Text = "GPIB000"
        txtAddr.Text = CStr(1)
        cboDelim.SelectedIndex = 1 'CR+LF
        cboEoi.SelectedIndex = 1 'Use
        txtSend.Text = "CONTEC Master Sample"
    End Sub
    '**************************************************************************************************
    '   Ending process(force to end)
    '**************************************************************************************************
    Private Sub Master_Closed(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Closed
        Call cmdExit_Click(cmdExit, New System.EventArgs())
    End Sub
End Class
