1

I am writing an application to scan bar code and show it to the text box. I am using Motorola MC3190 device runs on Windows Embedded compact 7.0. To implement barcode scanning, I used Symbol.dll and Symbol.barcode.dll.

I have an issue that device is scanning the bar codes but eliminate the characters before and after the spaces. My code is

private void Form1_Load(object sender, EventArgs e)
    {
        txtBarcode.Focus();
        barcodeReader = new Symbol.Barcode.Reader();
        barcodeReaderData = new Symbol.Barcode.ReaderData(Symbol.Barcode.ReaderDataTypes.Text, Symbol.Barcode.ReaderDataLengths.MaximumLabel);
        barcodeReader.Actions.Enable(); 
        barcodeReader.ReadNotify += new EventHandler(barcodeReader_Read);  
        barcodeReader.Actions.Read(barcodeReaderData);      
    }

private void barcodeReader_Read(object sender, EventArgs e)
    {
        Symbol.Barcode.ReaderData nextReaderData = barcodeReader.GetNextReaderData();  
        txtBarcode.Text = nextReaderData.Text;
        barcodeReader.Actions.Read(barcodeReaderData);  
    }

This code scans bar codes without spaces.

FYI: Earlier Motorola MC3190 could not scan the characters before and after the spaces, but after contacting the Motorola support team, they told me some changes in the device. Now the device is accepting barcodes with spaces. I checked in datawedge demonstration.

Now I am using symbol assembly that means I am overriding the existing functionality in my code but no luck so far.

Edit: enter image description here

When I scan this barcode in my application, it is skipping first digit 0 and last digit 2. textbox only shows 825610. But when I try scanning the same barcode in Datawedge Demonstration (software comes with device to test the barcode scanning) it shows 082566102

Nachiket
  • 620
  • 6
  • 23
  • What type of barcode is this? There may be relevant options you can set on `barcodeReader.Decoders.MyBarcodeType` which affect what the `nextReaderData.Text` will contain. Also it would help if you could link to a picture of a sample barcode. – C.Evenhuis Nov 03 '15 at 12:23
  • 'UPCE0', May be it is the barcode type which I am trying to scan – Nachiket Nov 03 '15 at 12:42

1 Answers1

4

The missing zero is included in the barcode format. UPC-E barcodes can start with either a 0 or a 1, which are returned by the scanner as UPCE0 and UPCE1. The missing 2 is the check digit.

You can include these by setting:

barcodeReader.Decoders.UPCE0.Preamble = UPC.Preambles.System;
barcodeReader.Decoders.UPCE0.ReportCheckDigit = true;

The "spaces" only exist in the representation of the barcode for humans, they separate the system and checksum digits from the data that matters. There are no spaces encoded in the barcode itself.

(For more information about UPC-E barcodes see https://en.wikipedia.org/wiki/Universal_Product_Code#UPC-E)

C.Evenhuis
  • 25,996
  • 2
  • 58
  • 72
  • DataWedge > Advance Config > profiles > profile0 > Input > Scanner > 1D Scanner > Decoder > UPCE0 > Params > tick on “Report Check Digit” > go into Preamble > Tick on “System character” >. This setting I made on my device. – Nachiket Nov 03 '15 at 13:19