Bar Codes

Copyright © by Mark Baker 1996

Copyright waiver

Return to MarkChrisSoft home page


Introduction

Barcodes are a very simple way of encoding a small amount of data, typically a single number. Their attraction is that they allow items to carry an identifying number (such as the product number found on supermarket goods), which acts as an index to a record in a database. This record can contain a whole range of information about the item, which can then be used for pricing in shops, stock control, progress control in manufacturing, personal identification in security systems, etc.

More complex bar code systems allow alphabetic, as well as numeric characters to be represented. However, the problem with these systems is that the resulting bar codes are often very long. A relatively new innovation is the '2-D' bar code, which allows a complete range of alphanumeric data to be coded efficiently. One type of '2-D' bar code looks more like rows of small square blocks, rather than the familiar parallel lines and they have to be presented to the reader at two different angles in order to be read.

Making Use of Bar Codes

You can buy software (starting at around GBP£50) that allows you to create your own bar codes, according to one of several standard coding systems. These can be printed out using standard desktop printers, onto the normal range of media, A4 sheets of paper, stickers, card, etc. Used in conjunction with a laminator, you can easily create your own membership cards, etc. However, if the covering plastic is too reflective then it may prevent accurate reading. I have experienced problems with an ink jet printer, due to the 'spread' of the ink, so a laser printer is probably better.

You can buy different kinds of bar code reader, at widely differing prices. The bottom of the range 'pen' type or wand reader is the cheapest, costing about GBP£50. Another GBP£50 gets you a keyboard 'wedge', which allows the reader to share the same port on your computer as your keyboard. The characters read by the reader are then input to the computer just as if they had been typed in.

This is ideal for students who want to use a bar code reader with their own computer programs. If they can program for keyboard data entry, then there is no reason why they cannot use a bar code reader too. My students program using Borland's Turbo Pascal and bar code input can be accepted by using the READKEY function or the READLN statement, just as you would from the keyboard.

The next step up from a wand reader is a CCD scanner, which reads much more reliably and for me, is well worth the extra cost. I bought one, with a built-in wedge, for around GBP£150 excluding tax. Apart from a slight hiccup when I initially tried to configure it, it has proved very easy to use. The configuration is handled by following the set up procedure. This involves reading in your choice of bar code options that are printed in the user guide. The scanner retains its configuration until the next time you run the set up procedure.

The next category up are the laser scanners, but given their price, they are firmly aimed at heavy-weight applications in commerce and industry. There are many companies that sell the necessary hardware and software and they usually advertise in the computing press.

For those of you in the UK who are looking for a contact, I have dealt with Paradigm Technology, who I have found to offer useful advice and support. They can be contacted on tel: 01491 822600, e-mail address: sales@paratech.co.uk

Bar Coding Systems - EAN 13

There are many bar coding systems in common use, however the EAN 13 is the one that we see most often in shops and supermarkets in Europe. EAN stands for European Article Number. An EAN 13 number is made up of 13 digits, in four groups.

The first 2 digits form the country code, 50 is the code for the UK.
The next 5 digits are the manufacturer's or supplier's code.
The next 5 digits are the product code and are allocated by the manufacturer.
The last digit is the check digit.

For example:
50 18374 49130 5

50  18374    49130      5
UK  Tesco    Digestive  Check
             biscuits   digit
Country code: These are allocated by international agreement.

Manufacturer code: Each country is responsible for giving every manufacturer, who wants one, a code. In the UK, you can obtain a code by registering with the Article Numbering Association.

Product code: Each manufacturer can then decide how to use the 5 digits of the product code, to identify their products.

Check digit: This is the result of a mathematical calculation carried out on the other 12 digits and is added on to the end of the bar code.

When the bar code is read or keyed in, the computer repeats the calculation on the first 12 digits. The answer should be the same as the check digit that was read or keyed in. If it is not, then the code has not been entered correctly and it must be re-entered.

EAN numbers can also include either a two or a five digit extension, such as in the ISSN system (see below). Japanese Article Numbers form part of the same code system and the American retail UPC-A symbology is a subset of this EAN/JAN World Code system.

EAN 8

Some packages are not big enough to carry the full EAN 13 bar code, a tube of sweets or a small jar of yeast extract for example. A few manufacturers are allocated EAN 8 codes, which as you might guess, have only eight digits, but there are not enough combinations available to share around all of them.

ISSN System

Magazines are bar coded, not only to help at the point of sale, but also to help with sale-or-return processing. Unsold magazines are returned to the wholesaler and scanned. The sales figures for that month are then corrected and the right amount of credit given to the retailer.

The ISSN (International Standard Serial Numbering) system also uses 13 digits and is a subset of the EAN 13 system. Each number starts with 977, with the next 7 digits identifying the magazine. Two spare digits follow, which can be used to encode the price, and the check digit is next. There are 2 extra digits which can be used for the issue number, eg. for a monthly magazine 06 would represent the June edition.

ISBN Numbering

The ISBN numbers found on books are encoded using a subset of the EAN 13 system, where the codes are prefixed with 978. The digits that make up the ISBN number then follow.

UPC

UPC stands for Universal Product Code and it is the standard symbology used in the US retail industry. UPC-A is a 12 digit code and forms a subset of the EAN/JAN World Product Code. There is also a shorter version, the six digit UPC-E code.

The first digit of a UPC number categorises the product, such as medicines and health related products, general grocery products, etc. The next five digits are the manufacturer's code with the next five being the product code and the last one being the check digit, as in the EAN 13 system.

EAN/UCC

EAN International was set up in 1977, as a non-profit making, voluntary association, based on the numbering associations (72 associations, operating in 78 countires in 1996) of indivdual countries. It works in partnership with UCC (Uniform Code Council), which operates in North America. Currently over 300,000 companies world-wide are using EAN standards, with another 138,000 under the UCC umbrella.

Codabar

Codabar is a very accurate, self checking symbology, that is widely used in libraries and for identifying packages in delivery systems. The codes can have variable lengths and can represent the digits 0-9 and six other characters ($ - / . : +).

Code 39

A very popular, general purpose, alpha-numeric code. It can represent the digits 0-9, all upper case letters and six other characters (/ , SPACE % + $). It is widely used in commerce and industry and there is no limit, in theory, to the number of characters that can be represented. However, codes tend to be relatively long, which places a practical limit on what can be encoded. There is a less well supported extended version, that covers all 128 ASCII characters. Check digits are optional.

Code 128

This code can represent the complete range of 128 ASCII characters. It is an alternative to Code 39, a key feature being its ability to encode control characters (eg. Line Feed or Carriage Return) as well as printable characters. Check digits are included as standard.

Two-Dimensional Bar Codes

There are two main classes of "2-D" code, stacked or multi-row bar codes and proper 2-D codes. A stacked bar code is made up of a set of bar code symbols arranged one above the other, eg. CodablockF. Proper 2-D codes can be either a matrix or a dot type. The matrix type is usually square and made up of grid of small, square cells, which can be black or white (rather like pixells on a monitor). DataMatrix is one example. Dot codes are also square, but use circular cells, eg Maxicode.

2D bar code diagram goes here

These codes are able to store much more information than conventional bar codes, often more than 2K. They can act as mini data files, encoding various details, instead of just an identification number. This makes it unnecessary to be on-line to a central database in order to extract information about the item in question. They are compact codes and can be used to mark small items and most allow for a certain amount of error correction. By using vision systems to scan 2-D bar codes, they can be marked using physical methods, such as engraving, punching and embossing. Gas turbine blades and the ceramic heat resistant tiles found on the space shuttle are examples of problem surfaces that have been marked using these techniques.


References:

Those Amazing Barcodes by Alan Winstanley, Practical Electronics, August 1993

Bar Codes - The Practical Guide published by Paradigm Technology, 1995
(Available from Paradigm Technology, tel: 01491 822600)

AIM Europe - The Definitive Buyers Guide published by Auto ID Service Providers
(AIM is a trade association representing companies supplying automatic identification products, tel: 01422 368368)


Return to MarkChrisSoft home page

Software: Applications for Teachers 2 - Bar Codes Bar Code Icon

Author: Mark Baker, e-mail mbaker@rmplc.co.uk
Last revision: 11th August 1996