Search code examples
barcodezplgs1-ai-syntaxgs1-databar

ZPL: How to encode an FNC1 within GS1 DataBar Expanded?


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.


Solution

  • 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