Using ZPL Stored Formats

Article ID: 13966029

Details


 

Topic or Information

Using ZPL Stored Formats 

Applies To

ZPL Compatible printers

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

Details

The Zebra Printer can use variable formats with variable data in conjunction with any device that can send the ASCII data (with command characters) in the correct format.

I have enclosed some examples below which may assist your future applications.

You can use a format held within the printer that can be stored in Volatile RAM and will be lost when powered off OR stored in permanent Flash or Memory Card (This would depend on the model of the printer and options fitted.)

This document lists 5 application suggestions on using Variable Formats.

1. Print label file stored in RAM
2. Print label file stored in RAM but include Variable.
3. Print label file stored in RAM but include Variable Serial Number.
4. Print label file stored in RAM using Scanner Header & Footer commands.
5. Print label file stored in RAM using a Weigh Scale.
6. Difference Between Permanent and Temporary storage areas.

1. Printing A Stored Format.
^XA                                                          (^XA - This is the Start Command)
^DFR:Format1.ZPL^FS                           
^FO50,50^A0,60,60^FDTest^FS       (FO is font location, A is Font, FD is Data used)
^XZ                                                           (^XZ - This is the End Command)

This will send the file directly to the printers RAM. If you perform a directory list this file will be shown on the list. To recall the label send the following file to the printer.

Recalling A Stored Format 
^XA^XFR:Format1.ZPL^FS^XZ

2. Printing A Stored Format with Variable.
^XA
^DFR:Filename.ZPL^FS 
^FO25,25^A0N,50,50^FDZebra Printer^FS           This shows the locations of the Variable field
^FO25,75^A0N,50,50^FDSerial Number^FS         numbers (^FN) to be used.
^FO25,150^A0N,50,50^FN1^FS
^XZ

Recalling A Stored Format 
^XA
^XFR:Filename.ZPL^FS                                      This is the variable information file.
^FN1^FD123^FS
^PQ100
^XZ

In order to print your labels you will have to send the first file to the printer and this will download the file into the printers RAM. If you then send the second file this will recall the saved file and then print the label using the variable field data as supplied with the second file.

3. Printing A Stored Format with variable Serial Number
If you are constantly printing the same label but a serial number is changing you can recall a saved format which includes the serial number as a variable field, an example is shown below.

^XA
^DFR:Filename.ZPL^FS 
^FO25,25^A0N,50,50^FDZebra Printer^FS        This shows the locations of the variable field
^FO25,75^A0N,50,50^FDSerial Number^FS      numbers (^FN) to be used.
^FO25,150^A0N,50,50^FN1^FS
^XZ

Recalling A Stored Format 
^XA
^XFR:Filename.ZPL^FS                                      This is the variable information file.
^FN1^SN123001,1^FS                                      This sets FN1 to use SN (Serial Number feature)
^PQ100                                                                   This will print 100 copies
^XZ

In order to print your labels you will have to send the first file and this will save the file into the printers RAM. If you then send the second file this will recall the saved file and then print the label using the variable field data as supplied with the second file.

4. Print label file stored in RAM using Scanner Header & Footer commands.
This can make a label much more complex with data input or actually scanning barcodes to create the printing label. In this example we will use the Header and the Footer capabilities of the scanner and will scan 1 code to use as a variable.

Step 1: This file is held in the Header section of the scanner being used.
^XA^FO50,50^A0,60,60^FD

Step 2: The scanner then scans the code required.

Step 3: This file is held in the Footer section of the scanner being used.
^FS^XZ     

The scanner will put the Header , Scanned Data and Footer parts together to print the label.

If the scanner memory is very limited you may need to save the data as a format and then it can be used in this method.

Step 1: This file is sent to the printer to store the format:
^XA^DFR:AB.ZPL^FS ^FO25,150^A0N,50,50^FN1^FS^XZ

Step 2: This file is held in the Header section of the scanner being used.
^XA^XFR:AB.ZPL^A0,60,60^FD

Step 3: The scanner then scans the code required.

Step 4: This file is held in the Footer section of the scanner being used.
^FS^XZ     

The label is recalled by the format and then the scanner will put the Header , Scanned Data and Footer parts together to print the label.

Please note not all scanners are capable of being used in this way, please contact your scanner supplier to ensure the scanner you have is capable of this type of application.

5. Print label file stored in RAM using a Weigh Scale.
Using a scanner of a weigh scale is very similar and requires the use of the data formatted in the same method as example 4 above, not all scales are able to send only the required data and therefore this would be recommended for suitability for your application.

If using a software program or ZBI you may be able to extract the string and then perform the ZPL label to be created using only a part of the data.

6. Differences Between Storage Locations
The Download Format (DF) command can be selected to download to the Printers volatile RAM, Permanent Flash, Permanent Memory Card.

Example 1
^DFB:Format1.ZPL^FS                        

Where
^DFB: Is the memory card             - This must be installed and not write protected.
^DFE: Is the Flash Memory           - This must be installed and available.
^DFR: is printers RAM                  - This will be lost when printer is turned off.

This is dependent on the printer being used and the options fitted to it.

Additional Information

ZPL Manual Read More>>