When you define a ZPL label template in the Serialized Manufacturing application, you have two text fields to include ZPL codes:
- Layout
- Template
Both fields accept valid ZPL codes, but these codes serve different purposes.
Layout Field versus Template Field
Field | Description | Required field? | Built-in Validator? | Stored on the printer? |
---|---|---|---|---|
Layout | It represents the skeleton of the label, hence it mostly stores static information, for example, the basic structure. | No | No | Yes |
Template | It defines the dynamic information of the label as placeholders, for example, serial number, batch, expiry date, and so on. This information is different per label. This field can contain static information, for example, the position of the placeholders. The field can even contain the full layout information. This ZPL code is sent to the printer for each label separately. | Yes | Yes (only for the placeholders, and not for the full ZPL code) | No |
If you want to print a huge amount of labels efficiently, it is recommended to define a layout because this information is stored on the printer at the beginning of the printing job and accelerates the printing process by sending only the dynamic information per label to the printer.
You can include "pointers" to dynamic information in the layout, for example, when specifying a QR code that holds multiple parameters. However, you need to match the pointer (field number) in the Layout field with the dynamic information in the Template field.
Use Case Example
1. Define the dynamic information in the Template field.
- Locate the ZPL file on the printer where the dynamic information will be used.
- Provide the placeholders in the Template field and associate the placeholders with field numbers (^FN). Note: You can only use the placeholders supported by that template type. The application lists the supported placeholders.
- Provide the print quantity settings.
In the following example:
- ^XFE:1A88.ZPL^FS --> the dynamic information will be used for the 1A88.ZPL file on the drive E: of the printer.
- ^FN1 --> ${expiration_date:YYYY.MM}
- ^FN2 --> ${batch_number}
- ^FN3 --> ${serial_number},${product_description},${license_number},${company},${phone_number}
- ^PQ1 --> the print quantity setting on the printer. In this example, the number of labels to print is set to "1" (default), so the label with the same values is printed only once, there are no further copies. Note: The setting on the hardware versus the printing order settings in Movilitas.Cloud is different.
- ^FD --> Field descriptor
- ^FS --> Field separator
^XA ^XFE:1A88.ZPL^FS ^FN1^FD${expiration_date:YYYY.MM} ^FS ^FN2^FD${batch_number}^FS ^FN3^FD${serial_number},${product_description},${license_number},${company},${phone_number}^FS ^PQ1 ^XZ
2. Define the layout in the Layout field.
- To save the layout on the printer, define the filename and the location on the printer. Make sure that this matches the value in the Template field.
- Refer to the placeholders of the Template field by using the field numbers (^FN).
- Provide other information related to the layout as needed.
The following ZPL code snippet is an example of how to save the layout to a file and where to store it on the printer:
- The file name is 1A88.ZPL.
- The file is saved on drive E of the printer.
^DFE:1A88.ZPL^FS
The following ZPL code snippet is an example of how the field numbers are positioned and manipulated as part of the layout:
- ^FN1 is the expiration date
- ^FN2 is the batch number
- ^FN3 is a QR code holding information about multiple parameters (serial number, product description, license number, company, and phone number)
^FO302,115,1^A0I,25,25^FN1^FS ^FO302,172,1^A0I,25,25^FN2^FS ^FO20,95^BQ,2,2^FN3^FS ^FO170,984^A0N,25,25^FN2^FS ^FO170,1041^A0N,25,25^FN1^FS ^FO335,950^BQ,2,2^FN3^FS
Example on the GUI
The following example illustrates the above use case on the UI, after going to Serialized Manufacturing application --> Labels --> Templates.
The following screenshot shows the beginning of the layout and the template:
The following screenshot shows the end of the layout with the field numbers (FN1, FN2, FN3) and the template that holds the link between the field number and the dynamic data: