ntwain icon indicating copy to clipboard operation
ntwain copied to clipboard

Error while scanning with Canon DR M260

Open ramveersgh opened this issue 6 years ago • 13 comments
trafficstars

When scanning with Canon DR M260 twain driver, I am getting the following error - Scanner error (unknown error-error code: 27).

Kindly suggest fixing this issue.

image

ramveersgh avatar Apr 22 '19 03:04 ramveersgh

Ive got the same Problem with the Canon dr g 2090. Its look like a Problem of the imagefomula driver. I found out that its a kind of sequence Error in the dsm. i have tryed some other twain frameworks and it raises the same message with saraff etc. Only the Twain for c# by TwainCoperation can succesfully work with the Scanner.

florianhaehnlein avatar May 13 '19 20:05 florianhaehnlein

It happens in DoTransferRoutine(ITwainSessionInternal session).

For every try to get some DGControl it returns a seqerror.

florianhaehnlein avatar May 14 '19 14:05 florianhaehnlein

@florianhaehnlein : Thank you very much for your reply.. Did you fins any solution for this in NTwain? OR You used Twain for c# by TwainCoperation ??

ramveersgh avatar Jun 15 '19 09:06 ramveersgh

@ramveersgh, @florianhaehnlein Did you find any solution for this error? I try using Twine for Canon DR M260....

qlik18 avatar Dec 06 '19 10:12 qlik18

I am unable to consistently reproduce this error. Can anyone provide the steps required to reproduce the error?

Ackara avatar Jul 14 '20 20:07 Ackara

@florianhaehnlein Hi. Do you have any solution in addition to twain-cs

yuanshengyu avatar Sep 11 '20 10:09 yuanshengyu

@ramveersgh @Ackara @yuanshengyu Did you find any solution for this error. We are getting this error on Canon DRG-2110. We are using NTwain from Nuget.

jerinthomasexperion avatar Sep 27 '20 08:09 jerinthomasexperion

Hi! Does someone find a solution to this error? Thanks

moonpink20 avatar Nov 06 '20 17:11 moonpink20

I got the same error with SARAFF software, but fixed it by setting IsTwain2Enable = false. So it might seem like the imageformua driver has some issues with newer twain versions. I could not find how to set the protocol version using ntwain to test, is this possible?

akselkvitberg avatar Jul 06 '22 12:07 akselkvitberg

There is. Set PlatformInfo.Current.PreferNewDSM = false.

soukoku avatar Jul 06 '22 13:07 soukoku

Set PlatformInfo.Current.PreferNewDSM = false doesn't work. I try to make some modifications and it works.

step1. add a new class in ntwain.dll and add a static variable in it to recode that if you choice the Canon G2090 scanner. ScannerType.Is_Canon_G2090

step2. Modify the version of twain to 1.9. // code in yourself source // ....... code of choice a new ds ScannerType.Is_Canon_G2090 = false; if (ds.Name.Contains("G2090")) { ScannerType.Is_Canon_G2090 = true; twain.ChangeAppTwainVersionTo1Point9(); } // code in class TwainSession.cs public void ChangeAppTwainVersionTo1Point9() { this._appId.ProtocolMajor = 1; this._appId.ProtocolMinor = 9; }

step3. when open the ds, add some code in DataSource.cs, in fact I find that when you invoke the method UpdateCallBack will always return failure whatever scanner you are using. But when you are using the Canon G2090 scanner it'll pop an error messagebox [error code = 27]. rc = _session.DGControl.Identity.OpenDS(this); if (!ScannerType.Is_Canon_G2090) { _session.UpdateCallback(); }

step4. modify the method <DoTransferRoutine> in class TransferLogic.cs if (!ScannerType.Is_Canon_G2090 && session.DGControl.XferGroup.Get(ref xferGroup) == ReturnCode.Success) { xferAudio = (xferGroup & DataGroups.Audio) == DataGroups.Audio; xferImage = xferGroup == DataGroups.None || (xferGroup & DataGroups.Image) == DataGroups.Image; }

    var rc = ReturnCode.Failure;
    if (ScannerType.Is_Canon_G2090)
    {
        rc = ReturnCode.Success;
    }
    else
    {
        rc = session.DGControl.PendingXfers.Get(pending);
    }

I can't explain this, but it really works anyway.

icehaopan avatar Nov 30 '22 08:11 icehaopan

@ramveersgh @yuanshengyu @qlik18 @jerinthomasexperion Have you found a solution yet?

ljchengx avatar Jan 16 '24 03:01 ljchengx