I have a problem with serialization. When I try ZPL code on Laberaly.com, it works as it should. But when that data is send to the printer, serialization does not work. Also, label is stored on printer - ^DF
and it is later called - ^XF
.
For simplicity I am only showing serialization part of the code code. This a label that is stored in the printer:
^XA
^CI31
^DFR:LABEL.ZPL^FS
^FT703,158^A0N,17,18^FH\^FN1^FS
^CI27
^XZ
And this is code to call label with serialization:
^XA
^CI28
^XFR:LABEL.ZPL^FS^FN1^FD1 of 4^SFD%%%%%,1%%%%%^FS
^PQ4
^XZ
No matter what I do with ^PQ
parameters, it is always printed 1 of 4 on all labels. I have tried this ^PQ4,0,1,Y
and ^PQ4,0,1,N
, but the result is always the same. Label size is 10x8 cm, printer model is ZD421.
EDIT:
So the solution is to move ^SF
part to the part that will be saved to the memory, with ^FN
.
It should look like this:
^XA
^CI31
^DFR:LABEL.ZPL^FS
^FT703,158^A0N,17,18^FH\^FN1^SFD%%%%%,1%%%%%^FS
^CI27
^XZ
Then serialization will work. Interesting thing is that this does not work on labelary.
I doubt the ^SF
command can be part of a numbered field. It must be directly embedded in the label format:
^XA
^CI31
^DFR:LABEL.ZPL^FS
^FT703,158^A0N,17,18^FD1 of 4^SFD%%%%%,1%%%%%^FS
^CI27
^XZ
^FN
are typically used for simple text substitution.