K8061 - Setdigitalchannel not working!

Hello,

Hope someone can help.

I am using Windows XP ver 2002 SP2 and writing in Visual Basic.

I am writing a program for the K8061 USB interface PCB, I have written software for the K8055 without any problem.

The problem I am having is with the SetDigitalChannel and ReadDigitalChannel functions.

I set a button to simply switch the output on, ie

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    SetDigitalChannel(0, 1)
End Sub

But when I click the button, nothing happens.

I then created a button that SetsAllDigital, as follows,

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    SetAllDigital(0)
End Sub

and this works fine as does the ClearAllDigital.

I am sure I must be doing something stupid, but I am really in need of some help as to why it is not working.

Many Thanks.

Your function looks OK.
Does your function declaration look like this:

Private Declare Sub SetDigitalChannel Lib "k8061.dll" (ByVal intCardNumber As Integer, ByVal Channel As Integer)

Hi,

No the function declaration was

Private Declare Sub SetDigitalChannel Lib "k8061.dll" (ByVal CardAddress As Long, ByVal Channel As Long)

I have now change it to

Private Declare Sub SetDigitalChannel Lib "k8061.dll" (ByVal intCardNumber As Integer, ByVal Channel As Integer)

and it is working great.

Many thanks for your fast responce, I am very happy! :smiley: