﻿Imports System.Text

Public Class frmEvent
    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 Frame7 As System.Windows.Forms.GroupBox
    Public WithEvents cboCount As System.Windows.Forms.ComboBox
    Public WithEvents Label7 As System.Windows.Forms.Label
    Public WithEvents Label9 As System.Windows.Forms.Label
    Public WithEvents Frame1 As System.Windows.Forms.GroupBox
    Public WithEvents Frame3 As System.Windows.Forms.GroupBox
    Public WithEvents cboRF1 As System.Windows.Forms.ComboBox
    Public WithEvents Frame2 As System.Windows.Forms.GroupBox
    Public WithEvents txtPresetReg As System.Windows.Forms.TextBox
    Public WithEvents cboRF0 As System.Windows.Forms.ComboBox
    Public WithEvents Label3 As System.Windows.Forms.Label
    Public WithEvents Label2 As System.Windows.Forms.Label
    Public WithEvents cboInputEvent As System.Windows.Forms.ComboBox
    Public WithEvents Label1 As System.Windows.Forms.Label
    Public WithEvents ToolTip1 As System.Windows.Forms.ToolTip
    Public WithEvents btnCancel As System.Windows.Forms.Button
    Public WithEvents Label8 As System.Windows.Forms.Label
    Public WithEvents Frame4 As System.Windows.Forms.GroupBox
    Public WithEvents Frame6 As System.Windows.Forms.GroupBox
    Public WithEvents btnOutPulse As System.Windows.Forms.Button
    Public WithEvents txtData As System.Windows.Forms.TextBox
    Public WithEvents txtChNo As System.Windows.Forms.TextBox
    Public WithEvents Label6 As System.Windows.Forms.Label
    Public WithEvents Label5 As System.Windows.Forms.Label
    Public WithEvents cboPulseLength As System.Windows.Forms.ComboBox
    Public WithEvents Frame5 As System.Windows.Forms.GroupBox
    Public WithEvents rdoAlarmError As System.Windows.Forms.RadioButton
    Public WithEvents rdoFilterError As System.Windows.Forms.RadioButton
    Public WithEvents rdoAiError As System.Windows.Forms.RadioButton
    Public WithEvents rdoCountMatch1 As System.Windows.Forms.RadioButton
    Public WithEvents rdoCountMatch0 As System.Windows.Forms.RadioButton
    Public WithEvents rdoGenOutput As System.Windows.Forms.RadioButton
    Public WithEvents Label4 As System.Windows.Forms.Label
    Public WithEvents Label10 As Label
    Public WithEvents btnOK As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Me.Frame7 = New System.Windows.Forms.GroupBox()
        Me.cboCount = New System.Windows.Forms.ComboBox()
        Me.Label7 = New System.Windows.Forms.Label()
        Me.Label9 = New System.Windows.Forms.Label()
        Me.Frame1 = New System.Windows.Forms.GroupBox()
        Me.Frame3 = New System.Windows.Forms.GroupBox()
        Me.cboRF1 = New System.Windows.Forms.ComboBox()
        Me.Frame2 = New System.Windows.Forms.GroupBox()
        Me.txtPresetReg = New System.Windows.Forms.TextBox()
        Me.cboRF0 = New System.Windows.Forms.ComboBox()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.cboInputEvent = New System.Windows.Forms.ComboBox()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
        Me.btnCancel = New System.Windows.Forms.Button()
        Me.Label8 = New System.Windows.Forms.Label()
        Me.Frame4 = New System.Windows.Forms.GroupBox()
        Me.Frame6 = New System.Windows.Forms.GroupBox()
        Me.btnOutPulse = New System.Windows.Forms.Button()
        Me.txtData = New System.Windows.Forms.TextBox()
        Me.txtChNo = New System.Windows.Forms.TextBox()
        Me.Label6 = New System.Windows.Forms.Label()
        Me.Label5 = New System.Windows.Forms.Label()
        Me.cboPulseLength = New System.Windows.Forms.ComboBox()
        Me.Frame5 = New System.Windows.Forms.GroupBox()
        Me.rdoAlarmError = New System.Windows.Forms.RadioButton()
        Me.rdoFilterError = New System.Windows.Forms.RadioButton()
        Me.rdoAiError = New System.Windows.Forms.RadioButton()
        Me.rdoCountMatch1 = New System.Windows.Forms.RadioButton()
        Me.rdoCountMatch0 = New System.Windows.Forms.RadioButton()
        Me.rdoGenOutput = New System.Windows.Forms.RadioButton()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.btnOK = New System.Windows.Forms.Button()
        Me.Label10 = New System.Windows.Forms.Label()
        Me.Frame7.SuspendLayout()
        Me.Frame1.SuspendLayout()
        Me.Frame3.SuspendLayout()
        Me.Frame2.SuspendLayout()
        Me.Frame4.SuspendLayout()
        Me.Frame6.SuspendLayout()
        Me.Frame5.SuspendLayout()
        Me.SuspendLayout()
        '
        'Frame7
        '
        Me.Frame7.BackColor = System.Drawing.SystemColors.Control
        Me.Frame7.Controls.Add(Me.cboCount)
        Me.Frame7.Controls.Add(Me.Label7)
        Me.Frame7.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame7.Location = New System.Drawing.Point(516, 9)
        Me.Frame7.Name = "Frame7"
        Me.Frame7.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame7.Size = New System.Drawing.Size(193, 70)
        Me.Frame7.TabIndex = 51
        Me.Frame7.TabStop = False
        Me.Frame7.Text = "Count Match Event"
        '
        'cboCount
        '
        Me.cboCount.BackColor = System.Drawing.SystemColors.Window
        Me.cboCount.Cursor = System.Windows.Forms.Cursors.Default
        Me.cboCount.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboCount.ForeColor = System.Drawing.SystemColors.WindowText
        Me.cboCount.Location = New System.Drawing.Point(64, 30)
        Me.cboCount.Name = "cboCount"
        Me.cboCount.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cboCount.Size = New System.Drawing.Size(121, 20)
        Me.cboCount.TabIndex = 30
        '
        'Label7
        '
        Me.Label7.AutoSize = True
        Me.Label7.BackColor = System.Drawing.SystemColors.Control
        Me.Label7.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label7.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label7.Location = New System.Drawing.Point(8, 34)
        Me.Label7.Name = "Label7"
        Me.Label7.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label7.Size = New System.Drawing.Size(32, 12)
        Me.Label7.TabIndex = 29
        Me.Label7.Text = "Type:"
        '
        'Label9
        '
        Me.Label9.BackColor = System.Drawing.SystemColors.Control
        Me.Label9.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label9.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label9.Location = New System.Drawing.Point(516, 173)
        Me.Label9.Name = "Label9"
        Me.Label9.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label9.Size = New System.Drawing.Size(193, 36)
        Me.Label9.TabIndex = 52
        Me.Label9.Text = "The count match register is set in the Notification Setting dialog."
        '
        'Frame1
        '
        Me.Frame1.BackColor = System.Drawing.SystemColors.Control
        Me.Frame1.Controls.Add(Me.Frame3)
        Me.Frame1.Controls.Add(Me.Frame2)
        Me.Frame1.Controls.Add(Me.cboInputEvent)
        Me.Frame1.Controls.Add(Me.Label1)
        Me.Frame1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame1.Location = New System.Drawing.Point(12, 9)
        Me.Frame1.Name = "Frame1"
        Me.Frame1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame1.Size = New System.Drawing.Size(233, 328)
        Me.Frame1.TabIndex = 49
        Me.Frame1.TabStop = False
        Me.Frame1.Text = "Event Signal Input"
        '
        'Frame3
        '
        Me.Frame3.BackColor = System.Drawing.SystemColors.Control
        Me.Frame3.Controls.Add(Me.cboRF1)
        Me.Frame3.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame3.Location = New System.Drawing.Point(8, 180)
        Me.Frame3.Name = "Frame3"
        Me.Frame3.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame3.Size = New System.Drawing.Size(217, 78)
        Me.Frame3.TabIndex = 10
        Me.Frame3.TabStop = False
        Me.Frame3.Text = "RF1 (Stop)"
        '
        'cboRF1
        '
        Me.cboRF1.BackColor = System.Drawing.SystemColors.Window
        Me.cboRF1.Cursor = System.Windows.Forms.Cursors.Default
        Me.cboRF1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboRF1.ForeColor = System.Drawing.SystemColors.WindowText
        Me.cboRF1.Location = New System.Drawing.Point(8, 34)
        Me.cboRF1.Name = "cboRF1"
        Me.cboRF1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cboRF1.Size = New System.Drawing.Size(177, 20)
        Me.cboRF1.TabIndex = 11
        '
        'Frame2
        '
        Me.Frame2.BackColor = System.Drawing.SystemColors.Control
        Me.Frame2.Controls.Add(Me.txtPresetReg)
        Me.Frame2.Controls.Add(Me.cboRF0)
        Me.Frame2.Controls.Add(Me.Label3)
        Me.Frame2.Controls.Add(Me.Label2)
        Me.Frame2.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame2.Location = New System.Drawing.Point(8, 68)
        Me.Frame2.Name = "Frame2"
        Me.Frame2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame2.Size = New System.Drawing.Size(217, 96)
        Me.Frame2.TabIndex = 5
        Me.Frame2.TabStop = False
        Me.Frame2.Text = "RF0 (Clear/Preset/Start)"
        '
        'txtPresetReg
        '
        Me.txtPresetReg.AcceptsReturn = True
        Me.txtPresetReg.BackColor = System.Drawing.SystemColors.Window
        Me.txtPresetReg.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.txtPresetReg.ForeColor = System.Drawing.SystemColors.WindowText
        Me.txtPresetReg.Location = New System.Drawing.Point(112, 57)
        Me.txtPresetReg.MaxLength = 0
        Me.txtPresetReg.Name = "txtPresetReg"
        Me.txtPresetReg.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.txtPresetReg.Size = New System.Drawing.Size(73, 20)
        Me.txtPresetReg.TabIndex = 8
        Me.txtPresetReg.Text = "Text1"
        '
        'cboRF0
        '
        Me.cboRF0.BackColor = System.Drawing.SystemColors.Window
        Me.cboRF0.Cursor = System.Windows.Forms.Cursors.Default
        Me.cboRF0.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboRF0.ForeColor = System.Drawing.SystemColors.WindowText
        Me.cboRF0.Location = New System.Drawing.Point(8, 26)
        Me.cboRF0.Name = "cboRF0"
        Me.cboRF0.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cboRF0.Size = New System.Drawing.Size(177, 20)
        Me.cboRF0.TabIndex = 6
        '
        'Label3
        '
        Me.Label3.AutoSize = True
        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(189, 60)
        Me.Label3.Name = "Label3"
        Me.Label3.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label3.Size = New System.Drawing.Size(25, 12)
        Me.Label3.TabIndex = 9
        Me.Label3.Text = "Hex"
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        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(8, 60)
        Me.Label2.Name = "Label2"
        Me.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label2.Size = New System.Drawing.Size(87, 12)
        Me.Label2.TabIndex = 7
        Me.Label2.Text = "Preset Register:"
        '
        'cboInputEvent
        '
        Me.cboInputEvent.BackColor = System.Drawing.SystemColors.Window
        Me.cboInputEvent.Cursor = System.Windows.Forms.Cursors.Default
        Me.cboInputEvent.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboInputEvent.ForeColor = System.Drawing.SystemColors.WindowText
        Me.cboInputEvent.Location = New System.Drawing.Point(56, 21)
        Me.cboInputEvent.Name = "cboInputEvent"
        Me.cboInputEvent.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cboInputEvent.Size = New System.Drawing.Size(145, 20)
        Me.cboInputEvent.TabIndex = 4
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        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(8, 26)
        Me.Label1.Name = "Label1"
        Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label1.Size = New System.Drawing.Size(32, 12)
        Me.Label1.TabIndex = 3
        Me.Label1.Text = "Type:"
        '
        'btnCancel
        '
        Me.btnCancel.BackColor = System.Drawing.SystemColors.Control
        Me.btnCancel.Cursor = System.Windows.Forms.Cursors.Default
        Me.btnCancel.ForeColor = System.Drawing.SystemColors.ControlText
        Me.btnCancel.Location = New System.Drawing.Point(620, 310)
        Me.btnCancel.Name = "btnCancel"
        Me.btnCancel.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.btnCancel.Size = New System.Drawing.Size(89, 26)
        Me.btnCancel.TabIndex = 48
        Me.btnCancel.Text = "Cancel"
        Me.btnCancel.UseVisualStyleBackColor = False
        '
        'Label8
        '
        Me.Label8.BackColor = System.Drawing.SystemColors.Control
        Me.Label8.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label8.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label8.Location = New System.Drawing.Point(516, 104)
        Me.Label8.Name = "Label8"
        Me.Label8.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label8.Size = New System.Drawing.Size(193, 35)
        Me.Label8.TabIndex = 53
        Me.Label8.Text = "All channels use the same setting."
        '
        'Frame4
        '
        Me.Frame4.BackColor = System.Drawing.SystemColors.Control
        Me.Frame4.Controls.Add(Me.Label10)
        Me.Frame4.Controls.Add(Me.Frame6)
        Me.Frame4.Controls.Add(Me.cboPulseLength)
        Me.Frame4.Controls.Add(Me.Frame5)
        Me.Frame4.Controls.Add(Me.Label4)
        Me.Frame4.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame4.Location = New System.Drawing.Point(252, 9)
        Me.Frame4.Name = "Frame4"
        Me.Frame4.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame4.Size = New System.Drawing.Size(257, 328)
        Me.Frame4.TabIndex = 50
        Me.Frame4.TabStop = False
        Me.Frame4.Text = "Event Signal Output"
        '
        'Frame6
        '
        Me.Frame6.BackColor = System.Drawing.SystemColors.Control
        Me.Frame6.Controls.Add(Me.btnOutPulse)
        Me.Frame6.Controls.Add(Me.txtData)
        Me.Frame6.Controls.Add(Me.txtChNo)
        Me.Frame6.Controls.Add(Me.Label6)
        Me.Frame6.Controls.Add(Me.Label5)
        Me.Frame6.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame6.Location = New System.Drawing.Point(8, 232)
        Me.Frame6.Name = "Frame6"
        Me.Frame6.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame6.Size = New System.Drawing.Size(241, 87)
        Me.Frame6.TabIndex = 22
        Me.Frame6.TabStop = False
        Me.Frame6.Text = "General Output"
        '
        'btnOutPulse
        '
        Me.btnOutPulse.BackColor = System.Drawing.SystemColors.Control
        Me.btnOutPulse.Cursor = System.Windows.Forms.Cursors.Default
        Me.btnOutPulse.ForeColor = System.Drawing.SystemColors.ControlText
        Me.btnOutPulse.Location = New System.Drawing.Point(152, 34)
        Me.btnOutPulse.Name = "btnOutPulse"
        Me.btnOutPulse.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.btnOutPulse.Size = New System.Drawing.Size(81, 26)
        Me.btnOutPulse.TabIndex = 27
        Me.btnOutPulse.Text = "Signal Output"
        Me.btnOutPulse.UseVisualStyleBackColor = False
        '
        'txtData
        '
        Me.txtData.AcceptsReturn = True
        Me.txtData.BackColor = System.Drawing.SystemColors.Window
        Me.txtData.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.txtData.ForeColor = System.Drawing.SystemColors.WindowText
        Me.txtData.Location = New System.Drawing.Point(88, 52)
        Me.txtData.MaxLength = 0
        Me.txtData.Name = "txtData"
        Me.txtData.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.txtData.Size = New System.Drawing.Size(57, 19)
        Me.txtData.TabIndex = 26
        Me.txtData.Text = "Text2"
        '
        'txtChNo
        '
        Me.txtChNo.AcceptsReturn = True
        Me.txtChNo.BackColor = System.Drawing.SystemColors.Window
        Me.txtChNo.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.txtChNo.ForeColor = System.Drawing.SystemColors.WindowText
        Me.txtChNo.Location = New System.Drawing.Point(88, 26)
        Me.txtChNo.MaxLength = 0
        Me.txtChNo.Name = "txtChNo"
        Me.txtChNo.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.txtChNo.Size = New System.Drawing.Size(57, 19)
        Me.txtChNo.TabIndex = 25
        Me.txtChNo.Text = "Text2"
        '
        'Label6
        '
        Me.Label6.BackColor = System.Drawing.SystemColors.Control
        Me.Label6.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label6.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label6.Location = New System.Drawing.Point(8, 53)
        Me.Label6.Name = "Label6"
        Me.Label6.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label6.Size = New System.Drawing.Size(65, 18)
        Me.Label6.TabIndex = 24
        Me.Label6.Text = "Data:"
        '
        'Label5
        '
        Me.Label5.AutoSize = True
        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, 29)
        Me.Label5.Name = "Label5"
        Me.Label5.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label5.Size = New System.Drawing.Size(68, 12)
        Me.Label5.TabIndex = 23
        Me.Label5.Text = "Channel No.:"
        '
        'cboPulseLength
        '
        Me.cboPulseLength.BackColor = System.Drawing.SystemColors.Window
        Me.cboPulseLength.Cursor = System.Windows.Forms.Cursors.Default
        Me.cboPulseLength.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboPulseLength.ForeColor = System.Drawing.SystemColors.WindowText
        Me.cboPulseLength.Location = New System.Drawing.Point(160, 203)
        Me.cboPulseLength.Name = "cboPulseLength"
        Me.cboPulseLength.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cboPulseLength.Size = New System.Drawing.Size(56, 20)
        Me.cboPulseLength.TabIndex = 21
        '
        'Frame5
        '
        Me.Frame5.BackColor = System.Drawing.SystemColors.Control
        Me.Frame5.Controls.Add(Me.rdoAlarmError)
        Me.Frame5.Controls.Add(Me.rdoFilterError)
        Me.Frame5.Controls.Add(Me.rdoAiError)
        Me.Frame5.Controls.Add(Me.rdoCountMatch1)
        Me.Frame5.Controls.Add(Me.rdoCountMatch0)
        Me.Frame5.Controls.Add(Me.rdoGenOutput)
        Me.Frame5.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame5.Location = New System.Drawing.Point(8, 26)
        Me.Frame5.Name = "Frame5"
        Me.Frame5.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame5.Size = New System.Drawing.Size(241, 164)
        Me.Frame5.TabIndex = 13
        Me.Frame5.TabStop = False
        Me.Frame5.Text = "Type:"
        '
        'rdoAlarmError
        '
        Me.rdoAlarmError.BackColor = System.Drawing.SystemColors.Control
        Me.rdoAlarmError.Cursor = System.Windows.Forms.Cursors.Default
        Me.rdoAlarmError.ForeColor = System.Drawing.SystemColors.ControlText
        Me.rdoAlarmError.Location = New System.Drawing.Point(16, 138)
        Me.rdoAlarmError.Name = "rdoAlarmError"
        Me.rdoAlarmError.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.rdoAlarmError.Size = New System.Drawing.Size(153, 18)
        Me.rdoAlarmError.TabIndex = 19
        Me.rdoAlarmError.TabStop = True
        Me.rdoAlarmError.Text = "Alarm Error"
        Me.rdoAlarmError.UseVisualStyleBackColor = False
        '
        'rdoFilterError
        '
        Me.rdoFilterError.BackColor = System.Drawing.SystemColors.Control
        Me.rdoFilterError.Cursor = System.Windows.Forms.Cursors.Default
        Me.rdoFilterError.ForeColor = System.Drawing.SystemColors.ControlText
        Me.rdoFilterError.Location = New System.Drawing.Point(16, 116)
        Me.rdoFilterError.Name = "rdoFilterError"
        Me.rdoFilterError.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.rdoFilterError.Size = New System.Drawing.Size(153, 18)
        Me.rdoFilterError.TabIndex = 18
        Me.rdoFilterError.TabStop = True
        Me.rdoFilterError.Text = "Digital Filter Error"
        Me.rdoFilterError.UseVisualStyleBackColor = False
        '
        'rdoAiError
        '
        Me.rdoAiError.BackColor = System.Drawing.SystemColors.Control
        Me.rdoAiError.Cursor = System.Windows.Forms.Cursors.Default
        Me.rdoAiError.ForeColor = System.Drawing.SystemColors.ControlText
        Me.rdoAiError.Location = New System.Drawing.Point(16, 93)
        Me.rdoAiError.Name = "rdoAiError"
        Me.rdoAiError.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.rdoAiError.Size = New System.Drawing.Size(153, 19)
        Me.rdoAiError.TabIndex = 17
        Me.rdoAiError.TabStop = True
        Me.rdoAiError.Text = "Abnormal Input Error"
        Me.rdoAiError.UseVisualStyleBackColor = False
        '
        'rdoCountMatch1
        '
        Me.rdoCountMatch1.BackColor = System.Drawing.SystemColors.Control
        Me.rdoCountMatch1.Cursor = System.Windows.Forms.Cursors.Default
        Me.rdoCountMatch1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.rdoCountMatch1.Location = New System.Drawing.Point(16, 71)
        Me.rdoCountMatch1.Name = "rdoCountMatch1"
        Me.rdoCountMatch1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.rdoCountMatch1.Size = New System.Drawing.Size(153, 19)
        Me.rdoCountMatch1.TabIndex = 16
        Me.rdoCountMatch1.TabStop = True
        Me.rdoCountMatch1.Text = "Count Match REG1"
        Me.rdoCountMatch1.UseVisualStyleBackColor = False
        '
        'rdoCountMatch0
        '
        Me.rdoCountMatch0.BackColor = System.Drawing.SystemColors.Control
        Me.rdoCountMatch0.Cursor = System.Windows.Forms.Cursors.Default
        Me.rdoCountMatch0.ForeColor = System.Drawing.SystemColors.ControlText
        Me.rdoCountMatch0.Location = New System.Drawing.Point(16, 48)
        Me.rdoCountMatch0.Name = "rdoCountMatch0"
        Me.rdoCountMatch0.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.rdoCountMatch0.Size = New System.Drawing.Size(153, 18)
        Me.rdoCountMatch0.TabIndex = 15
        Me.rdoCountMatch0.TabStop = True
        Me.rdoCountMatch0.Text = "Count Match REG0"
        Me.rdoCountMatch0.UseVisualStyleBackColor = False
        '
        'rdoGenOutput
        '
        Me.rdoGenOutput.BackColor = System.Drawing.SystemColors.Control
        Me.rdoGenOutput.Cursor = System.Windows.Forms.Cursors.Default
        Me.rdoGenOutput.ForeColor = System.Drawing.SystemColors.ControlText
        Me.rdoGenOutput.Location = New System.Drawing.Point(16, 26)
        Me.rdoGenOutput.Name = "rdoGenOutput"
        Me.rdoGenOutput.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.rdoGenOutput.Size = New System.Drawing.Size(153, 18)
        Me.rdoGenOutput.TabIndex = 14
        Me.rdoGenOutput.TabStop = True
        Me.rdoGenOutput.Text = "General Output"
        Me.rdoGenOutput.UseVisualStyleBackColor = False
        '
        'Label4
        '
        Me.Label4.AutoSize = True
        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(16, 206)
        Me.Label4.Name = "Label4"
        Me.Label4.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label4.Size = New System.Drawing.Size(135, 12)
        Me.Label4.TabIndex = 20
        Me.Label4.Text = "Pulse Width (Coefficient):"
        '
        'btnOK
        '
        Me.btnOK.BackColor = System.Drawing.SystemColors.Control
        Me.btnOK.Cursor = System.Windows.Forms.Cursors.Default
        Me.btnOK.ForeColor = System.Drawing.SystemColors.ControlText
        Me.btnOK.Location = New System.Drawing.Point(524, 310)
        Me.btnOK.Name = "btnOK"
        Me.btnOK.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.btnOK.Size = New System.Drawing.Size(89, 26)
        Me.btnOK.TabIndex = 47
        Me.btnOK.Text = "OK"
        Me.btnOK.UseVisualStyleBackColor = False
        '
        'Label10
        '
        Me.Label10.AutoSize = True
        Me.Label10.BackColor = System.Drawing.SystemColors.Control
        Me.Label10.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label10.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label10.Location = New System.Drawing.Point(222, 206)
        Me.Label10.Name = "Label10"
        Me.Label10.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label10.Size = New System.Drawing.Size(25, 12)
        Me.Label10.TabIndex = 23
        Me.Label10.Text = "Hex"
        '
        'frmEvent
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 12)
        Me.ClientSize = New System.Drawing.Size(720, 374)
        Me.Controls.Add(Me.Label9)
        Me.Controls.Add(Me.Frame1)
        Me.Controls.Add(Me.btnCancel)
        Me.Controls.Add(Me.Label8)
        Me.Controls.Add(Me.Frame4)
        Me.Controls.Add(Me.btnOK)
        Me.Controls.Add(Me.Frame7)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "frmEvent"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Hardware Event Setting"
        Me.Frame7.ResumeLayout(False)
        Me.Frame7.PerformLayout()
        Me.Frame1.ResumeLayout(False)
        Me.Frame1.PerformLayout()
        Me.Frame3.ResumeLayout(False)
        Me.Frame2.ResumeLayout(False)
        Me.Frame2.PerformLayout()
        Me.Frame4.ResumeLayout(False)
        Me.Frame4.PerformLayout()
        Me.Frame6.ResumeLayout(False)
        Me.Frame6.PerformLayout()
        Me.Frame5.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Dim OutputEvent As Integer = CNT_OEVENT_GENOUT
    Dim RF0 As Integer = CNT_INP_NONE
    Dim RF1 As Integer = CNT_INP_NONE
    Dim PresetReg As Integer = &H1000S


    '===================================================
    '	Dialog initialization
    '===================================================
    Private Sub frmEvent_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.Left = (Screen.PrimaryScreen.Bounds.Width - Me.Width) / 2
        Me.Top = (Screen.PrimaryScreen.Bounds.Height - Me.Height) / 2
        '===================================================
        '	Initialize combo boxes
        '===================================================
        'Signal input event
        With cboInputEvent
            .Items.Clear()
            .Items.Insert(0, "General Input")
            .Items.Insert(1, "Counter Start/Stop")
            .Items.Insert(2, "Counter Preset")
            .Items.Insert(3, "Counter Clear")
        End With

        'Counter Event
        With cboCount
            .Items.Clear()
            .Items.Insert(0, "None")
            .Items.Insert(1, "Preset")
            .Items.Insert(2, "Clear")
        End With

        'RF0 rising/falling
        With cboRF0
            .Items.Clear()
            .Items.Insert(0, "None")
            .Items.Insert(1, "Rising")
            .Items.Insert(2, "Falling")
        End With

        'RF1 rising/falling
        With cboRF1
            .Items.Clear()
            .Items.Insert(0, "None")
            .Items.Insert(1, "Rising")
            .Items.Insert(2, "Falling")
        End With

        'Pulse width
        With cboPulseLength
            .Items.Clear()
            .Items.Insert(&H0S, "0")
            .Items.Insert(&H1S, "1")
            .Items.Insert(&H2S, "2")
            .Items.Insert(&H3S, "3")
            .Items.Insert(&H4S, "4")
            .Items.Insert(&H5S, "5")
            .Items.Insert(&H6S, "6")
            .Items.Insert(&H7S, "7")
            .Items.Insert(&H8S, "8")
            .Items.Insert(&H9S, "9")
            .Items.Insert(&HAS, "A")
            .Items.Insert(&HBS, "B")
            .Items.Insert(&HCS, "C")
            .Items.Insert(&HDS, "D")
            .Items.Insert(&HES, "E")
            .Items.Insert(&HFS, "F")
        End With

        cboInputEvent.SelectedIndex = 0
        cboCount.SelectedIndex = 0
        cboRF0.SelectedIndex = 2
        cboRF1.SelectedIndex = 2
        cboPulseLength.SelectedIndex = 0
        txtPresetReg.Text = "1000"

        '===================================================
        '	Initialize data
        '===================================================
        ' Input event signal
        cboInputEvent_SelectedIndexChanged(cboInputEvent, New System.EventArgs())

        'Output event signal
        If OutputEvent = CNT_OEVENT_GENOUT Then
            rdoGenOutput.Checked = System.Windows.Forms.CheckState.Checked
            cboPulseLength.Enabled = False
            txtChNo.Enabled = True
            txtData.Enabled = True
            btnOutPulse.Enabled = True
        End If
        If OutputEvent And CNT_OEVENT_MATCH0 Then
            rdoCountMatch0.Checked = System.Windows.Forms.CheckState.Checked
            cboPulseLength.Enabled = True
            txtChNo.Enabled = False
            txtData.Enabled = False
            btnOutPulse.Enabled = False
        End If
        If OutputEvent And CNT_OEVENT_MATCH1 Then
            rdoCountMatch1.Checked = System.Windows.Forms.CheckState.Checked
            cboPulseLength.Enabled = True
            txtChNo.Enabled = False
            txtData.Enabled = False
            btnOutPulse.Enabled = False
        End If
        If OutputEvent And CNT_OEVENT_AIERR Then
            rdoAiError.Checked = System.Windows.Forms.CheckState.Checked
            cboPulseLength.Enabled = True
            txtChNo.Enabled = False
            txtData.Enabled = False
            btnOutPulse.Enabled = False
        End If
        If OutputEvent And CNT_OEVENT_FLTERR Then
            rdoFilterError.Checked = System.Windows.Forms.CheckState.Checked
            cboPulseLength.Enabled = True
            txtChNo.Enabled = False
            txtData.Enabled = False
            btnOutPulse.Enabled = False
        End If

        If OutputEvent And CNT_OEVENT_ALMERR Then
            rdoAlarmError.Checked = System.Windows.Forms.CheckState.Checked
            cboPulseLength.Enabled = True
            txtChNo.Enabled = False
            txtData.Enabled = False
            btnOutPulse.Enabled = False
        End If
        txtChNo.Text = "0"
        txtData.Text = "1"
    End Sub

    '---------------------------------------------
    ' Setting completion processing
    '---------------------------------------------
    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        Dim dwInputEvent As Integer
        Dim wPulseLength As Short
        Dim dwCountEvent As Integer
        Dim ChNo As Short
        Dim ret As Integer
        Dim str As String
        Dim buf As New String("", 100)
        Dim error_string As New StringBuilder("", 256)

        '-------------------------------
        ' Get setting information
        '-------------------------------
        ' Input event signal
        ' Input Event
        dwInputEvent = cboInputEvent.SelectedIndex
        ' Preset Reg
        ' In order to set the Preset Reg value to signed, convert it once through hexadecimal characters
        PresetReg = Convert.ToInt32(Hex(Val("&H" & txtPresetReg.Text)), 16)
        ' RF0
        RF0 = cboRF0.SelectedIndex
        ' RF1
        RF1 = cboRF1.SelectedIndex


        ' Output event signal
        OutputEvent = CNT_OEVENT_GENOUT

        If rdoCountMatch0.Checked = True Then
            OutputEvent = OutputEvent Or CNT_OEVENT_MATCH0

        ElseIf rdoCountMatch1.Checked = True Then
            OutputEvent = OutputEvent Or CNT_OEVENT_MATCH1

        ElseIf rdoAiError.Checked = True Then
            OutputEvent = OutputEvent Or CNT_OEVENT_AIERR

        ElseIf rdoFilterError.Checked = True Then
            OutputEvent = OutputEvent Or CNT_OEVENT_FLTERR

        ElseIf rdoAlarmError.Checked = True Then
            OutputEvent = OutputEvent Or CNT_OEVENT_ALMERR
        End If

        ' Pulse width
        Select Case cboPulseLength.SelectedIndex
            Case 0
                wPulseLength = &H0S
            Case 1
                wPulseLength = &H1S
            Case 2
                wPulseLength = &H2S
            Case 3
                wPulseLength = &H3S
            Case 4
                wPulseLength = &H4S
        End Select
        ' Count match event
        dwCountEvent = cboCount.SelectedIndex

        '-------------------------------
        ' Set the set information to device
        '-------------------------------
        For ChNo = 0 To frmCounter.ChannelNum - 1
            '---------------------------------------------
            ' Set hardware event of control input signal
            '---------------------------------------------
            ret = CntSetInputHardwareEvent(frmCounter.Id, ChNo, dwInputEvent, RF0, RF1, 0)
            If ret <> 0 Then
                CntGetErrorString(ret, error_string)
                str = String.Format("CntSetInputHardwareEvent : ret = {0:D}" & vbCrLf & error_string.ToString(), ret)
                MsgBox(str, MsgBoxStyle.OKOnly, "Error")
                GoTo ERR_END
            End If
            '---------------------------------------------
            ' Set preset register
            '---------------------------------------------
            If dwInputEvent = CNT_IEVENT_PRESET Or dwCountEvent = CNT_MATCH_PRESET Then
                ret = CntSetPresetRegister(frmCounter.Id, ChNo, PresetReg, 0)
                If ret <> 0 Then
                    CntGetErrorString(ret, error_string)
                    str = String.Format("CntSetPresetRegister : ret = {0:D}" & vbCrLf & error_string.ToString(), ret)
                    MsgBox(str, MsgBoxStyle.OKOnly, "Error")
                    GoTo ERR_END
                End If
            End If
            '---------------------------------------------
            ' Set hardware event of control output signal
            '---------------------------------------------
            ret = CntSetOutputHardwareEvent(frmCounter.Id, ChNo, 0, OutputEvent, wPulseLength)
            If ret <> 0 Then
                CntGetErrorString(ret, error_string)
                str = String.Format("CntSetOutputHardwareEvent : ret = {0:D}" & vbCrLf & error_string.ToString(), ret)
                MsgBox(str, MsgBoxStyle.OKOnly, "Error")
                GoTo ERR_END
            End If
            '---------------------------------------------
            ' Set hardware event of count match
            '---------------------------------------------
            ret = CntSetCountMatchHardwareEvent(frmCounter.Id, ChNo, 0, dwCountEvent, 0)
            If ret <> 0 Then
                CntGetErrorString(ret, error_string)
                str = String.Format("CntSetCountMatchHardwareEvent : ret = {0:D}" & vbCrLf & error_string.ToString(), ret)
                MsgBox(str, MsgBoxStyle.OKOnly, "Error")
                GoTo ERR_END
            End If
        Next ChNo
