-1

I'm developing app for device Zebra MC33.
I need parse GS1_EXP barcode according it's to groups. Example of barcode with two groups:

(01)12345678901234(10)ABCD1234

There are 2 similar questions and I thing they are not answered.
GS1-128 barcode parsing
GS1 barcode parsing

I know about just 2 methods how to get data from the scanner in my code:

data.getData();

or

data.getRawData()

Full example of method where data came from scanner and I'm able to manipulate it:

 public void onData(ScanDataCollection scanDataCollection) 
{
...
if (scanDataCollection != null && scanDataCollection.getResult() == ScannerResults.SUCCESS)
                {
                    ArrayList<ScanDataCollection.ScanData> scanData = scanDataCollection.getScanData();
                    for (ScanDataCollection.ScanData data : scanData) {
                        // Get the scanned data
                        data.getData();
                    }
                }
...
}

Both methods retun symbols which are the same as visible for humans. And I can't detect special FNC1 character which is delimiter between sections.
Does somebody knows how to parse barcodes correctly?

Delphi Coder
  • 1,723
  • 1
  • 14
  • 25
Asya Troyan
  • 3
  • 1
  • 5

1 Answers1

0

An interpretation of a FNC1 character could/should be programmed on the scanner firmware directly. So, if a FCN1 character is placed somewhere in the barcode, this will be replaced with a human-readable one. Normally, a FCN1 character can be read by the scanner only.

For example, take the code 30: Variable count n2+n..8: the first two character are contained in the barcode by default (30), the second part of the code can take up to 8 characters. Let's say, the variable count takes only 3 of 8 characters (n2+an3), so these 3 characters are followed by a FCN1 character to "terminate" this part of the barcode and to start with the next key-value group.

Take a look how your scanner can be programmed to replace the FCN1 code into a human readable character (for example in $). To do this, you have to use the scanners own programming manual - the scanner can be programmed invidiually by scanning plenty of barcodes in a specific order. After this step, the scanner is configured properly and you will be able to parse and interpret prompted barcodes like a champ :).

I did this by implementing the look up table as a hash table, so finding the right value for a specific key works quite fast.

Hope this helps you solving your issue. Good luck!

BWappsAndmore
  • 491
  • 3
  • 17