2

I am creating a GS1 DataBar Expanded barcode in ZPL and I can't find a way to encode FNC1 character to terminate variable length GS1 Application identifiers (GS1 AI).

To be honest, it is not a necessity. GS1 DataBar is mostly used for fresh foods and other groceries, and so far I noticed only one variable length GS1 AI (10 - batch/lot) to be used regularly. Though I haven't done any research, so maybe I am wrong.

Nevertheless, it came to my mind if it is possible in ZPL to insert FNC1 character. In other programming languages it is possible to include it, but I had no luck with ZPL. It seems, that GS1 DataBar does not work well with hex commands. When I used hex Group Separator (GS; ASCII value 29) character _1D it didn't even rendered the code. Other FNC1 escape sequences like _1 from GS1 Data Matrix or >8 from GS1-128 do not work, as expected.

I found this answer on Zebra support, but it did not rendered on Labelary ZPL viewer, so I am not sure if it works. I tried including the # character directly and with hex character, but with no success.

My ZPL code:

^XA
^FO100,100^BRN,6,4,,,6
^FD010858000000000931030001251722022210ABC123^FS
^XZ

What I wonder is how to include for example serial number AI (21) after batch AI (10) at the end of the code.

Terry Burton
  • 2,801
  • 1
  • 29
  • 41
Viliamm
  • 618
  • 5
  • 12

1 Answers1

1

According to this document the # character must be entered at the start of the field to represent the implicit FNC1 in first position.

So for the GS1 Application Identifier data:

GTIN             (01) 08580000000009
NET WEIGHT (kg)  (3103) 000125
USE BY or EXPIRY (17) 220222
BATCH/LOT        (10) ABC123              <--- FNC1 required
SERIAL           (21) 000123

You would have the following ZPL:

^XA
^FO100,100
^BRN,6,4,,,6
^FD#010858000000000931030001251722022210ABC123#21000123^FS
^XZ
Terry Burton
  • 2,801
  • 1
  • 29
  • 41
  • 1
    Thank you, sir. I did not tried to include the # character at the beginning, because in the article it is stated that # corresponds to [GS]. I misunderstood the article. It works now and I was able to print GS1 DataBar. Thank you very much. – Viliamm Mar 14 '23 at 09:16
  • 1
    Internal to barcode symbols there is a flag indicator for GS1 mode. Traditionally (per Code 128) this was indicated by the barcode message being internally encoded with an FNC1 character in the first data position. In this role the FNC1 is not included in the output data stream. Other symbologies use different schemes, but the indicator is always silent. FNC1 is also used in the symbol as the variable-length AI terminator. In this role it is transmitted as GS (ASCII 29). Libraries often take the notion of "FNC1 in first" quite literally requiring that you include this signal in the input data. – Terry Burton Mar 14 '23 at 11:19