New Source module problem

Forum for software developers to discuss BCI2000 software development
Post Reply
Posts: 9
Joined: 13 May 2014, 10:30

New Source module problem

Post by skvpe » 09 Jan 2015, 21:18


I am implementing a custom signal source to get and display data from the usb. The new signal source is using BufferedADC. In there I found that I have to declare all the functions to open/close USB device in the DoAcquire() function. If I split these declarations in multiple functions then I get access denied error. I wanted to open USB device in OnStartAcqusition() and close it in Halt() or StopRun(). What might be causing this problem?

Another issue is how do I go about writing the application to display the values I get?


Posts: 1163
Joined: 12 Feb 2003, 11:06

Re: New Source module problem

Post by mellinger » 13 Jan 2015, 14:35


if Windows CreateFile() or similar fails with Access Denied, you might not have closed the device properly, or its driver might be buggy. Try again after removing and reconnecting the device, or restarting the machine if nothing else helps.

Typically, you open a device during AutoConfig() or Initialize(). These may be called multiple times, so in order to avoid trying to open a device multiple times, make sure to close any open device before opening the one that is configured in the parameters.

OnStartAcquisition() is meant to ask the device for sending data, not for connecting to the device.
StopRun() will be called when a run ends, at which point you don't want to close the device.


Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest