VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form IOLogic 
   BackColor       =   &H00000000&
   Caption         =   "Combination IO Logic Control"
   ClientHeight    =   7710
   ClientLeft      =   165
   ClientTop       =   855
   ClientWidth     =   10080
   Icon            =   "Combination IO Logic.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   7710
   ScaleWidth      =   10080
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame Frame2 
      BackColor       =   &H00800000&
      Caption         =   " IO Logic List"
      ForeColor       =   &H00FFFFFF&
      Height          =   5310
      Index           =   6
      Left            =   120
      TabIndex        =   22
      Top             =   2160
      Width           =   9850
      Begin MSComDlg.CommonDialog CommonDialog2 
         Left            =   360
         Top             =   3960
         _ExtentX        =   847
         _ExtentY        =   847
         _Version        =   393216
      End
      Begin VB.Timer ScriptRunning 
         Enabled         =   0   'False
         Interval        =   250
         Left            =   480
         Top             =   3360
      End
      Begin VB.ListBox IOLogicOutputData 
         BackColor       =   &H0080FFFF&
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   4860
         ItemData        =   "Combination IO Logic.frx":030A
         Left            =   6420
         List            =   "Combination IO Logic.frx":0311
         TabIndex        =   24
         TabStop         =   0   'False
         Top             =   240
         Width           =   3285
      End
      Begin VB.Frame Frame10 
         BackColor       =   &H00800000&
         Height          =   135
         Index           =   1
         Left            =   6420
         TabIndex        =   38
         Top             =   5040
         Width           =   3280
      End
      Begin VB.ListBox IOLogicInputData 
         BackColor       =   &H0080FFFF&
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   4860
         ItemData        =   "Combination IO Logic.frx":0328
         Left            =   1320
         List            =   "Combination IO Logic.frx":032F
         TabIndex        =   23
         TabStop         =   0   'False
         Top             =   240
         Width           =   3280
      End
      Begin VB.Frame Frame10 
         BackColor       =   &H00800000&
         Height          =   135
         Index           =   0
         Left            =   1320
         TabIndex        =   37
         Top             =   5040
         Width           =   3280
      End
      Begin VB.CheckBox InvertIOLogic 
         BackColor       =   &H00800000&
         Caption         =   "Invert IO"
         ForeColor       =   &H00FFFFFF&
         Height          =   525
         Left            =   200
         TabIndex        =   35
         Top             =   2180
         Width           =   975
      End
      Begin VB.Frame Frame7 
         BackColor       =   &H00000000&
         Height          =   140
         Index           =   0
         Left            =   210
         TabIndex        =   36
         Top             =   2640
         Width           =   900
      End
      Begin VB.CheckBox XORIOLogic 
         BackColor       =   &H00800000&
         Caption         =   "XOR  IO"
         ForeColor       =   &H00FFFFFF&
         Height          =   735
         Left            =   200
         TabIndex        =   34
         Top             =   1500
         Width           =   975
      End
      Begin VB.CheckBox LatchIOLogicOuputs 
         BackColor       =   &H00800000&
         Caption         =   "Latch Outputs "
         ForeColor       =   &H00FFFFFF&
         Height          =   615
         Left            =   200
         TabIndex        =   33
         Top             =   960
         Width           =   975
      End
      Begin VB.CheckBox EnableIOLogicControl 
         BackColor       =   &H00800000&
         Caption         =   "Enable Logic List"
         ForeColor       =   &H00FFFFFF&
         Height          =   615
         Left            =   200
         TabIndex        =   32
         Top             =   360
         Width           =   975
      End
      Begin VB.Frame Frame6 
         BackColor       =   &H00FF8080&
         Height          =   5020
         Left            =   4670
         TabIndex        =   25
         Top             =   150
         Width           =   1695
         Begin VB.CommandButton OpenScript 
            Height          =   645
            Left            =   100
            Picture         =   "Combination IO Logic.frx":0345
            Style           =   1  'Graphical
            TabIndex        =   31
            Top             =   2925
            Width           =   1500
         End
         Begin VB.CommandButton SaveScript 
            Height          =   645
            Left            =   100
            Picture         =   "Combination IO Logic.frx":064F
            Style           =   1  'Graphical
            TabIndex        =   30
            Top             =   3600
            Width           =   1500
         End
         Begin VB.CommandButton PrintScript 
            Height          =   645
            Left            =   100
            Picture         =   "Combination IO Logic.frx":0959
            Style           =   1  'Graphical
            TabIndex        =   29
            Top             =   4260
            Width           =   1500
         End
         Begin VB.CommandButton AddToList 
            Caption         =   "&Add To List"
            Height          =   495
            Left            =   100
            TabIndex        =   28
            Top             =   200
            Width           =   1500
         End
         Begin VB.CommandButton RemoveFromList 
            Caption         =   "&Remove"
            Height          =   495
            Left            =   100
            TabIndex        =   27
            Top             =   700
            Width           =   1500
         End
         Begin VB.CommandButton ClearList 
            Caption         =   "&Clear List"
            Height          =   495
            Left            =   100
            TabIndex        =   26
            Top             =   1220
            Width           =   1500
         End
         Begin VB.Image ScriptLEDON 
            Height          =   225
            Left            =   1200
            Picture         =   "Combination IO Logic.frx":0C63
            Top             =   2400
            Visible         =   0   'False
            Width           =   225
         End
         Begin VB.Image ScriptLEDOFF 
            Height          =   225
            Left            =   1200
            Picture         =   "Combination IO Logic.frx":0F77
            Top             =   2400
            Width           =   225
         End
         Begin VB.Image SCLogo 
            Height          =   675
            Left            =   120
            Picture         =   "Combination IO Logic.frx":128B
            Stretch         =   -1  'True
            Top             =   2000
            Width           =   1500
         End
         Begin VB.Line Line1 
            BorderColor     =   &H00800000&
            BorderWidth     =   10
            X1              =   0
            X2              =   1680
            Y1              =   15
            Y2              =   15
         End
      End
      Begin MSComDlg.CommonDialog CommonDialog1 
         Left            =   3000
         Top             =   3720
         _ExtentX        =   847
         _ExtentY        =   847
         _Version        =   393216
      End
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00800000&
      ForeColor       =   &H00000000&
      Height          =   2100
      Index           =   0
      Left            =   120
      TabIndex        =   0
      Top             =   20
      Width           =   9850
      Begin VB.Frame Frame3 
         BackColor       =   &H00E0E0E0&
         Caption         =   "10 BIT Output Port "
         ForeColor       =   &H00000000&
         Height          =   1820
         Index           =   1
         Left            =   6420
         TabIndex        =   1
         Top             =   140
         Width           =   3290
         Begin VB.Frame Frame8 
            BackColor       =   &H00FF8080&
            Caption         =   "HEX Value"
            ForeColor       =   &H00FFFFFF&
            Height          =   855
            Index           =   2
            Left            =   1750
            TabIndex        =   6
            Top             =   795
            Width           =   1335
            Begin VB.TextBox ShowIOLogic1OutputHEX 
               Alignment       =   2  'Center
               BackColor       =   &H000000FF&
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   13.5
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   465
               Left            =   150
               MaxLength       =   3
               TabIndex        =   7
               Text            =   "0"
               Top             =   240
               Width           =   1035
            End
         End
         Begin VB.Frame Frame8 
            BackColor       =   &H00FF8080&
            Caption         =   "Decimal Value"
            ForeColor       =   &H00FFFFFF&
            Height          =   855
            Index           =   3
            Left            =   160
            TabIndex        =   4
            Top             =   795
            Width           =   1335
            Begin VB.TextBox ShowIOLogic1OutputDecimal 
               Alignment       =   2  'Center
               BackColor       =   &H000000FF&
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   13.5
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   465
               Left            =   140
               MaxLength       =   4
               TabIndex        =   5
               Text            =   "0"
               Top             =   240
               Width           =   1035
            End
         End
         Begin VB.Frame Frame9 
            BackColor       =   &H00FF8080&
            Height          =   855
            Index           =   1
            Left            =   1500
            TabIndex        =   2
            Top             =   800
            Width           =   255
            Begin VB.Frame Frame4 
               Height          =   495
               Index           =   0
               Left            =   120
               TabIndex        =   3
               Top             =   240
               Width           =   15
            End
            Begin VB.Shape Shape1 
               BackColor       =   &H0000FFFF&
               BackStyle       =   1  'Opaque
               Height          =   700
               Index           =   1
               Left            =   15
               Top             =   120
               Width           =   225
            End
         End
         Begin VB.Line Line3 
            BorderColor     =   &H00800000&
            BorderWidth     =   8
            X1              =   1590
            X2              =   3240
            Y1              =   15
            Y2              =   15
         End
         Begin VB.Label Label1 
            BackStyle       =   0  'Transparent
            Caption         =   "D0  D1  D2  D3  D4  D5  D6  D7  D8  D9"
            ForeColor       =   &H000000FF&
            Height          =   255
            Index           =   1
            Left            =   180
            TabIndex        =   8
            Top             =   520
            Width           =   3015
         End
         Begin VB.Image IOLogic1OutputLEDOFF 
            Height          =   225
            Index           =   9
            Left            =   2880
            Picture         =   "Combination IO Logic.frx":2E90F
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDOFF 
            Height          =   225
            Index           =   8
            Left            =   2580
            Picture         =   "Combination IO Logic.frx":2FF65
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDOFF 
            Height          =   225
            Index           =   7
            Left            =   2280
            Picture         =   "Combination IO Logic.frx":315BB
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDOFF 
            Height          =   225
            Index           =   6
            Left            =   1980
            Picture         =   "Combination IO Logic.frx":32C11
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDOFF 
            Height          =   225
            Index           =   5
            Left            =   1680
            Picture         =   "Combination IO Logic.frx":34267
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDOFF 
            Height          =   225
            Index           =   4
            Left            =   1380
            Picture         =   "Combination IO Logic.frx":358BD
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDOFF 
            Height          =   225
            Index           =   3
            Left            =   1080
            Picture         =   "Combination IO Logic.frx":36F13
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDOFF 
            Height          =   225
            Index           =   2
            Left            =   780
            Picture         =   "Combination IO Logic.frx":38569
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDOFF 
            Height          =   225
            Index           =   1
            Left            =   480
            Picture         =   "Combination IO Logic.frx":39BBF
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDOFF 
            Height          =   225
            Index           =   0
            Left            =   180
            Picture         =   "Combination IO Logic.frx":3B215
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDON 
            Height          =   225
            Index           =   9
            Left            =   2880
            Picture         =   "Combination IO Logic.frx":3C86B
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDON 
            Height          =   225
            Index           =   8
            Left            =   2580
            Picture         =   "Combination IO Logic.frx":3DF5F
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDON 
            Height          =   225
            Index           =   7
            Left            =   2280
            Picture         =   "Combination IO Logic.frx":3F653
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDON 
            Height          =   225
            Index           =   6
            Left            =   1980
            Picture         =   "Combination IO Logic.frx":40D47
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDON 
            Height          =   225
            Index           =   5
            Left            =   1680
            Picture         =   "Combination IO Logic.frx":4243B
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDON 
            Height          =   225
            Index           =   4
            Left            =   1380
            Picture         =   "Combination IO Logic.frx":43B2F
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDON 
            Height          =   225
            Index           =   3
            Left            =   1080
            Picture         =   "Combination IO Logic.frx":45223
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDON 
            Height          =   225
            Index           =   2
            Left            =   780
            Picture         =   "Combination IO Logic.frx":46917
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDON 
            Height          =   225
            Index           =   1
            Left            =   480
            Picture         =   "Combination IO Logic.frx":4800B
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1OutputLEDON 
            Height          =   225
            Index           =   0
            Left            =   180
            Picture         =   "Combination IO Logic.frx":496FF
            Top             =   270
            Width           =   225
         End
      End
      Begin VB.Frame Frame3 
         BackColor       =   &H00E0E0E0&
         Caption         =   "10 BIT Input Port "
         ForeColor       =   &H00000000&
         Height          =   1820
         Index           =   0
         Left            =   1320
         TabIndex        =   9
         Top             =   140
         Width           =   3290
         Begin VB.Frame Frame8 
            BackColor       =   &H00FF8080&
            Caption         =   "Decimal Value"
            ForeColor       =   &H00FFFFFF&
            Height          =   855
            Index           =   0
            Left            =   160
            TabIndex        =   14
            Top             =   795
            Width           =   1335
            Begin VB.TextBox ShowIOLogic1InputDecimal 
               Alignment       =   2  'Center
               BackColor       =   &H000000FF&
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   13.5
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   465
               Left            =   150
               MaxLength       =   4
               TabIndex        =   15
               Text            =   "0"
               Top             =   240
               Width           =   1035
            End
         End
         Begin VB.Frame Frame8 
            BackColor       =   &H00FF8080&
            Caption         =   "HEX Value"
            ForeColor       =   &H00FFFFFF&
            Height          =   855
            Index           =   1
            Left            =   1750
            TabIndex        =   12
            Top             =   795
            Width           =   1335
            Begin VB.TextBox ShowIOLogic1InputHEX 
               Alignment       =   2  'Center
               BackColor       =   &H000000FF&
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   13.5
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FFFFFF&
               Height          =   465
               Left            =   150
               MaxLength       =   3
               TabIndex        =   13
               Text            =   "0"
               Top             =   240
               Width           =   1035
            End
         End
         Begin VB.Frame Frame9 
            BackColor       =   &H00FF8080&
            Height          =   855
            Index           =   0
            Left            =   1500
            TabIndex        =   10
            Top             =   800
            Width           =   255
            Begin VB.Frame Frame5 
               Height          =   495
               Index           =   0
               Left            =   120
               TabIndex        =   11
               Top             =   240
               Width           =   15
            End
            Begin VB.Shape Shape1 
               BackColor       =   &H0000FFFF&
               BackStyle       =   1  'Opaque
               Height          =   700
               Index           =   0
               Left            =   15
               Top             =   120
               Width           =   225
            End
         End
         Begin VB.Line Line2 
            BorderColor     =   &H00800000&
            BorderWidth     =   8
            X1              =   1470
            X2              =   3240
            Y1              =   15
            Y2              =   15
         End
         Begin VB.Label Label1 
            BackStyle       =   0  'Transparent
            Caption         =   "D0  D1  D2  D3  D4  D5  D6  D7  D8  D9"
            ForeColor       =   &H000000FF&
            Height          =   255
            Index           =   4
            Left            =   180
            TabIndex        =   16
            Top             =   520
            Width           =   3015
         End
         Begin VB.Image IOLogic1InputLEDON 
            Height          =   225
            Index           =   0
            Left            =   180
            Picture         =   "Combination IO Logic.frx":4ADF3
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDON 
            Height          =   225
            Index           =   1
            Left            =   480
            Picture         =   "Combination IO Logic.frx":4C4E7
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDON 
            Height          =   225
            Index           =   2
            Left            =   780
            Picture         =   "Combination IO Logic.frx":4DBDB
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDON 
            Height          =   225
            Index           =   3
            Left            =   1080
            Picture         =   "Combination IO Logic.frx":4F2CF
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDON 
            Height          =   225
            Index           =   4
            Left            =   1380
            Picture         =   "Combination IO Logic.frx":509C3
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDON 
            Height          =   225
            Index           =   5
            Left            =   1680
            Picture         =   "Combination IO Logic.frx":520B7
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDON 
            Height          =   225
            Index           =   6
            Left            =   1980
            Picture         =   "Combination IO Logic.frx":537AB
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDON 
            Height          =   225
            Index           =   7
            Left            =   2280
            Picture         =   "Combination IO Logic.frx":54E9F
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDON 
            Height          =   225
            Index           =   8
            Left            =   2580
            Picture         =   "Combination IO Logic.frx":56593
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDON 
            Height          =   225
            Index           =   9
            Left            =   2880
            Picture         =   "Combination IO Logic.frx":57C87
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDOFF 
            Height          =   225
            Index           =   0
            Left            =   180
            Picture         =   "Combination IO Logic.frx":5937B
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDOFF 
            Height          =   225
            Index           =   1
            Left            =   480
            Picture         =   "Combination IO Logic.frx":5A9D1
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDOFF 
            Height          =   225
            Index           =   2
            Left            =   780
            Picture         =   "Combination IO Logic.frx":5C027
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDOFF 
            Height          =   225
            Index           =   3
            Left            =   1080
            Picture         =   "Combination IO Logic.frx":5D67D
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDOFF 
            Height          =   225
            Index           =   4
            Left            =   1380
            Picture         =   "Combination IO Logic.frx":5ECD3
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDOFF 
            Height          =   225
            Index           =   5
            Left            =   1680
            Picture         =   "Combination IO Logic.frx":60329
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDOFF 
            Height          =   225
            Index           =   6
            Left            =   1980
            Picture         =   "Combination IO Logic.frx":6197F
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDOFF 
            Height          =   225
            Index           =   7
            Left            =   2280
            Picture         =   "Combination IO Logic.frx":62FD5
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDOFF 
            Height          =   225
            Index           =   8
            Left            =   2580
            Picture         =   "Combination IO Logic.frx":6462B
            Top             =   270
            Width           =   225
         End
         Begin VB.Image IOLogic1InputLEDOFF 
            Height          =   225
            Index           =   9
            Left            =   2880
            Picture         =   "Combination IO Logic.frx":65C81
            Top             =   270
            Width           =   225
         End
      End
      Begin VB.Line Line4 
         BorderWidth     =   10
         X1              =   0
         X2              =   9840
         Y1              =   0
         Y2              =   0
      End
      Begin VB.Label Label2 
         BackColor       =   &H00000000&
         BackStyle       =   0  'Transparent
         Caption         =   "THEN"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   24
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FFFFFF&
         Height          =   735
         Index           =   5
         Left            =   4820
         TabIndex        =   21
         Top             =   810
         Width           =   1455
      End
      Begin VB.Label Label2 
         BackColor       =   &H00000000&
         BackStyle       =   0  'Transparent
         Caption         =   "IF"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   24
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FFFFFF&
         Height          =   735
         Index           =   4
         Left            =   450
         TabIndex        =   20
         Top             =   820
         Width           =   615
      End
      Begin VB.Label Label2 
         BackColor       =   &H00000000&
         BackStyle       =   0  'Transparent
         Caption         =   "IF"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   24
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   735
         Index           =   0
         Left            =   480
         TabIndex        =   19
         Top             =   850
         Width           =   615
      End
      Begin VB.Label Label2 
         BackColor       =   &H00000000&
         BackStyle       =   0  'Transparent
         Caption         =   "THEN"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   24
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   735
         Index           =   1
         Left            =   4850
         TabIndex        =   18
         Top             =   850
         Width           =   1455
      End
      Begin VB.Label Label2 
         BackColor       =   &H00000000&
         BackStyle       =   0  'Transparent
         Caption         =   "IF"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   24
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FFFFFF&
         Height          =   735
         Index           =   2
         Left            =   450
         TabIndex        =   17
         Top             =   830
         Width           =   615
      End
   End
   Begin VB.Menu LogicScript 
      Caption         =   " &Logic Script"
      Begin VB.Menu MenuStartNew 
         Caption         =   "Start New"
         Shortcut        =   ^N
      End
      Begin VB.Menu MenuOpen 
         Caption         =   "Open"
         Shortcut        =   ^O
      End
      Begin VB.Menu Bar1 
         Caption         =   "-"
      End
      Begin VB.Menu MenuSave 
         Caption         =   "Save..."
         Shortcut        =   ^S
      End
      Begin VB.Menu MenuSaveAs 
         Caption         =   "Save As"
      End
      Begin VB.Menu Bar2 
         Caption         =   "-"
      End
      Begin VB.Menu MenuPrint 
         Caption         =   "Print..."
         Shortcut        =   ^P
      End
      Begin VB.Menu Bar3 
         Caption         =   "-"
      End
      Begin VB.Menu MenuExit 
         Caption         =   "           < Exit >"
      End
   End
