6

I have some products which have 2d GS1 bar codes on them. Most have the format 01.17.10 which is GTIN.Expiry Date.Lot Number.

This makes sense as 01 and 17 are fixed length, so can be parsed easily, just by splitting the string in the appropriate place.

However, I also have some in the format 01.10.17.21 (GTIN.Lot.Expiry.Serial Number) which doesn't make sense because Lot and Serial number are variable length, meaning I cannot use position to decode the various elements. Also, I cannot search for the AIs as they could legitimately appear in the data.

It seems that I've no way of reliably decoding this format. Am I missing something?

Thanks!

Terry Burton
  • 2,801
  • 1
  • 29
  • 41
tony.wiredin
  • 617
  • 8
  • 21
  • For those of us that aren't experts on serial numbers (being a programming site, we're not supposed to be), this question isn't particularly understandable. – Bernhard Barker Sep 25 '13 at 16:47
  • 2
    For those of us programmers who work with GS1, it is. The question isn't about serial numbers, it's about the algorithmic decoding of a string with a particular format. To my mind, it's exactly the kind of question a programmer would be interested in – tony.wiredin Sep 25 '13 at 16:50
  • I'm all for algorithm questions, the problem is I don't know, for example, what `01.17.10` means (you said 01 and 17 are fixed length, but I've got nothing beyond that), or what the serial numbers look like, so I don't really know the problem you're having. – Bernhard Barker Sep 25 '13 at 17:01

1 Answers1

4

According to the GS 1 website, "More than one AI can be carried in one bar code. When this happens, AIs with a fixed length data content (e.g., SSCC has a fixed length of 18 digits) are placed at the beginning and AI with variable lengths are placed at the end. If more than one variable length AI is placed in one bar code, then a special "function" character is used to tell the scanner system when one ends and the other one starts."

So it looks like they intend for you to order your AIs with the fixed width identifiers first. Then separate the variable-width fields with a function character, which it, appears is FNC1, but implementing that that will depend on the barcode symbology you are using, It may be different between DataMatrix, Code 128 and QR Code for example.

Brian Anderson
  • 1,661
  • 1
  • 17
  • 27
  • Many thanks - this is the answer. I had spotted an escape character in the string I get from the barcode scanner, but was concerned it was a rogue element I couldn't depend on. Now I know that it's meant to be there, I can work with that – tony.wiredin Sep 30 '13 at 09:21