﻿Option Strict Off
Option Explicit On 
Friend Class LogicSet
	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.
	Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
	Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
	Friend WithEvents chkOut3 As System.Windows.Forms.CheckBox
    Friend WithEvents btnComReturn As System.Windows.Forms.Button
    Friend WithEvents chkIn1 As System.Windows.Forms.CheckBox
	Friend WithEvents chkIn2 As System.Windows.Forms.CheckBox
	Friend WithEvents chkIn3 As System.Windows.Forms.CheckBox
	Friend WithEvents chkIn4 As System.Windows.Forms.CheckBox
	Friend WithEvents chkIn5 As System.Windows.Forms.CheckBox
	Friend WithEvents chkIn6 As System.Windows.Forms.CheckBox
	Friend WithEvents chkIn7 As System.Windows.Forms.CheckBox
	Friend WithEvents TextOut1 As System.Windows.Forms.TextBox
	Friend WithEvents TextOut2 As System.Windows.Forms.TextBox
	Friend WithEvents TextOut3 As System.Windows.Forms.TextBox
	Friend WithEvents txtLim As System.Windows.Forms.TextBox
	Friend WithEvents Frame1 As System.Windows.Forms.GroupBox
	Friend WithEvents chkOut2 As System.Windows.Forms.CheckBox
	Friend WithEvents chkOut1 As System.Windows.Forms.CheckBox
	Friend WithEvents txtIn7 As System.Windows.Forms.TextBox
	Friend WithEvents txtIn6 As System.Windows.Forms.TextBox
	Friend WithEvents txtIn5 As System.Windows.Forms.TextBox
	Friend WithEvents txtIn4 As System.Windows.Forms.TextBox
	Friend WithEvents txtIn3 As System.Windows.Forms.TextBox
	Friend WithEvents txtIn2 As System.Windows.Forms.TextBox
	Friend WithEvents txtIn1 As System.Windows.Forms.TextBox
	Friend WithEvents chkLim As System.Windows.Forms.CheckBox
	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Frame1 = New System.Windows.Forms.GroupBox()
        Me.chkOut2 = New System.Windows.Forms.CheckBox()
        Me.chkOut1 = New System.Windows.Forms.CheckBox()
        Me.TextOut3 = New System.Windows.Forms.TextBox()
        Me.TextOut2 = New System.Windows.Forms.TextBox()
        Me.TextOut1 = New System.Windows.Forms.TextBox()
        Me.chkOut3 = New System.Windows.Forms.CheckBox()
        Me.GroupBox2 = New System.Windows.Forms.GroupBox()
        Me.txtLim = New System.Windows.Forms.TextBox()
        Me.chkLim = New System.Windows.Forms.CheckBox()
        Me.btnComReturn = New System.Windows.Forms.Button()
        Me.GroupBox3 = New System.Windows.Forms.GroupBox()
        Me.txtIn7 = New System.Windows.Forms.TextBox()
        Me.txtIn6 = New System.Windows.Forms.TextBox()
        Me.txtIn5 = New System.Windows.Forms.TextBox()
        Me.txtIn4 = New System.Windows.Forms.TextBox()
        Me.txtIn3 = New System.Windows.Forms.TextBox()
        Me.txtIn2 = New System.Windows.Forms.TextBox()
        Me.txtIn1 = New System.Windows.Forms.TextBox()
        Me.chkIn7 = New System.Windows.Forms.CheckBox()
        Me.chkIn6 = New System.Windows.Forms.CheckBox()
        Me.chkIn5 = New System.Windows.Forms.CheckBox()
        Me.chkIn4 = New System.Windows.Forms.CheckBox()
        Me.chkIn3 = New System.Windows.Forms.CheckBox()
        Me.chkIn2 = New System.Windows.Forms.CheckBox()
        Me.chkIn1 = New System.Windows.Forms.CheckBox()
        Me.Frame1.SuspendLayout()
        Me.GroupBox2.SuspendLayout()
        Me.GroupBox3.SuspendLayout()
        Me.SuspendLayout()
        '
        'Frame1
        '
        Me.Frame1.Controls.AddRange(New System.Windows.Forms.Control() {Me.chkOut2, Me.chkOut1, Me.TextOut3, Me.TextOut2, Me.TextOut1, Me.chkOut3})
        Me.Frame1.Location = New System.Drawing.Point(16, 16)
        Me.Frame1.Name = "Frame1"
        Me.Frame1.Size = New System.Drawing.Size(200, 128)
        Me.Frame1.TabIndex = 0
        Me.Frame1.TabStop = False
        Me.Frame1.Text = "Out Logic"
        '
        'chkOut2
        '
        Me.chkOut2.Checked = True
        Me.chkOut2.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chkOut2.Location = New System.Drawing.Point(16, 56)
        Me.chkOut2.Name = "chkOut2"
        Me.chkOut2.Size = New System.Drawing.Size(64, 16)
        Me.chkOut2.TabIndex = 7
        Me.chkOut2.Text = "OUT 2"
        '
        'chkOut1
        '
        Me.chkOut1.Checked = True
        Me.chkOut1.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chkOut1.Location = New System.Drawing.Point(16, 24)
        Me.chkOut1.Name = "chkOut1"
        Me.chkOut1.Size = New System.Drawing.Size(64, 16)
        Me.chkOut1.TabIndex = 6
        Me.chkOut1.Text = "OUT 1"
        '
        'TextOut3
        '
        Me.TextOut3.Enabled = False
        Me.TextOut3.Location = New System.Drawing.Point(88, 88)
        Me.TextOut3.Name = "TextOut3"
        Me.TextOut3.ReadOnly = True
        Me.TextOut3.Size = New System.Drawing.Size(96, 21)
        Me.TextOut3.TabIndex = 5
        Me.TextOut3.Text = "Low Active "
        '
        'TextOut2
        '
        Me.TextOut2.Enabled = False
        Me.TextOut2.Location = New System.Drawing.Point(88, 56)
        Me.TextOut2.Name = "TextOut2"
        Me.TextOut2.ReadOnly = True
        Me.TextOut2.Size = New System.Drawing.Size(96, 21)
        Me.TextOut2.TabIndex = 4
        Me.TextOut2.Text = "Low Active "
        '
        'TextOut1
        '
        Me.TextOut1.Enabled = False
        Me.TextOut1.Location = New System.Drawing.Point(88, 24)
        Me.TextOut1.Name = "TextOut1"
        Me.TextOut1.ReadOnly = True
        Me.TextOut1.Size = New System.Drawing.Size(96, 21)
        Me.TextOut1.TabIndex = 3
        Me.TextOut1.Text = "Low Active "
        '
        'chkOut3
        '
        Me.chkOut3.Checked = True
        Me.chkOut3.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chkOut3.Location = New System.Drawing.Point(16, 88)
        Me.chkOut3.Name = "chkOut3"
        Me.chkOut3.Size = New System.Drawing.Size(64, 16)
        Me.chkOut3.TabIndex = 2
        Me.chkOut3.Text = "OUT 3"
        '
        'GroupBox2
        '
        Me.GroupBox2.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtLim, Me.chkLim})
        Me.GroupBox2.Location = New System.Drawing.Point(16, 152)
        Me.GroupBox2.Name = "GroupBox2"
        Me.GroupBox2.Size = New System.Drawing.Size(200, 64)
        Me.GroupBox2.TabIndex = 1
        Me.GroupBox2.TabStop = False
        Me.GroupBox2.Text = "Limit Logic"
        '
        'txtLim
        '
        Me.txtLim.Enabled = False
        Me.txtLim.Location = New System.Drawing.Point(88, 24)
        Me.txtLim.Name = "txtLim"
        Me.txtLim.ReadOnly = True
        Me.txtLim.Size = New System.Drawing.Size(96, 21)
        Me.txtLim.TabIndex = 1
        Me.txtLim.Text = "Low Active "
        '
        'chkLim
        '
        Me.chkLim.Checked = True
        Me.chkLim.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chkLim.Location = New System.Drawing.Point(16, 24)
        Me.chkLim.Name = "chkLim"
        Me.chkLim.Size = New System.Drawing.Size(56, 24)
        Me.chkLim.TabIndex = 0
        Me.chkLim.Text = "Limit"
        '
        'btnComReturn
        '
        Me.btnComReturn.Location = New System.Drawing.Point(128, 248)
        Me.btnComReturn.Name = "btnComReturn"
        Me.btnComReturn.Size = New System.Drawing.Size(80, 24)
        Me.btnComReturn.TabIndex = 3
        Me.btnComReturn.Text = "&Return"
        '
        'GroupBox3
        '
        Me.GroupBox3.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtIn7, Me.txtIn6, Me.txtIn5, Me.txtIn4, Me.txtIn3, Me.txtIn2, Me.txtIn1, Me.chkIn7, Me.chkIn6, Me.chkIn5, Me.chkIn4, Me.chkIn3, Me.chkIn2, Me.chkIn1})
        Me.GroupBox3.Location = New System.Drawing.Point(232, 16)
        Me.GroupBox3.Name = "GroupBox3"
        Me.GroupBox3.Size = New System.Drawing.Size(184, 256)
        Me.GroupBox3.TabIndex = 4
        Me.GroupBox3.TabStop = False
        Me.GroupBox3.Text = "In Logic"
        '
        'txtIn7
        '
        Me.txtIn7.Enabled = False
        Me.txtIn7.Location = New System.Drawing.Point(72, 216)
        Me.txtIn7.Name = "txtIn7"
        Me.txtIn7.ReadOnly = True
        Me.txtIn7.Size = New System.Drawing.Size(96, 21)
        Me.txtIn7.TabIndex = 13
        Me.txtIn7.Text = "Low Active "
        '
        'txtIn6
        '
        Me.txtIn6.Enabled = False
        Me.txtIn6.Location = New System.Drawing.Point(72, 184)
        Me.txtIn6.Name = "txtIn6"
        Me.txtIn6.ReadOnly = True
        Me.txtIn6.Size = New System.Drawing.Size(96, 21)
        Me.txtIn6.TabIndex = 12
        Me.txtIn6.Text = "Low Active "
        '
        'txtIn5
        '
        Me.txtIn5.Enabled = False
        Me.txtIn5.Location = New System.Drawing.Point(72, 152)
        Me.txtIn5.Name = "txtIn5"
        Me.txtIn5.ReadOnly = True
        Me.txtIn5.Size = New System.Drawing.Size(96, 21)
        Me.txtIn5.TabIndex = 11
        Me.txtIn5.Text = "Low Active "
        '
        'txtIn4
        '
        Me.txtIn4.Enabled = False
        Me.txtIn4.Location = New System.Drawing.Point(72, 120)
        Me.txtIn4.Name = "txtIn4"
        Me.txtIn4.ReadOnly = True
        Me.txtIn4.Size = New System.Drawing.Size(96, 21)
        Me.txtIn4.TabIndex = 10
        Me.txtIn4.Text = "Low Active "
        '
        'txtIn3
        '
        Me.txtIn3.Enabled = False
        Me.txtIn3.Location = New System.Drawing.Point(72, 88)
        Me.txtIn3.Name = "txtIn3"
        Me.txtIn3.ReadOnly = True
        Me.txtIn3.Size = New System.Drawing.Size(96, 21)
        Me.txtIn3.TabIndex = 9
        Me.txtIn3.Text = "Low Active "
        '
        'txtIn2
        '
        Me.txtIn2.Enabled = False
        Me.txtIn2.Location = New System.Drawing.Point(72, 56)
        Me.txtIn2.Name = "txtIn2"
        Me.txtIn2.ReadOnly = True
        Me.txtIn2.Size = New System.Drawing.Size(96, 21)
        Me.txtIn2.TabIndex = 8
        Me.txtIn2.Text = "Low Active "
        '
        'txtIn1
        '
        Me.txtIn1.Enabled = False
        Me.txtIn1.Location = New System.Drawing.Point(72, 24)
        Me.txtIn1.Name = "txtIn1"
        Me.txtIn1.ReadOnly = True
        Me.txtIn1.Size = New System.Drawing.Size(96, 21)
        Me.txtIn1.TabIndex = 7
        Me.txtIn1.Text = "Low Active "
        '
        'chkIn7
        '
        Me.chkIn7.Checked = True
        Me.chkIn7.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chkIn7.Location = New System.Drawing.Point(16, 216)
        Me.chkIn7.Name = "chkIn7"
        Me.chkIn7.Size = New System.Drawing.Size(48, 16)
        Me.chkIn7.TabIndex = 6
        Me.chkIn7.Text = "IN 7"
        '
        'chkIn6
        '
        Me.chkIn6.Checked = True
        Me.chkIn6.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chkIn6.Location = New System.Drawing.Point(16, 184)
        Me.chkIn6.Name = "chkIn6"
        Me.chkIn6.Size = New System.Drawing.Size(48, 16)
        Me.chkIn6.TabIndex = 5
        Me.chkIn6.Text = "IN 6"
        '
        'chkIn5
        '
        Me.chkIn5.Checked = True
        Me.chkIn5.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chkIn5.Location = New System.Drawing.Point(16, 152)
        Me.chkIn5.Name = "chkIn5"
        Me.chkIn5.Size = New System.Drawing.Size(48, 16)
        Me.chkIn5.TabIndex = 4
        Me.chkIn5.Text = "IN 5"
        '
        'chkIn4
        '
        Me.chkIn4.Checked = True
        Me.chkIn4.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chkIn4.Location = New System.Drawing.Point(16, 120)
        Me.chkIn4.Name = "chkIn4"
        Me.chkIn4.Size = New System.Drawing.Size(48, 16)
        Me.chkIn4.TabIndex = 3
        Me.chkIn4.Text = "IN 4"
        '
        'chkIn3
        '
        Me.chkIn3.Checked = True
        Me.chkIn3.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chkIn3.Location = New System.Drawing.Point(16, 88)
        Me.chkIn3.Name = "chkIn3"
        Me.chkIn3.Size = New System.Drawing.Size(48, 16)
        Me.chkIn3.TabIndex = 2
        Me.chkIn3.Text = "IN 3"
        '
        'chkIn2
        '
        Me.chkIn2.Checked = True
        Me.chkIn2.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chkIn2.Location = New System.Drawing.Point(16, 56)
        Me.chkIn2.Name = "chkIn2"
        Me.chkIn2.Size = New System.Drawing.Size(48, 16)
        Me.chkIn2.TabIndex = 1
        Me.chkIn2.Text = "IN 2"
        '
        'chkIn1
        '
        Me.chkIn1.Checked = True
        Me.chkIn1.CheckState = System.Windows.Forms.CheckState.Checked
        Me.chkIn1.Location = New System.Drawing.Point(16, 24)
        Me.chkIn1.Name = "chkIn1"
        Me.chkIn1.Size = New System.Drawing.Size(48, 16)
        Me.chkIn1.TabIndex = 0
        Me.chkIn1.Text = "IN 1"
        '
        'LogicSet
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(432, 286)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.GroupBox3, Me.btnComReturn, Me.GroupBox2, Me.Frame1})
        Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "LogicSet"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "LogicSetting"
        Me.Frame1.ResumeLayout(False)
        Me.GroupBox2.ResumeLayout(False)
        Me.GroupBox3.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub chkIn1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkIn1.Click

        If chkIn1.CheckState = 1 Then
            txtIn1.Text = "Low Active"
            CtrlInOutLog = CtrlInOutLog Xor &H1
        ElseIf chkIn1.CheckState = 0 Then
            txtIn1.Text = "High Active"
            CtrlInOutLog = CtrlInOutLog Or &H1
        End If

    End Sub

    Private Sub chkIn2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkIn2.Click

        If chkIn2.CheckState = 1 Then
            txtIn2.Text = "Low Active"
            CtrlInOutLog = CtrlInOutLog Xor &H2
        ElseIf chkIn2.CheckState = 0 Then
            txtIn2.Text = "High Active"
            CtrlInOutLog = CtrlInOutLog Or &H2
        End If

    End Sub

    Private Sub chkIn3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkIn3.Click

        If chkIn3.CheckState = 1 Then
            txtIn3.Text = "Low Active"
            CtrlInOutLog = CtrlInOutLog Xor &H4
        ElseIf chkIn3.CheckState = 0 Then
            txtIn3.Text = "High Active"
            CtrlInOutLog = CtrlInOutLog Or &H4
        End If

    End Sub

    Private Sub chkIn4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkIn4.Click

        If chkIn4.CheckState = 1 Then
            txtIn4.Text = "Low Active"
            CtrlInOutLog = CtrlInOutLog Xor &H8
        ElseIf chkIn4.CheckState = 0 Then
            txtIn4.Text = "High Active"
            CtrlInOutLog = CtrlInOutLog Or &H8
        End If

    End Sub

    Private Sub chkIn5_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkIn5.Click

        If chkIn5.CheckState = 1 Then
            txtIn5.Text = "Low Active"
            CtrlInOutLog = CtrlInOutLog Xor &H10
        ElseIf chkIn5.CheckState = 0 Then
            txtIn5.Text = "High Active"
            CtrlInOutLog = CtrlInOutLog Or &H10
        End If

    End Sub

    Private Sub chkIn6_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkIn6.Click

        If chkIn6.CheckState = 1 Then
            txtIn6.Text = "Low Active"
            CtrlInOutLog = CtrlInOutLog Xor &H20
        ElseIf chkIn6.CheckState = 0 Then
            txtIn6.Text = "High Active"
            CtrlInOutLog = CtrlInOutLog Or &H20
        End If

    End Sub

    Private Sub chkIn7_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkIn7.Click

        If chkIn7.CheckState = 1 Then
            txtIn7.Text = "Low Active"
            CtrlInOutLog = CtrlInOutLog Xor &H40
        ElseIf chkIn7.CheckState = 0 Then
            txtIn7.Text = "High Active"
            CtrlInOutLog = CtrlInOutLog Or &H40
        End If

    End Sub

    Private Sub chkLim_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkLim.Click

        If chkLim.CheckState = 1 Then
            txtLim.Text = "Low Active"
            CtrlInOutLog = CtrlInOutLog Xor &H80
        ElseIf chkLim.CheckState = 0 Then
            txtLim.Text = "High Active"
            CtrlInOutLog = CtrlInOutLog Or &H80
        End If

    End Sub

    Private Sub chkOut1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkOut1.Click

        If chkOut1.CheckState = 1 Then
            TextOut1.Text = "Low Active"
            CtrlInOutLog = CtrlInOutLog Xor &H100
        ElseIf chkOut1.CheckState = 0 Then
            TextOut1.Text = "High Active"
            CtrlInOutLog = CtrlInOutLog Or &H100
        End If

    End Sub

    Private Sub chkOut2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkOut2.Click

        If chkOut2.CheckState = 1 Then
            TextOut2.Text = "Low Active"
            CtrlInOutLog = CtrlInOutLog Xor &H200
        ElseIf chkOut2.CheckState = 0 Then
            TextOut2.Text = "High Active"
            CtrlInOutLog = CtrlInOutLog Or &H200
        End If

    End Sub

    Private Sub chkOut3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkOut3.Click

        If chkOut3.CheckState = 1 Then
            TextOut3.Text = "Low Active"
            CtrlInOutLog = CtrlInOutLog Xor &H400
        ElseIf chkOut3.CheckState = 0 Then
            TextOut3.Text = "High Active"
            CtrlInOutLog = CtrlInOutLog Or &H400
        End If

    End Sub



    Private Sub btnComReturn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnComReturn.Click

        Me.Close()

    End Sub

    Private Sub ChkDisp(ByRef cText As System.Windows.Forms.TextBox, ByVal flg As Integer)

        If flg = 0 Then
            cText.Text = "Low Active"
        Else
            cText.Text = "High Active"
        End If

    End Sub

    Private Sub ChkAndDisp(ByRef cChk As System.Windows.Forms.CheckBox, ByRef cText As System.Windows.Forms.TextBox, ByVal flg As Integer)

        ChkDisp(cText, flg)
        If flg = 0 Then
            cChk.CheckState = 1
        Else
            cChk.CheckState = 0
        End If

    End Sub

    Private Sub LogicSet_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        ' CheckBox Initialise
        ChkAndDisp(chkIn1, txtIn1, CtrlInOutLog And &H1)
        ChkAndDisp(chkIn2, txtIn2, CtrlInOutLog And &H2)
        ChkAndDisp(chkIn3, txtIn3, CtrlInOutLog And &H4)
        ChkAndDisp(chkIn4, txtIn4, CtrlInOutLog And &H8)
        ChkAndDisp(chkIn5, txtIn5, CtrlInOutLog And &H10)
        ChkAndDisp(chkIn6, txtIn6, CtrlInOutLog And &H20)
        ChkAndDisp(chkIn7, txtIn7, CtrlInOutLog And &H40)
        ChkAndDisp(chkLim, txtLim, CtrlInOutLog And &H80)
        ChkAndDisp(chkOut1, TextOut1, CtrlInOutLog And &H100)
        ChkAndDisp(chkOut2, TextOut2, CtrlInOutLog And &H200)
        ChkAndDisp(chkOut3, TextOut3, CtrlInOutLog And &H400)

    End Sub

End Class
