Option Strict Off
Option Explicit On 
Public Class Counter
    Inherits System.Windows.Forms.Form

#Region " Windows tH[ fUCiŐꂽR[h "

    Public Sub New()
        MyBase.New()

        ' ̌Ăяo Windows tH[ fUCiŕKvłB
        InitializeComponent()

        ' InitializeComponent() Ăяǒɏǉ܂B

    End Sub

    ' Form  dispose I[o[ChăR|[lgꗗ܂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

    '  : ȉ̃vV[ẂAWindows tH[ fUCiŕKvłB
    ' Windows tH[ fUCigĕύXĂB  
    ' R[h GfB^͎gpȂłB
	Friend WithEvents Label13 As System.Windows.Forms.Label
    Friend WithEvents Label11 As System.Windows.Forms.Label
    Friend WithEvents Label7 As System.Windows.Forms.Label
	Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
	Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
	Friend WithEvents Label3 As System.Windows.Forms.Label
	Friend WithEvents Label1 As System.Windows.Forms.Label
	Friend WithEvents Label2 As System.Windows.Forms.Label
	Friend WithEvents Label10 As System.Windows.Forms.Label
	Friend WithEvents Label9 As System.Windows.Forms.Label
	Friend WithEvents Label8 As System.Windows.Forms.Label
	Friend WithEvents Label6 As System.Windows.Forms.Label
	Friend WithEvents Label5 As System.Windows.Forms.Label
	Friend WithEvents Label4 As System.Windows.Forms.Label
	Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
	Friend WithEvents CntTimer As System.Windows.Forms.Timer
	Friend WithEvents btnCntExit As System.Windows.Forms.Button
	Friend WithEvents btnCntStop As System.Windows.Forms.Button
	Friend WithEvents btnCntPreset As System.Windows.Forms.Button
	Friend WithEvents btnCntCompare As System.Windows.Forms.Button
	Friend WithEvents btnCntInit As System.Windows.Forms.Button
	Friend WithEvents rdoPreset1 As System.Windows.Forms.RadioButton
	Friend WithEvents rdoPreset0 As System.Windows.Forms.RadioButton
	Friend WithEvents txtPreset7 As System.Windows.Forms.TextBox
	Friend WithEvents txtPreset6 As System.Windows.Forms.TextBox
	Friend WithEvents txtPreset5 As System.Windows.Forms.TextBox
	Friend WithEvents txtPreset4 As System.Windows.Forms.TextBox
	Friend WithEvents txtPreset3 As System.Windows.Forms.TextBox
	Friend WithEvents txtPreset2 As System.Windows.Forms.TextBox
	Friend WithEvents txtPreset1 As System.Windows.Forms.TextBox
	Friend WithEvents txtPreset0 As System.Windows.Forms.TextBox
	Friend WithEvents txtCh7 As System.Windows.Forms.TextBox
	Friend WithEvents txtCh6 As System.Windows.Forms.TextBox
	Friend WithEvents txtCh5 As System.Windows.Forms.TextBox
	Friend WithEvents txtCh4 As System.Windows.Forms.TextBox
	Friend WithEvents txtCh3 As System.Windows.Forms.TextBox
	Friend WithEvents txtCh2 As System.Windows.Forms.TextBox
	Friend WithEvents txtCh1 As System.Windows.Forms.TextBox
	Friend WithEvents txtCh0 As System.Windows.Forms.TextBox
	Friend WithEvents rdoCh1 As System.Windows.Forms.RadioButton
	Friend WithEvents rdoCh0 As System.Windows.Forms.RadioButton
	Friend WithEvents txtErr As System.Windows.Forms.TextBox
	Friend WithEvents txtStart As System.Windows.Forms.TextBox
	Friend WithEvents cboDeviceName As System.Windows.Forms.ComboBox
	Friend WithEvents btnCntStart As System.Windows.Forms.Button
	Friend WithEvents btnExit As System.Windows.Forms.Button
	Friend WithEvents txtReturnCode As System.Windows.Forms.TextBox
	Friend WithEvents btnCntMode As System.Windows.Forms.Button
    Friend WithEvents txtStatus7 As System.Windows.Forms.TextBox
    Friend WithEvents txtStatus6 As System.Windows.Forms.TextBox
	Friend WithEvents txtStatus5 As System.Windows.Forms.TextBox
	Friend WithEvents txtStatus4 As System.Windows.Forms.TextBox
	Friend WithEvents txtStatus3 As System.Windows.Forms.TextBox
	Friend WithEvents txtStatus2 As System.Windows.Forms.TextBox
	Friend WithEvents txtStatus1 As System.Windows.Forms.TextBox
	Friend WithEvents txtStatus0 As System.Windows.Forms.TextBox
	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Me.btnCntExit = New System.Windows.Forms.Button()
        Me.btnCntStop = New System.Windows.Forms.Button()
        Me.btnCntPreset = New System.Windows.Forms.Button()
        Me.btnCntCompare = New System.Windows.Forms.Button()
        Me.btnCntInit = New System.Windows.Forms.Button()
        Me.Label13 = New System.Windows.Forms.Label()
        Me.Label11 = New System.Windows.Forms.Label()
        Me.Label7 = New System.Windows.Forms.Label()
        Me.GroupBox3 = New System.Windows.Forms.GroupBox()
        Me.rdoPreset1 = New System.Windows.Forms.RadioButton()
        Me.rdoPreset0 = New System.Windows.Forms.RadioButton()
        Me.txtPreset7 = New System.Windows.Forms.TextBox()
        Me.txtPreset6 = New System.Windows.Forms.TextBox()
        Me.txtPreset5 = New System.Windows.Forms.TextBox()
        Me.txtPreset4 = New System.Windows.Forms.TextBox()
        Me.txtPreset3 = New System.Windows.Forms.TextBox()
        Me.txtPreset2 = New System.Windows.Forms.TextBox()
        Me.txtPreset1 = New System.Windows.Forms.TextBox()
        Me.txtPreset0 = New System.Windows.Forms.TextBox()
        Me.GroupBox1 = New System.Windows.Forms.GroupBox()
        Me.txtCh7 = New System.Windows.Forms.TextBox()
        Me.txtCh6 = New System.Windows.Forms.TextBox()
        Me.txtCh5 = New System.Windows.Forms.TextBox()
        Me.txtCh4 = New System.Windows.Forms.TextBox()
        Me.txtCh3 = New System.Windows.Forms.TextBox()
        Me.txtCh2 = New System.Windows.Forms.TextBox()
        Me.txtCh1 = New System.Windows.Forms.TextBox()
        Me.txtCh0 = New System.Windows.Forms.TextBox()
        Me.rdoCh1 = New System.Windows.Forms.RadioButton()
        Me.rdoCh0 = New System.Windows.Forms.RadioButton()
        Me.txtErr = New System.Windows.Forms.TextBox()
        Me.txtStart = New System.Windows.Forms.TextBox()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.cboDeviceName = New System.Windows.Forms.ComboBox()
        Me.btnCntStart = New System.Windows.Forms.Button()
        Me.btnExit = New System.Windows.Forms.Button()
        Me.txtReturnCode = New System.Windows.Forms.TextBox()
        Me.Label10 = New System.Windows.Forms.Label()
        Me.btnCntMode = New System.Windows.Forms.Button()
        Me.Label9 = New System.Windows.Forms.Label()
        Me.Label8 = New System.Windows.Forms.Label()
        Me.Label6 = New System.Windows.Forms.Label()
        Me.Label5 = New System.Windows.Forms.Label()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.GroupBox2 = New System.Windows.Forms.GroupBox()
        Me.txtStatus7 = New System.Windows.Forms.TextBox()
        Me.txtStatus6 = New System.Windows.Forms.TextBox()
        Me.txtStatus5 = New System.Windows.Forms.TextBox()
        Me.txtStatus4 = New System.Windows.Forms.TextBox()
        Me.txtStatus3 = New System.Windows.Forms.TextBox()
        Me.txtStatus2 = New System.Windows.Forms.TextBox()
        Me.txtStatus1 = New System.Windows.Forms.TextBox()
        Me.txtStatus0 = New System.Windows.Forms.TextBox()
        Me.CntTimer = New System.Windows.Forms.Timer(Me.components)
        Me.GroupBox3.SuspendLayout()
        Me.GroupBox1.SuspendLayout()
        Me.GroupBox2.SuspendLayout()
        Me.SuspendLayout()
        '
        'btnCntExit
        '
        Me.btnCntExit.Location = New System.Drawing.Point(424, 346)
        Me.btnCntExit.Name = "btnCntExit"
        Me.btnCntExit.Size = New System.Drawing.Size(104, 24)
        Me.btnCntExit.TabIndex = 11
        Me.btnCntExit.Text = "CntExit"
        '
        'btnCntStop
        '
        Me.btnCntStop.Location = New System.Drawing.Point(424, 258)
        Me.btnCntStop.Name = "btnCntStop"
        Me.btnCntStop.Size = New System.Drawing.Size(104, 24)
        Me.btnCntStop.TabIndex = 10
        Me.btnCntStop.Text = "CntStopCount"
        '
        'btnCntPreset
        '
        Me.btnCntPreset.Location = New System.Drawing.Point(424, 226)
        Me.btnCntPreset.Name = "btnCntPreset"
        Me.btnCntPreset.Size = New System.Drawing.Size(104, 24)
        Me.btnCntPreset.TabIndex = 9
        Me.btnCntPreset.Text = "CntPreset"
        '
        'btnCntCompare
        '
        Me.btnCntCompare.Location = New System.Drawing.Point(424, 138)
        Me.btnCntCompare.Name = "btnCntCompare"
        Me.btnCntCompare.Size = New System.Drawing.Size(104, 24)
        Me.btnCntCompare.TabIndex = 7
        Me.btnCntCompare.Text = "rݒ..."
        '
        'btnCntInit
        '
        Me.btnCntInit.Location = New System.Drawing.Point(424, 10)
        Me.btnCntInit.Name = "btnCntInit"
        Me.btnCntInit.Size = New System.Drawing.Size(104, 24)
        Me.btnCntInit.TabIndex = 0
        Me.btnCntInit.Text = "CntInit"
        '
        'Label13
        '
        Me.Label13.Location = New System.Drawing.Point(16, 384)
        Me.Label13.Name = "Label13"
        Me.Label13.Size = New System.Drawing.Size(48, 15)
        Me.Label13.TabIndex = 48
        Me.Label13.Text = "߂lF"
        '
        'Label11
        '
        Me.Label11.Location = New System.Drawing.Point(10, 342)
        Me.Label11.Name = "Label11"
        Me.Label11.Size = New System.Drawing.Size(48, 16)
        Me.Label11.TabIndex = 45
        Me.Label11.Text = "7"
        '
        'Label7
        '
        Me.Label7.Location = New System.Drawing.Point(10, 247)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(48, 16)
        Me.Label7.TabIndex = 41
        Me.Label7.Text = "3"
        '
        'GroupBox3
        '
        Me.GroupBox3.Controls.AddRange(New System.Windows.Forms.Control() {Me.rdoPreset1, Me.rdoPreset0, Me.txtPreset7, Me.txtPreset6, Me.txtPreset5, Me.txtPreset4, Me.txtPreset3, Me.txtPreset2, Me.txtPreset1, Me.txtPreset0})
        Me.GroupBox3.Location = New System.Drawing.Point(303, 98)
        Me.GroupBox3.Name = "GroupBox3"
        Me.GroupBox3.Size = New System.Drawing.Size(107, 272)
        Me.GroupBox3.TabIndex = 5
        Me.GroupBox3.TabStop = False
        Me.GroupBox3.Text = "vZbgl"
        '
        'rdoPreset1
        '
        Me.rdoPreset1.Location = New System.Drawing.Point(21, 40)
        Me.rdoPreset1.Name = "rdoPreset1"
        Me.rdoPreset1.Size = New System.Drawing.Size(60, 20)
        Me.rdoPreset1.TabIndex = 1
        Me.rdoPreset1.TabStop = True
        Me.rdoPreset1.Text = "16i"
        '
        'rdoPreset0
        '
        Me.rdoPreset0.Checked = True
        Me.rdoPreset0.Location = New System.Drawing.Point(21, 18)
        Me.rdoPreset0.Name = "rdoPreset0"
        Me.rdoPreset0.Size = New System.Drawing.Size(60, 20)
        Me.rdoPreset0.TabIndex = 0
        Me.rdoPreset0.TabStop = True
        Me.rdoPreset0.Text = "10i"
        '
        'txtPreset7
        '
        Me.txtPreset7.Location = New System.Drawing.Point(8, 240)
        Me.txtPreset7.Name = "txtPreset7"
        Me.txtPreset7.Size = New System.Drawing.Size(88, 19)
        Me.txtPreset7.TabIndex = 9
        Me.txtPreset7.Text = "TextBox8"
        '
        'txtPreset6
        '
        Me.txtPreset6.Location = New System.Drawing.Point(8, 216)
        Me.txtPreset6.Name = "txtPreset6"
        Me.txtPreset6.Size = New System.Drawing.Size(88, 19)
        Me.txtPreset6.TabIndex = 8
        Me.txtPreset6.Text = "TextBox7"
        '
        'txtPreset5
        '
        Me.txtPreset5.Location = New System.Drawing.Point(8, 192)
        Me.txtPreset5.Name = "txtPreset5"
        Me.txtPreset5.Size = New System.Drawing.Size(88, 19)
        Me.txtPreset5.TabIndex = 7
        Me.txtPreset5.Text = "TextBox6"
        '
        'txtPreset4
        '
        Me.txtPreset4.Location = New System.Drawing.Point(8, 168)
        Me.txtPreset4.Name = "txtPreset4"
        Me.txtPreset4.Size = New System.Drawing.Size(88, 19)
        Me.txtPreset4.TabIndex = 6
        Me.txtPreset4.Text = "TextBox5"
        '
        'txtPreset3
        '
        Me.txtPreset3.Location = New System.Drawing.Point(8, 144)
        Me.txtPreset3.Name = "txtPreset3"
        Me.txtPreset3.Size = New System.Drawing.Size(88, 19)
        Me.txtPreset3.TabIndex = 5
        Me.txtPreset3.Text = "TextBox4"
        '
        'txtPreset2
        '
        Me.txtPreset2.Location = New System.Drawing.Point(8, 120)
        Me.txtPreset2.Name = "txtPreset2"
        Me.txtPreset2.Size = New System.Drawing.Size(88, 19)
        Me.txtPreset2.TabIndex = 4
        Me.txtPreset2.Text = "TextBox3"
        '
        'txtPreset1
        '
        Me.txtPreset1.Location = New System.Drawing.Point(8, 96)
        Me.txtPreset1.Name = "txtPreset1"
        Me.txtPreset1.Size = New System.Drawing.Size(88, 19)
        Me.txtPreset1.TabIndex = 3
        Me.txtPreset1.Text = "TextBox2"
        '
        'txtPreset0
        '
        Me.txtPreset0.Location = New System.Drawing.Point(8, 72)
        Me.txtPreset0.Name = "txtPreset0"
        Me.txtPreset0.Size = New System.Drawing.Size(88, 19)
        Me.txtPreset0.TabIndex = 2
        Me.txtPreset0.Text = "TextBox1"
        '
        'GroupBox1
        '
        Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtCh7, Me.txtCh6, Me.txtCh5, Me.txtCh4, Me.txtCh3, Me.txtCh2, Me.txtCh1, Me.txtCh0, Me.rdoCh1, Me.rdoCh0})
        Me.GroupBox1.Location = New System.Drawing.Point(61, 98)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(131, 272)
        Me.GroupBox1.TabIndex = 3
        Me.GroupBox1.TabStop = False
        Me.GroupBox1.Text = "JEgl"
        '
        'txtCh7
        '
        Me.txtCh7.Location = New System.Drawing.Point(8, 240)
        Me.txtCh7.Name = "txtCh7"
        Me.txtCh7.Size = New System.Drawing.Size(112, 19)
        Me.txtCh7.TabIndex = 9
        Me.txtCh7.Text = "TextBox8"
        '
        'txtCh6
        '
        Me.txtCh6.Location = New System.Drawing.Point(8, 216)
        Me.txtCh6.Name = "txtCh6"
        Me.txtCh6.Size = New System.Drawing.Size(112, 19)
        Me.txtCh6.TabIndex = 8
        Me.txtCh6.Text = "TextBox7"
        '
        'txtCh5
        '
        Me.txtCh5.Location = New System.Drawing.Point(8, 192)
        Me.txtCh5.Name = "txtCh5"
        Me.txtCh5.Size = New System.Drawing.Size(112, 19)
        Me.txtCh5.TabIndex = 7
        Me.txtCh5.Text = "TextBox6"
        '
        'txtCh4
        '
        Me.txtCh4.Location = New System.Drawing.Point(8, 168)
        Me.txtCh4.Name = "txtCh4"
        Me.txtCh4.Size = New System.Drawing.Size(112, 19)
        Me.txtCh4.TabIndex = 6
        Me.txtCh4.Text = "TextBox5"
        '
        'txtCh3
        '
        Me.txtCh3.Location = New System.Drawing.Point(8, 144)
        Me.txtCh3.Name = "txtCh3"
        Me.txtCh3.Size = New System.Drawing.Size(112, 19)
        Me.txtCh3.TabIndex = 5
        Me.txtCh3.Text = "TextBox4"
        '
        'txtCh2
        '
        Me.txtCh2.Location = New System.Drawing.Point(8, 120)
        Me.txtCh2.Name = "txtCh2"
        Me.txtCh2.Size = New System.Drawing.Size(112, 19)
        Me.txtCh2.TabIndex = 4
        Me.txtCh2.Text = "TextBox3"
        '
        'txtCh1
        '
        Me.txtCh1.Location = New System.Drawing.Point(8, 96)
        Me.txtCh1.Name = "txtCh1"
        Me.txtCh1.Size = New System.Drawing.Size(112, 19)
        Me.txtCh1.TabIndex = 3
        Me.txtCh1.Text = "TextBox2"
        '
        'txtCh0
        '
        Me.txtCh0.Location = New System.Drawing.Point(8, 72)
        Me.txtCh0.Name = "txtCh0"
        Me.txtCh0.Size = New System.Drawing.Size(112, 19)
        Me.txtCh0.TabIndex = 2
        Me.txtCh0.Text = "TextBox1"
        '
        'rdoCh1
        '
        Me.rdoCh1.Location = New System.Drawing.Point(24, 40)
        Me.rdoCh1.Name = "rdoCh1"
        Me.rdoCh1.Size = New System.Drawing.Size(60, 20)
        Me.rdoCh1.TabIndex = 1
        Me.rdoCh1.TabStop = True
        Me.rdoCh1.Text = "16i"
        '
        'rdoCh0
        '
        Me.rdoCh0.Checked = True
        Me.rdoCh0.Location = New System.Drawing.Point(24, 18)
        Me.rdoCh0.Name = "rdoCh0"
        Me.rdoCh0.Size = New System.Drawing.Size(60, 20)
        Me.rdoCh0.TabIndex = 0
        Me.rdoCh0.TabStop = True
        Me.rdoCh0.Text = "10i"
        '
        'txtErr
        '
        Me.txtErr.Location = New System.Drawing.Point(144, 66)
        Me.txtErr.Name = "txtErr"
        Me.txtErr.Size = New System.Drawing.Size(32, 19)
        Me.txtErr.TabIndex = 2
        Me.txtErr.Text = ""
        '
        'txtStart
        '
        Me.txtStart.Location = New System.Drawing.Point(62, 66)
        Me.txtStart.Name = "txtStart"
        Me.txtStart.Size = New System.Drawing.Size(32, 19)
        Me.txtStart.TabIndex = 1
        Me.txtStart.Text = ""
        '
        'Label3
        '
        Me.Label3.Location = New System.Drawing.Point(141, 50)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(91, 16)
        Me.Label3.TabIndex = 32
        Me.Label3.Text = "G[WX^F"
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(10, 15)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(70, 16)
        Me.Label1.TabIndex = 29
        Me.Label1.Text = "foCXF"
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(61, 50)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(80, 16)
        Me.Label2.TabIndex = 31
        Me.Label2.Text = "NWX^F"
        '
        'cboDeviceName
        '
        Me.cboDeviceName.Location = New System.Drawing.Point(81, 11)
        Me.cboDeviceName.Name = "cboDeviceName"
        Me.cboDeviceName.Size = New System.Drawing.Size(200, 20)
        Me.cboDeviceName.TabIndex = 15
        '
        'btnCntStart
        '
        Me.btnCntStart.Location = New System.Drawing.Point(424, 194)
        Me.btnCntStart.Name = "btnCntStart"
        Me.btnCntStart.Size = New System.Drawing.Size(104, 24)
        Me.btnCntStart.TabIndex = 8
        Me.btnCntStart.Text = "CntStartCount"
        '
        'btnExit
        '
        Me.btnExit.Location = New System.Drawing.Point(424, 402)
        Me.btnExit.Name = "btnExit"
        Me.btnExit.Size = New System.Drawing.Size(104, 24)
        Me.btnExit.TabIndex = 12
        Me.btnExit.Text = "Exit"
        '
        'txtReturnCode
        '
        Me.txtReturnCode.Location = New System.Drawing.Point(80, 384)
        Me.txtReturnCode.Name = "txtReturnCode"
        Me.txtReturnCode.Size = New System.Drawing.Size(320, 19)
        Me.txtReturnCode.TabIndex = 14
        Me.txtReturnCode.Text = "TextBox26"
        '
        'Label10
        '
        Me.Label10.Location = New System.Drawing.Point(10, 318)
        Me.Label10.Name = "Label10"
        Me.Label10.Size = New System.Drawing.Size(48, 16)
        Me.Label10.TabIndex = 44
        Me.Label10.Text = "6"
        '
        'btnCntMode
        '
        Me.btnCntMode.Location = New System.Drawing.Point(424, 103)
        Me.btnCntMode.Name = "btnCntMode"
        Me.btnCntMode.Size = New System.Drawing.Size(104, 24)
        Me.btnCntMode.TabIndex = 6
        Me.btnCntMode.Text = "[hݒ..."
        '
        'Label9
        '
        Me.Label9.Location = New System.Drawing.Point(10, 294)
        Me.Label9.Name = "Label9"
        Me.Label9.Size = New System.Drawing.Size(48, 16)
        Me.Label9.TabIndex = 43
        Me.Label9.Text = "5"
        '
        'Label8
        '
        Me.Label8.Location = New System.Drawing.Point(10, 270)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(48, 16)
        Me.Label8.TabIndex = 42
        Me.Label8.Text = "4"
        '
        'Label6
        '
        Me.Label6.Location = New System.Drawing.Point(10, 223)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(48, 16)
        Me.Label6.TabIndex = 40
        Me.Label6.Text = "2"
        '
        'Label5
        '
        Me.Label5.Location = New System.Drawing.Point(10, 198)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(48, 16)
        Me.Label5.TabIndex = 39
        Me.Label5.Text = "1"
        '
        'Label4
        '
        Me.Label4.Location = New System.Drawing.Point(10, 174)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(48, 16)
        Me.Label4.TabIndex = 36
        Me.Label4.Text = "0"
        '
        'GroupBox2
        '
        Me.GroupBox2.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtStatus7, Me.txtStatus6, Me.txtStatus5, Me.txtStatus4, Me.txtStatus3, Me.txtStatus2, Me.txtStatus1, Me.txtStatus0})
        Me.GroupBox2.Location = New System.Drawing.Point(201, 98)
        Me.GroupBox2.Name = "GroupBox2"
        Me.GroupBox2.Size = New System.Drawing.Size(91, 272)
        Me.GroupBox2.TabIndex = 4
        Me.GroupBox2.TabStop = False
        Me.GroupBox2.Text = "Xe[^X"
        '
        'txtStatus7
        '
        Me.txtStatus7.Location = New System.Drawing.Point(8, 240)
        Me.txtStatus7.Name = "txtStatus7"
        Me.txtStatus7.Size = New System.Drawing.Size(72, 19)
        Me.txtStatus7.TabIndex = 9
        Me.txtStatus7.Text = "TextBox8"
        '
        'txtStatus6
        '
        Me.txtStatus6.Location = New System.Drawing.Point(8, 216)
        Me.txtStatus6.Name = "txtStatus6"
        Me.txtStatus6.Size = New System.Drawing.Size(72, 19)
        Me.txtStatus6.TabIndex = 8
        Me.txtStatus6.Text = "TextBox7"
        '
        'txtStatus5
        '
        Me.txtStatus5.Location = New System.Drawing.Point(8, 192)
        Me.txtStatus5.Name = "txtStatus5"
        Me.txtStatus5.Size = New System.Drawing.Size(72, 19)
        Me.txtStatus5.TabIndex = 7
        Me.txtStatus5.Text = "TextBox6"
        '
        'txtStatus4
        '
        Me.txtStatus4.Location = New System.Drawing.Point(8, 168)
        Me.txtStatus4.Name = "txtStatus4"
        Me.txtStatus4.Size = New System.Drawing.Size(72, 19)
        Me.txtStatus4.TabIndex = 6
        Me.txtStatus4.Text = "TextBox5"
        '
        'txtStatus3
        '
        Me.txtStatus3.Location = New System.Drawing.Point(8, 144)
        Me.txtStatus3.Name = "txtStatus3"
        Me.txtStatus3.Size = New System.Drawing.Size(72, 19)
        Me.txtStatus3.TabIndex = 5
        Me.txtStatus3.Text = "TextBox4"
        '
        'txtStatus2
        '
        Me.txtStatus2.Location = New System.Drawing.Point(8, 120)
        Me.txtStatus2.Name = "txtStatus2"
        Me.txtStatus2.Size = New System.Drawing.Size(72, 19)
        Me.txtStatus2.TabIndex = 4
        Me.txtStatus2.Text = "TextBox3"
        '
        'txtStatus1
        '
        Me.txtStatus1.Location = New System.Drawing.Point(8, 96)
        Me.txtStatus1.Name = "txtStatus1"
        Me.txtStatus1.Size = New System.Drawing.Size(72, 19)
        Me.txtStatus1.TabIndex = 3
        Me.txtStatus1.Text = "TextBox2"
        '
        'txtStatus0
        '
        Me.txtStatus0.Location = New System.Drawing.Point(8, 72)
        Me.txtStatus0.Name = "txtStatus0"
        Me.txtStatus0.Size = New System.Drawing.Size(72, 19)
        Me.txtStatus0.TabIndex = 2
        Me.txtStatus0.Text = "TextBox1"
        '
        'CntTimer
        '
        '
        'Counter
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 12)
        Me.ClientSize = New System.Drawing.Size(538, 437)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnCntExit, Me.btnCntStop, Me.btnCntPreset, Me.btnCntCompare, Me.btnCntInit, Me.Label13, Me.Label11, Me.Label7, Me.GroupBox3, Me.GroupBox1, Me.txtErr, Me.txtStart, Me.Label3, Me.Label1, Me.Label2, Me.cboDeviceName, Me.btnCntStart, Me.btnExit, Me.txtReturnCode, Me.Label10, Me.btnCntMode, Me.Label9, Me.Label8, Me.Label6, Me.Label5, Me.Label4, Me.GroupBox2})
        Me.Font = New System.Drawing.Font("lr oSVbN", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "Counter"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "JE^Tv"
        Me.GroupBox3.ResumeLayout(False)
        Me.GroupBox1.ResumeLayout(False)
        Me.GroupBox2.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Dim Ret As Int32                        ' ߂l
    Dim szError As New System.Text.StringBuilder("", 256)  ' G[
	Dim m_Ch(7) As TextBox					' JEglRg[
	Dim m_Status(7) As TextBox				' Xe[^XlRg[
	Dim m_Preset(7) As TextBox				' vZbglRg[
	Dim CompCount(7) As Integer				' rv
	Dim szText As New String("", 100)

	'---------------------------------------------------------
	'	_CAO
	'---------------------------------------------------------
	Private Sub Counter_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

		Dim i As Short
		Dim PresetData As Integer
		'-----------------------------------
		' foCX̌o
		'-----------------------------------
		Dim Index As Short
		Dim GroupID, UnitID, DeviceID As Short
		Dim DeviceName As New System.Text.StringBuilder("", 256)
		Dim Device As New System.Text.StringBuilder("", 256)
		Index = 0
		Do
			Ret = CntQueryDeviceName(Index, GroupID, UnitID, DeviceID, DeviceName, Device)
			If Ret <> CNT_ERR_SUCCESS Then
				Exit Do
			End If
			cboDeviceName.Items.Add(DeviceName.ToString())
			Index += 1
		Loop
		cboDeviceName.SelectedIndex = 0
		'-----------------------------------
		' ʃACȅ
		'-----------------------------------
		txtReturnCode.Text = ""
		rdoCh0.Checked = True
		rdoPreset0.Checked = True
		' JEgl
		m_Ch(0) = txtCh0
		m_Ch(1) = txtCh1
		m_Ch(2) = txtCh2
		m_Ch(3) = txtCh3
		m_Ch(4) = txtCh4
		m_Ch(5) = txtCh5
		m_Ch(6) = txtCh6
		m_Ch(7) = txtCh7
		For i = 0 To 7
			m_Ch(i).Text = ""
		Next i
		' Xe[^X
		m_Status(0) = txtStatus0
		m_Status(1) = txtStatus1
		m_Status(2) = txtStatus2
		m_Status(3) = txtStatus3
		m_Status(4) = txtStatus4
		m_Status(5) = txtStatus5
		m_Status(6) = txtStatus6
		m_Status(7) = txtStatus7
		For i = 0 To 7
			m_Status(i).Text = ""
		Next i
		' vZbgl
		m_Preset(0) = txtPreset0
		m_Preset(1) = txtPreset1
		m_Preset(2) = txtPreset2
		m_Preset(3) = txtPreset3
		m_Preset(4) = txtPreset4
		m_Preset(5) = txtPreset5
		m_Preset(6) = txtPreset6
		m_Preset(7) = txtPreset7
		For i = 0 To 7
			PresetData = i * 100
			m_Preset(i).Text = Str(PresetData)
		Next i
	End Sub

	'---------------------------------------------------------
	'	
	'---------------------------------------------------------
	Private Sub btnCntInit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCntInit.Click

		Dim szDeviceName As New String("", 100)
		Dim i As Short
		'-----------------------------
		' ʂfoCX擾
		'-----------------------------
		szDeviceName = cboDeviceName.Text
		'-----------------------------
		' sȂAID擾
		'-----------------------------
		Ret = CntInit(szDeviceName, Id)
		'-----------------------------
		' G[
		'-----------------------------
		CntGetErrorString(Ret, szError)
		txtReturnCode.Text = "CntInt : " & szError.ToString()
		If Ret <> CNT_ERR_SUCCESS Then
			Exit Sub
		End If
		'-----------------------------
		' `l擾
		'-----------------------------
		CntGetMaxChannels(Id, ChannelNum)
		'-----------------------------
		' JE^AXe[^XAvZbg
		' \̖
		'-----------------------------
		For i = 0 To 7
			If i < ChannelNum Then
				m_Ch(i).Enabled = True
				m_Status(i).Enabled = True
				m_Preset(i).Enabled = True
			Else
				m_Ch(i).Enabled = False
				m_Status(i).Enabled = False
				m_Preset(i).Enabled = False
			End If
		Next i
		'-----------------------------
		' ^C}N
		'-----------------------------
		CntTimer.Enabled = True

	End Sub

	'---------------------------------------------------------
	'	[h_CAO\
	'---------------------------------------------------------
	Private Sub btnCntMode_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCntMode.Click

		'-----------------------------
		' _CAO[_ŕ\
		'-----------------------------
		Dim ModeDlg As New Mode()
		ModeDlg.ShowDialog()
		ModeDlg.Dispose()

	End Sub

	'---------------------------------------------------------
	'	r_CAO\
	'---------------------------------------------------------
	Private Sub btnCntCompare_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCntCompare.Click

		'-----------------------------
		' _CAO[_ŕ\
		'-----------------------------
		Dim CompDlg As New Comp()
		CompDlg.ShowDialog()
		CompDlg.Dispose()

	End Sub

	'---------------------------------------------------------
	'	JE^X^[g
	'---------------------------------------------------------
	Private Sub btnCntStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCntStart.Click

        Dim ChNo(7) As Short
		Dim i As Short
		'-----------------------------
		' p[^̐ݒ
		'-----------------------------
		For i = 0 To (ChannelNum - 1)
			ChNo(i) = i
		Next i
		'-----------------------------
		' JE^X^[g
		'-----------------------------
        Ret = CntStartCount(Id, ChNo, ChannelNum)
		'-----------------------------
		' G[
		'-----------------------------
		CntGetErrorString(Ret, szError)
		txtReturnCode.Text = "CntStartCount : " & szError.ToString()
		If Ret <> CNT_ERR_SUCCESS Then
			Exit Sub
		End If

	End Sub

	'---------------------------------------------------------
	'	vZbg
	'---------------------------------------------------------
	Private Sub btnCntPreset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCntPreset.Click

		Dim ChNo(7) As Short
        Dim PresetData(7) As Int32
		Dim i As Short
		'-----------------------------
		' ʂ̃f[^擾ƃp[^̐ݒ
		'-----------------------------
        For i = 0 To (ChannelNum - 1)
            ChNo(i) = i
            szText = m_Preset(i).Text
            Try
                If rdoPreset0.Checked = True Then
                    PresetData(i) = Integer.Parse(szText)
                Else
                    PresetData(i) = Integer.Parse(szText, System.Globalization.NumberStyles.HexNumber)
                End If
            Catch ex As Exception
                PresetData(i) = 0
            End Try
        Next i
		'-----------------------------
		' vZbg
		'-----------------------------
        Ret = CntPreset(Id, ChNo, ChannelNum, PresetData)
		'-----------------------------
		' G[
		'-----------------------------
		CntGetErrorString(Ret, szError)
		txtReturnCode.Text = "CntPreset : " & szError.ToString()

	End Sub

	'---------------------------------------------------------
	'	JE^Xgbv
	'---------------------------------------------------------
	Private Sub btnCntStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCntStop.Click

		Dim ChNo(7) As Short
		Dim i As Short
		'-----------------------------
		' p[^̐ݒ
		'-----------------------------
		For i = 0 To (ChannelNum - 1)
			ChNo(i) = i
		Next i
		'-----------------------------
		' JE^Xgbv
		'-----------------------------
        Ret = CntStopCount(Id, ChNo, ChannelNum)
		'-----------------------------
		' G[
		'-----------------------------
		CntGetErrorString(Ret, szError)
		txtReturnCode.Text = "CntStopCount : " & szError.ToString()

	End Sub

	'---------------------------------------------------------
	'	I
	'---------------------------------------------------------
	Private Sub btnCntExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCntExit.Click

		'-----------------------------
		' ^C}~
		'-----------------------------
		CntTimer.Enabled = False
		'-----------------------------
		' Is
		'-----------------------------
		Ret = CntExit(Id)
		'-----------------------------
		' G[
		'-----------------------------
		CntGetErrorString(Ret, szError)
		txtReturnCode.Text = "CntExit :" & szError.ToString()

	End Sub

	'---------------------------------------------------------
	'	_CAOI
	'---------------------------------------------------------
	Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click

		'-----------------------------
		' ^C}~
		'-----------------------------
		CntTimer.Enabled = False
		'-----------------------------
		' Is
		'-----------------------------
		Ret = CntExit(Id)
		'-----------------------------
		' _CAOI
		'-----------------------------
		End

	End Sub

	Private Sub Counter_Closed(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Closed

		' Is
		Ret = CntExit(Id)

	End Sub

	'---------------------------------------------------------
	'	^C}
	'---------------------------------------------------------
	Private Sub CntTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CntTimer.Tick

		Dim ChNo(7) As Short
        Dim CountData(7) As Int32
		Dim Sts(7) As Short
		Dim i As Short
		Dim bIs10 As Boolean
		Dim Start, Err As Byte
		'-----------------------------
		' NWX^l擾
		'-----------------------------
		Ret = CntGetRemoteStatus(Id, Start, Err)
		'-----------------------------
		' G[
		'-----------------------------
		If Ret <> CNT_ERR_SUCCESS Then
			CntGetErrorString(Ret, szError)
			txtReturnCode.Text = "CntGetRemoteStatus : " & szError.ToString()
			Exit Sub
		End If
		'-----------------------------
		' p[^ݒ
		'-----------------------------
		For i = 0 To (ChannelNum - 1)
			ChNo(i) = i
			CountData(i) = 0
		Next i
		'-----------------------------
		' JEgl擾
		'-----------------------------
        Ret = CntReadCount(Id, ChNo, ChannelNum, CountData)
		'-----------------------------
		' G[
		'-----------------------------
		If Ret <> CNT_ERR_SUCCESS Then
			CntGetErrorString(Ret, szError)
			txtReturnCode.Text = "CntReadCount : " & szError.ToString()
			Exit Sub
		End If
		'-----------------------------
		' Xe[^X擾
		'-----------------------------
		For i = 0 To (ChannelNum - 1)
			Ret = CntReadStatus(Id, i, Sts(i))
			'-----------------------------
			' G[
			'-----------------------------
			If Ret <> CNT_ERR_SUCCESS Then
				CntGetErrorString(Ret, szError)
				txtReturnCode.Text = "CntReadStatus : " & szError.ToString()
				Exit Sub
			End If
		Next i
		'-----------------------------
		' JEgf[^AXe[^Xf[^\
		'-----------------------------
		txtStart.Text = String.Format("{0:X2}", Start)
		txtErr.Text = String.Format("{0:X2}", Err)
		bIs10 = rdoCh0.Checked
		For i = 0 To (ChannelNum - 1)
			If bIs10 = True Then
				szText = Str(CountData(i))
			Else
				szText = String.Format("{0:X8}", CountData(i))
			End If
			m_Ch(i).Text = szText
			szText = String.Format("{0:X2}", Sts(i))
			m_Status(i).Text = szText
		Next i

	End Sub

	'---------------------------------------------------------
	'	10i^16iϊ
	'---------------------------------------------------------
	'	`lf[^F10i
	Private Sub rdoCh0_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles rdoCh0.MouseDown

		CntTimer_Tick(CntTimer, New System.EventArgs())

	End Sub


	'	`lf[^F16i
	Private Sub rdoCh1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles rdoCh1.MouseDown

		CntTimer_Tick(CntTimer, New System.EventArgs())

	End Sub

	'	vZbgf[^F10i
	Private Sub rdoPreset0_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles rdoPreset0.MouseDown

		'-----------------------------
		' ʂ̃f[^擾ƕ\̕ύX
		'-----------------------------
		Dim i As Short
		Dim PresetData As Integer
		For i = 0 To 7
			szText = m_Preset(i).Text
            Try
                PresetData = Integer.Parse(szText, System.Globalization.NumberStyles.HexNumber)
            Catch ex As Exception
                PresetData = 0
            End Try
            szText = String.Format("{0:d}", PresetData)
            m_Preset(i).Text = szText
        Next i

	End Sub

	'	vZbgf[^F16i
	Private Sub rdoPreset1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles rdoPreset1.MouseDown

		'-----------------------------
		' ʂ̃f[^擾ƕ\̕ύX
		'-----------------------------
		Dim i As Short
		Dim PresetData As Integer
		For i = 0 To 7
			szText = m_Preset(i).Text
            Try
                PresetData = Integer.Parse(szText)
            Catch ex As Exception
                PresetData = 0
            End Try
            szText = String.Format("{0:X8}", PresetData)
			m_Preset(i).Text = szText
		Next i

	End Sub
End Class