K-WANG

+086-15305925923
Service expert in industrial control field!
NameDescriptionContent
Adequate Inventory, Timely Service
pursuit of excellence 
Ship control system
Equipment control system
Power monitoring system
Current position:
新闻动态
newS
   
Brand

Zebra EPL2 Programming Language Programming Guide

From: | Author:Wang | Time :2026-05-15 | 725 visit: | 🔊 Click to read aloud ❚❚ ▶ | Share:


Zebra EPL2 Programming Language Programming Guide

Zebra EPL2(ELTRON ®  The official programming manual of Programming Language is aimed at label printer developers, fully defining the EPL2 command syntax, parameters, formats, and usage rules. It supports text, one-dimensional barcodes, two-dimensional barcodes (QR/DataMatrix/PDF417/Aztec/MaxiCode), graphics, lines, form storage, variables/counters, RTC clocks, and other printing elements. It provides SGD (Set/Get/Do) configuration instructions and wired/wireless network parameters, covering serial/parallel/Ethernet/wireless settings, error codes, memory management, character sets (including China, Japan, and South Korea), and is suitable for desktop printers such as G-Series, 2844, 3842. The core is used for label template design, batch printing, variable printing, and automation control.


EPL2 core command system

1. Image and page control

Key parameters of command function

N Clear image cache None

Set label width (dots) from 0 to 65535

Q Set label length+spacing length, spacing, offset

Set the left and right margins, as well as the top and bottom margins, of the reference origin point (X, Y) for R

Z sets the printing direction T=forward/B=reverse

Number of printed copies and sets executed by P

XA automatic detection label size none

2. Text Printing (Command A)

Function: Print text, supporting built-in fonts 1-5 and Asian fonts 8-9 (Chinese, Japanese, and Korean)

Grammar: A x, y, rotation, font, aspect ratio, aspect ratio, reversed color, "content"

Support: Variables, counters, RTC time/date (TT/TD), expression calculation

3. Barcode printing

One dimensional barcode (B command)

Support: Code 39/128, EAN-8/13, UPC-A/E, Codabar, ITF, Postnet, etc

2D barcode (b command)

QR Code、Data Matrix、PDF417、Aztec、MaxiCode、Aztec Mesa

PDF417 supports Macro PDF large data splitting

4. Graphics and Lines

Command function

LO/LE/LW black/XOR/white lines

LS diagonal line

X box

GM/GG/GK stores/calls/deletes PCX graphics

GW directly writes binary graphics

5. Forms, Variables, and Counters

Form storage: FS (Save) → FE (End) → FR (Call) → FK (Delete)

Variable (V): Supports 00~99, maximum 99 characters, left/right/center alignment

Counter (C): 0~9, steps ± 1~9, used for serial number printing

AUTOFR: Automatically run forms upon startup, enabling offline printing

6. Printer system configuration

Command function

Printing speed (1-6 ips)

D printing density (0~15)

Y serial port settings (baud rate/checksum/data bits/stop bits)

Hardware options (cutter, peeling, sensor)

Fine adjustment of cutting blade position

C Cut the paper immediately

^@Printer reset

^Default factory reset

SGD (Set/Get/Do) configuration instruction

Format:! U1 setvar/getvar/do "Parameters" "Values"

Core purpose:

Setvar: Set network, serial port, and print mode

Getvar: query firmware IP、 Mileage and status

Do: Perform actions (clean the cutting blade, calibrate the sensor)

Support:

Network: IP, DHCP, FTP, HTTP, SNMP, TELNET

Wireless: SSID, Security, Roaming, Signal

Milemeter: total print length, print head lifespan, media count


Character set and multilingual support

Latin characters: Code Page 437/850/852/1252

Asian Double Byte:

Simplified Chinese GBK 936

Japanese Shift JIS 932

Korean 949

Command: I select the code page; Set the spacing between Asian characters; Replace Euro symbol with oR


Error and Status Report

^Ee: Immediately return error code

Common errors:

00: No errors

01: Grammar error

03: Barcode data length error

07: Paper/ribbon shortage

11: Print head turned on

US/UT: Enable serial port error feedback (ACK/NACK)


Memory management

M: Allocate memory for forms/graphics/soft fonts

FI/UE/UG: Query Form/Font/Graphic Information

FK/GK/EK: Delete Forms/Graphics/Soft Fonts


Key questions and answers

Question 1: What is the most core tag template structure in EPL2? What are the minimum commands required?

Answer: The simplest template fixed structure is: N → q (width) → Q (length) → content (A/B/X, etc.) → P (printing). The cache must be cleared with N, the paper defined with q/Q, and finally output with P. Example: Nq400Q200,24A50,50,0,1,1,1, N, "Hello Zebra" P1

Question 2: How does EPL2 achieve continuous printing of serial numbers? What is the difference between a counter and a variable?

answer:

Counter (C command): dedicated to increasing/decreasing numbers from 0 to 9, supports stepping, suitable for serial numbers.

Variable (V command): can store any string, numbered from 00 to 99, used for custom content such as product name and batch.

Usage: Define V/C in the form first, use when printing? Incoming data, with reference method V01/C1.

Question 3: What is the relationship between EPL2 and SGD instructions? What scenarios are they used for?

answer:

EPL2: Used for label content design (text, barcode, graphics, forms).

SGD: Used for printer system configuration (IP, speed, density, network, status query).

Both can coexist but must be sent separately and cannot be written on the same line; SGD is here! Starting with U1, EPL2 directly starts with the command.

  • Hirschmann RS30-1602O6O6SDAUHX - Ethernet Switch
  • BELDEN 942141999-33 / 94214199933 - Industrial Ethernet Switch
  • HIRSCHMANN MM3-4FXS2 - MICE Media Module
  • HIRSCHMANN MAR1030-4OTTTTTTTTTTTTTTTTTTTTTTTTUM9HPHX-CAB - Industrial Switch
  • HIRSCHMANN M4-GIGA 8-SFP - Ethernet Module
  • HIRSCHMANN SPIDER-SL-2008T1999999TY9HH - Switch
  • HIRSCHMANN M4-GIGA 8-SFP - Switch
  • HIRSCHMANN MACH104-20TX-FR-L3P - Switch
  • HIRSCHMANN MSP40-00200SCZ999HHE2A - Industrial Ethernet Switch
  • HIRSCHMANN SPIDER 4TX/1FX-SM EEC - Switching Module
  • HIRSCHMANN MACH102-8TP-R - Switch
  • HIRSCHMANN RS30-0802O6O6SDAEHC09.0.10 - Switch
  • Hirschmann RS20-0800M2M2SDAEHC09.0.14 - Industrial Switch
  • HIRSCHMANN RS20-0400S2S2SDAEHC09.0.00 - Industrial Switch
  • HIRSCHMANN MSP40-00200SCZ999HHE2A - Industrial Switch
  • HIRSCHMANN MSM40-C1C1C1C1SZ9HH9E99.9 - Switch Media Module
  • HIRSCHMANN RS30-2402T1T1SDAEHC09.0.14 - Rail Switch
  • Hirschmann mm3-4TX1 - MICE Realtime Module
  • HIRSCHMANN RH1-CX+(NAVY) - Industrial Switch
  • HIRSCHMANN OCTOPUS 16M - IP67 Industrial Switch
  • HIRSCHMANN RS30-1602OOZZSDAEHC09.0.14 - Switch
  • HIRSCHMANN OZD-PROFI-12M-G12 - Profibus Fiber Converter
  • HIRSCHMANN MACH4002-24G-L3P - Modular Gigabit Switch
  • Hirschmann MM3-2FXS2/2TX1 - Industrial Switch
  • HIRSCHMANN RS30-0802O6O6SDAEHC09.100 - Industrial Switch
  • Hirschmann SPIDER II 8TX/2FX-SM EEC - Industrial Switch
  • Hirschmann RS20-0800S2S2SDAEHC09.1.00 - Industrial Switch
  • HIRSCHMANN OCTOPUS 8TX-EEC - Ethernet Switch
  • HIRSCHMANN ECFL2-BFOC 943353-021 - Fiber Optic Module
  • HIRSCHMANN RSPE30 RSPE30-24044O7T99-SCCZ999HHSE2A - Industrial Switch
  • Hirschmann RS2-4TX/1FX-SM EEC - Industrial Switch
  • HIRSCHMANN RS20-0800M2M2SDAEHC07.1.01 - Industrial Switch
  • HIRSCHMANN RS30-1602O6O6TDAPHC09.1.00 - Ethernet Switch
  • HIRSCHMANN MACH 1030 MAR1030-OTZZZZZZZZZZZZSM9HPHX - Switchgear
  • HIRSCHMANN MS20-2400SAAPHC - Industrial Switch
  • HIRSCHMANN MACH102-8TP-R - Industrial Switches
  • HIRSCHMANN RS30-1602T1T1SDAEHC09.0.10 - Industrial Switch
  • HIRSCHMANN RS20-1600M2M2SDAEHC09.1.00 - Industrial Switch
  • HIRSCHMANN MM3-4FXM2 - MICE Media Module
  • HIRSCHMANN MSM20-S2S2S2S2SZ9HH9E99.9.99 - Industrial Switch
  • Hirschmann RS2-3TX/2FX EEC - Switch
  • HIRSCHMANN RS20-0800T1T1SDAEHC09.1.00 - Industrial Switch
  • Hirschmann RS2-3TX/2FX EEC - Switch
  • HIRSCHMANN OZDProfi12MG11 - Photoelectric Converter
  • HIRSCHMANN MACH 1030 MAR1030-OTZZZZZZZZZZZZSM9HPHX - Switchgear
  • HIRSCHMANN MAR1040-4C4C4C4C9999SM9HPHH05.1.00 - Industrial Switch
  • HIRSCHMANN RS20-1600M2T1SDAEHC - Switch
  • hirschmann MM2-4FXM3 - Switch
  • HIRSCHMANN MS4128-L3E ATEX - Industrial Switch
  • HIRSCHMANN M4-FAST8-SFP - Switch
  • HIRSCHMANN RS20-0800S2S2SDAPHC 09.1.00 - Switch
  • HIRSCHMANN RS20-1600M2M2SDAPHC08.0.05 - Industrial Grade Ethernet Switch
  • Hirschmann 934233021 OZD Genius G12-1300 - Optical Fiber Repeater
  • HIRSCHMANN BRS40-00169999-STCZ99HHSES - Industrial Switch
  • HIRSCHMANN MM3-4FXS2 - MICE Media Module
  • HIRSCHMANN SPIDER Giga 2TX PoE EEC - Industrial POE Power Supply Device
  • HIRSCHMANN RS20-1600T1T1SDAEHC09.1.00 - Industrial Switch
  • HIRSCHMANN RSB20-0800T1T1EAABHH - Industrial Ethernet Switch
  • HIRSCHMANN RS20-0400M2M2SDAEHC07.1.05 - Industrial Switch
  • HIRSCHMANN RS30-1602O6O6TDAPHC09.1.00 - Switch
  • HIRSCHMANN RS20-0900VVM2EDHEHH05.0.02 - Switch
  • HIRSCHMANN RSPM20-4T14T1SZ9HHS9 - Switch
  • HIRSCHMANN QSY 190K 392025-63 - Servo Motor
  • HIRSCHMANN RPS 80 EEC - Power Supply
  • HIRSCHMANN RS30-1602T1T1SDAEHC09.0.10 - Industrial Switch
  • HIRSCHMANN RS20-1600M2T1TDAEHC - Industrial Switch
  • HIRSCHMANN MACH4002 48+4G-L3P - Modular Gigabit Switch
  • Hirschmann OZD Profi 12M G12-1300 PRO OZD-PROFI-12M-G12-1300-PRO - Photoelectric Converter
  • HIRSCHMANN RS30-1602OOZZSDAEHC09.0.10 - Industrial Switch
  • HIRSCHMANN MAR1030-4OTTTTTTTTTTTTTTTTTTTTTTTTUM9HPHX-CAB - MAR1030-4OTTTTTTTTTTTTTTTTTTTTTTTTUM9HPHX-CAB
  • HIRSCHMANN RS20-1600M2M2SDAEHC09.0.14 - Switch
  • HIRSCHMANR S30-1602O6O6TDAPHC09.1.00 - Switches
  • Hirschmann MM3-4FXS2 - Switch Module
  • RS20-1600M2M2SDAPHC07.0.02 RS20-1600M2M2SDAPHC07.0.02 - Switch
  • HIRSCHMANN RS20-0800S2S2SDAUHC - Industrial Switch
  • HIRSCHMANN SPIDER-SL-20-08T1999999SY9HHHH - Industrial Switch
  • HIRSCHMANN MS20-0800SAAEHH04.2.04 - Industrial Switch
  • HIRSCHMANN SPIDER II 8TX/1FX EEC - Industrial Switch Module
  • HIRSCHMANN GRS1042-AT2ZEHH01Z9HHSE3AMR06.0.01 - Industrial Switch
  • hirschmann MM2-4FXM3 - Switch
  • HIRSCHMANN RS30-1602T1T1SDAEHC09.0.10 - Industrial Switch
  • HIRSCHMANN MS30-0802SAAPHC04.1 - Industrial Switch
  • Hirschmann SPIDER II 8TX/2FX-SM EEC - Industrial Switch
  • HIRSCHMANN MAR1030-4OTTTTTTTTTTTTTTTTTTTTTTTTUM9HPHX-CAB - Industrial Switches
  • HIRSCHMANN OS20-001200T5T5T5-TBBZ999HHNE3S08.1.00 - Switch
  • HIRSCHMANN MAR1030-4OT - Switch Module
  • Hirschmann MM3-4FXM2 - Industrial Switches
  • HIRSCHMANN RSB20-0800T1T1TAABHH - Switch
  • Hirschmann MACH104-20TX-F - Switches
  • HIRSCHMANN RSB20-0800T1T1EAABHH - Ethernet Switch
  • HIRSCHMANN RS20-0800S2T1SDAUHC - Industrial Switch
  • HIRSCHMANN OBR40-9-LC - Optical Bus Repeater
  • HIRSCHMANN RS20-2400TITISDAEHC09.1.00 - Exchange Board
  • HIRSCHMANN MSP40-00200SCZ999HHE2A - Industrial Switch
  • HIRSCHMANN RS20-1600T1T1SDAEHC09.1.00 - Industrial Switch
  • RS30-0802O6O6SDHPHH06.0.03 RS30-0802O6O6SDHPHH06.0.03 - Industrial Switch
  • HIRSCHMANN RS20-1600T1T1SDAEHC09.1.00 - Industrial Switch
  • BELDEN OS20-002800T5T5T5-TBBY999GMSE3S / OS20002800T5T5T5TBBY999GMSE3S - IP67 Industrial Switch
  • HIRSCHMANN RS20-1600M2M2SDAUHC - Exchange Board
  • Hirschmann MM3-2FXS2/2TX1 - Industrial Switch
  • HIRSCHMANN RS20-2400S4S4SDAEHC09.0.14 - Industrial Switch
  • HIRSCHMANN M4-GIGA 8-SFP - Media Module
  • Hirschmann SPIDER II 8TX/1FX EEC - Industrial Switch Module
  • NEW HIRSCHMANN OZDProfi12MG11 - Photoelectric Converter
  • HIRSCHMANN RS30-1602O6O6TDAPHC09.1.00 - Ethernet Switch
  • HIRSCHMANN RS20-0800M2T1SDAUHC - Industrial Switch
  • RSPE30-24044O7T99-SCCZ999HHSE2A 942 084-999 RSPE30-24044O7T99-SCCZ999HHSE2A 942 084-999 - Industrial Switch
  • HIRSCHMANN RS20-0400T1T1DAEHC04.0.01 - Switch
  • HIRSCHMANN BRS42-0012OOOO-SPCZ99HHSES - Switch
  • Hirschmann MS4128-L3P - Rail Switch
  • RS20-1600M2M2SDAPHC08.0.05 RS20-1600M2M2SDAPHC08.0.05 - Switch
  • HIRSCHMANN OS20-002000T5T5T5-TBBZ999HH - Industrial Switch
  • HIRSCHMANN RS30-0802O6O6SDAEHC09.0.10 - Switch
  • HIRSCHMANN RS20-0400S2S2EDHEHH09.0.14 - Industrial Switch
  • HIRSCHMANN OZDProfi12MG12-1300 PRO - Photoelectric Converter
  • MM3-4FXS2 MM3-4FXS2 - Industrial Switch
  • MACH 1020 MACH 1020 - Industrial Switch
  • Hirschmann RS2-3TX/2FX EEC - Switch
  • BELDEN SPIDER II 8TX / SPIDERII8TX - Rail Switch
  • HIRSCHMANN RS20-1600M2M2TDAEHC09.0.14 - Exchange Board
  • HIRSCHMANN MM3-4FXM2 - MICE Media Module
  • Hirschmann OZD Genius G12-1300 - Optical Fiber Repeater
  • HIRSCHMANN MSM40-T1T1T1T1TZ9HH9E99.9.99 - Switch
  • HIRSCHMANN RS20-0800M2M2SDAUHC - Industrial Switch
  • HIRSCHMANN RS20-1600T1T1SDAEHC09.1.00 - Industrial Switch
  • Hirschmann RS20-0800M2M2SDAEHC09.0.14 - Industrial Switch
  • Hirschmann MM2-2FXM2 - Media Module
  • HIRSCHMANN SFP-GIG-LX/LC - Optical Module