![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/6/cd/6cdd8c80-ce60-48ad-81ee-c40b6d52dfda/6cdd8c80-ce60-48ad-81ee-c40b6d52dfda-bge5.png)
Scanner API C-5
E-EQ-MX3CERG-A-ARC MX3-CE Reference Guide
Scanner API
The scanner has 2 different usage methods, depending upon whether or not the scanner wedge is
active. If the scanner wedge is active, the serial port or ports it is configured to will be locked so
other applications cannot open them.
Scanner Wedge Interface
Activating Scan (Internal Scanner Only)
An event must be sent to the scanner wedge to cause a scan to happen:
HANDLE scanstate, scandelta;
scanstate = CreateEvent(NULL, FALSE, FALSE, L"StateScanKey1");
scandelta = CreateEvent(NULL, FALSE, FALSE, L"DeltaScanKey1");
// scanner on
SetEvent(scanstate);
SetEvent(scandelta);
When a successful scan occurs, the scanner engine will be deactivated. Otherwise a reset event
can be sent to stop the scan attempt:
// scanner off
ResetEvent(scanstate);
SetEvent(scandelta);
Tethered scanners cannot be triggered by software.
Retrieving Data
Data from the scan engine is translated into keystrokes, and passed to the process that has the
current focus as WM_CHAR messages. Only ASCII scan data is translated; anything outside the
standard range is silently ignored by the scan wedge. This method relies on correct configuration
of the scanner engine (using scanned barcode options) to transmit the correct data to the computer.
Direct scanner interface
Activating Scan (Internal Scanner Only)
The scanner will begin scanning when DTR is set active, and terminate when DTR is set inactive,
or when a successful scan occurs.
Tethered scanners cannot be triggered by software.
Retrieving Data
Data from the scan engine may be retrieved using the standard Win32 calls for talking to serial
ports. The internal scanner is COM3, a tethered scanner connected to the cradle with a docked
computer is COM2, a tethered scanner to the right serial port is COM1, and the left serial port (on
a dual serial endcap) is COM3.