VERSION 5.00 Begin VB.Form Sample1Form Caption = "Sample 1" ClientHeight = 3990 ClientLeft = 45 ClientTop = 330 ClientWidth = 6495 LinkTopic = "Form1" ScaleHeight = 3990 ScaleWidth = 6495 StartUpPosition = 3 'Windows Default Begin VB.TextBox Text1 BackColor = &H8000000F& Height = 1668 Left = 120 Locked = -1 'True MultiLine = -1 'True TabIndex = 12 Text = "Sample1u.frx":0000 Top = 360 Width = 6276 End Begin VB.CommandButton TestButton Caption = "Start Test" Height = 372 Left = 2880 TabIndex = 11 Top = 3456 Width = 1440 End Begin VB.CommandButton ExitButton Caption = "Exit Program" Height = 372 Left = 4800 TabIndex = 10 Top = 3456 Width = 1440 End Begin VB.Frame BaseAddressBox Caption = "Base Address for ISA Card" Height = 768 Left = 300 TabIndex = 7 Top = 3180 Width = 2256 Begin VB.TextBox BaseEdit Height = 288 Left = 1200 TabIndex = 8 Text = "300" Top = 320 Width = 852 End Begin VB.Label Label2 Caption = "Base Address:" Height = 192 Left = 120 TabIndex = 9 Top = 360 Width = 1068 End End Begin VB.Timer TestTimer Enabled = 0 'False Interval = 100 Left = 4440 Top = 3480 End Begin VB.Frame Frame1 Caption = "Output" Height = 960 Left = 120 TabIndex = 0 Top = 2124 Width = 6276 Begin VB.Label PortPanel Alignment = 2 'Center BorderStyle = 1 'Fixed Single Caption = "0000000000000000" Height = 252 Index = 0 Left = 240 TabIndex = 6 Top = 480 Width = 1788 End Begin VB.Label PortPanel Alignment = 2 'Center BorderStyle = 1 'Fixed Single Caption = "0000000000000000" Height = 252 Index = 2 Left = 4320 TabIndex = 5 Top = 480 Width = 1788 End Begin VB.Label PortPanel Alignment = 2 'Center BorderStyle = 1 'Fixed Single Caption = "0000000000000000" Height = 252 Index = 1 Left = 2280 TabIndex = 4 Top = 480 Width = 1788 End Begin VB.Label Label4 Alignment = 2 'Center Caption = "Port 1" Height = 192 Left = 2280 TabIndex = 3 Top = 240 Width = 1788 End Begin VB.Label Label5 Alignment = 2 'Center Caption = "Port 2" Height = 192 Left = 4320 TabIndex = 2 Top = 240 Width = 1788 End Begin VB.Label Label3 Alignment = 2 'Center Caption = "Port 0" Height = 192 Left = 240 TabIndex = 1 Top = 240 Width = 1788 End End Begin VB.Label Label1 Alignment = 2 'Center AutoSize = -1 'True Caption = "IDO-48" 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 = 2844 TabIndex = 13 Top = 0 Width = 768 End End Attribute VB_Name = "Sample1Form" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Declare Function InPortB Lib "ACCES32" Alias "VBInPortB" (ByVal Port As Long) As Integer Private Declare Function OutPort Lib "ACCES32" Alias "VBOutPort" (ByVal Port As Long, ByVal Value As Integer) As Integer Dim current As Long Dim i As Integer Dim mask As Long Dim Address As Integer 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() If TestTimer.Enabled Then TestTimer.Enabled = False TestButton.Caption = "Start Test" BaseEdit.Enabled = True Else TestTimer.Enabled = True TestButton.Caption = "Abort Test" BaseEdit.Enabled = False Address = "&h" + Sample1Form.BaseEdit.Text i = 0 current = &HFFFE End If ' end if/else End Sub Private Sub TestTimer_Timer() Dim Port As Integer Dim ThisString As String ThisString = "" mask = 1 For i = 0 To 15 If (current And mask) = 0 Then ThisString = 0 + ThisString Else ThisString = 1 + ThisString End If mask = mask * 2 Next For Port = 0 To 2 PortPanel(Port).Caption = ThisString Call OutPort(Address + (Port * 2), current Mod 256) Call OutPort(Address + (Port * 2) + 1, current / 256) Next current = Not (2 ^ i) i = (i + 1) Mod 16 End Sub