When a single FNC4 is present in a string, the following symbol is converted to ASCII as usual, and then 128 is added to the ASCII value. The feature is not widely supported and is not used in GS1-128.
X BAR SYMBOL CODE CODE
The special symbol FNC4 ("Function 4"), present only in code sets A and B, can be used to encode all the Latin-1 ( ISO-8859-1) characters in a Code 128 barcode. Using FNC4 to encode high (160–255) characters For instance the code set C value "33" and the code set B value "A" are both considered to be a Code 128 value of 33, and the check digit is computed based on the value of 33 times the symbol's position within the barcode. The checksum is computed over the symbol values, without regard for which code set is active at the time. The remainder is then converted back to one of the 103 non-delimiter symbols (following the instructions given below) and appended to the barcode, immediately before the stop symbol.įor example, in the following table, the code 128 variant A checksum value is calculated for the alphanumeric string PJJ123C:įor the purpose of computing the check symbol, the shift and code-switch symbols are treated the same as any other symbol in the bar code. The sum of the products is then reduced modulo 103. The start symbol and first encoded symbol are in position 1. It is calculated by summing the start code 'value' to the products of each symbol's 'value' multiplied by its position in the barcode string. The check digit is a weighted modulo-103 checksum.
Reading the stop pattern left to right is the stop symbol (followed by a 2-unit bar), and reading the stop pattern right to left is the reverse stop symbol (followed by a 2-unit bar). The two stop symbols are special because they are always followed by a 2-unit bar, forming a 13-unit long stop pattern. Two of the symbols are used for stop (end-of-barcode) indication, stop and reverse stop. There are 108 possible 11-unit wide symbols, and the code uses all possible symbols. Three 1's in sequence (111) indicates a bar three times as thick as a single 1 bar. A single 1 would be the thinnest line in the bar code. For instance, encoding the ASCII character "0" can be viewed as 10011101100, where a sequence of 1's is a bar and a sequence of 0's is a space. Each bar or space is 1, 2, 3 or 4 units wide, the sum of the widths of bars must be even (4, 6 or 8 units), the sum of the widths of the spaces must be odd (3, 5 or 7 units), and total 11 units per symbol. It is mandatory at the left and right side of the barcode.Įach symbol in the barcode is composed of three bars and three spaces. The minimum width of the quiet zone to the left and right of the Code 128 is 10x, where x is the minimum width of a module.
Each symbol consists of three black bars and three white spaces of varying widths. The check symbol is calculated from a weighted sum ( modulo 103) of all the symbols.Ĭode 128 includes 108 symbols: 103 data symbols, 3 start symbols, and 2 stop symbols.