Question

I am trying to print a Code 128 barcode on a label using the following the piece of ZPL with a Zebra ZP 450 printer:

^BY3^BCN,112,N^FO090,660^FD>;>89102100^FS

I'm expecting the barcode to scan as "9102100". However, when I scan the printed barcode, it reads as "910210" -- cutting off the final digit.

If I change the last digit, it is still cut off. But if I add more digits onto the end, e.g. "9102100357", the barcode correctly reads as "9102100357".

Why am I "losing" a digit in this particular case?

Was it helpful?

Solution

The >; inside of your ^FD block is telling the code 128 barcode to go into a subset (subset C in this case) which forces the data in the barcode to be numeric pairs (00 - 99). Any data that is not supplied in numeric pairs is ignored. If you put a letter in there, it will ignore that pair. In your case 9102100 has an odd number of numbers, so it ignores the last one. If for example, you add another 0, it will put all the letters in the barcode.

The ;> which puts the barcode in Subset C is not the default. Subset B or :> is the default which will allow any character to be encoded in the barcode. So you can replace the ;> with :>, or just remove the ;> entirely, and it will print out properly.

Check out the ^BC documentation in the ZPL programming manual for more information about Code 128 subsets and data validation

OTHER TIPS

See pg 92 of the ZPL Programming Guide.

This issue may have been fixed in the firmware update, see below:

Example: This is an example with the mode parameter set to D*:

^XA
^PON
^LH0,0
^BY2,2.5,145
^FO218,343
^BCB,,Y,N,N,D
^FD(91)0005886>8(10)0000410549>8(99)05^FS
^XZ

D* — When trying to print the last Application Identifier with an odd number of characters, a problem existed when printing EAN128 bar codes using Mode D. The problem was fixed in firmware version V60.13.0.6."

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top