This project is read-only.

Detect if Paper is loaded or not.

Jun 1, 2009 at 10:30 PM


Thanks for this wonderful code. I have now customized it to set resolution,page size and disable the progress bar.

However I'm having problems with detecting if paper is loaded or not. I know I need to use one of these - FeederLoaded or PaperDetectable, but I'm not sure how to code it.

Would you please help me and point me in th right direction?

Any help regarding this would be much appreciated.

Jun 3, 2009 at 8:24 PM
Edited Jun 3, 2009 at 8:26 PM

I think Cap_PaperDetectable is the more natural cap for detected whether paper is loaded or not as it doesn't require any other caps to be set first.

But tell me what you're trying to accomplish.  Are you looking for the device to pop-up come tell you when paper is ready or are you trying to determine if paper is available after you have set an operation in progress?

And yeah, I'll build a function for Cap_PaperDetectable.  It's a OneVal Bool, shouldn't be too tricky



Jun 3, 2009 at 10:20 PM

Thanks for responding.

Actually I need to enable/disable the "Scan" button depending upon whether paper has been fed or not. That is what I'm trying to do.

I try to code a function that will return the status using OperationTriplets.Control.Capability.Getvalue(Enumerations.Capability.CAP_FEEDERLOADED). But this always returns False.

I do not know what I'm missing here? Is this the way to do?

Any help regarding this would be much appreciated.

Jun 4, 2009 at 7:17 AM

without having had a chance to look at the code I would recommend stepping thru the GetValue in the debugger to see if somewhere in there you find an rc=Failure and cc=NotSupported.  I wonder if your device supports the Capabilty.

Then ( and I'm just thinking outloud here ) I imagine that you would also need some way for the 'Scan' button to be enabled again once the (function is working) paper is loaded?  At least in a production enviroment, unless the user is often forgetting to put paper in the device (seems like that would be the exception not the rule) this is adding more complexity than benifit.  Or do you have some slick (without user untervention) idea for getting the Scan button re-enabled?  I guess ( still just thinkning outloud ) you could have a timer and poll the capability, but I generally try to avoid polling for the status of stuff - though this might be pretty useful if you pull it off.

Sorry I didn't have time to dig throught the code to mock up a function, hopefully I can have a look at it.  In the meantime, if I remember correctly when you run the sample project in Debug mode there is a whole bunch of information in the output window of your IDE ( at least if you're using visual studio ) and I believe one of the things I output was the returned informationfrom SupportedCaps.  Is Cap_FeederLoaded in that list?  Another thing that comes to mind is one of Dosadi's tools.  They have a tool to report all of the support capabilies of a driver for a device.  What kind of warnings do you see with their tool?

And what device (hardware and driver) are your testing this with?



Jun 4, 2009 at 2:08 PM

I'm trying to use the "Visioneer" portable scanner.

With  regards to the "polling" I was planning to run a background process to detect the paper status and accordingly enable or disable the button.

Yes. I'm running from VS IDE. I will check the output window for that capability.

In short, what I'm trying to achieve is a similar functionality that the scanner's UI has. But I'm not showing the scanner's ui. So I would like to have this feature. But I will check the output window and see if the scanner supports it.

Thanks a lot.