1

I am writing some code to parse GS1 barcodes. There are a few App Idents (AIs) in the specification that I don't understand. For example, AI 426 (https://www.gs1.org/standards/barcodes/application-identifiers/426?lang=en):

enter image description here

This is saying that the data must be 3 digits (the app ident) followed by another 3 digits for the country code (e.g. 426824). As such it is a fixed length field. The bit I don't understand is that it also says it requires a FNC1 delimiter. Surely if it is a fixed length field it won't require a delimiter after the data? Can anyone shed any light as to why the specification says this, or is it likely to be a mistake?

  • With GS1, the FNC1 goes before the AI to indicate the start of each data segment. In your example, it would be `426824`. The field ends with the start of the next data segment (which would begin with FNC1) or the end of the barcode. – Mark Warren Aug 23 '22 at 14:13
  • @MarkWarren if that was the case every AI would need a FNC1? I thought FNC1s only went at the end of variable length data? If you know the length of the data you don't need an FNC1. – David Christopher Reynolds Aug 23 '22 at 14:18
  • Need to amend my original comment. There are two "versions" of AIs in the GS1 spec. Look for the table "Figure 5.10" in the spec. It enumerates what are refered to as pre-defined length fields. These are the _only_ fields that do not require a FNC1 terminator. All other fields (including other fixed length fields) require the FNC1 terminator. So your example will be encoded as `426824`. I believe this oddness is to maintain backward compatibility with a previous version of the spec. – Mark Warren Aug 23 '22 at 15:38
  • And remember that the FNC1 terminator can be omitted on last data segment in the barcode. – Mark Warren Aug 23 '22 at 15:43
  • 1
    Finally found the authoritative comment in the spec. You can find it immediately before the start of section "5.10.2 Concatenation": GS1 Application Identifiers starting with two digits that are not included in Figure 5.10 have a variable length even if the definition of the GS1 Application Identifier specifies a fixed length data field. – Mark Warren Aug 23 '22 at 15:49
  • Thanks @MarkWarren. Have you got a link to that spec please? I can't find that table or quote in the spec I am working from. – David Christopher Reynolds Aug 23 '22 at 16:05
  • @MarkWarren It's to ensure that the list of predefined fixed length fields can be immutably included within decoder firmware that is not subject to frequent updates. (Pace layering.) – Terry Burton Aug 23 '22 at 23:06
  • This official resource is useful for decode and validation. https://raw.githubusercontent.com/gs1/gs1-syntax-dictionary/main/gs1-syntax-dictionary.txt Note the "*" flag field. – Terry Burton Aug 23 '22 at 23:07
  • 1
    Here is the extraction process: https://stackoverflow.com/a/31760872/2568535 – Terry Burton Aug 23 '22 at 23:10

0 Answers0