Error at opening the Data Source

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Moderator: Alex

Post Reply
derek_k
Posts: 4
Joined: Wed May 12, 2010 2:12 am

Error at opening the Data Source

Post by derek_k » Tue Jun 15, 2010 11:53 pm

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?

Alex
Site Admin
Posts: 1461
Joined: Thu Jul 10, 2008 2:21 pm

Re: Error at opening the Data Source

Post by Alex » Fri Jun 18, 2010 9:03 am

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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests