Welcome to ELAM Solutions Helpcenter

All topics /
Categories /
Hardware & Tools
/
ZPL Printer

ZPL Printer

Published:
September 25, 2024
Updated:
July 2, 2024
From:
Waldemar

Table of Content

This article describes how a ZPL (Zebra Print Language) printer can be controlled via ELAM Solutions in order to print labels.

Supported Printer

The ELAM ZPL controller (Zebra Print Language) controller supports ZPL printers. ZPL printers are label printers that use the ZPL (Zebra Programming Language). These printers are specifically designed for printing barcodes, labels and other marking-related applications and are often used in logistics, retail and manufacturing environments.

Here are some key features of ZPL printers:

  1. Zebra Programming Language (ZPL): ZPL is a proprietary printer language developed by Zebra Technologies. It enables the simple design and printing of labels using commands and codes that can be saved in text files.
  2. Variety of applications: ZPL printers are often used to print shipping labels, product labels, inventory labels and other types of barcode labels.
  3. High print quality: These printers offer high resolution and print quality for clear and legible barcodes and text.
  4. Robustness and reliability: ZPL printers are designed for use in demanding environments and offer high reliability and durability.

The following ZPL printer models are currently supported:

  • Zebra ZT410
  • Zebra GK420t
  • ZD420

Prerequisites

To be able to use a ZPL printer in ELAM Solutions, at least one SWA5 Mini Client is required as a gateway. The printer must be connected directly to the DHCP socket of the SWA5 Mini Client via a LAN cable so that it is automatically created as a tool in ELAM Administration.

Establishing a connection with ELAM Solutions

The printer is automatically created as a tool in the ELAM Solutions system. In the factory setting, printers obtain the IP address assignment automatically. DHCP printers are network printers that obtain their IP addresses automatically from a DHCP server (Dynamic Host Configuration Protocol), in this case from the SWA5 Client or Mini Client. This simplifies the setup in ELAM Solutions. Static IP addresses of printers are currently not supported in ELAM Solutions.

Connect the printer via LAN cable to the DHCP socket of the SWA5 Client or Mini Client. The printer automatically obtains its IP address and is automatically created as a tool in ELAM Administration.

ZPL Printer in ELAM Solutions

How can labels be created and printed?

Labels must be created using third-party software. A ZPL file must be generated from the labels, which can be sent to the printer via ELAM Solutions. In our example, we used the Zebra GK420t thermal transfer printer to print labels. Using the free Zebra Designer 3 software, we created a label graphically and generated a ZPL file from it. In the ZPL file, the ZPL code is copied and pasted into ELAM Solutions, edited and sent to the printer.

Label Software

In principle, any software from your manufacturer can be used to create labels graphically. In our example, we are using the free Zebra Designer 3 software.

Quick step-by-step instructions

1. Install Zebra Designer 3:

  • Download Zebra Designer 3 from the Zebra website and install the software.

2. Start Zebra Designer 3:

  • Open Zebra Designer 3 after installation.

3. Create new Label :

  • Click on "New document" or "New label" to start a new project.
  • Select the printer from the list of installed printers. If the printer is not installed, add it.

4. Configure label settings:

  • Define the size of the label (width and height).
  • Select the print orientation (portrait or landscape).

5. Create a label design:

  • Use the tools in Zebra Designer 3 to create the layout of your label:
    • Add text fields and enter the desired text.
    • Add barcodes and configure the barcode properties.
    • Add images or logos if required.
    • Place and align the elements according to your needs.

6. Save label and generate ZPL code:

  • Once the label design is ready, go to "File" > "Save as" to save the label design.
  • To generate the ZPL code, go to "File" > "Export" > "Export ZPL print data".
  • Select the location and file name for the ZPL file and save it.

7. Paste ZPL-Code in ELAM Solutions

  • In ELAM Administration, go to "Files" > "Label overview" > "New label" and insert the ZPL code.
  • Edit the placeholders as desired and save the label.

8. Define printer step in the flowchart editor

  • Drag the printer step from the library in the flowchart and select the label to be printed.
  • Save the flowchart and release a new version for the wizard.

9. Start flowchart with the printer step in the wizard

  • Use a variant to start the flowchart with the printer step so that the label is printed.

Create labels and generate ZPL file

In our example, we create a label with variable and static data that is to be printed. To do this, the correct label size (width and length) must first be set.

Zebra Label Designer 3 - Label Size

The following elements can be defined on the label from the library using drag&drop:

  • Texts
  • Barcodes
  • Pictures (Schwarz/Weiß)
  • Rectangles
  • Lines
  • Ellipses

  1. Data to be printed can be either static or dynamic/variable.
    • Static is always used when fixed information should always be printed.
    • Variable is used if dynamic information should always be printed. If ELAM is to print certain data, "Variable keyboard input" must be selected as the type.

Initial values should always be used so that you can recognize in the generated ZPL code which placeholders must be replaced by ELAM-specific placeholders in order to be able to print variable data.

Zebra Label Designer 3 - Variable Data
Zebra Label Designer 3 - Fixed Data
  1. To be able to create a ZPL file, the "Print to file" checkbox must be selected in the menu under "Print".
  2. Click on "Print" to save the .ZPL file.
Zebra Label Designer 3 - Save Label as ZPL-File
  1. Open the .ZPL file with a text editor or Notepad++ to display the ZPL code.
  2. Copy the ZPL code to the clipboard with CTRL-C.
ZPL Code

Edit ZPL code in ELAM Solutions

The copied ZPL code must be pasted and edited in ELAM Administration.

  1. Click on "Files" in the menu.
  2. Click on "New file" on the button.
  3. Enter any name with a ".zpl" ending.
  4. Paste the copied code from the clipboard into the window.
ELAM Administration - Insert ZPL Code

Optionally, the label can be displayed graphically in a preview. To do this, click on "Preview" so that the label can be displayed on the "labelary.com" page. On this page you will also find comprehensive documentation about the Zebra Print Language.

Next, we replace the set placeholders with ELAM-specific placeholders. The following placeholders can be used, which are replaced with the correct data during the print job.

  • Day
  • Month
  • Year
  • Serial number
  • Production order
  • Variant-ID
  • Variant-Name
  • Varianten Comment
Information about the placeholders is displayed when you move the mouse over them.
ELAM Administration - Placeholder

Use ELAM placeholder

The placeholders available in ELAM are replaced by the predefined placeholders from the Label Designer software by copy&paste.

IMPORTANT: Only ever insert the ELAM placeholders between the ZPL commands! In our example, the ELAM placeholder must always be inserted between the ^FD and ^FS commands. A complete overview of all available commands can be found here: https://labelary.com/docs.html
TIP: One or more ELAM placeholders can also be combined and separated by any characters.
ELAM Administration - Using ELAM Placeholder via copy&paste

Finished example of a ZPL code for printing a label

The ZPL code (Zebra Programming Language) is used to print a label.

ELAM Administration - ZPL Code for Label print

Here is a detailed description of the individual parts of the code and what they do:

1. Initialization and settings:

Initialization and settings
  • ^XA: Start of the label.
  • ~TA000: Sets the time shift to 0.
  • ~JSN: Activates the printer settings.
  • ^LT0: Sets the pressure level to 0.
  • ^MNW: Sets the printer mode to "Normal".
  • ^MTT: Activates thermal mode.
  • ^PON: Activates the print output.
  • ^PMN: Sets the printer mode to Normal.
  • ^LH0,0: Sets the label origin to (0,0).
  • ^JMA: Sets the automatic calibration of the printer.
  • ^PR4,4: Sets the print speed and print quality.
  • ~SD15: Sets the print density to 15.
  • ^JUS: Activates the blocking of printing.
  • ^LRN: Sets the reverse mode.
  • ^CI0: Sets the character set to the default character set.
  • ^XZ: End of the initialization range.
  • 2. Definition of the label:

    Defining the label
  • ^XA: Start of the label.
  • ^MMT: Activates thermal mode.
  • ^PW400: Sets the label width to 400 dots.
  • ^LL0192: Sets the label height to 192 points.
  • ^LS0: Sets the left margin to 0.
  • 3. Graphics and fields:

    Graphic and Fields
  • ^FO192,0: Sets the origin of the graphic to (192,0).
  • ^GFA: Defines a compressed graphic.
  • 4. Text fields and barcode:

    Textfields and Barcode
  • ^FTx,y: Sets the origin of the text field.
  • ^A0N,h,w: Sets the font type and size.
  • ^FH\: Activates hexadecimal representation.
  • ^FD...^FS: Defines the text content.
  • ^BQN,2,4: Defines a QR code.
  • 5. Line and print parameters:

    Line and print parameters
  • ^FO209,57: Sets the origin of the line to (209.57).
  • ^GB190,0,2: Draws a line with a width of 190 points and a thickness of 2 points.
  • ^PQ1,0,1,Y: Sets the print parameters (number of copies, pause between copies, etc.).
  • ^XZ: End of the label.
  • Summary: This ZPL code creates a label with various text fields, a QR code and a horizontal line. The placeholders {variantNumber}, {orderNumber}, {variantName}, {serialNumber}, {Day}#{Month}#{Year}#{Clock} are replaced by the corresponding values when the label is printed.

    Set up print step in the Flowchart Editor

    The print step is a manual step that must be manually confirmed by a user in the wizard. Sometimes labels are printed out of focus. This allows the user to react and repeat the print job and only confirms the step when the printed label is OK.

    To trigger a print job, the print step from the library must be inserted into the flowchart in the flowchart editor. A label file must be selected in the details, which is automatically sent to the printer.

    ELAM Administration - Flwochart Editor Step Template Print