in Twain there is no Condition Code to show the application an empty feeder (no more sheets to scan) during batch scanning. I know before start to scan a batch of paper the data source should check CAP_FEEDERLOADED. But in case the batch scan is running and after the last page was scanned the next DAT_IMAGExxxXFER should return something like TWRC_FAILURE/TWCC_NOPAPER. Do anybody know how the data source can tell it to the application ?
After you receive the last image, so after you leave the image transfer loop, why don’t you do a timer with Get/CAP_FEEDERLOADED, and if TRUE : EnableDS ?
From my point of view, if your code leaves the loop, there are two reasons, first there’s no page in the feeder, or second, the user took too much time to put paper in the feeder and the driver reached its timeout, disabling DS. I assume that you want to restart scanning in the second case.
If TW_PENDINGXFERS == 0 the feeder is empty.