SoftwarePractice.org: Home | Courseware | Wiki | Archive

Bar Code 39 Standards

From SoftwarePractice.org

Contents

Introduction to Code 39

Image:Code39.JPG
Barcode 39 Standard


Code 39 is widely used in Industry and is defined in the American National Standards Institute (ANSI) standard MH10.8M1983.

Character Set of Code 39

Includes the digits 0-9, the letters A-Z (upper case only) and the following symbols: space( ), minus(-), plus(+), period(.), dollar sign($), slash(/) and percent(%) as shown in the table below.

Character Set for Bar Code 39
Type Allowed Characters
Digits 0 1 2 3 4 5 6 7 8 9
Letters A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Symbols space( ) minus(-) plus(+) period(.) dollar sign($) slash(/) percent(%)

A special start/stop character is placed at the beginning and end of each barcode. The barcode may be of any length, although more than 25 characters is pushing the limits.


Specifications of Code 39

Each character consists of 9 elements: 5 bars and 4 spaces. Each character includes 3 wide and 6 narrow elements. Thusly each character consists of 5black bars and 4 white bars. Characters are separated by an inter-character gap which is the same width as a narrow bar.

Code 39 consists of 43 main alphanumeric characters, as seen in the following:

1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ - . $ / + % SPACE

However, code 39 is also extendible to full 128 ASCII characters using a two-character precedence code scheme.

The ratio of wide:narrow bar width may be in the range of 1.8 to 3.4. Barcodes with a narrow bar width of less than 0.508mm should have a ratio of at least 2.5. A ratio of 3.0 is generally recommended. Every Code 39 barcode should be preceded and followed by a quiet zone with the width of at least 10 narrow bars. Also a 39 barcode starts and ends with an asterisk character "*", and generally decoders do not transmit this character as part of the data it reads.

For barcodes requiring a higher level of data security or accuracy, a checksum digit may be integrated into the barcode. The check character is positioned between the final data character and the end asterisk character.

Checksum

Code 39 is considered to be a self checking code, whereby if a bar or a space is mixed up and misplaced in the barcode, the character itself cannot consequently be changed to another character. The barcode will proceed to read an error.

However for implementations and requiring a high level of accuracy, a checksum digit can by added to the barcode, by using a modulo 43 calculation. Implementing a Checksum cannot be automatically detected as a seperate entitiy for a reader, it is required for this feature to be enabled in the barcode reader

The checksum is calculated as follows:

  1. The value of each barcode character is obtained and converted to the checksum digit numerical equivalent. The start and end characters are not included. 
  2. Add the values of each checksum digit obtained from step 1.
  3. Divide the total summation by 43.
  4. The remainder from the division is the checksum value, to be inserted prior to the end character.



To return to main page of Team B click here Bar code reading from image

Personal tools