I need the scanner to call an event when a bar code is scanned so that I can utilize the bar code programmatically.
The scanner scans fine in presentation mode, and it calls the bar code scan event that I created. I did this by
1) Registering for events
string inXML = "<inArgs>" +
"<cmdArgs>" +
"<arg-int>6</arg-int>" + //Number of events you want to subscribe to
"<arg-int>1,2,4,8,16,32</arg-int>" + //Comma separated event IDs
"</cmdArgs>" +
"</inArgs>";
cCoreScannerClass.ExecCommand(REGISTER_FOR_EVENTS, ref inXML, out outXML, out status);
2) Then, I subscribed to the event
cCoreScannerClass.BarcodeEvent += new _ICoreScannerEvents_BarcodeEventEventHandler(bcEvent);
In any mode other than presentation mode, I need to trigger the scanner:
string inXML = "<inArgs>" +
"<scannerID>" + scanner.ScannerID.ToString() + "</scannerID>" +
"</inArgs>";
cCoreScannerClass.ExecCommand(trigger, ref inXML, out outXML, out status);
The trigger turns on and off (which I can see visually) as expected. The scanner beeps when it scans a bar code, but no events are called. Since I set continuous mode to false, the trigger is released when I scan a bar code (which is further verification that it is scanning the bar code but not calling the events).
Other useful information:
After speaking with Zebra support, I later found out that the "Software trigger only" trigger mode is no longer supported in newer models of DS-457 (DS457-XX20004ZZWW onward) because it "causes issues with the software configurations and security issues."
If one wants to trigger the scanner(s) via the API, it is recommended that the programmer use "Host trigger mode." The API can also set the device to "Level" trigger mode, which will allow the same functionality as Host trigger mode, but will also allow for manual physical trigger of the scanner.