8.8
S
CAN
T
RIGGER
()
Prototype:
SCAN_RESULT ScanTrigger(HANDLE hScanner);
Purpose:
Trigger a scan on a scanning device.
Arguments:
[in] hScanner is the value received by the client application in lParam of the WM_INSERTION
message specified when ScanInit() was called.
If the application program doesn’t support callbacks, use 1 for the HANDLE (if multi-scanner
disabled) .
Notes:
For the CFSC/SDSC/CHS, this function returns immediately and, upon a successful read, the client
application will receive the user-defined WM_SCANNERDATA message specified in a prior call to
ScanRequestDataEvents(). For scanners that use hardware triggers on the scanner device, this
function returns successfully but has no effect. For these other devices, the client application will
asynchronously receive the WM_SCANNERDATA message when the user presses the trigger button
on the scanner.
Normally, this call is used start the scanner. The scanning stops after scanning a supported bar code
or when the time-out period expires (typically 3 seconds). There is no indication to the calling
program if no bar code is found.
For RFID, this call will issue a Select Tag command to the reader – depending on registry settings
this can be modified. This call is made with tag type set to Auto-detect so it returns the first tag ID
it can read in its field. The application program will receive a WM_SCANNERDATA message
indicating data is available and calling ScanGetData() returns the tag type and tag ID. No message
will be received if there is no tag in the field at the time ScanTrigger() is called or if there was an
error reading the tag. Note that this behavior is dependent on the settings found in the registry or
modified via the RFID Setup Control Panel.
Note: This is a legacy function for compatibility with SocketScan and it’s recommended that
ScanRFIDSelectTag() be used instead.
Returns:
SR_SUCCESS
The operation completed successfully.
SR_NOT_INITIALIZED
A successful call to ScanInit() must be made first.
SR_INVALID_SCANNER_HANDLE
The hScanner argument is not a valid scanner handle.
SR_SCANNER_NOT_OPEN
This function fails if the scanner is not open.
April 8, 2010
Page 31
Document#: 6410-00147 K
Revision 2.28