Exercise 4: ^SN — Serial Number Command
Exercise 4: ^SN — Serial Number Command

Exercise 4: ^SN — Serial Number Command

Send this format to the printer:
^XA ^FO100,100^ADN,36,20^SN001,1,Y^FS ^PQ3 ^XZ
To vary the
^SNv,n,z
to exercise increment/decrement and leading zeros functions, consult this guide.
If your serial number contains alpha and numeric characters, you can increment or decrement a specific segment of the data even if it is in the middle, as this sample sequence shows:
ABCD1000EFGH, ABCD1001EFGH, ABCD1002EFGH
Send this file to the printer and to see how it increments the serial number. The
^SF
command can also work with alpha characters.
^XA ^FO100,100^ADN,36,20^FDABCD1000EFGH^SF%%%%dddd%%%%,10000^FS ^PQ15 ^XZ
Notice how the field data character position aligns with the
^SF
data string:
^
F
D
A
B
C
D
1
0
0
0
E
F
G
H
^
S
F
%
%
%
%
d
d
d
d
%
%
%
%
1
0
0
0
0
2
0
0
0
0
3
0
0
0
0
And on through…
1
0
1
4
0
0
0
0
The last label prints
ABCD1014EFGH
.
The % is placed in positions that you do not want to increment or decrement,
d =
decimal,
10000 =
increment value.
For more details on
^SF
, see ^SF.