1

Using ZPL script, I have to generate a barcode with GS1-128 (formally known as Code 128, UCC/EAN 128).

The problem is, it is generating barcode but a number is not correct from the middle of the barcode.

^XA

^FO15,280
^BY3,2:1
^BCR,100,Y,Y,Y,D
^FD(01)90717497100536(3202)0090(11)210716(21)9000000014^FS

^XZ

But in output, it generates a barcode (01)90717497100535(3202)0090(11)210716(21)9000000014

535 instead of 536.

Any idea?

Terry Burton
  • 2,801
  • 1
  • 29
  • 41
Saboor
  • 21
  • 3

2 Answers2

2

You have wrongly calculated check digit - it is 5 as printer corrects you. This correction may be turned off, but I am not sure about that and I would never recommend turning it off. GTIN with wrong check digit is not valid. To wrap it up, the generated code is correct, just check your input GTINs to see if they have correct check digits.

Viliamm
  • 618
  • 5
  • 12
0

It is fixed by adding additional zero to start. Ref: https://stackoverflow.com/a/68502657/323917

^XA

^FO15,200
^BY3,2:1
^BCR,100,Y,Y,Y,D
^FD(01)00090717497100536(3202)0090(11)210716(21)9000000014^FS
 
^XZ
Saboor
  • 21
  • 3
  • GTIN AI-(01) in GS1-128 barcode MUST be allways in 14-digit format. Source: https://www.gs1.org/standards/barcodes/application-identifiers/01 Prefixing a 14-digit GTIN with more zeros would lead to making the whole GS1-128 code invalid. In this case is the error simple - the last digit (check digit) is wrongly calculated. It is indeed 5, as generator outputs. There is a control mechanism that checks check digit and corrects it if it is wrong. – Viliamm Aug 09 '21 at 19:42