Bar Codes And Light Pens

As an option HUNTER is capable of reading 2 types of barcodes:

  • Code39
  • EAN 8/13

To provide these facilities software packages are loaded into the file system of HUNTER as permanent files. Access to these files is not allowed to the user. However, the operating system accesses the files in order to support the wand option when required in programs utilising the Basic statements such as WINPUT, WINCHR etc. Access to the files is totally transparent to the user.

Other codes are available to special order.

If an attempt is made to access these files without them being present, then a "system file error" will be displayed.

See LEMO Connector for details of connecting and removing the LEMO plug.

Bar Code Scanning Techniques

There are a few simple rules to follow when using a hand held wand:

Check that the tip of the wand is free from dirt. Prolonged use of the wand may lead to a build up of dust inside the tip, covering the lens. To check for this the tip must be unscrewed and, if dust is found, a gentle wipe with a soft cloth will remove it. The performance of the wand will not be immediately affected by a build up of dust, but rather a gradual decrease in the reliability of the wand operation. A weekly check should be all that is required for normal use.

The tips of certain wands are made of plastic and as such, pressing the wand firmly onto the bar code will result in tip wear. This will affect the wand performance since the focal length of the lens will not coincide with the distance between the barcode and the lens, i.e. the bar code will appear to be 'out of focus'. It is recommended that the wand be held gently in the hand and moved lightly across the bar code for best results.

It is recommended that the scan should be carried out at a constant speed with the wand in contact with the barcode throughout the scanning period. The scan should be at right angles to the bars of the bar code. However, HUNTER tolerates a considerable variation in the scan technique.

The scan can be slow, fast, traversed across the bar code in an arc rather than a perfect straight line, or even scanned in a 'wavy' line, provided that the wand remains within the bar code region. HUNTER will allow both Code391 and EAN 8/13 bar code types to be scanned either left to right or right to left.

It is not necessary to place the wand precisely at the beginning of the bar code before a scan since HUNTER will work out which information transmitted from the wand actually corresponds to the bar code itself. If the wand is resting on a bar code, it is possible to move the wand to either end of the bar code and then scan in the opposite direction. HUNTER will then work out the beginning and end of the bar code.

HUNTER will allow a maximum of 16 characters to be represented by a Code 39 bar code. This should be borne in mind if the reader intends to produce his own Code 39 bar codes. If larger codes are required, contact HUSKY Computers for details.

European Article Number, EAN 8/13

There are 2 EAN bar code formats:

  • EAN 8 Short Version
  • EAN 13 Full length Version

Both are used in marking retail articles of sale in shops, Hypermarkets, warehouses, etc.

EAN 13 is the general name used to describe a series of barcode formats of which ANA (United Kingdom) is one particular version. See [[ASSIGNMENT OF PREFIX DIGITS BY EAN]] for precise details.

The general form of EAN 13 is 13 all-numeric digits comprising:

First 2 digits

Prefix denoting the National Numbering Authority administering the remainder of the number.

Next 10 digits

National Article Number, the structure of which is determined by the National Numbering Authority.

Last digit

Check digit, calculated by modulo-10 arithmetic, i.e:

Prefix National Article No. Check
P1 P2 xxxxxxxxxxxxxxxxxxx. C

eg: 5000183962862

In the above example the prefix is 50, i.e. the numbering authority is ANA, the United Kingdom's authority. The National Article Number is 0018396286 and the check digit is 2.

The EAN 8 system is an entirely independent series of numbers of 8 digit length. The general form of which is:

First 2 digits

Prefix, as in EAN 13

Next 5 digits

National Short Article Number

Last digit

Check digit, as in EAN 13

Prefix National Article No. Check
P1 P2 xxxxxxxxxxxxxxxxxxx. C

e.g: 50159109

where, the prefix is 50 and so the National Numbering Authority is ANA. The Short Article Number is 15910, and the Check Digit is 9.

12 Character Barcode
12 Character Bardcode

The general format of EAN 13 is shown above. As can be seen, there are 3 types of guard patterns; 2 normal guard patterns and a centre guard pattern. Only 12 of the 13 digits are represented by barcodes and the 13th digit must be calculated by considering the mixture of characters which represent the first 6 digits. The first 6 digits are represented by characters chosen from either Set A or Set B, whilst the last 6 digits are represented by characters from Set C only. See CODING OF NUMBER CHARACTERS. The allowed combinations of Set A and Set B characters are shown in COMBINATION OF SET A AND SET B CHARACTERS.

The general format of EAN 8 is shown in Fig 2.3, 8 CHARACTER BAR CODES. Note in this case that the first 4 digits are all chosen from Set A and the last 4 digits from Set C. Again, the guard bars are present.

Due to the fixed parity (all from Set C) of the last 6 digits in EAN-13 and the last 4 digits in EAN-8, both types of barcodes may be scanned in either direction, i.e. the barcodes are bi-directional.

Assignment Of Prefix Digits By EAN

Prefix Description
00-09 (Reserved for UPC)
20-29 In-Store Numbers
30-37 Gencod (France)
40-43 CGS (Germany)
49 Distribution Code Centre (Japan)
50 ANA (United Kingdom)
54 ICODIF (Belgium)
57 Dansk Varekode Administration (Denmark)
61-62 (Reserved for DCI)
54 The Central Chamber of Commerce (Finland)
65-69 (Reserved for DCI)
70 (Norway)
73 Swedish EAN Committee (Sweden)
76 Schweizerische Artilelkode Vereinigung (Switzerland)
77 APNA Australia
80-83 (Italy)
84 AECOC (Spain)
87 UAC (Netherlands)
90-91 BAN Austria
978 ISBN
979 Reserved for ISBN
98-99 Coupon Numbers

Code 39

CODE 39 is an alphanumeric bar code consisting of 43 data characters (0-9, A-Z, 6 symbols and space) and a unique start/stop character These characters are represented by light and dark bands, as shown in below.

Code 39 is so named due to the structure of each character being represented by 9 elements (5 bars and 4 spaces) 3 of which are wide and the remaining 6 are narrow. A wide bar or space is assigned a value 1, and a narrow bar or space is assigned a value 0. Gaps between characters have no value.

The number of characters in a code is limited only by the capabilities of the reader equipment or by human factors if a hand held wand is used.

Each code starts and ends with an asterisk "*", thus the code may be scanned in either direction.

The width of a unit bar may vary considerably allowing various printing methods to be used to produce the characters, e.g: offset, letter press, dot matrix printers. The recommended standard density is 9.4 characters per inch, but a density of 1.4 characters per inch may be used for corrugated containers.

A complete Code 39 bar code consists of a leading white space (referred to as a quiet zone), a start character, data characters, a stop character and a trailing quiet zone.

A check digit may be produced if required and is modulus 43. The check digit is the last data character and calculated in the following manner:

Suppose the data characters are:


then the sum of the data characters are:


Now, 115/43=2 Remainder 29

The check digit is the character corresponding to the value of the remainder, which in this example is 29, i.e. ”T".

Therefore, the complete data character sequence is:


The numeric values assigned to each Code 39 character is shown in the table below.

Char Code Char Code Char Code
0 0 F 15 U 30
1 1 G 16 V 31
2 2 H 17 W 32
3 3 I 18 X 33
4 4 J 19 Y 34
5 5 K 20 Z 35
6 6 L 21 - 36
7 7 M 22 . 37
8 8 N 23 Space 38
9 9 O 24 $ 39
A 10 P 25 / 40
B 11 Q 26 + 41
C 12 R 27 % 42
D 13 S 28
E 14 T 29

  1. Code 39 is the trademark of Intermec Corp.