The IntermecBarcodeScanner, SocketBarcodeScanner, and SymbolBarcodeScanner nonvisual objects inherit from the BarcodeScanner base class. They interface, respectively, with the Intermec, Socket, and Symbol bar code scanners. Table 15-1 displays bar code scanners supported by PocketBuilder.
Manufacturer |
Device types |
---|---|
Intermec |
CN2 and 1700 series |
Socket Communications |
In-Hand Scan Card laser scanner devices |
Symbol Technologies |
PPT 2800 and 8800 Series Pocket PC terminals |
You can add a bar code scanner object to your PocketBuilder application by selecting the IntermecBarcodeScanner, SocketBarcodeScanner, or SymbolBarcodeScanner menu item from the Insert>Object menu in the window painter. After you add this object to your application, you must call the Open function on the object to load the scanner DLLs and connect to the scanner firmware.
You start a synchronous scan by calling ScanWait, passing in a scan timeout period in seconds. You can run continuous scans by calling the ScanNoWait function from the ScanTriggered event. You retrieve scan data by calling RetrieveData and assigning instance members of the SymbolBarcodeScanner object to variables of the appropriate datatype, or by displaying the values of the instance members in text boxes of an application window or user object.
The following is example code for reading a single bar code scan using a SymbolBarcodeScanner object that is assigned to l_scanner:
Integer li_ret
li_ret = l_scanner.Open()
li_ret = l_scanner.ScanWait( 30 )
li_ret = l_scanner.RetrieveData()
sle_symbology.text=string(l_scanner.ScannedSymbology)
sle_data.text = l_scanner.ScannedData
Properties and functions of the BarcodeScanner base class (implemented by the IntermecBarcodeScanner, SocketBarcodeScanner, and SymbolBarcodeScanner objects) are described in the PowerScript Reference and in the online Help.