products & services <
supported printers <
contact us <
|Products and Services|
Solutions available: Windows stand-alone font, Windows font + encoder, AFP, Xerox, PCL, and bespoke solutions.
Or, alternatively, email firstname.lastname@example.org with your requirements and we will find a solution for you.
Code 128 specification
The Code 128 character set is composed of:
The six elements which make up a single barcode character each consist of three blanks and three spaces (except for the stop character which is built up of four bars and three spaces). The ratio between the four element widths (bars or spaces) is 1:2, 1:3 and 1:4. Each Code 128 character consists of 11 modules, where a module is the narrowest element width. So if the narrowest element width is '1' then the widths of the other elements are 2, 3 and 4, and the overall width of a character (in pixels) is 11. If the narrowest module is '2' then the widths of the other elements are 4, 6, and 8 and the overall width of the character (in pixels) is 22, and so on.
Three character sets (A, B and C) are needed to enable all 128 ASCII characters and the double density digits to be printed. It is important to note that the font itself does not contain three different sets of characters - the font only contains one set of characters. The change between character sets occurs in the barcode reader by selecting different Start characters or Shift characters within the font, and this causes the barcode reader to switch between character sets.
In double-density mode (Character Set C), each Code 128 character represents a pair of digits. For instance, the two digits '1' and '2' in Code 128 C become a single character '12'. Therefore, you should have an even number of digits in your numeric fields.
Special control characters can be used within the barcode symbol to switch from one character set to another. This enables users to employ all the ASCII characters (character set A or B), and also to utilise the double-density representation by Character Set C.
Each barcode symbol operates with two self-check facilities which function independently of one another. One self-check function works by comparing the number of modules in the bars and spaces to ensure that they agree; the second using a check digit calculated using Modulo 103.
Character Sets A, B and C
Character Set B also contains all the standard upper case and lower case alphanumeric keyboard characters and special characters.
Character Set C is composed of 100 pairs of digits from 00 to 99, and special characters. This enables numeric-only data to be represented with twice the density.
It is possible to switch from one character set to another within a barcode symbol. This switch is initiated using special code characters and shift characters. The code characters enable users to initiate a switch in character sets, which then applies to all subsequent characters in the barcode symbol. When the Shift character is used, the change only applies to the next character. Function characters (FNCs) define commands which are transferred to the barcode reader, instructing the device to execute special actions or applications.
The complete barcode symbol consists of a quiet zone, a start character, the data string, a check digit, the stop character and a trailing quiet zone. The check digit is calculated using Modulo 103.
Encoding the Symbol
Example data 1234567890
Because our example string is numbers only, we can take advantage of Code 128's double-density feature by using Character Set C - pairs of digits.
The 10 individual numbers in the example must be turned into pairs of digits. Each digit pair must then be translated to its correct position in the barcode font using the character arrangement table.
The final string should look like this:
Modulo 103 Check Digit
The check digit is calculated using the VALUE defined for every Code 128 character (see Character Arrangement Table). This is done by summing the Start Code value plus the product of each character position (most significant character position equals 1) and the character value of the character in that position. The sum of all these is divided by 103. The remainder of the answer is the value of the Check Digit (which can be looked up from the table). Every encoded character is included except the Stop and Check Digit.
Character Arrangement Tables