Reputation: 24747
I have a simple program print barcodes. The label format is in a preloaded form. The value the barcode is passed by a parameter as follow.
^XA
^XFR:FORM.ZPL
^FN999^FDH654321+Y0001+OABC+^FS
^PQ2,0,1,N
And it print two barcodes
H654321+Y0001+OABC+
H654321+Y0001+OABC+
What I want is the middle part as a serial number, and it will print barcodes like this
H654321+Y0001+OABC+
H654321+Y0002+OABC+
I have tried the ^SN and ^SF
^FN999^FDH654321+Y0001+OABC+^SF%%%%%%%%%dddd%%%%%%,1%%%%%%^FS
But it was not success, two copies are the same. How can I do it in ZPL-II?
Upvotes: 2
Views: 8478
Reputation: 1
You should increment consider the symbol %
as Zero, like this
^FN999^FDH654321+Y0001+OABC+^SF%%%%%%%%%dddd%%%%%%,1%%%%%%^FS %%%%%%= 1000000
.
Then
^FN999^FDH654321+Y0001+OABC+^SF%%%%%%%%%dddd%%%%%%,1000000^FS
Upvotes: -1
Reputation: 11
Use the serial field command ^SF not ^SN (documented in the Zebra ZPL programming reference with examples)
Upvotes: 1
Reputation: 11
Try this code:
^XA
^LH10,40
^BCN,150,Y,N,N^FD^SNH654321+Y0001+OABC+,1,Y^FS
^PQ2,0,1,Y
^XZ
Upvotes: 1
Reputation: 1
Try changing the ^PQ2,0,1,N
to ^PQ2,0,0,N
. The value in in replicates field indicated that you wanted a duplicate serial number printed before the serial number was incremented.
Upvotes: 0
Reputation: 24747
It was a no go. And end up generate the sequence in the application, not in the printer.
Upvotes: 0
Reputation: 20271
Ripped from a ZPL II manual:
^AF^SN 0001, 1, Y^FS
Define serialized field, starting value of 1, increment by 1, insert leading zeros
I have no way of knowing if this will help you though, since I have only experience with EPL2 label definitions.
Upvotes: 1