End
Attribute VB_Name = "IOLogic"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
   For LoopX = 0 To 9
       IOLogic1OutputLEDOFF(LoopX).Visible = True
       IOLogic1OutputLEDON(LoopX).Visible = False
       IOLogic1InputLEDOFF(LoopX).Visible = True
       IOLogic1InputLEDON(LoopX).Visible = False
   Next
   IOLogicInputData.Clear
   IOLogicOutputData.Clear
End Sub

Public Sub ClearListProc()
   On Error Resume Next
   IOLogicInputData.Clear
   IOLogicOutputData.Clear
End Sub

Private Sub ClearList_Click()
   Call ClearListProc
End Sub

Private Sub EnableIOLogicControl_Click()
   If EnableIOLogicControl.Value Then
      ScriptRunning.Enabled = True
   Else
      ScriptRunning.Enabled = False
   End If
End Sub

Private Sub Form_Resize()
   On Error Resume Next
   If IOLogic.Width > 10200 Then IOLogic.Width = 10200
   If IOLogic.Height > 8400 Then IOLogic.Height = 8400
End Sub

Private Sub IOLogic1OutputLEDOFF_Click(Index As Integer)
'Allow user to click on LEDS that are ON to toggle the bits OFF.
   IOLogic1OutputLEDOFF(Index).Visible = False
   IOLogic1OutputLEDON(Index).Visible = True
   IOLogicOutputBitSet(Index) = True
   IOLogicOutputDecimalVal = 0
                              
   For LoopX = 0 To 9
       If IOLogicOutputBitSet(LoopX) = True Then
          IOLogicOutputDecimalVal = IOLogicOutputDecimalVal + BitValTable(LoopX)
       End If
   Next
   ShowIOLogic1OutputDecimal.Text = Trim(Str(IOLogicOutputDecimalVal))
   ShowIOLogic1OutputHEX.Text = Trim(Hex(IOLogicOutputDecimalVal))
