ZPL guide 9 of 9

Label size, quantity and printer settings

Tell the printer how big the label is, how many to print, how fast and how dark, and which of those settings survive a power cycle. Notes where the guide says availability depends on the printer model.

Width and length

Question How do I tell the printer how wide and how long the label is, and when is ^LL required?

^PW sets the print width in dots, from 2 up to the width of the label; a larger value is reduced to the label's maximum. Its default is the last permanently saved value.p. 329

^LL sets the label length in dots, from 1 to 32000 and not more than the maximum label size; the installed memory decides that maximum. It is necessary with continuous media, which has no gaps, notches, slots or holes between labels.p. 294

WarningTo affect the current label, ^LL must come before the first ^FS. If the value you give exceeds what the printer accepts, the bottom of the label is cut off.p. 294

^LL has an optional second value. N, the default, applies the length only to continuous media; Y applies it to gap and mark media as well. The guide leaves open whether leaving the value out resets it to N or keeps the earlier setting.p. 294

Convert with the dots-per-millimeter arithmetic from the coordinates guide, or switch the format to millimeters or inches with ^MU. A 100 mm by 50 mm label on an 8 dots per millimeter printer is 800 by 400 dots. The guide's inch formulas for ^LL are 203.2 dots per inch for that head and 304.8 for 12 dots per millimeter.pp. 294, 312

^MN tells the printer what media it has: continuous (N), web sensing (Y or W), mark sensing (M), auto-detect during calibration (A, G-series only) or variable-length continuous (V, KR403 only). For continuous media the label length comes from ^LL, and a black-mark offset applies only to mark sensing.p. 307

example.zplZPL
^XA
^PW800
^LL400
^FO40,40^A0N,40,40^FDShelf 12^FS
^XZ

A 100 by 50 mm label on an 8 dots per millimeter printer: width 800 dots, length 400 dots. With the default second ^LL value, the length applies only to continuous media.

Quantity and serial numbers

Question How do I print many copies, and with serial numbers?

^PQ takes the total quantity (1 to 99,999,999, default 1), the number of labels between pauses (default 0, no pause) and how many replicates of each serial number to print (default 0). It goes before ^XZ.pp. 54, 324

^SN replaces ^FD on a field and makes its data change on each label. It takes a starting value, an increment (negative to count down, default 1) and a flag for leading zeros (default N). Up to 12 right-most digits are indexed.pp. 193, 341, 342, 1766

The number steps only after all replicates of it have printed, as set by the third ^PQ value. If the printer runs out of paper or ribbon, the first label after recovery repeats the previous number in case that label did not fully print.p. 342

TipTo get a fixed width, put the leading zeros into the starting value yourself.p. 342

example.zplZPL
^XA
^FO40,40^A0N,40,40^SN0001,1,Y^FS
^PQ6
^XZ

Six labels in all. ^SN starts at 0001 and goes up by 1 with leading zeros kept; with no replicates set, the number changes on every label.

Speed, darkness, media and print mode

Question How do I set speed and darkness, and choose media type and print mode?

^PR sets print, slew and backfeed speeds. It stays in effect until you reissue it or turn the printer off, and some models revert to the default speed when power is lost. The values are letters and numbers for speeds from 1 to 14 inches per second, with 1 limited to some 600 dpi models and 13 and 14 to the Xi4 and RXi4 printers. The guide's exercise says 2 to 12, and the entry says the speed is limited by the printer. Check your printer's specification; asking for more than it can do runs it at its own limit.pp. 54, 326, 327

TipTest speed against your media and ribbon. The guide says print quality depends on media, ribbon, speed and operating modes.p. 326

~SD sets darkness absolutely, from 00 to 30; it equals the printer's front-panel darkness setting. ^MD adjusts it relative to the current setting, from -30 to 30, and each ^MD is measured from the value on the configuration label rather than from the previous ^MD. The guide says the ~SD value, where there is one, is added to the ^MD value. On the XiIIIPlus, Xi4 and RXi4 printers the range is 0 to 30 in steps of 0.1.pp. 301, 333

^MT picks the media type: T for thermal transfer, which uses a ribbon, or D for direct thermal, which needs none. If you omit the value, the command is ignored.p. 311

^MM chooses what happens after printing: tear-off, peel-off, rewind, applicator, cutter, delayed cutter, RFID or kiosk. Which modes exist depends on the printer, and several are tied to named models, so read your printer's user guide before relying on one. A missing or invalid value leaves the current mode unchanged.pp. 305, 306

Warning^LL, ^PW, ^PR, ^MN, ^MM and ^MT are all ignored on the HC100 printer.pp. 294, 306, 308, 311, 327, 329

What survives a power cycle

Question Which of these settings survive a power cycle, and how do I save them?

Do not assume. ^LL is not persistent across a power cycle unless ^JUS is received. ^PW defaults to the last permanently saved value. ^PR lasts until reissued or power-off. On G-series printers a value set with ^MD does persist.pp. 294, 301, 326, 329

^JU controls saving: S saves the current settings, which are used at power-on, and R recalls the last saved ones. F reloads factory settings, N factory network settings and A both; those reloads are lost at power-off unless saved with ^JUS.p. 278

Settings made in ZPL can affect settings made through SGD. If something you set keeps reverting, check the other language.p. 47

Fine alignment and turning the label around

Question How do I fine-tune alignment, or rotate the whole label?

^LT moves the whole format up or down, by at most 120 dot rows on most printers, to fine-tune alignment without editing fields. The label top value on the front panel is double the one used in ZPL.p. 297

^LH moves the reference point for every field after it, and ^PO inverts the whole format 180 degrees for a differently mounted printer; the coordinates guide explains both.pp. 293, 322

The same label with BarcoderX

Question How does BarcoderX send a label to the printer?

BarcoderX is pre-launch and its API is not final. It is designed to let you describe the label once in .NET and emit ZPL or EPL. It prints over TCP, serial, the Windows spooler, CUPS or USB, or queues a job through the API for the print agent. See Printing.

Questions

When do I need ^LL?

With continuous media, where nothing physical separates labels; for gap or mark media the second ^LL value must be Y. It must come before the first ^FS to affect the current label.p. 294

What is the difference between ~SD and ^MD?

~SD sets darkness to an absolute value from 00 to 30. ^MD adjusts it relative to the current setting.pp. 301, 333

Will my label length survive a power cycle?

Not unless ^JUS is received. The guide says ^LL is not persistent across a power cycle without it.pp. 278, 294

Commands in this guide

BarcoderX is a .NET SDK for thermal labels and barcodes. See how it prints and exports labels.

Source Zebra, ZPL II, ZBI 2, Set-Get-Do, Mirror, WML Programming Guide, P1134473-11EN Rev A, 2026/07/05, pages 47, 54, 193, 201, 278, 293, 294, 297, 301, 305 to 308, 311, 312, 322, 324, 326, 327, 329, 333, 341, 342, 1766.

Written by BarcoderX in its own words. Checked against the guide on 2026-11-14.

ZPL and ZPL II are trademarks of Zebra Technologies Corporation. This reference is written by BarcoderX in its own words from Zebra's published programming guide. BarcoderX is an independent product and is not affiliated with, endorsed by or sponsored by Zebra Technologies.