ZPL Script for barcode GS1-128 issue

804 views Asked by At

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?

2

There are 2 answers

1
Saboor On

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
0
Viliamm On

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.