ERR_END:
        Me.Hide()
    End Sub

    '---------------------------------------------
    ' Cancel processing
    '---------------------------------------------
    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Me.Hide()
    End Sub

    '---------------------------------------------
    ' Set event signal input
    '---------------------------------------------
    Private Sub cboInputEvent_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboInputEvent.SelectedIndexChanged
        If cboInputEvent.Text = "General Input" Then
            cboRF0.SelectedIndex = 0
            cboRF1.SelectedIndex = 0
            cboRF0.Enabled = False
            cboRF1.Enabled = False
            txtPresetReg.Enabled = False
        End If
        If cboInputEvent.Text = "Counter Start/Stop" Then
            cboRF0.Enabled = True
            cboRF1.Enabled = True
            txtPresetReg.Enabled = False
        End If
        If cboInputEvent.Text = "Counter Preset" Then
            cboRF0.Enabled = True
            cboRF1.SelectedIndex = 0
            cboRF1.Enabled = False
            txtPresetReg.Enabled = True
        End If
        If cboInputEvent.Text = "Counter Clear" Then
            cboRF0.Enabled = True
            cboRF1.SelectedIndex = 0
            cboRF1.Enabled = False
            txtPresetReg.Enabled = False
        End If
        If cboCount.Text = "Preset" Then
            txtPresetReg.Enabled = True
        End If
    End Sub

    Private Sub cboCount_Selendok(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoGenOutput.Click
        cboInputEvent_SelectedIndexChanged(cboInputEvent, New System.EventArgs())
    End Sub

    '---------------------------------------------
    ' Set event signal output
    '---------------------------------------------
    Private Sub rdoGenOutput_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoGenOutput.Click

        cboPulseLength.Enabled = False
        txtChNo.Enabled = True
        txtData.Enabled = True
        btnOutPulse.Enabled = True

    End Sub

    Private Sub rdoCountMatch0_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoCountMatch0.Click

        cboPulseLength.Enabled = True
        txtChNo.Enabled = False
        txtData.Enabled = False
        btnOutPulse.Enabled = False

    End Sub

    Private Sub rdoCountMatch1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoCountMatch1.Click

        cboPulseLength.Enabled = True
        txtChNo.Enabled = False
        txtData.Enabled = False
        btnOutPulse.Enabled = False

    End Sub

    Private Sub rdoAiError_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoAiError.Click

        cboPulseLength.Enabled = True
        txtChNo.Enabled = False
        txtData.Enabled = False
        btnOutPulse.Enabled = False

    End Sub

    Private Sub rdoFilterError_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdoFilterError.Click

        cboPulseLength.Enabled = True
        txtChNo.Enabled = False
        txtData.Enabled = False
        btnOutPulse.Enabled = False

    End Sub

    Private Sub rdoAlarmError_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoAlarmError.Click

        cboPulseLength.Enabled = True
        txtChNo.Enabled = False
        txtData.Enabled = False
        btnOutPulse.Enabled = False

    End Sub

    '---------------------------------------------
    ' Signal output processing
    '---------------------------------------------
    Private Sub btnOutPulse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOutPulse.Click
        Dim ChNo As Short
        Dim Data As Byte
        Dim ret As Integer
        Dim str As String
        Dim buf As New String("", 100)
        Dim error_string As New StringBuilder("", 256)

        ChNo = Val(txtChNo.Text)
        Data = CByte(txtData.Text)
        '---------------------------------------------
        ' General output processing
        '---------------------------------------------
        ret = CntOutputDOBit(frmCounter.Id, ChNo, 0, Data)
        If ret <> 0 Then
            CntGetErrorString(ret, error_string)
            str = String.Format("CntOutPulse : ret = {0:D}" & vbCrLf & error_string.ToString(), ret)
            MsgBox(str, MsgBoxStyle.OKOnly, "Error")
        End If
    End Sub

    Private Sub frmEvent_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        e.Cancel = True
        Me.Hide()
    End Sub
End Class
