Search code examples
barcodezplbarcode-printingzpl-iicode128

ZPL Code 128 multiple subset barcode isn't printing as expected


I'm using the following command to print a multi-subset (FS1-128) Code 128 barcode in ZPL:

^XA
^FO600,250
^BY3
^BCR,175,N,N,N,N
^FD>;>8019931265099999891>7T77>5000126101000600209^FS
^XZ

I'm trying to generate:

Start C + FNC1 + 019931265099999891 + Code A + T77 + Code C + 000126101000600209

When I print it out, the barcode reads:

Start C + FNC1 + 019931265099999891 + Code A + 77 + Code C + 000126101000600209 + 95 + STOP

I know that ZPL added the 95 (symbol check) and STOP to complete the barcode. The Code A section is all wrong though. The T is missing, and the 7s are coded as a pair (i.e. Code C), not single digits. It's like it's printed the Code A, but neglected to switch to that subset...

More info: I'm printing to a Zebra GX420d and a Zebra LP 2844-Z.


Solution

  • This is a hacky fix, but it works.

    To get the subset A portion ("T77") of my mostly subset C barcode to print correctly, I translated the individual subset A characters to their subset C equivalents and used those values instead.

    To generate:

    Start C + FNC1 + 019931265099999891 + Code A + T77 + Code C + 000126101000600209
    

    My input string ended up being:

    Start C + FNC1 + 019931265099999891 + Code A + 522323 + Code C + 000126101000600209
    

    Which in ZPL is:

    ^FD>;>8019931265099999891>7522323>5000126101000600209^FS