Michael Piefel
Michael Piefel

Reputation: 19958

Print Code 128 (GS1) with Zebra/Bixolon printer

I’m printing barcodes with a mobile printer. In particular, it is a Bixolon SPP-R200II that is programmed using CPCL.

My challenge now is this: The code to print is a License Plate GS1 NVE (also known as EAN 128 and a few other permutations). As an example, take 00340435081776152901, which is usually rendered like “(00) 340435081776152901” (or very similar). Using an online barcode generator, the result is:

Generated barcode

I can also confirm visually that this is the same as what I found “in real life” from a different source, printed on a label. However, when I try to reproduce this with CPCL, I use the following piece of code:

VBARCODE UCCEAN128 10 3 200 92 560 00340435081776152901

This results in the following; this code was printed and scanned and enhanced a bit, it’s blurry but can be read by my barcode scanner:

Printed barcode (scanned)

Now you can quite easily see that these barcodes look different. The barcode from my printer is considerably wider, it contains more bars. However, my barcode scanner app (I use Barcode Scanner from Cognex) reads both with the same value and the same type “Code 128 (GS1)”.

The barcode type that was used here is UCCEAN128; note that I could change that to 128, but that would result in something identified as “Code 128” instead. Can the printer generate a barcode that is equivalent to the first image above?

Upvotes: 2

Views: 346

Answers (1)

Lukas Niemeyer
Lukas Niemeyer

Reputation: 31

To answer the part about the two different representations: When you look at the bars and count zeroes and ones and look it up in a Code 128 documentation, you will see that the first barcode is:

  1. Start Code C
  2. FNC 1
  3. 00
  4. 34
  5. ...

It encodes two decimal digits in each 11 bits, which is quite clever considering the input consists of an even number of digits. The second barcode is:

  1. Start Code B
  2. FNC 1
  3. 0
  4. 0
  5. 3
  6. 4
  7. ...

It is longer because it encodes each decimal digits on its own in 11 bits.

Upvotes: 3

Related Questions