Difference between FNC1 and GS field delimiters

I have been researching about the FNC1 / GS codes that we find in documentation and that we find when reading barcodes for TTT. I will try to send my conclusions, and save most of the details.

In some barcodes standard (as the ones issued by GS1 organization), there are some special codes called “field delimiters”. Some of these standard field delimiters are FNC1, FNC2, FNC3 or FNC4.

FNC1 (Function Code One) is mentioned in the Tobacco Product Directive and it has two main uses:

  1. As an initial character, when needing to complete the three-char code that identified the kind of product
    1. 235 for packets
    2. 01 for cartons and mastercases. It could become <FNC1>01
    3. 00 for pallets and picking boxes. It could become <FNC1>00
  1. As a group delimiter after a field with a  variable size that is shorter than the maximum
    1. Example: 21041703200737144901<FNC1>

FNC1 has no official correspondence with any ASCII character.

However, as a representation of field delimiter FNC1 is needed, the ASCII special character <GS> (Group Separator) is traditionally used instead, as a convention. This character is not displayable (i.e., it is “invisible”), and it is encoded as ASCII 029 or 0x1D (hexadecimal) value.

Because of its historical function in data processing and the fact that it is not a valid data character in the GS1 system, “GS” (ASCII value 029) was chosen as the “alias” to represent an FNC1 character encoded as a field delimiter

To sum up, the use of FNC1 and GS is a matter of context:

  1. FNC1 terminology is used when talking about barcode encoding (e.g., GS1 standards).
  2. GS terminology is used when translating these codes into ASCII or “human readable” codes (though there are “invisible” characters) (e.g, upUI and aUI)<GS>010541070671855321041703200737144901<GS>240PRD45678

I hope that is it clearer now why GS and FNC1 are sometimes used indistinctly. Also we should also know while reading barcodes what we must find when expecting GS characters (ASCII 029, 0x1D or Unicode \u001D).

Because of the compatibility issues related to processing an invisible and uncommon character as GS in many areas (database storage, programming language handling, browser interpretation, etc.) some developers prefer to translate FNC1 into a fully readable character that is not commonly used, as for example the vertical bar (|).



Leave a Reply

Your email address will not be published. Required fields are marked *