Using the Labview_DLL.dll to access the USB datastream
Posted: Wed Oct 06, 2004 3:59 pm
				
				Dear Forum, 
I am currently writing some software to read the datastream coming from the USB Receiver. via the PCs USB port. This data will then be used to control some real-time EEG software. I have written a small program that will aquire a block of data from the USB port and write it to a file for further inspection.
Here is the code:
When I run the above code I get "Linker Error : Unresolved external.....  " . I am using Borland C++ Builder v6.0 and have added the DLL file to the project using the "Add to project..." menu option. Any assistance you could give me will be greatly appreciated  .
 .
Many thanks
Dave.
			I am currently writing some software to read the datastream coming from the USB Receiver. via the PCs USB port. This data will then be used to control some real-time EEG software. I have written a small program that will aquire a block of data from the USB port and write it to a file for further inspection.
Here is the code:
Code: Select all
__declspec(dllimport) HANDLE OPEN_DRIVER_ASYNC(void);
__declspec(dllimport) bool USB_WRITE(HANDLE hdevice, PCHAR usbdata);
__declspec(dllimport) bool READ_MULTIPLE_SWEEPS(HANDLE hdevice, PCHAR data, DWORD nBytesToRead);
__declspec(dllimport) bool READ_POINTER(HANDLE hdevice, PDWORD pointer);
__declspec(dllimport) CLOSE_DRIVER_ASYNC(HANDLE hdevice);
//---------------------------------------------------------------------------
char usbdata[63];
char data[33554432];
DWORD nBytesToRead = 33554432;
int main(int argc, char* argv[])
{
        HANDLE hdevice=OPEN_DRIVER_ASYNC();
        for (int i=0; i<64; i++)
        {
                usbdata[i]=0;
        }
        USB_WRITE(hdevice, usbdata);
        READ_MULTIPLE_SWEEPS(hdevice, data, nBytesToRead);
        usbdata[0]=1;
        USB_WRITE(hdevice, usbdata);
        usbdata[0]=0;
        USB_WRITE(hdevice, usbdata);
        CLOSE_DRIVER_ASYNC(hdevice);
        return 0;
}
 .
 .Many thanks
Dave.
 There still remain a lot of questions on 'daisy chained' mode (the real sequence of pin-channels, touchproofs and sensors from different boxes, the way the system will behave in case of only one box, but in mode, for example, 2 etc) - but I do not thing they are relevant now.
 There still remain a lot of questions on 'daisy chained' mode (the real sequence of pin-channels, touchproofs and sensors from different boxes, the way the system will behave in case of only one box, but in mode, for example, 2 etc) - but I do not thing they are relevant now.