﻿Imports System.Text

Public Class frmEvent
    Inherits System.Windows.Forms.Form

#Region " Windows フォーム デザイナで生成されたコード "

    Public Sub New()
        MyBase.New()

        ' この呼び出しは Windows フォーム デザイナで必要です。
        InitializeComponent()

        ' InitializeComponent() 呼び出しの後に初期化を追加します。

    End Sub

    ' Form は dispose をオーバーライドしてコンポーネント一覧を消去します。
    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 フォーム デザイナで必要です。
    Private components As System.ComponentModel.IContainer

    ' メモ : 以下のプロシージャは、Windows フォーム デザイナで必要です。
    ' Windows フォーム デザイナを使って変更してください。  
    ' コード エディタは使用しないでください。
    Public WithEvents btnOK As System.Windows.Forms.Button
    Public WithEvents Label8 As System.Windows.Forms.Label
    Public WithEvents btnCancel As System.Windows.Forms.Button
    Public WithEvents ToolTip1 As System.Windows.Forms.ToolTip
    Public WithEvents Label9 As System.Windows.Forms.Label
    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 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 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 Label10 As Label
    Public WithEvents Label1 As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Me.btnOK = New System.Windows.Forms.Button()
        Me.Label8 = New System.Windows.Forms.Label()
        Me.btnCancel = New System.Windows.Forms.Button()
        Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
        Me.Label9 = New System.Windows.Forms.Label()
        Me.Frame7 = New System.Windows.Forms.GroupBox()
        Me.cboCount = New System.Windows.Forms.ComboBox()
        Me.Label7 = 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.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.Label10 = New System.Windows.Forms.Label()
        Me.Frame7.SuspendLayout()
        Me.Frame4.SuspendLayout()
        Me.Frame6.SuspendLayout()
        Me.Frame5.SuspendLayout()
        Me.Frame1.SuspendLayout()
        Me.Frame3.SuspendLayout()
        Me.Frame2.SuspendLayout()
        Me.SuspendLayout()
        '
        '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, 289)
        Me.btnOK.Name = "btnOK"
        Me.btnOK.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.btnOK.Size = New System.Drawing.Size(89, 24)
        Me.btnOK.TabIndex = 0
        Me.btnOK.Text = "OK"
        Me.btnOK.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, 97)
        Me.Label8.Name = "Label8"
        Me.Label8.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label8.Size = New System.Drawing.Size(193, 33)
        Me.Label8.TabIndex = 46
        Me.Label8.Text = "全てのチャネルにおいて同一の設定となります。"
        '
        '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, 289)
        Me.btnCancel.Name = "btnCancel"
        Me.btnCancel.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.btnCancel.Size = New System.Drawing.Size(89, 24)
        Me.btnCancel.TabIndex = 41
        Me.btnCancel.Text = "ｷｬﾝｾﾙ"
        Me.btnCancel.UseVisualStyleBackColor = False
        '
        '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, 161)
        Me.Label9.Name = "Label9"
        Me.Label9.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label9.Size = New System.Drawing.Size(193, 33)
        Me.Label9.TabIndex = 45
        Me.Label9.Text = "カウント一致レジスタの設定は通知設定 ダイアログで行います。"
        '
        '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, 65)
        Me.Frame7.TabIndex = 44
        Me.Frame7.TabStop = False
        Me.Frame7.Text = "カウント一致イベント"
        '
        '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, 28)
        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, 32)
        Me.Label7.Name = "Label7"
        Me.Label7.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label7.Size = New System.Drawing.Size(37, 12)
        Me.Label7.TabIndex = 29
        Me.Label7.Text = "タイプ："
        '
        '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, 305)
        Me.Frame4.TabIndex = 43
        Me.Frame4.TabStop = False
        Me.Frame4.Text = "イベント信号出力"
        '
        '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, 216)
        Me.Frame6.Name = "Frame6"
        Me.Frame6.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame6.Size = New System.Drawing.Size(241, 81)
        Me.Frame6.TabIndex = 22
        Me.Frame6.TabStop = False
        Me.Frame6.Text = "汎用出力"
        '
        '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, 32)
        Me.btnOutPulse.Name = "btnOutPulse"
        Me.btnOutPulse.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.btnOutPulse.Size = New System.Drawing.Size(81, 24)
        Me.btnOutPulse.TabIndex = 27
        Me.btnOutPulse.Text = "信号出力"
        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, 48)
        Me.txtData.MaxLength = 0
        Me.txtData.Name = "txtData"
        Me.txtData.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.txtData.Size = New System.Drawing.Size(57, 18)
        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, 24)
        Me.txtChNo.MaxLength = 0
        Me.txtChNo.Name = "txtChNo"
        Me.txtChNo.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.txtChNo.Size = New System.Drawing.Size(57, 18)
        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, 49)
        Me.Label6.Name = "Label6"
        Me.Label6.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label6.Size = New System.Drawing.Size(65, 17)
        Me.Label6.TabIndex = 24
        Me.Label6.Text = "データ："
        '
        '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, 27)
        Me.Label5.Name = "Label5"
        Me.Label5.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label5.Size = New System.Drawing.Size(72, 12)
        Me.Label5.TabIndex = 23
        Me.Label5.Text = "チャネル番号："
        '
        '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(106, 189)
        Me.cboPulseLength.Name = "cboPulseLength"
        Me.cboPulseLength.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cboPulseLength.Size = New System.Drawing.Size(70, 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, 24)
        Me.Frame5.Name = "Frame5"
        Me.Frame5.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame5.Size = New System.Drawing.Size(241, 153)
        Me.Frame5.TabIndex = 13
        Me.Frame5.TabStop = False
        Me.Frame5.Text = "タイプ："
        '
        '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, 128)
        Me.rdoAlarmError.Name = "rdoAlarmError"
        Me.rdoAlarmError.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.rdoAlarmError.Size = New System.Drawing.Size(153, 17)
        Me.rdoAlarmError.TabIndex = 19
        Me.rdoAlarmError.TabStop = True
        Me.rdoAlarmError.Text = "アラームエラー"
        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, 108)
        Me.rdoFilterError.Name = "rdoFilterError"
        Me.rdoFilterError.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.rdoFilterError.Size = New System.Drawing.Size(153, 17)
        Me.rdoFilterError.TabIndex = 18
        Me.rdoFilterError.TabStop = True
        Me.rdoFilterError.Text = "デジタルフィルタエラー"
        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, 87)
        Me.rdoAiError.Name = "rdoAiError"
        Me.rdoAiError.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.rdoAiError.Size = New System.Drawing.Size(153, 17)
        Me.rdoAiError.TabIndex = 17
        Me.rdoAiError.TabStop = True
        Me.rdoAiError.Text = "異常入力エラー"
        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, 66)
        Me.rdoCountMatch1.Name = "rdoCountMatch1"
        Me.rdoCountMatch1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.rdoCountMatch1.Size = New System.Drawing.Size(153, 17)
        Me.rdoCountMatch1.TabIndex = 16
        Me.rdoCountMatch1.TabStop = True
        Me.rdoCountMatch1.Text = "カウント一致 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, 45)
        Me.rdoCountMatch0.Name = "rdoCountMatch0"
        Me.rdoCountMatch0.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.rdoCountMatch0.Size = New System.Drawing.Size(153, 17)
        Me.rdoCountMatch0.TabIndex = 15
        Me.rdoCountMatch0.TabStop = True
        Me.rdoCountMatch0.Text = "カウント一致 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, 24)
        Me.rdoGenOutput.Name = "rdoGenOutput"
        Me.rdoGenOutput.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.rdoGenOutput.Size = New System.Drawing.Size(153, 17)
        Me.rdoGenOutput.TabIndex = 14
        Me.rdoGenOutput.TabStop = True
        Me.rdoGenOutput.Text = "汎用出力"
        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, 192)
        Me.Label4.Name = "Label4"
        Me.Label4.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label4.Size = New System.Drawing.Size(84, 12)
        Me.Label4.TabIndex = 20
        Me.Label4.Text = "パルス幅(係数)："
        '
        '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, 305)
        Me.Frame1.TabIndex = 42
        Me.Frame1.TabStop = False
        Me.Frame1.Text = "イベント信号入力"
        '
        '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, 168)
        Me.Frame3.Name = "Frame3"
        Me.Frame3.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame3.Size = New System.Drawing.Size(217, 73)
        Me.Frame3.TabIndex = 10
        Me.Frame3.TabStop = False
        Me.Frame3.Text = "RF1 (停止)"
        '
        '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, 32)
        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, 64)
        Me.Frame2.Name = "Frame2"
        Me.Frame2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame2.Size = New System.Drawing.Size(217, 89)
        Me.Frame2.TabIndex = 5
        Me.Frame2.TabStop = False
        Me.Frame2.Text = "RF0 (クリア/プリセット/開始)"
        '
        '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, 53)
        Me.txtPresetReg.MaxLength = 0
        Me.txtPresetReg.Name = "txtPresetReg"
        Me.txtPresetReg.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.txtPresetReg.Size = New System.Drawing.Size(73, 18)
        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, 24)
        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(192, 56)
        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, 56)
        Me.Label2.Name = "Label2"
        Me.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label2.Size = New System.Drawing.Size(92, 12)
        Me.Label2.TabIndex = 7
        Me.Label2.Text = "プリセット レジスタ："
        '
        '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, 20)
        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, 24)
        Me.Label1.Name = "Label1"
        Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label1.Size = New System.Drawing.Size(37, 12)
        Me.Label1.TabIndex = 3
        Me.Label1.Text = "タイプ："
        '
        '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(182, 192)
        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, 322)
        Me.Controls.Add(Me.Label8)
        Me.Controls.Add(Me.btnCancel)
        Me.Controls.Add(Me.Label9)
        Me.Controls.Add(Me.Frame7)
        Me.Controls.Add(Me.Frame4)
        Me.Controls.Add(Me.Frame1)
        Me.Controls.Add(Me.btnOK)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "frmEvent"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "ハードウェアイベント設定"
        Me.Frame7.ResumeLayout(False)
        Me.Frame7.PerformLayout()
        Me.Frame4.ResumeLayout(False)
        Me.Frame4.PerformLayout()
        Me.Frame6.ResumeLayout(False)
        Me.Frame6.PerformLayout()
        Me.Frame5.ResumeLayout(False)
        Me.Frame1.ResumeLayout(False)
        Me.Frame1.PerformLayout()
        Me.Frame3.ResumeLayout(False)
        Me.Frame2.ResumeLayout(False)
        Me.Frame2.PerformLayout()
        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


    '===================================================
    '	ダイアログ初期化
    '===================================================
    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
        '===================================================
        '	コンボボックス初期化
        '===================================================
        '信号入力イベント
        With cboInputEvent
            .Items.Clear()
            .Items.Insert(0, "汎用入力")
            .Items.Insert(1, "カウンタ 開始/停止")
            .Items.Insert(2, "カウンタ プリセット")
            .Items.Insert(3, "カウンタ クリア")
        End With

        'カウンタイベント
        With cboCount
            .Items.Clear()
            .Items.Insert(0, "なし")
            .Items.Insert(1, "プリセット")
            .Items.Insert(2, "クリア")
        End With

        'RF0 立ち上がり/立下り
        With cboRF0
            .Items.Clear()
            .Items.Insert(0, "なし")
            .Items.Insert(1, "立ち上がり")
            .Items.Insert(2, "立ち下り")
        End With

        'RF1 立ち上がり/立下り
        With cboRF1
            .Items.Clear()
            .Items.Insert(0, "なし")
            .Items.Insert(1, "立ち上がり")
            .Items.Insert(2, "立ち下り")
        End With

        'パルス幅
        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"

        '===================================================
        '	データ初期化
        '===================================================
        ' イベント信号入力
        cboInputEvent_SelectedIndexChanged(cboInputEvent, New System.EventArgs())

        'イベント信号出力()
        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

    '---------------------------------------------
    ' 設定完了処理
    '---------------------------------------------
    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)

        '-------------------------------
        ' 設定情報取得
        '-------------------------------
        ' イベント信号入力
        ' Input Event
        dwInputEvent = cboInputEvent.SelectedIndex
        ' Preset Reg
        ' Preset Reg値を符号ありで設定するため、一度16進文字例変換を経由
        PresetReg = Convert.ToInt32(Hex(Val("&H" & txtPresetReg.Text)), 16)
        ' RF0
        RF0 = cboRF0.SelectedIndex
        ' RF1
        RF1 = cboRF1.SelectedIndex


        ' イベント信号出力
        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

        ' パルス幅
        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
        ' カウント一致イベント
        dwCountEvent = cboCount.SelectedIndex

        '-------------------------------
        ' 設定情報をデバイスへセット
        '-------------------------------
        For ChNo = 0 To frmCounter.ChannelNum - 1
            '---------------------------------------------
            ' 制御入力信号のハードウェアイベント設定
            '---------------------------------------------
            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
            '---------------------------------------------
            ' プリセットレジスタの設定
            '---------------------------------------------
            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
            '---------------------------------------------
            ' 制御出力信号のハードウェアイベント設定
            '---------------------------------------------
            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
            '---------------------------------------------
            ' カウント一致のハードウェアイベント設定
            '---------------------------------------------
            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

    '---------------------------------------------
    ' キャンセル処理
    '---------------------------------------------
    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Me.Hide()
    End Sub

    '---------------------------------------------
    ' イベント信号入力 設定
    '---------------------------------------------
    Private Sub cboInputEvent_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboInputEvent.SelectedIndexChanged

        If cboInputEvent.Text = "汎用入力" Then
            cboRF0.SelectedIndex = 0
            cboRF1.SelectedIndex = 0
            cboRF0.Enabled = False
            cboRF1.Enabled = False
            txtPresetReg.Enabled = False
        End If
        If cboInputEvent.Text = "カウンタ 開始/停止" Then
            cboRF0.Enabled = True
            cboRF1.Enabled = True
            txtPresetReg.Enabled = False
        End If
        If cboInputEvent.Text = "カウンタ プリセット" Then
            cboRF0.Enabled = True
            cboRF1.SelectedIndex = 0
            cboRF1.Enabled = False
            txtPresetReg.Enabled = True
        End If
        If cboInputEvent.Text = "カウンタ クリア" Then
            cboRF0.Enabled = True
            cboRF1.SelectedIndex = 0
            cboRF1.Enabled = False
            txtPresetReg.Enabled = False
        End If
        If cboCount.Text = "プリセット" 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

    '---------------------------------------------
    ' イベント信号入力 設定
    '---------------------------------------------
    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

    '---------------------------------------------
    ' 信号出力 処理
    '---------------------------------------------
    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)
        '---------------------------------------------
        ' 汎用出力処理
        '---------------------------------------------
        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
