Page 1 of 1

Error at opening the Data Source

Posted: Tue Jun 15, 2010 11:53 pm
by derek_k
I've got a persistent problem that is happening on all my deployments (5 or 6) - random exceptions when attempting a scan:

Vintasoft.Twain.TwainException: Error at opening the Data Source.
at Vintasoft.Twain.VSTwain.OpenDataSource()

I haven't been able to reproduce the problem, but it typically happens after the scanner has entered power saving mode and the user attempts a scan. The only way to solve the problem is to power off the scanner entirely, and turn it back on - OR, doing a scan from the built in scan utility in Windows will usually work, and then the scan using the vintasoft sdk will work afterwards.

This is happening on Windows XP x86, Win 7 x86 and Win 7 x64 machines, with HP N6010, Scanjet 5000 and Scanjet 7000 devices alike. It doesn't seem to matter if I use the twain or WIA devices.

The usage of VS twain is very simple. In a nutshell:

using (var twain = new VSTwain()) {
twain.StartDevice();

twain.ShowUI = false;
twain.ShowIndicators = false;
twain.DisableAfterAcquire = true;
twain.AutoCleanBuffer = true;

twain.SourceIndex = <source index>;
twain.OpenDataSource();

//scanning here...

twain.CloseDataSource();
twain.StopDevice();
}

Any idea what might be causing this?

Re: Error at opening the Data Source

Posted: Fri Jun 18, 2010 9:03 am
by Alex
Hello Derek,
I've got a persistent problem that is happening on all my deployments (5 or 6) - random exceptions when attempting a scan:
Vintasoft.Twain.TwainException: Error at opening the Data Source.
at Vintasoft.Twain.VSTwain.OpenDataSource()
What code do you use for scanning? Make sure that you are using the AcquireModal method in a loop.

Best regards, Alexander