Avoid Interleaved 2 of 5 Code

I was asked to recommend a scanner by a customer who sent me samples of their bar codes. They were all Interleaved 2 of 5 code, which is a numeric only code whose only saving grace is that you can print a lot of digits in a small space. Here are three symbologies encoding the numbers 1 to 8:

You can see that Interleaved 2 of 5 takes up the least space, but Code 128 is pretty close. Interleaved 2 of 5 has a built in defect in that the stop/stop patterns are not unique and if the scanner enters or leaves the code in a spot that resembles a start or stop, the code can be short scanned.

Code 128 is always printed with a check digit anyway and has a unique start/stop pattern, making it a superior code to I 2 of 5.

My customer’s bar code looked like this:

This is a picture from our microscope. Notice that the narrow bar measures .1 mm, or 3 mils. This is a 300 dpi printer. The wide to narrow ration of this code should be 3 to 1; this is printed at 4 to 1. Lastly, the narrow bar under the red arrow should be one element wide, this one is two.

Their printer is doing a bad job printing this code, but fortunately for them modern scanners are pretty forgiving and this code can be read reliably with a Xenon with high density optics.


GS1 Application Identifiers

The stated goal of GS1 (formerly the UPC Code Council) is to “develop and maintains global standards for business communication”. Their most widely know standard is for barcode labels. Here’s a sample GS1 barcode:

A scanner reading this barcode will¬† output “[C101189010720001501719083110LM123”.¬† The symbology above is Code 128 which has 106 different symbol patterns in it’s character set, three different start characters, three subsets (A,B, and C), and four function characters (FNC1 to FNC4) that are not printable that are used for special functions.

All GS1 barcodes start with a Start C symbol followed by a Function 1 character; scanners are supposed to interpret this a “[C1”, which indicates to the receiving software that the code follows GS1 rules.

The three pairs of characters enclosed in parenthesis are Application Identifiers; they tell the receiving software what type of data follows. Note that the parentheses are in the human readable only, they are not in the bar code itself.

A full list of AIs can be found here, but in the above example:

01 – Identifies the following data as a GTIN (Global Trade Identification Number)

17 – indicates an expiration date (YYMMDD)

10 – is a lot number, which is variable length field.

Note that if a variable length field (or more precisely, if the FNC1 is required by the GS1 tables) is in front of another field, a separator character must be used to signal the end of the field. This character can be a FNC1 or and ASCII group separator character (Hex 1D).

GS1 barcodes can also be Datamatrix codes; they follow the same rules as Code 128 except that the first three characters output are “[d2” instead of the “[C1” for Code 128.