Creating GS1 Barcodes with Zebra Printers for Data Matrix and Code 128 using ZPL

Article ID: 83997005

Details


 

Topic or Information

Creating GS1 Barcodes with Zebra Printers using DataMatrix or Code 128 

Applies To

Zebra ZPL Compatible Printers
Excludes: 2824 Series, 2844 Series, S4M (E53 Firmware Version), 888 DD/TT Series, MZ Series, ZQ110, EM220, EM220II

Details

A special start character is used to identify barcodes as a GS1.  The start character is called FNC1.  The FNC1 character instructs a decoder that the next characters are a GS1 AI.  The FNC1 character is also used in the middle of a barcode to denote the end of a variable length GS1 field and the beginning of a new AI.

Zebra ZPL printers support the FNC1 character by using an escape sequence as part of the barcode data string.  An escape sequence is defined as an escape sequence control character and an escape sequence code.  The escape sequence control character denotes the start of the escape sequence.  In ZPL, different barcode types use different escape sequences to create the FNC1 character.

 

Code 128

 The escape sequence control character for Code 128 barcodes is the greater-than symbol (“>”).  The escape sequences for a Code 128 barcode are as follows:

User-added image

The escape sequence is inserted in the barcode data string; it is not part of the label format.

Example GS1 data string containing a GTIN and Serial Number:

>;>8011234567890123421123456

User-added image

 

Example GS1 data string containing a GTIN, Serial Number, and Batch Number:

>;>8011234567890123421123456>810>6ABC123

User-added image

 

Data Matrix

The escape sequence control character for Data Matrix barcodes varies based on the printer firmware version.  For this reason, the safest course of action is to define the escape sequence control character directly in the ZPL file instead of relying on the firmware default.

The ZPL command to print a Data Matrix barcode is:

 ^BXo,h,s,c,r,f,g

User-added image

 The “g” field is the one that defines the escape sequence control character.  This field should be set to the underscore symbol (“_”).

Example Data Matrix command:

^BXN,9,200,20,20,,_

User-added image

 Once the ZPL has been modified to define the escape sequence control character, then the barcode data string can be created with the proper escape sequence.  The Data Matrix escape sequence code for the FNC1 character is the one symbol (“1”), making the FNC1 escape sequence “_1”.

Example GS1 data string containing a GTIN and Serial Number:

_1011234567890123421123456

 User-added image

 Example GS1 data string containing a GTIN, Serial Number, and Batch Number:

_1011234567890123421123456_110ABC123

User-added image

 

Source

Chris S