What is the actual HEX / binary value of the GS1 FNC1 character?

F.P picture F.P · Jul 9, 2015 · Viewed 20.6k times · Source

I have searched many a page on wikipedia, the official GS1 specifications, but have yet to find a definite answer to the question

What is the actual HEX / binary value of the GS1 FNC1 character?

There is much information about how to use the GS1 identifiers, how to print the barcodes with ZPL and how to encode the FNC1, but I want to know the actual HEX value of that character.

Answer

Terry Burton picture Terry Burton · Jul 9, 2015

The special function characters such as FNC1 through FNC4 do not have any direct ASCII representation. Each symbology that supports such characters has a different scheme for encoding them in its internal representation quite distinct from any byte-orientated character data.

The FNC characters serve both as flag characters (indicating something special to the reader) and as formatting characters (modifying the meaning of the encoded data). As such they are not intended to be transmitted directly in the data received by the host system from a basic barcode reader.

The usual purpose of each of the FNC characters are as follows:

  • FNC1 - Structured Data flag character indicating GS1 and AIM formatting AND group separator formatting character, amongst other uses.
  • FNC2 - Message Append flag character for buffering the data in groups of symbols for a single read.
  • FNC3 - Reader Programming flag character for device configuration purposes.
  • FNC4 - Extended ASCII formatting character for encoding characters with ordinals 128-255.

Be aware that they may not all be available in certain barcode symbologies and may even be specified in different, non-typical or overloaded ways.

Encoding an FNC character in a symbol's internal data is accomplished via an "escape mechanism" specific to the encoding software. For example, to use FNC1 in its typical GS1 structured data role for the data "(01)00312345678906(21)123456789012(30)0144" you might see the FNC1 characters escaped as {FNC1} so that the input looks like {FNC1}010031234567890621123456789012{FNC1}300144. But each library has a different way of accepting these non-data characters and some will even insert the required characters automatically.

Upon scanning a barcode the symbol's internal data is typically decoded then transmitted to the host over a basic channel (e.g. keyboard wedge) as a sequence of bytes to be interpreted according to the Latin-1 character encoding. The FNC characters cannot be represented in such a manner and are excluded from the data stream, however their formatting effect on the data remains.

For instance, the standards for most symbologies specify that when an FNC1 character is being used in its role as a field separator in data conforming to GS1 Application Identifier Standard Format it should be decoded and transmitted as GS (ASCII 29). Explicitly stated, the formatting effect of a FNC1 character used as a GS1 Application Identifier separator is to place a GS character at the end of the variable-length field. But in other roles (such as when FNC1 is used in "first/second position" as a flag character and with non-GS1 formatted data) there is no formatting effect on the carried data and therefore no ASCII representation during decoding.

Another instance of the special function characters having a formatting effect on the data is with symbologies that use FNC4 to extend their reach from 7-bit ASCII into extended ASCII as described in this answer.

A subtle technical point is that the data transferred to the host is often prefixed with a short symbol indicator header known as a "symbology identifier" which denotes the type and usage of the symbol from which the data is being read. This is often modified by the presence of otherwise invisible flag characters within the symbol data, for example to indicate the presence of GS1 formatted data with "FNC1 in first" or to indicate reader programming mode when FNC3 appears anywhere in the symbol. The details are symbology specific.