CSE370 Physical Representation: Barcode Code 39
Devin Kipp and Michael Pirog
Original question: How would the string CSE370 be
represented at the physical level in the following media?
Barcode
Due to there being a variety of different bar code
standards, we answered the exact question:
How would the string CSE370 be represented at the physical
level as a CODE39 Barcode?
Background:
Barcode Layout:
A barcode is a pattern of black and white vertical lines of
various thicknesses surrounded by a zone of white.
The barcode is scanned with a laser, and the intensity of
the reflection of the light off of the light and dark patterns
is detected by a photo diodeand digitized into the internal
representation of the barcode data. (This internal
representation is of course dependant on the software used.
Some barcode readers connect to the RS-232 port on a computer,
others "stuff" the keyboard buffer with the data representing
the keystrokes as if the user had typed in the characters in
the barcode.) For a pen type device, the process could be
visually represented as such:
The the tip of the pen device sequentially reads the lines
and decodes the characters. For a laser scanner, the entire
barcode's reflection pattern is read at once and decoded
afterwards.
From left to right, the general makeup of a barcode is as
follows:
Quiet Zone, Start Character, Character String, Optional
Checksum Character, End Character, Trailing Quiet Zone.
Leading Quiet Zone:
White space, which allows the barcode reader to ascertain
the dimensions and placement of the actual scan lines.
Start Character:
A pre-specified character signaling the start of the
encoded data.
Character String:
The actual information that is to be encoded as a
barcode.
Optional Checksum Character:
A character that will verify the integrity of the data
encoded as a bar code.
End Character:
A pre-specified character signaling the end of the encoded
data.
Trailing Quiet Zone:
Serves the same purpose as the Leading Quiet Zone.
CODE39 Symbology
In the CODE39 specification, each character is uniquely
represented by 9 vertical lines. These lines are either "wide"
or "narrow." Exactly 3 of the 9 lines must be "wide," which is
where the name CODE39 comes from.
The actual widths of these wide and narrow lines are:
Narrow |
Wide |
.508-.19mm |
2.0-2.2 * narrow |
>.508 |
2.0-3.0 * narrow |
The following information, from
http://www.adams1.com/pub/russadam/39code.html, describes the
exact specifications for the dimensions of the
barcode.
The height of the bars must be at least .15 times the
symbol's length or .25 inches, whichever is larger. The
overall length of the symbol is given by the equation:
L = (C + 2)(3N + 6)X + (C + 1)I
where
L = length of symbol (not counting quiet zone, dimension
will be in mils)
C = number of data characters
X = X-dimension (width of the smallest element in mils.)
N = wide-to-narrow multiple(use 3.0 if your code has a 3 to
1 ratio, etc.)
I = inter-character gap width
Leading Quiet Zone:
A space of white which is at least 10 times the width of
the smallest element in the barcode, namely, the chosen width
of the narrow lines.
Start Character:
For CODE39, the start character is represented by the
asterisk: "*" For information on its physical representation,
see below.
Character String:
The characters that can be represented in CODE39 are shown
in the table below, with their numerical representation. For
each number there exists a mapping to a combination of wide
and narrow lines, which is summarized in the second chart
|
|
Character/Number Mappings |
Character/Barcode Mappings |
|
|
Character |
Value |
|
Character |
Value |
0 |
0 |
|
M |
22 |
1 |
1 |
|
N |
23 |
2 |
2 |
|
O |
24 |
3 |
3 |
|
P |
25 |
4 |
4 |
|
Q |
26 |
5 |
5 |
|
R |
27 |
6 |
6 |
|
S |
28 |
7 |
7 |
|
T |
29 |
8 |
8 |
|
U |
30 |
9 |
9 |
|
V |
31 |
A |
10 |
|
W |
32 |
B |
11 |
|
X |
33 |
C |
12 |
|
Y |
34 |
D |
13 |
|
Z |
35 |
E |
14 |
|
- |
36 |
F |
15 |
|
. |
37 |
G |
16 |
|
space |
38 |
H |
17 |
|
$ |
39 |
I |
18 |
|
/ |
40 |
J |
19 |
|
+ |
41 |
K |
20 |
|
% |
42 |
L |
21 |
|
|
| |
|
|
|
|
|
|
|
|
|
|
The characters are spaced with something known as the
"inter-character gap'. There is not a precise definition of
its width, but this gap is always a white space, with a width
roughly equivalent to a narrow bar. In some cases it may be a
wide bar's width.
Checksum Character:
In CODE39, this is not normally used, but if there are
certain requirements for data integrity, a checksum character
can be used. To obtain the character that should be placed
here, add the numerical values of all previous characters
excluding the start character, and divide this number by 43.
The remainder will be mapped back to its corresponding letter,
and this letter should be included as the last character in
the string.
End Character:
For CODE39, the end character is represented by the
asterisk: "*" For information on its physical representation,
see above.
Trailing Quiet Zone:
A space of white which is at least 10 times the width of
the smallest element in the barcode, namely, the chosen width
of the narrow lines.
Exact Representation of CSE370 as a CODE39 Barcode (No
checksum)
Conclusions and Comments:
Once the specifications were found and studied,
representing "CSE370" as a barcode was as simple as mapping
the characters to their numbers, and these numbers to their
nine stripe wide and narrow line physical representation. That
and a little Adobe Photoshop to make the actual barcode
graphic.
Principle Sources
http://www.taltech.com/TALtech_web/resources/intro_to_bc/introbc.htm
http://www.idautomation.com/code39faq.html
http://www.barcodeman.com/info/c39_1.php3
Other Sources:
http://www.adams1.com/pub/russadam/39code.html
http://www.barcode-1.net
http://www.fontware.co.uk/3of9.htm
http://www.milk.com/barcode
|