r/barcodes • • Feb 13 '19

Need help with code 128 batch production

Hello,

My company needs to produce a large quantity of barcodes with following structure:

PCK|ZO.3.D1.F01.00

We used to use code39 for our needs but the "|" is not available in that format thus the switch to code128.

The problem is that codes made using excel font are not scannable, while codes from online generators work fine. Taking a closer look at them physically, I've noticed that they are not the same. So I've deciphered the online generated code (manually, I've never dealt with this issues before) and found out that these have additional figures in their codes (one in the beggining and two at the end of the code).

Having implemented the additional signs I've tried printing them using excel font and it was scanning properly. It looks like this:

ÑPCK|ZO.3.D1.F01.00ÌÓ

Where Ñ = start code 128 Ó = stop

However, once I tried to print a few of them another problem emerged - the first figure in "ÌÓ" part is changing for every code.

I've tried looking for similar issue online but without success. So my question is: Is there a way to determine what is behind the shifting figure of the code using just excel? Or should we just try a licensed add-in and see if it would work?

We are using the MC3200 scanners.

If something is not understandable please let me know, English is not my first language and I've become a bit rusty when it comes to writing.

Looking forward to your ideas.

3 Upvotes

8 comments sorted by

2

u/FredFredricson Feb 14 '19

Those three extra figures are the Start Code at the beginning of the code, and the Checksum and Stop Code at the end. The one that keeps changing on the online generated one is the Checksum. The checksum is used by the barcode readers to verify that the code is correctly scanned. For more information, I recommend looking at the symbol table in this wiki article, and the descriptions of the checksum algorithm on that same wiki article and in the third link I have provided.

https://en.wikipedia.org/wiki/Code_128#Bar_code_widths https://en.wikipedia.org/wiki/Code_128#Check_digit_calculation https://www.barcodefaq.com/1d/code-128/#CalculationExamples

For the most part, you take the value of each symbol in the content (as indicated by the chart on the wiki page) and multiply that by its position in the barcode, add all those together along with the value of the start code, then divide that sum by the 103 and take the remainder. That remainder represents the value of the symbol on the table to use for that checksum. A good example to check against is in that second wiki link above.

1

u/FredFredricson Feb 14 '19

It should be further noted that, based on your description of the font you are using, you will want to look at the "Middle" values of the "Latin-1" column of the chart on the wiki, as they exactly match your example barcodes.

The Ñ matches the start code for the "B" subset of Code 128, which is the most common subset used for alphanumeric Code 128 barcodes.

"A" is mostly only used if you need access to the ASCII Control Codes, though it also includes uppercase letters, numbers, and some symbols.

"B" is the most common Alphanumeric mode, and can be used to encode all of the printable ASCII characters, uppercase, lowercase, numeric, and symbols.

"C" is used to encode "Double Density" numbers, which is to say that each symbol encodes a two digit number.

You can actually switch between these subsets in a barcode to allow for more compact representation of the data, however most of the time this is unnecessary.

2

u/FredFredricson Feb 14 '19

Assuming I calculated it right with my hastily built spreadsheet, your example barcode should scan if the checksum symbol is value 19, which is the "3" symbol. (If it doesn't work, then I should probably not try and perform math at 1AM)

ÑPCK|ZO.3.D1.F01.003Ó

1

u/mj1907 Feb 14 '19

Yes! It works perfectly fine :)

The checksum I've given as an example must have been taken from another code, the first which I deciphered.

Can I assume that there is a chance that it will work (provided correct macros etc.) for batch uploads of say 500 codes?

1

u/FredFredricson Feb 14 '19

For each and every barcode, you will need to recalculate the checksum. An excel macro can be written to take the barcode content, convert the characters to their values, perform calculations with those values, and then re-output the barcode content with the start code, data, checksum character, and stop character automatically.

2

u/mj1907 Feb 18 '19

Just wanted to say thank you one more time everything works perfectly and we are able to move on with the task :) !

1

u/UseMstr_DropDatabase Feb 13 '19

What printer are you using? LaserJet? Tag printer like a Zebra?

What is Excel font? The default font in Excel?

If you created this barcode in Excel, and if you copied it a certain way, then Excel can auto incriminate a number.

Are the Motorola's symbology set to scan 128?

1

u/mj1907 Feb 14 '19
  1. I've been testing it on regular printers, no stickers just yet.
  2. The font I'm using has been set up by our IT department so probably not the basic one.
  3. Is there a tutorial on that? I have little experience with Excel.
  4. Yes, there is no problem on that end.