Jump to content

TWAIN and LabVIEW


Recommended Posts

Yeah, there is a topic that is a few years old.  Didn't want to revive it and it was marginally helpful.  What is the best solution?  Right now, I'm looking at TWAIN Commander and just calling it from the command line.  I can justify this if it saves me some significant development time, though I don't really care to pay other people for things I can develop myself.  Essentially, I just want to tell a scanner to scan and give it some parameters such as where to put the images in what format.  I care about resolution and some other things, but if I can set default values in a windows interface then that is great with me.  They won't change.

 

From people who have worked with this, can I develop my own C++ code fairly quickly to accomplish what I want or am I really better off paying someone $500 for a tool?  Surely there are some free .NET or ActiveX libraries around?  I wouldn't mind working with those, I just haven't found them.  

Link to comment
Yeah, there is a topic that is a few years old.  Didn't want to revive it and it was marginally helpful.  What is the best solution?  Right now, I'm looking at TWAIN Commander and just calling it from the command line.  I can justify this if it saves me some significant development time, though I don't really care to pay other people for things I can develop myself.  Essentially, I just want to tell a scanner to scan and give it some parameters such as where to put the images in what format.  I care about resolution and some other things, but if I can set default values in a windows interface then that is great with me.  They won't change.

 

From people who have worked with this, can I develop my own C++ code fairly quickly to accomplish what I want or am I really better off paying someone $500 for a tool?  Surely there are some free .NET or ActiveX libraries around?  I wouldn't mind working with those, I just haven't found them.  

 

To add to your original question: No the Twain API is not trivial to call from an environment like LabVIEW. It is based on a very old Windows 3.0 paradigma that communicates through the applications windows event queue with the client and this windows event queue is pretty well hidden from the normal LabVIEW level where you normally operate inside VIs. For a big part this is because each LabVIEW platform has a fundamentally different window manager interface that had to be handled in LabVIEW in a consistent manner for all platforms. So this sits deep in the guts of LabVIEW and is only with some low level Windows API magic accessible in a way that allows to handle the Twain messages properly.

 

I developed in the past such an interface for some internal projects and it worked, but is still quite a stretch from something that could be released to the greater public without risking disappointment by many developers who would go about using it. It worked for me because I knew how to call it (and what not to try to do) and because I could go into the C code and debug the issues if any surfaced. But it was a very painful debugging experience since if you try to single step into those parts of window event handling you are generally creating all kinds of hard deadlocks and race conditions on both the standard Windows event handling level as the more specialized LabVIEW windows manager layer.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.