K8055 Visual Basic 4 Run Time Error ‘53’ File Not Found
Hi All
My K8055 powers up and runs fine with the compiled K8055 Demo and K8055D dll v3.0.2.0 provided by Velleman.
If I load the source code provided and compile it myself I get a running form.
However, when I try to connect it I get the “Run Time Error ‘53’ File Not Found” message.
Debug indicates that the error occurs at the “h = OpenDevice(CardAddress)” statement.
My card is set to address 0 which I verified using the Debug statement “Debug.Print CardAddress”.
My goal is to learn Visual Basic by modifying the provided code but I am stuck before I start. Any help will be appreciated.
Mike241
Option Explicit
Dim DoNothing As Boolean
Dim n As Integer
Private Declare Function OpenDevice Lib "k8055d.dll" (ByVal CardAddress As Long) As Long
Private Declare Sub CloseDevice Lib "k8055d.dll" ()
Private Declare Function ReadAnalogChannel Lib "k8055d.dll" (ByVal Channel As Long) As Long
Private Declare Sub ReadAllAnalog Lib "k8055d.dll" (Data1 As Long, Data2 As Long)
Private Declare Sub OutputAnalogChannel Lib "k8055d.dll" (ByVal Channel As Long, ByVal Data As Long)
Private Declare Sub OutputAllAnalog Lib "k8055d.dll" (ByVal Data1 As Long, ByVal Data2 As Long)
Private Declare Sub ClearAnalogChannel Lib "k8055d.dll" (ByVal Channel As Long)
Private Declare Sub SetAllAnalog Lib "k8055d.dll" ()
Private Declare Sub ClearAllAnalog Lib "k8055d.dll" ()
Private Declare Sub SetAnalogChannel Lib "k8055d.dll" (ByVal Channel As Long)
Private Declare Sub WriteAllDigital Lib "k8055d.dll" (ByVal Data As Long)
Private Declare Sub ClearDigitalChannel Lib "k8055d.dll" (ByVal Channel As Long)
Private Declare Sub ClearAllDigital Lib "k8055d.dll" ()
Private Declare Sub SetDigitalChannel Lib "k8055d.dll" (ByVal Channel As Long)
Private Declare Sub SetAllDigital Lib "k8055d.dll" ()
Private Declare Function ReadDigitalChannel Lib "k8055d.dll" (ByVal Channel As Long) As Boolean
Private Declare Function ReadAllDigital Lib "k8055d.dll" () As Long
Private Declare Function ReadCounter Lib "k8055d.dll" (ByVal CounterNr As Long) As Long
Private Declare Sub ResetCounter Lib "k8055d.dll" (ByVal CounterNr As Long)
Private Declare Sub SetCounterDebounceTime Lib "k8055d.dll" (ByVal CounterNr As Long, ByVal DebounceTime As Long)
Private Sub Connect_Click()
Dim CardAddress As Long
Dim h As Long
CardAddress = 0
CardAddress = 3 - (Check1(0).Value + Check1(1).Value * 2)
Debug.Print CardAddress
h = OpenDevice(CardAddress)
Debug.Print h
Select Case h
Case 0, 1, 2, 3
Label1.Caption = "Card " + Str(h) + " connected"
Case -1
Label1.Caption = "Card " + Str(CardAddress) + " not found"
End Select
If h >= 0 Then Timer1.Enabled = True
End Sub