TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

Transfer of multiple images

Forums › TWAIN Classic › Transfer of multiple images

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • April 30, 2019 at 2:17 am #50904 Reply
    Oleh
    • Topics - 95
    • Replies - 183
    • Total Posts - 278

    Hi,

    I’m creating a Twain DS for a user controller camera, and have question regarding to multiple images transfer. I Would appreciate if someone can answer them. In my case, user can take picture by pressing a button on camera, so I’m trying to see how will scenario work with applications that support multiple images and user presses button several times.

    Q1. In the scenario when application supports unlimited amount of images ( CAP_XFERCOUNT is negotiated to -1 ) and TWAIN is in state 5 – DS enabled.
    As far as I understand following possible scenario should work:
    a. User presses button. my DS calls XFERReady callback. We are in state 6
    b. App requests image using one of the methods.
    c. DS transfers image, and responds with TWRC_XFERDONE once everything is transmitted
    d. App calls DG_CONTROL/DAT_PENDINGXFERS/MSG_ENDXFER, we respond with 0 in count field, since there are no more images. This results in State 5
    e. App waits further one ( doesn’t call disableUI ).
    f. User presses button on scanner. DS calls XFERReady and steps b…f repeat
    Is that correct scenario? I’m using twacker to test it. However once transfer of 1 images is done and MSG_ENDXFER with 0 count is replied, twacker will not accept images anymore, although visually it claims that it is still in state 5. This looks like bug in twacker to me.

    Q2. What if CAP_XFERCOUNT is negotiated to 1? According to documentation this means that DS should send not more then 1 image per session. But what is considered session? Does it mean between showUI and hideUI calls? Or is session amount of images transferred until we got to state 5, so in Q1, step F is already second session?

    Q3. Rather theoretical scenario, but still. If user is very fast ( or application is slow ), and he makes multiple images while transfer of previous image is still ongoing. This means that in scenario 1, step D, we can keep responding with count 1 because every time while we transferred
    current image, user manager to take new image.
    Is that correct?

    Thank you.

    May 1, 2019 at 10:13 am #50906 Reply
    markm
    • Topics - 95
    • Replies - 183
    • Total Posts - 278

    Q1. In the scenario when application supports unlimited amount of images ( CAP_XFERCOUNT is negotiated to -1 ) and TWAIN is in state 5 – DS enabled.
    As far as I understand following possible scenario should work:
    a. User presses button. my DS calls XFERReady callback. We are in state 6
    b. App requests image using one of the methods.
    c. DS transfers image, and responds with TWRC_XFERDONE once everything is transmitted
    d. App calls DG_CONTROL/DAT_PENDINGXFERS/MSG_ENDXFER, we respond with 0 in count field, since there are no more images. This results in State 5
    e. App waits further one ( doesn’t call disableUI ).
    f. User presses button on scanner. DS calls XFERReady and steps b…f repeat
    Is that correct scenario? I’m using twacker to test it. However once transfer of 1 images is done and MSG_ENDXFER with 0 count is replied, twacker will not accept images anymore, although visually it claims that it is still in state 5. This looks like bug in twacker to me.
    In programmatic mode (ShowUI == FALSE) once the driver goes to state 5 (due to TW_PENDINGXFERS.Count == 0) the driver must return to state 4, and then reissue DG_CONTROL / DAT_USERINTERFACE / MSG_ENABLEDS.

    Q2. What if CAP_XFERCOUNT is negotiated to 1? According to documentation this means that DS should send not more then 1 image per session. But what is considered session? Does it mean between showUI and hideUI calls? Or is session amount of images transferred until we got to state 5, so in Q1, step F is already second session?
    Yes, as indicated above CAPX_XFERCOUNT will end the capture phase, returning the driver state to 5, which should then be taken back down to 4.

    Q3. Rather theoretical scenario, but still. If user is very fast ( or application is slow ), and he makes multiple images while transfer of previous image is still ongoing. This means that in scenario 1, step D, we can keep responding with count 1 because every time while we transferred
    current image, user manager to take new image.
    Is that correct?
    I would recommend sticking with -1, because that indicates that there’s an unknown number of images waiting to be transferred. One thing that may be helpful would be to report a value of TRUE for CAP_FEEDERLOADED when an image is ready to be transferred. It would be easy for applications to poll for this. A more advanced solution using events can also be accomplished using CAP_DEVICEEVENT.

    May 9, 2019 at 2:54 am #50915 Reply
    Oleh
    • Topics - 95
    • Replies - 183
    • Total Posts - 278

    Thanks a lot for the reply.
    Regarding first question – is it also like that for (ShowUI == TRUE)?

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Transfer of multiple images
Your information:




Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • Hello world
  • Girls of Desire: All babes in one place, crazy, art
  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.