GS1 Barcode

We need to analyze the GS1 datamatrix barcode, which will be provided by the other party. We know that they are going to use GTIN (01), lot number (10), expiration date (17), serial number (21). The problem is that the barcode reader displays a string, a format such as 01076123456789001710050310AC3453G321455777. Since there is no separator, and the serial number and batch number are variable length according to the GS1 standard, it is difficult for us to identify the segments. My understanding is that it seems that the best way to parse is to embed the parser into the scanning device, and not from the application. But we have not yet planned to introduce software. How can I implement a parser? Any suggestions?

+5
source share
2 answers

At the end of a variable-length field, there must be an FNC1 character that is not filled to the maximum; so FNC1 will appear between G3 and 21 .

FNC1 is invisible to humans, but can be detected by scanners and will be played in the line reported by the scanner. Just send the line directly to the text file and view the text with a hexadecimal reader. FNC1 should be obvious.

If possible, it might be an idea to swap the sequence of field 21 and field 10 , since you are using a pure digit for 21 . This would make the barcode a bit shorter.

+3
source

One way to deal with this is to program the scanner to replace FNC1 with a space or other character in plain text before sending it to your application. The scanner manufacturer typically provides a tool for creating programming barcodes that can perform simple replacements on the scanner. Then you can analyze the data without having to process special characters.

0
source

Source: https://habr.com/ru/post/1200852/


All Articles