K8055 SetCurrentDevice & SearchDevices Issue

I am using a K8055 board, while running my program i use SetCurrentDevice to ensure that the my program is still connected to the card.

However, if i disconnect my card and execute SetCurrentDevice(0), the return value is 0, shouldnt this be -1 if the card is no longer connected?

I tried to work around this by using SearchDevices to check to see if the card is still connected before attempting to execute a command but a simular issue occurs here also. The following code illustrates my issue:

[code] Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

    Dim test As Integer = -9

    Debug.Print("Initial " & test)

    test = OpenDevice(0)
    Debug.Print("OpenDevice " & test)

    test = -9
    Debug.Print("Reset " & test)

    test = SetCurrentDevice(0)
    Debug.Print("SetCurrentDevice " & test)

    test = -9
    Debug.Print("Reset " & test)

    test = SearchDevices
    Debug.Print("SearchDevices " & test)

    test = -9
    Debug.Print("Reset " & test)

End Sub[/code]

This produces the following output:

[color=#408040]Initial -9
OpenDevice 0 'Expected
Reset -9
SetCurrentDevice 0 'Expected
Reset -9
SearchDevices 0 'This should return a decimal 1 (0001) for a card with address of zero
Reset -9[/color]

I did not disconnect the card during this test, however, if i were to do so, the SetCurrentDevice call would still return a 0, where i would expect it to return -1

Is this a bug in the DLL? Or am i doing something wrong?

I am using the 3.0.2.0 version of the K8055 DLL

Kind Regards

Phil

It seems the return values of function ReadAllAnalog are -1 if the card is disconnected.
Also function ReadAnalogChannel returns -1 if the card is disconnected.
I tested with the latest DLL version 3.
Here a link to my Visual C++ 2008 Express project files I used to test this feature: box.net/shared/jhm672nk6z

Thank you very much. This does exactly what i need.