End Sub

Private Sub IOLogic1OutputLEDON_Click(Index As Integer)
'Allow user to click on LEDS that are ON to toggle the bits OFF.
   IOLogic1OutputLEDOFF(Index).Visible = True
   IOLogic1OutputLEDON(Index).Visible = False
   IOLogicOutputBitSet(Index) = False
   IOLogicOutputDecimalVal = 0
   
   For LoopX = 0 To 9
       If IOLogicOutputBitSet(LoopX) = True Then
          IOLogicOutputDecimalVal = IOLogicOutputDecimalVal + BitValTable(LoopX)
       End If
   Next
   ShowIOLogic1OutputDecimal.Text = Trim(Str(IOLogicOutputDecimalVal))
   ShowIOLogic1OutputHEX.Text = Trim(Hex(IOLogicOutputDecimalVal))
End Sub

Private Sub IOLogic1InputLEDOFF_Click(Index As Integer)
'Allow user to click on LEDS that are ON to toggle the bits OFF.
   IOLogic1InputLEDOFF(Index).Visible = False
   IOLogic1InputLEDON(Index).Visible = True
   IOLogicInputBitSet(Index) = True
   IOLogicInputDecimalVal = 0
                              
   For LoopX = 0 To 9
       If IOLogicInputBitSet(LoopX) = True Then
          IOLogicInputDecimalVal = IOLogicInputDecimalVal + BitValTable(LoopX)
       End If
   Next
   ShowIOLogic1InputDecimal.Text = Trim(Str(IOLogicInputDecimalVal))
   ShowIOLogic1InputHEX.Text = Trim(Hex(IOLogicInputDecimalVal))
