Dosadi home  

Go Back   Dosadi Forum > Dosadi > EZTwain Classic (Free) Library

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-21-2010, 06:28 PM
tthunt tthunt is offline
Participant
 
Join Date: Apr 2010
Posts: 2
Default Detecting Device On-Line

I'm using Java with JNA to access the EZTW32.dll. So far it's working great.

So I've read through the EZTwain Pro User Guide and through the forums and came up with this link on a work around for detecting if a scanner is online or not.

http://www.dosadi.com/ezt3devonline.htm

But the

Code:
TWAIN_GetCapBool(CAP_DEVICEONLINE, 2)
code is not available in the Classic version.

Is there a chance that this code could be added to the Classic version? Or can you help me understand how I might use the TWAIN_DS method?

I know based on the link above why detecting a device online is a pain, but we'd really like to enable or disable a "Scan" button based on whether or not the scanner is on-line.

Thank you.
Reply With Quote
  #2  
Old 04-21-2010, 10:44 PM
Spike's Avatar
Spike Spike is offline
Wizard
 
Join Date: Oct 2004
Location: Vashon, WA
Posts: 1,582
Default

Hi tthunt - I can probably help with that, although reading capability values is more of an EZTwain Pro thing. However, I want to make sure you understand that determining whether or not a scanner is on-line is not a *programming* problem - it's a standardization problem. CAP_DEVICEONLINE is foolishly defined by the TWAIN standard, and most TWAIN drivers implement it in a way that makes it useless.
So, you can read the value, but it doesn't solve the actual problem. The most common cases:

1. In order to read it, you have to open the device, and when you open the device, if the scanner is not on-line the driver displays an error message to the user.
A. The error message cannot be suppressed (without extreme Windows hackery.)
B. After reporting the error, the driver typically fails the open!
As a result, by the time you can read the value of CAP_ONLINE, it is always TRUE...

2. For the Fujitsu fi-series (and some others) if the scanner is unplugged or turned off, the TWAIN driver is removed from the TWAIN device list. So when it is off-line, you can't open it to ask it if it is on-line. If you can open it and read CAP_DEVICEONLINE, then you don't need to: The value must be TRUE.

There's a section about this in the EZTwain Pro User Guide, but I think it says basically the same thing. Does this clarify things some?
__________________
-spike _/\_
Reply With Quote
  #3  
Old 04-22-2010, 02:14 PM
tthunt tthunt is offline
Participant
 
Join Date: Apr 2010
Posts: 2
Default

Spike,

Thank you. That does clear it up.

In our initial development, one of the developers was using a different third party software package with a Fujitsu. And he was able to determine if it was online or not. But based on your description, it sounds like it was dumb luck on our part that the Fujitsu was working the way we had hoped with the "getSources" method call we were using.

Since then I've been working with EZTwain Classic and different scanners and I'm starting to gain a better understanding on how everything is working.

Thank you for your response.
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:01 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content ©2007-2009 Dosadi