VERSION 5.00 Begin VB.Form Sample0Form Caption = "Sample 0" ClientHeight = 7215 ClientLeft = 60 ClientTop = 345 ClientWidth = 5775 LinkTopic = "Form1" ScaleHeight = 481 ScaleMode = 3 'Pixel ScaleWidth = 385 StartUpPosition = 3 'Windows Default Begin VB.Timer TestTimer Enabled = 0 'False Interval = 100 Left = 2400 Top = 1680 End Begin VB.Frame ChannelBox Height = 4155 Left = 120 TabIndex = 7 Top = 2040 Width = 5535 Begin VB.Label ChannelLabel Caption = " Channel 1" BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Index = 1 Left = 30 TabIndex = 24 Top = 480 Width = 5475 End Begin VB.Label ChannelLabel Caption = " Channel 2" BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Index = 2 Left = 30 TabIndex = 23 Top = 720 Width = 5475 End Begin VB.Label ChannelLabel Caption = " Channel F" BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Index = 15 Left = 30 TabIndex = 22 Top = 3840 Width = 5475 End Begin VB.Label ChannelLabel Caption = " Channel E" BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Index = 14 Left = 30 TabIndex = 21 Top = 3600 Width = 5475 End Begin VB.Label ChannelLabel Caption = " Channel D" BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Index = 13 Left = 30 TabIndex = 20 Top = 3360 Width = 5475 End Begin VB.Label ChannelLabel Caption = " Channel C" BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Index = 12 Left = 30 TabIndex = 19 Top = 3120 Width = 5475 End Begin VB.Label ChannelLabel Caption = " Channel B" BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Index = 11 Left = 30 TabIndex = 18 Top = 2880 Width = 5475 End Begin VB.Label ChannelLabel Caption = " Channel A" BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Index = 10 Left = 30 TabIndex = 17 Top = 2640 Width = 5475 End Begin VB.Label ChannelLabel Caption = " Channel 9" BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Index = 9 Left = 30 TabIndex = 16 Top = 2400 Width = 5475 End Begin VB.Label ChannelLabel Caption = " Channel 8" BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Index = 8 Left = 30 TabIndex = 15 Top = 2160 Width = 5475 End Begin VB.Label ChannelLabel Caption = " Channel 7" BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Index = 7 Left = 30 TabIndex = 14 Top = 1920 Width = 5475 End Begin VB.Label ChannelLabel Caption = " Channel 6" BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Index = 6 Left = 30 TabIndex = 13 Top = 1680 Width = 5475 End Begin VB.Label ChannelLabel Caption = " Channel 5" BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Index = 5 Left = 30 TabIndex = 12 Top = 1440 Width = 5475 End Begin VB.Label ChannelLabel Caption = " Channel 4" BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Index = 4 Left = 30 TabIndex = 11 Top = 1200 Width = 5475 End Begin VB.Label ChannelLabel Caption = " Channel 3" BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Index = 3 Left = 30 TabIndex = 10 Top = 960 Width = 5475 End Begin VB.Label ChannelLabel Caption = " Channel 0" BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Index = 0 Left = 30 TabIndex = 9 Top = 240 Width = 5475 End End Begin VB.TextBox InstructText BackColor = &H8000000F& Height = 1335 Left = 120 Locked = -1 'True MultiLine = -1 'True TabIndex = 6 Text = "sample0u.frx":0000 Top = 360 Width = 5535 End Begin VB.CommandButton ExitButton Caption = "E&xit Program" Height = 375 Left = 4200 TabIndex = 5 Top = 6600 Width = 1455 End Begin VB.CommandButton TestButton Caption = "Start test" Height = 375 Left = 2520 TabIndex = 4 Top = 6600 Width = 1455 End Begin VB.Frame BaseAddressBox Caption = "Base Address for ISA Card" Height = 855 Left = 120 TabIndex = 1 Top = 6240 Width = 2175 Begin VB.TextBox BaseEdit Height = 315 Left = 720 TabIndex = 2 Text = "300" Top = 360 Width = 1215 End Begin VB.Label Label2 Caption = "Hex" Height = 195 Left = 240 TabIndex = 3 Top = 400 Width = 285 End End Begin VB.Label TitleLabel Alignment = 2 'Center Caption = " Channel Data Read " BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 210 Left = 240 TabIndex = 8 Top = 1800 Width = 5250 End Begin VB.Label CardName Alignment = 2 'Center AutoSize = -1 'True Caption = "A12-16E" BeginProperty Font Name = "MS Sans Serif" Size = 12 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 300 Left = 2400 TabIndex = 0 Top = 0 Width = 975 End End Attribute VB_Name = "Sample0Form" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Declare Function GetTickCount Lib "kernel32" () As Long Private Declare Function InPortB Lib "ACCES32" Alias "VBInPortB" (ByVal Port As Long) As Integer Private Declare Function OutPortB Lib "ACCES32" Alias "VBOutPortB" (ByVal Port As Long, ByVal Value As Byte) As Integer Private Declare Function InPort Lib "ACCES32" Alias "VBInPort" (ByVal Port As Long) As Integer Private Declare Sub Sleep Lib "kernel32" (ByVal ms As Long) Private Sub ExitButton_Click() End End Sub Private Sub Form_Load() If (InPortB(&H61) = &HAA55) Then Call MsgBox("ACCESNT.SYS not detected. Please copy ACCESNT.SYS into [NT]/system32/drivers and re-run this sample.", 0, "Warning") End If End Sub Private Sub TestButton_Click() Dim i As Integer If TestTimer.Enabled = True Then TestTimer.Enabled = False For i = 0 To 15 ChannelLabel(i).Caption = " Channel " & Hex$(i) & " 0" Next TestButton.Caption = "Start Test" Else TestTimer.Enabled = True TestButton.Caption = "Abort Test" End If End Sub ' end TestButtonClick Private Sub TestTimer_Timer() Dim base As Integer Dim counts As Long Dim channel As Integer Dim timeout As Integer base = "&H" + BaseEdit.Text For channel = 0 To 15 timeout = 1000 Call OutPortB(base + 2, channel) Sleep 2 Call OutPortB(base + 3, 0) Do While (Not ((InPortB(base + 2) And &H80) = 0) And (timeout > 0)) timeout = timeout - 1 Loop outputdata = (InPort(base + 6) \ 16) And &HFFF ChannelLabel(channel).Caption = " Channel " & Hex$(channel) & " " & outputdata Next End Sub ' end TestTimerTimer