Occurs when a scan operation is started.
Event ID |
Objects |
---|---|
None |
BarcodeScanner objects |
None.
None.
Use this event with the ScanNoWait function and implement as an asynchronous (continuous) scan.
The following code in the ScanTriggered event implements continuous scanning:
// Bar code trigger
// A scan event (typically read) has occured
int iRet
int itmp
string stmp
lb_res.AddItem( "==== Scan Triggered ====" )
lb_res.AddItem("Data: " + this.ScannerName )
iRet = this.RetrieveData()
lb_res.AddItem("RetrieveData: " + string(iRet) )
// ** Display the status **
choose case iRet
case 1
lb_res.AddItem("*SUCCESS*")
case -9
// common
lb_res.AddItem("*Incorrect State (aborted?)")
case -13
// common
lb_res.AddItem("*Timeout (benign)")
case -12
// common
lb_res.AddItem("*Read Cancelled")
// ** and the rare errors **
case -1
lb_res.AddItem("*ERR - General")
case -8
lb_res.AddItem("*ERR - Buffer Allocation")
case -10
lb_res.AddItem("*ERR - Device")
case -11
lb_res.AddItem("*ERR - Read Pending")
case else
lb_res.AddItem("*ERR - Other")
end choose
// ** Display the data **
if iRet = 1 then
// Data:
stmp = this.ScannedData
lb_res.AddItem("Data: " + stmp ) // Symbology:
itmp = this.ScannedSymbology
stmp = this.Decodername(itmp)
lb_res.AddItem("Symbology: " + string(itmp) + " : "& + stmp )
// TimeStamp:
stmp = STRING( this.ScannedTimeStamp, "hh:mm:ss" )
lb_res.AddItem("TimeStamp: " + stmp )
end if
// ** Continue? **
if cbx_rearm.checked then
iRet = this.ScanNoWait()
lb_res.AddItem("ScanNoWait: " + string(iRet) )
end if
lb_res.SelectItem( lb_res.totalitems() )
ScanNoWait