K8055 SetCurrentDevice

Hi,

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 am using the 3.0.2.0 version of the K8055 DLL

Cheers

Phil

For anyone else experiencing this possible bug, a work around is to use the SearchDevices method as follows (Visual Basic):


Private Declare Function SearchDevices Lib "k8055d.dll" () As Integer

Private Function CheckConnection(ByVal CardID As Integer) As Boolean

        Dim result As Short = (2 ^ CardID) And SearchDevices

        Return IIf(result = 1, True, False)

    End Function

The problem is, my version of SearchDevices() returns ‘0’ no matter how many cards are connected

//Why are the boards not working sepperate any clue??? Plz plz help me :frowning:

#include “K8055D_C.h”
#include
#include <windows.h>
using namespace std;

int main()
{

OpenDevice(0);
OpenDevice(1);

int tala1 = 0;
int tala2 = 0;
do
{
SetCurrentDevice(0);
tala1 = ReadAnalogChannel(1);
tala2 = ReadAnalogChannel(2);
cout << tala1 << endl << tala2 << endl;
Sleep(1000);
SetCurrentDevice(1);
OutputAnalogChannel(1,tala1);
OutputAnalogChannel(2,tala2);
}
while(1);
ClearAnalogChannel(1);
ClearAnalogChannel(2);
CloseDevice();
return 0;
}