End Sub

Private Sub IOLogic1InputLEDON_Click(Index As Integer)
'Allow user to click on LEDS that are ON to toggle the bits OFF.
   IOLogic1InputLEDOFF(Index).Visible = True
   IOLogic1InputLEDON(Index).Visible = False
   IOLogicInputBitSet(Index) = False
   IOLogicInputDecimalVal = 0
                              
   For LoopX = 0 To 9
       If IOLogicInputBitSet(LoopX) = True Then
          IOLogicInputDecimalVal = IOLogicInputDecimalVal + BitValTable(LoopX)
       End If
   Next

   ShowIOLogic1InputDecimal.Text = Trim(Str(IOLogicInputDecimalVal))
   ShowIOLogic1InputHEX.Text = Trim(Hex(IOLogicInputDecimalVal))
End Sub

Private Sub IOLogicOutputData_Click()
   ListNumber = IOLogicOutputData.ListIndex
   IOLogicInputData.ListIndex = ListNumber
End Sub

Private Sub IOLogicInputData_Click()
   ListNumber = IOLogicInputData.ListIndex
   IOLogicOutputData.ListIndex = ListNumber
End Sub

Private Sub MenuExit_Click()
   Me.Hide
End Sub

Private Sub MenuOpen_Click()
   Call OpenProc
End Sub

Private Sub MenuPrint_Click()
   Call PrintProc
End Sub

Private Sub MenuSave_Click()
   Call SaveProc
End Sub

Private Sub MenuSaveAs_Click()
   Call SaveProc
End Sub

Private Sub MenuStartNew_Click()
   Call ClearListProc
End Sub

Private Sub OpenScript_Click()
   Call OpenProc
End Sub

Private Sub PrintScript_Click()
   Call PrintProc
End Sub

Private Sub SaveScript_Click()
   Call SaveProc
End Sub

Private Sub ScriptRunning_Timer()
   If ScriptLEDON.Visible = False Then
      ScriptLEDON.Visible = True
      ScriptLEDOFF.Visible = False
   Else
      ScriptLEDON.Visible = False
      ScriptLEDOFF.Visible = True
   End If
End Sub

Private Sub ShowIOLogic1OutputDecimal_Change()
   IOLogicOutputDecimalVal = Val(ShowIOLogic1OutputDecimal.Text)
   Call UpdateVirtualOutputLEDS
End Sub

Private Sub ShowIOLogic1OutputHEX_Change()
   HexValue = Trim(ShowIOLogic1OutputHEX.Text)
   Call HexConversion
   IOLogicOutputDecimalVal = HexToDecimalValue
   Call UpdateVirtualOutputLEDS
