software no longer works after a driver update

Post Reply
HvD
Posts: 2
Joined: Mon Dec 24, 2007 5:00 pm
Location: The Netherlands

software no longer works after a driver update

Post by HvD »

Dear all,

I have the problem that my software does not work anymore after I updated the driver. Driver was downloaded from http://www.biosemi.com/download.htm and is the 32bits windows XP, vista, windows 7 driver. My software uses the new dll correctly so it seems because when I use the old dll file I get an error when initialising the handle. However, when I run the sync_test program this does work without problems but the code seems to be the same.

When I debug my own software I get NO error messages, so all the calls to USB_WRITE etc went well. After a call to USB_WRITE with the first byte as FF the [i]data [/i]light shortly is green on the usb receiver but than turns off again. No data is coming in when I call READ_POINTER.

Note that returning the system to the old driver and using the old LABVIEW_DLL.DLL file everythings works just fine.

any suggestions?

thanks,
Hans

pmac
Posts: 70
Joined: Thu Jan 21, 2010 2:51 pm
Location: Canada

Post by pmac »

Hi Hans,

First lets try the following.

Create a text file called "labview_dll.ini" in the directory that contains your .exe. Put a line in this file that contains just the word "log". If this file already exists in your directory, add the line to that file. Then retry your program. You should get 3 ".log" files that give some information about your calls and associated acquisition events.

You could try this with your program and with the synctest program and compare the results or send the 3 files generated when running your program to me in a private message through this forum.

Beware: each time you run your program output is appended to the 3 ".log" files. You must delete these files to remove output from previous
runs.

Paul

pmac
Posts: 70
Joined: Thu Jan 21, 2010 2:51 pm
Location: Canada

Post by pmac »

For the record, the problem has been resolved.

The trouble was caused, in part, by a difference between the two Labview_DLL.dll versions, in the way the READ_MULTIPLE_SWEEPS API is implemented.

Hans was calling READ_MULTIPLE_SWEEPS once and then using USB_WRITE calls to repeatedly start and stop acquisition. This pattern of use (i.e. multiple starts and stops) is not addressed in the information presented in the FAQ web page entry "How can I make my own acquisition software ?". It apparently works with the original BioSemi kernel mode driver's dll. That is,

READ_MULTIPLE_SWEEPS(...
for (...)
{
USB_WRITE(... the x'ff' byte and 63 0's to enable handshake
READ_POINTER(...
...
USB_WRITE(... the 64 0's to disable handshake
}

When using the new WinUsb based driver's dll, the READ_MULTIPLE_SWEEPS call must be repeated before any USB_WRITE that's being used to start acquisition. READ_MULTIPLE_SWEEPS now runs in user mode rather than kernel mode. It starts a thread to handle the repeated read calls needed to cycle through the ring buffer. This thread terminates when USB_WRITE is called to disable sample input. This sequence works:

for (...)
{
READ_MULTIPLE_SWEEPS(...
USB_WRITE(... the x'ff' byte and 63 0's to enable handshake
READ_POINTER(...
...
USB_WRITE(... the 64 0's to disable handshake
}

Programs that start and stop acquisition once between the OPEN_DRIVER and CLOSE_DRIVER calls shouldn't have this problem.

Paul

Post Reply