- This script only extracts barcodes from EAN128 symbology. If you need to manage a different barcode symbology, you can uncomment "OS.Alert" to see the symbolgy type when you scan a barcode and make the needed change.
- You may need to adjust the variables "startCharacter" and "length" in the script.
- Some barcodes contain non-printable characters which differ from the printed label. These extra characters
mean you may need a different start.
function OnBarcodeRead( session, data, source, type, date, time )
// TEST: Uncomment this line to view barcode type
//OS.Alert( "type= " + type );
// TODO: Only strip EAN128 barcode.
// TODO: Adjust startCharacter and length to extract
// TODO: the desired data.
var typeEAN128 = 63;
var startCharacter = 2;
var length = 11;
// If barcode is EAN128, extract data
if (type == typeEAN128)
// Extract part of the data
data = data.substr( startCharacter, length );
// NOTE: When using a script, the configuration postamble is ignored.
// TODO: Add postamble here if needed.
//data += "\r"; // Enter
// Send barcode to emulator
CETerm.SendText( data, session );
// Return 0 to handle barcode normally
// Return 1 if handled here