End Sub

Private Sub ShowIOLogic1InputDecimal_Change()
   IOLogicInputDecimalVal = Val(ShowIOLogic1InputDecimal.Text)
   Call UpdateVirtualInputLEDS
End Sub

Private Sub ShowIOLogic1InputHEX_Change()
   HexValue = Trim(ShowIOLogic1InputHEX.Text)
   Call HexConversion
   IOLogicInputDecimalVal = HexToDecimalValue
   Call UpdateVirtualInputLEDS
End Sub

Public Sub UpdateVirtualInputLEDS()
   On Error Resume Next
   For LoopX = 0 To 9
       If IOLogicInputDecimalVal And BitValTable(LoopX) Then
          IOLogic1InputLEDOFF(LoopX).Visible = False
          IOLogic1InputLEDON(LoopX).Visible = True
          IOLogicInputBitSet(LoopX) = True
       Else
          IOLogic1InputLEDON(LoopX).Visible = False
          IOLogic1InputLEDOFF(LoopX).Visible = True
          IOLogicInputBitSet(LoopX) = False
       End If
   Next

   ShowIOLogic1InputHEX.Text = Trim(Hex(IOLogicInputDecimalVal))
   ShowIOLogic1InputDecimal.Text = Trim(IOLogicInputDecimalVal)
