Search code examples
zebra-printerszplzpl-ii

I want to print an incremental count on the top right corner of my labels from my Zebra printer using ZPL


I currently know how many labels I want to print and use ^PQ# to print that amount but the trouble is getting an incrementing count printed on the corner of each label.

There are a couple problems right now. First is that Zebra doesn't have anything letting me print the odometer value on the zebra printer. It will kind of let me print the number of centimetres or inches using ~WQOD, but it comes with a lot of extra information that I don't want. I couldn't find any commands in the manual just letting me print the number of labels with the reset-able odometer.

I could create a counter outside of the printer then send a request to print each label with a new number on the top right, however, that overloads the printer and causes connection issues with the printer if I print too many labels.

Are there any ways to overcome either of those issues so I can print an incrementing counter on each label?


Solution

  • The command to print a sequence of numbers across labels is ^SN. It is specifically used with ^PQ.

    ^SN001,1,N^FS
    ^PQ3
    

    To not overload the printer, send all individual labels within one connection, as a single string stream, don't open a separate connection for each.