|
Code 128 Barcode
|
Code 128 Symbology Barcode Data Sheet |
|
Code A | Code B | Code C | ASCII * | Unicode * | Char * | Value | Code A | Code B | Code C | ASCII * | Unicode * | Char * | Value | |
Space | Space | 00 | 0194 | 00C2 | Ÿ | 00 | V | V | 54 | 0086 | 0056 | V | 54 | |
! | ! | 01 | 0033 | 0021 | ! | 01 | W | W | 55 | 0087 | 0057 | W | 55 | |
" | " | 02 | 0034 | 0022 | " | 02 | X | X | 56 | 0088 | 0058 | X | 56 | |
# | # | 03 | 0035 | 0023 | # | 03 | Y | Y | 57 | 0089 | 0059 | Y | 57 | |
$ | $ | 04 | 0036 | 0024 | $ | 04 | Z | Z | 58 | 0090 | 005A | Z | 58 | |
% | % | 05 | 0037 | 0025 | % | 05 | [ | [ | 59 | 0091 | 005B | [ | 59 | |
& | & | 06 | 0038 | 0026 | & | 06 | \ | \ | 60 | 0092 | 005C | \ | 60 | |
' | ' | 07 | 0039 | 0027 | ' | 07 | ] | ] | 61 | 0093 | 005D | ] | 61 | |
( | ( | 08 | 0040 | 0028 | ( | 08 | ^ | ^ | 62 | 0094 | 005E | ^ | 62 | |
) | ) | 09 | 0041 | 0029 | ) | 09 | _ | _ | 63 | 0095 | 005F | _ | 63 | |
* | * | 10 | 0042 | 002A | * | 10 | nul | ` | 64 | 0096 | 0060 | ` | 64 | |
+ | + | 11 | 0043 | 002B | + | 11 | soh | a | 65 | 0097 | 0061 | a | 65 | |
, | , | 12 | 0044 | 002C | , | 12 | stx | b | 66 | 0098 | 0062 | b | 66 | |
- | - | 13 | 0045 | 002D | - | 13 | etx | c | 67 | 0099 | 0063 | c | 67 | |
. | . | 14 | 0046 | 002E | . | 14 | eot | d | 68 | 0100 | 0064 | d | 68 | |
/ | / | 15 | 0047 | 002F | / | 15 | eno | e | 69 | 0101 | 0065 | e | 69 | |
0 | 0 | 16 | 0048 | 0030 | 0 | 16 | ack | f | 70 | 0102 | 0066 | f | 70 | |
1 | 1 | 17 | 0049 | 0031 | 1 | 17 | bel | g | 71 | 0103 | 0067 | g | 71 | |
2 | 2 | 18 | 0050 | 0032 | 2 | 18 | bs | h | 72 | 0104 | 0068 | h | 72 | |
3 | 3 | 19 | 0051 | 0033 | 3 | 19 | ht | i | 73 | 0105 | 0069 | i | 73 | |
4 | 4 | 20 | 0052 | 0034 | 4 | 20 | lf | j | 74 | 0106 | 006A | j | 74 | |
5 | 5 | 21 | 0053 | 0035 | 5 | 21 | vt | k | 75 | 0107 | 006B | k | 75 | |
6 | 6 | 22 | 0054 | 0036 | 6 | 22 | ff | l | 76 | 0108 | 006C | l | 76 | |
7 | 7 | 23 | 0055 | 0037 | 7 | 23 | cr | m | 77 | 0109 | 006D | m | 77 | |
8 | 8 | 24 | 0056 | 0038 | 8 | 24 | s0 | n | 78 | 0110 | 006E | n | 78 | |
9 | 9 | 25 | 0057 | 0039 | 9 | 25 | s1 | o | 79 | 0111 | 006F | o | 79 | |
: | : | 26 | 0058 | 003A | : | 26 | dle | p | 80 | 0112 | 0070 | p | 80 | |
; | ; | 27 | 0059 | 003B | ; | 27 | dc1 | q | 81 | 0113 | 0071 | q | 81 | |
< | < | 28 | 0060 | 003C | < | 28 | dc2 | r | 82 | 0114 | 0072 | r | 82 | |
= | = | 29 | 0061 | 003D | = | 29 | dc3 | s | 83 | 0115 | 0073 | s | 83 | |
> | > | 30 | 0062 | 003E | > | 30 | dc4 | t | 84 | 0116 | 0074 | t | 84 | |
? | ? | 31 | 0063 | 003F | ? | 31 | nak | u | 85 | 0117 | 0075 | u | 85 | |
@ | @ | 32 | 0064 | 0040 | @ | 32 | syn | v | 86 | 0118 | 0076 | v | 86 | |
A | A | 33 | 0065 | 0041 | A | 33 | etb | w | 87 | 0119 | 0077 | w | 87 | |
B | B | 34 | 0066 | 0042 | B | 34 | can | x | 88 | 0120 | 0078 | x | 88 | |
C | C | 35 | 0067 | 0043 | C | 35 | em | y | 89 | 0121 | 0079 | y | 89 | |
D | D | 36 | 0068 | 0044 | D | 36 | sub | z | 90 | 0122 | 007A | z | 90 | |
E | E | 37 | 0069 | 0045 | E | 37 | esc | { | 91 | 0123 | 007B | { | 91 | |
F | F | 38 | 0070 | 0046 | F | 38 | fs | | | 92 | 0124 | 007C | | | 92 | |
G | G | 39 | 0071 | 0047 | G | 39 | gs | } | 93 | 0125 | 007D | } | 93 | |
H | H | 40 | 0072 | 0048 | H | 40 | rs | ~ | 94 | 0126 | 007E | ~ | 94 | |
I | I | 41 | 0073 | 0049 | I | 41 | us | del | 95 | 0195 | 00C3 | Ã | 95 | |
J | J | 42 | 0074 | 004A | J | 42 | fnc 3 | fnc 3 | 96 | 0196 | 00C4 | Ä | 96 | |
K | K | 43 | 0075 | 004B | K | 43 | fnc 2 | fnc2 | 97 | 0197 | 00C5 | Å | 97 | |
L | L | 44 | 0076 | 004C | L | 44 | Shift | Shift | 98 | 0198 | 00C6 | Æ | 98 | |
M | M | 45 | 0077 | 004D | M | 45 | code C | code C | 99 | 0199 | 00C7 | Ç | 99 | |
N | N | 46 | 0078 | 004E | N | 46 | code B | fnc 4 | code B | 0200 | 00C8 | È | 100 | |
O | O | 47 | 0079 | 004F | O | 47 | fnc 4 | code A | code A | 0201 | 00C9 | É | 101 | |
P | P | 48 | 0080 | 0050 | P | 48 | fnc 1 | fnc 1 | fnc 1 | 0202 | 00CA | Ê | 102 | |
Q | Q | 49 | 0081 | 0051 | Q | 49 | Start A | Start A | Start A | 0203 | 00CB | Ë | 103 | |
R | R | 50 | 0082 | 0052 | R | 50 | Start B | Start B | Start B | 0204 | 00CC | Ì | 104 | |
S | S | 51 | 0083 | 0053 | S | 51 | Start C | Start C | Start C | 0205 | 00CD | Í | 105 | |
T | T | 52 | 0084 | 0054 | T | 52 | Stop | Stop | Stop | 0206 | 00CE | Î | ||
U | U | 53 | 0085 | 0055 | U | 53 |
* It is necessary to print the Code 128 space character from ASCII 194 instead of ASCII 32 because Windows cannot print a symbol instead of a space character from Visual Basic and most other development environments. Macintosh systems should print the Code128 font from unicode locations if possible because the extended characters map to different characters than what is displayed on the "Char" column in MAC Roman encoding.
* The columns ASCII, Char and Unicode are unique to our Code 128 barcode fonts.
The following code from Visual Basic prints out all characters of the Code 128 font in order:
Private Sub Command1_Click() Dim x As Integer Dim I As Integer For x = 0 To 105 Printer.FontSize = 12 Printer.Font = "Times New Roman" If x < 95 Then I = x + 32 'Add 32 to characters of value less or = to 95 If x >= 95 Then I = x + 100 'Add 100 to characters of value over 95 If x = 0 Then I = 159 'Necessary to print the space character Printer.Print x 'Print the Code 128 value Printer.FontSize = 20 Printer.Font = "AdvCode128c" 'Print the Code 128 bar code font for the value Printer.Print Chr(I) Next x MsgBox "Done printing." End Sub
Code 128 Check Character Calculation |
The check character is positioned after the data characters and just before the stop character. To determine the value of the check character:
Calculating Character Set A or B:
The following table is an example of how to obtain the check character for the data "biz" using Code 128 character set B.
Start B | b | i | z | STOP | |
weighting | 1 | 2 | 3 | ||
values | 104 | 66 | 73 | 90 | |
totals | 104 | 66 | 146 | 270 |
To print extended ASCII characters from your keyboard that do not have keys defined, you can use the ALT+<xxxx> key combination where xxxx equals the character's ASCII location in 4 digits. For example, to type ASCII character 104 into Microsoft Word, select the font in Word, press the ALT key and while holding it down type 0104 on the keypad of your keyboard. You must use the keypad to do this and you must enter 4 digits.
Therefore to print the data "biz" as a barcode, you would need to type: ALT 0204, b, i, z, g, ALT 0206 or ÌbizgÎ . Click here for more information on printing fonts with extended ASCII characters or use our font automation tools.
Calculating Character Set C:
The following table is an example of how to obtain the check character for the number "667390" using Code 128 character set C. First we have to interleave the numbers into pairs and then choose the appropriate character that represents the number pair.
Start C | 66 | 73 | 90 | STOP | |
weighting | 1 | 2 | 3 | ||
values | 105 | 66 | 73 | 90 | |
totals | 105 | 66 | 146 | 270 |
Therefore to print the data "667390" as a barcode, you would need to type: ALT 0205, b, i, z, h, ALT 0206 or ÍbizhÎ . Click here for more information on printing fonts with extended ASCII characters or use our font automation tools.
Switching Between Character Sets:
It is possible to switch between character sets in a single Code 128 barcode symbol. Although character set B can encode text and numbers, you may want to switch to set A to encode a function such as a tab or carriage return.
The following table is an example of how to encode the data "biz" using Code 128 character set B with a switch to character set A for a carriage return function.
Start B | b | i | z | É | m | STOP | |
weighting | 1 | 2 | 3 | 4 | 5 | ||
values | 104 | 66 | 73 | 90 | 101 | 77 | |
totals | 104 | 66 | 146 | 270 | 404 | 385 |
This type of switching between character sets is also compatible with our font automation tools. For example, if you specify the data bizÉm ( É is the switch to set A and m is the function according to the chart) as the input for the Code 128 B function, the data ÌbizÉmDÎ would be returned which would perform the switch to set A and the function of a return when printed with our font and scanned by a barcode scanner.
Source Code for a Code 128 Application |
The following Visual Basic, ANSI C and Java Source Code is used to print a Code 128 B barcode and calculate the check character. You may use this code in your application as long as the copyright notice is not removed. If you plan to test this code you must install the appropriate font.
The X dimension (X is the width of the narrow bar) is listed below for various point sizes.
Our Code 128 fonts have been specially designed to be able to produce dependable and scannable barcodes when printed at large and small point sizes. With a 600 DPI laser printer, the Code 128 font can be printed as small as 6 points if the scanner supports reading it. Printed with a HP Laserjet at 600 DPI, we have been able to dependably scan our Code 128 font printed at 6 points with the Intermec CCD scanner we sell for $219 at our IDAutomation.com site. Excluding the start and stop characters, you can achieve slightly more than 20 CPI print density when printing at 6 points. Keep in mind though, the Code 128 fonts should be printed at 12 points or larger for open systems.
Point Size |
Approximate X dimension | |
48 | .85 mm | .032" |
36 | .63 mm | .024" |
24 | .42 mm | .016" |
16 | .28 mm | .011" |
12 | .21 mm | .008" |
8 | .14 mm | .006" |
6 | .105 mm | .004" |
Installation Instructions |
For the most up to date installation procedures for Macintosh, UNIX and other operating systems please visit our Technical Support Site.
To install the Code 128 barcode font in Windows:
If you have any questions or need assistance, please contact us.
Copyright © IDAutomation.com, Inc. 2000. All trademarks are the property of their respective owners.
|
>