^SN Serialization Data
Gives a field a serial value that the printer raises or lowers by a set step each time a label is printed. It works on text and barcode fields.
^SNv,n,z
^SN parameters
| Parameter | Meaning | Accepted values | Default |
|---|---|---|---|
vstarting valuepp. 341, 1766 |
The data of the field, whose trailing number is the part that is indexed. The guide's scripting examples give a value with text in front of the digits, which shows the digit sequence is the part that changes. |
At most 12 digits in the portion to be indexed. |
1
|
nincrement or decrement valuep. 341 |
How much the serial value changes between labels. A minus sign in front makes it a decrement. |
Up to 12 digits. To decrement, put a minus (-) sign before the value. |
1
|
zadd leading zeros (if needed)pp. 341, 342 |
Whether leading zeros are printed or suppressed. |
|
N
|
^SN notes and gotchas
-
Interaction
The value changes once all replicates of the current serial number have been printed. The number of replicates is set by the r parameter of
pp. 324, 342^PQ, whose default is 0. -
Interaction
pp. 186, 193, 206^FHcan be used with^SNdata, and^FBcan format an^SNstring into a block. The guide advises against^FTwithout x and y following^SN. -
Firmware
In x.13 and earlier, the first integer found when scanning from right to left starts the indexed part of the data, and for a field ending in a letter the data is scanned character by character from the right until a digit is found.
Firmware: x.13 and earlier p. 341 -
Firmware
In x.14 and later the same scan runs from the end of the backing store toward its start, so the first number found from there starts the indexed part.
Firmware: x.14 and later p. 341 -
Firmware
From V60.13.0.10,
Firmware: V60.13.0.10 p. 189^SNworks together with the^FCclock-indicator command, which belongs to the Real Time Clock feature. -
Note
The guide says
p. 341^SNcan be applied to 100 to 150 fields in one format, to alphanumeric as well as barcode fields, and that at most the 12 right-most integers of a field are indexed. -
Note
With leading zeros printed (Y), the starting value is the right-most run of digits in x.13 and earlier, and the first run of digits found going backward in the backing store in x.14 and later. Its width is found by scanning from the right until the first non-digit, a space or a letter. To get a particular width, write the leading zeros into the starting value yourself.
p. 342 -
Note
With leading zeros suppressed (N), the same rule applies for the starting value, except that any leading spaces are included in it.
p. 342 -
Note
If the printer runs out of media or ribbon while a serialized run is printing, the first label after the supply is replaced and calibration is done carries the same serial number as the partial label printed before the interruption. The guide says
p. 342^JZcontrols this. -
Note
The tutorial pages add
p. 55^SFfor serializing a segment inside the data with a mask, as a different way to index characters that are not at the end. -
Guide issue
The
pp. 324, 342^SNentry describes the r parameter of^PQas belonging to the print quality command, while the^PQentry names the command Print Quantity and lists r as replicates of each serial number. The two entries therefore name the command differently.
^SN example
^XA ^FO40,40^A0N,30,30^SN0100,5,Y^FS ^PQ4 ^XZ
One serialized field starting at 0100 with a step of 5 and leading zeros kept. ^PQ4 asks for 4 labels, so the field value is raised by 5 for each new label, since ^PQ gives no replicates.
Guides that use ^SN
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 55, 60, 186, 189, 193, 201, 204, 206, 207, 324, 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.