End Sub

Public Sub UpdateVirtualOutputLEDS()
   On Error Resume Next
   For LoopX = 0 To 9
       If IOLogicOutputDecimalVal And BitValTable(LoopX) Then
          IOLogic1OutputLEDOFF(LoopX).Visible = False
          IOLogic1OutputLEDON(LoopX).Visible = True
          IOLogicOutputBitSet(LoopX) = True
       Else
          IOLogic1OutputLEDON(LoopX).Visible = False
          IOLogic1OutputLEDOFF(LoopX).Visible = True
          IOLogicOutputBitSet(LoopX) = False
       End If
   Next

   ShowIOLogic1OutputHEX.Text = Trim(Hex(IOLogicOutputDecimalVal))
   ShowIOLogic1OutputDecimal.Text = Trim(IOLogicOutputDecimalVal)
End Sub

Private Sub AddToList_Click()
   On Error Resume Next
   IOLogicInputData.AddItem "IF Input Decimal Data =" + Str(IOLogicInputDecimalVal)
   IOLogicOutputData.AddItem "THEN Ouput Data =" + Str(IOLogicOutputDecimalVal)
End Sub

Private Sub RemoveFromList_Click()
   On Error Resume Next
   'Subtract data from list
   IOLogicInputData.RemoveItem (ListNumber)
   IOLogicOutputData.RemoveItem (ListNumber)

