2

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?

Dennis C
  • 24,511
  • 12
  • 71
  • 99

6 Answers6

1

Try this code:

^XA
^LH10,40
^BCN,150,Y,N,N^FD^SNH654321+Y0001+OABC+,1,Y^FS
^PQ2,0,1,Y
^XZ
Vladis
  • 11
  • 3
1

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.

Community
  • 1
  • 1
Treb
  • 19,903
  • 7
  • 54
  • 87
  • It make serial numbers, but I didn't find any way to concate/join/combine data. I cannot use it because the output will only contains the last segment. My program do support EPL2 too, and it can be done very well and simple by using counter. What's wrong with ZPL? – Dennis C Dec 05 '08 at 12:36
1

Use the serial field command ^SF not ^SN (documented in the Zebra ZPL programming reference with examples)

Tom
  • 11
  • 1
0

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.

VMAtm
  • 27,943
  • 17
  • 79
  • 125
Paul
  • 1
0

It was a no go. And end up generate the sequence in the application, not in the printer.

Dennis C
  • 24,511
  • 12
  • 71
  • 99
-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

LRutten
  • 1,634
  • 7
  • 17