Synchronous Scanning - deprecated

Synchronous scanning is also called blocked scanning. As a programmer, you instruct ScanningManager to scan and your program blocks until results are ready.

NOTE:The following features cannot be used with synchronous scanning:

In the Scantron OMR Scanning world, a document may consist of a single sheet or could be a multi-sheet booklet. When a single sheet is scanned, ScanningManager will return control to the calling program when the sheet is at the print station and when the document has been completely scanned. When a multi-sheet document is scanned, ScanningManager returns control to the calling program when the sheet is at the print station and when the entire document has been completely scanned. It was also return control when a session has been completed.

To implement synchronous scanning, do the following:

  1. Create an instance of ScanningManager. By default ScanningManager assumes that you do not want to customize error handling. Even if a call to SetKernelErrorMode has been made with mode = L_CLIENTHANDLES_GENERRORS, L_CLIENTHANDLES_SCANERRORS, L_CLIENTHANDLES_SCANERRORS_BASIC, or L_CLIENTHANDLES_SCANERRORS_ADVANCED, ScanningManager will ignore these values and behave as if it were called with a value of 0 during a synchronous scanning session.
  2. Call ScanningManager.SetClientWindowHandle with a window handle over which you would like all your dialogs to be displayed. This is the only way to ensure that all dialogs and messages displayed by ScanTools Plus are visible to the user. You could pass in a value of –1 instead of a window handle and force all dialogs and messages come up as DeskTop Modal.
  3. Create an instance of SessionInfo. SessionInfo has numerous properties that you can alter to configure your scanning session. Most of these properties have default values so you can selectively modify properties that are relevant to your application. Some of the more commonly used properties are the Application, ApplicationDirectory, DataFile and DataDirectory. If you leave the DataFile property blank, ScanningManager will create a data file called XYZ.dat where XYZ is the application number specified for the session. The SessionInfo.Synchronous property must be set to True to scan synchronously. The default value of Synchronous is False; make sure that you change it. The StopAfter property is ignored when scanning synchronously.
  4. Call ScanningManager.Scan along with the SessionInfo object just created.
  5. Call ScanningManager.BlockForScannerEvent in a loop until the session ends. BlockForScannerEvent will return when a sheet reached the print head, when a document has been completely scanned, or when the session is complete. BlockForScannerEvent has an output parameter of type L_EVENTTYPES_ENUM that indicates the last event that occurred. A value of L_EVENTTYPES_SHEETATPRINTHEAD indicates that a sheet is waiting at the print head. A value of L_EVENTTYPES_DOCCOMPLETE indicates that the document has been completely scanned. A value of L_EVENTTYPES_SESSIONCOMPLETE indicates that the current scanning session has been closed.
  6. A scanning session may be closed in these different ways:
  7. The data file created/modified during this session may be viewed using Data Services.

  1. If your application requires access to scanned data after each document is scanned, you must call ScanningManager.GetDocOutput right after a call to BlockForScannerEvent returns a value of L_EVENTTYPES_DOCCOMPLETE The GetDocOutput method returns an object of type DocOutput (docO). You can examine various properties of docO to obtain details of the document just scanned. The complete ASCII record (including score and conversion fields) for this document is available in the DataRecordInNCSFormat property. You can use the DocumentType and ConnectionString properties to open a recordset and access individual fields in the record without having to hardcode the record structure. This is a good time to store the data record in a database.
  2. If your application requires control at the sheet level you must you must call ScanningManager.GetSheetOutput right after a call to BlockForScannerEvent returns a value of L_EVENTTYPES_SHEETATPRINTHEAD. The GetSheetOutput method returns an object (sheetO) of type SheetOutput. Within this event handler you can examine various properties of the sheetO to obtain details of the sheet just scanned. The sheet is at "Print Head" waiting to be stacked and printed upon. The current document is in the process of being scanned and the complete ASCII record is not available. The partial ASCII record for this document may be obtained by examining the PartialDataRecordinNCSFormat property. If the document being scanned consists of a single sheet the record returned by PartialDataRecordinNCSFormat will be complete except for score and conversion fields. If the document being scanned consists of multi-sheet booklets the record returned by PartialDataRecordinNCSFormat will contain fields from the sheets that have been scanned so far; fields belonging to sheets of the current document that are yet to be scanned will be blank. You can determine the number of the sheet (within the document) that is currently stationed at the print head by examining the SheetNumber property. The stacker to which this sheet will be sent by is available in the StackerSelection property. You can also determine the string that will be printed on this sheet by examining the PrintString property. You have the ability to direct the sheet to a different stacker and alter the print string by calling the ModifyStackerSelection and ModifyPrintString methods of ScanningManager.

You can use Data Services to open an ADO recordset using the partial ASCII record and access individual fields without hardcoding the record layout. The only drawback to using the recordset (or partial ASCII data) is that you will not be able to tell incomplete fields from the complete but blank fields. You must figure out another way to determine this if this is important to your application.

 

 

See Help on Help for additional information on using this help file.

See Scantron Technical Support for additional information on technical support and training options.

See the ScanTools Suite System Requirements for further details on hardware and software requirements.

ScanTools is a suite of products; the specific information you want may appear in the help for a different module. If you don't find what you're looking for here, try one of the following:

 

Scantron Corporation

Customer Service (forms, products, and services):

1-800-SCANTRON (722-6876)

www.scantron.com

Technical Support:

1-800-445-3141

[email protected]

Copyright © 1998-2012 Scantron Corporation. All rights reserved. Use permitted only under license. www.scantron.com. No part of the Help or user guides may be reproduced in any form, or by any means, without express permission from Scantron Corporation.

LINKS TO THIRD PARTY SITES

This help system may contain links to third party websites ("Linked Sites"). The Linked Sites are not under the control of Scantron and Scantron is not responsible for the content of any Linked Site, including without limitation any link contained in a Linked Site or any changes or modifications to a Linked Site. Scantron is not responsible for web casting or any other form of transmission received from any Linked Site. Scantron provides Users with the ability to link the Assessment System to the Linked Sites as a convenience to you, and the inclusion of any link does not imply endorsement by Scantron of the Linked Site or any association with its operators.