End Sub

Public Sub SaveProc()
   On Error GoTo UserCanceled 'User click cancel?
   CommonDialog1.Filter = "IO Logic Script Files (*.IO)|*.IO|"
   CommonDialog1.Flags = 0: CommonDialog1.CancelError = True
   CommonDialog1.DialogTitle = "Save IO Logic Script File"
   CommonDialog1.ShowSave
   StrBuffer = CommonDialog1.filename
            
   Open StrBuffer For Output As #1
'Save input values
   For LoopX = 0 To IOLogicInputData.ListCount - 1
       Print #1, IOLogicInputData.List(LoopX)
   Next
       Print #1, "< Input-List-End >"
'Save output values
  For LoopX = 0 To IOLogicOutputData.ListCount - 1
      Print #1, IOLogicOutputData.List(LoopX)
  Next
  Print #1, "< Output-List-End >"
  Close #1
'============
UserCanceled:
'============
End Sub

Public Sub OpenProc()
   On Error GoTo UserCanceled 'User click cancel?
   CommonDialog1.Filter = "IO Logic Script Files (*.IO)|*.IO|"
   CommonDialog1.Flags = 0: CommonDialog1.CancelError = True
   CommonDialog1.DialogTitle = "Save IO Logic Script File"
   CommonDialog1.ShowOpen
   StrBuffer = CommonDialog1.filename
'Clear lists
   IOLogicInputData.Clear
   IOLogicOutputData.Clear
'Open filename for output
   Open StrBuffer For Input As #1
'Open input values
        Do Until StrBuffer = "< Input-List-End >"
10         Line Input #1, StrBuffer
           If StrBuffer <> "< Input-List-End >" Then IOLogicInputData.AddItem (StrBuffer)
        Loop
'Open output values
   Do Until StrBuffer = "< Output-List-End >"
20    Line Input #1, StrBuffer
      If StrBuffer <> "< Output-List-End >" Then IOLogicOutputData.AddItem (StrBuffer)
   Loop
'============
UserCanceled:
'============
Close #1
End Sub

Public Sub PrintProc()
   On Error GoTo UserCanceled 'User click cancel?
   CommonDialog1.CancelError = True
   CommonDialog1.DialogTitle = "Print Logic Script"
   CommonDialog1.Flags = cdlPDReturnDC + cdlPDNoPageNums
   CommonDialog1.Flags = CommonDialog1.Flags + cdlPDAllPages
   CommonDialog1.Flags = CommonDialog1.Flags + cdlPDSelection
   CommonDialog1.ShowPrinter

   Printer.FontName = "Courier New"
   Printer.FontSize = 8
   Printer.FontBold = True
   StrBuffer = ""
   Printer.Print ""
   Printer.Print ""
   Printer.Print "        ------------------------------------------------------------------------------------------------------"
   Printer.Print "        --------- IO Logic Script ------------------------- " + Date$ + " -------------- " + Time$ + " ---------------"
   Printer.Print "        ------------------------------------------------------------------------------------------------------"
   Printer.Print ""
   Printer.FontBold = False

   For LoopX = 0 To IOLogicInputData.ListCount
       Printer.Print "                  " + IOLogicInputData.List(LoopX) + Space(42 - Len(IOLogicInputData.List(LoopX))) + IOLogicOutputData.List(LoopX)
   Next
   Printer.EndDoc
'============
UserCanceled:
'============
End Sub

Private Sub Form_Unload(Cancel As Integer)
   Me.Hide
   Cancel = True
End Sub
