Code - 128

 What is Code 128?
  • Code 128 is a high-density linear barcode symbology defined in ISO/IEC 15417:2007. It is used for alphanumeric or numeric-only barcodes. It can encode all 128 characters of ASCII and, by use of an extension symbol (FNC4), the Latin-1 characters defined in ISO/IEC 8859-1.
  •                              Why is idautomation Code 128 a complex barcode?

    • The Code 128 barcode may be complex to use because of the different character sets, which is the primary reason IDAutomation provides the Code 128 auto function, “Code128 ( )”, in several of the Font Tools, Components and Applications.
    •                                Why is Code 128 better than ITF?

      • When CODE-C is used as the start character, one bar pattern can represent 2-digits numbers. This allows very efficient barcode composition. If the barcode data has 12 or more digits, CODE 128 provides smaller size than ITF. Since CODE 128 uses 4 types of bar size, printers with high print quality are required.
      •                                   How many characters can a barcode encode?

        • It can encode all 128 characters of ASCII and, by use of an extension symbol (FNC4), the Latin-1 characters defined in ISO/IEC 8859-1. [citation needed]. It generally results in more compact barcodes compared to other methods like Code 39, especially when the texts contain mostly digits.
        • A Code 128 barcode has seven sections:

          1. Quiet zone
          2. Start symbol
          3. Encoded data
          4. Check symbol (mandatory)
          5. Stop symbol
          6. Final bar (often considered part of the stop symbol)
          7. Quiet zone

          1. Subtype

          Code 128 includes 108 symbols: 103 data symbols, 3 start symbols, and 2 stop symbols. Each symbol consists of three black bars and three white spaces of varying widths. All widths are multiples of a basic "module". Each bar and space is 1 to 4 modules wide, and the symbols are fixed width: the sum of the widths of the three black bars and three white bars is 11 modules.

          The stop pattern is composed of two overlapped symbols and has four bars. The stop pattern permits bidirectional scanning. When the stop pattern is read left-to-right (the usual case), the stop symbol (followed by a 2-module bar) is recognized. When the stop pattern is read right-to-left, the reverse stop symbol (followed by a 2-module bar) is recognized. A scanner seeing the reverse stop symbol then knows it must skip the 2-module bar and read the rest of the barcode in reverse.



        •                                                  Code 128 at a Glance

            • Type: Linear barcode symbology
            • Applications: Warehousing, transport, logistics, retail
            • Character set: Encodes all 128 characters from ASCII set
            • Modes: Control characters, alphanumeric, numeric compaction
            • Check digit: Modulo 103 (not mandatory but recommended)
            • Generators: Stand-alone, barcode fonts, barcode extensions
            • Scanning: CCD / Laser scanners, imagers, scanner apps
            • Printing: Thermal direct, thermal transfer, laser, inkjet, dot-matrix



      • The code set to use is indicated to the scanner by the start symbol or start character. Also available are various mode switching or shift characters to switch from one set to another within a barcode symbol. Usually the sub type selection and switching within a symbol is handled by the barcode software that creates the code.

        For reference we are including the bar patterns of the three start- and the single stop-character here. When using a Code 128 barcode font in Excel or similar applications, the start and stop characters will be mapped to certain character positions; however, the mapping is not standardized and will vary from font to font.

      • Code 128 Auto refers to the automatic selection of the 128 subtype depending on the encoded data. This is performed by the respective barcode software to minimize the size of the code. Code 128 Auto is not a separate version or subset of the code.

      • In principle non-ASCII characters like German umlauts (e.g. "Ä Ö Ü") or accented characters (e.g. "á ñ ò") can be encoded in a Code 128 symbol by using a special character (FNC4), defined for Code 128 A and Code 128 B. However, this feature is not widely supported and cumbersome to use. Using a 2D barcode symbology like QR or Data Matrix with dedicated support for non-ASCII or Unicode data might be a better choice.

      • The barcode software that generates the code will usually calculate the check digit automatically. The check digit can be any character from the code set, including non-printable characters like TAB or EOT. It is therefore not common to append the check character to the readable text under the code, likewise it is usually not transmitted by the scanner with the encoded data

      • Another popular choice to encode alphanumeric characters is Code 39. The biggest advantages of Code 39 is that it can be used without a check digit. On the negative side, the barcode will only natively encode capital characters ("ABC"); small caps ("abc") can be encoded with Code 39 Extended but this code can get very large, as the following example illustrates

      • Code 128 is a good choice for embedding barcodes in your spreadsheet. Applications include catalogs with article numbers, serial numbers or GS1 data points like GTIN or best-before dates. The easiest and most straight forward way of creating Code 128 barcodes in Excel or Google Sheets is with a Code 128 barcode font. 

      • Manually decoding Code 128 is possible, beginning with the start symbol and going forward one character or pair of digits at a time. A Code 128 decoder will also have to take mode switching and shift characters into account. Finally, the validity of the decoded data has to be verified against the Modulo 103 check digit.

      • It is safe to assume that all barcode scanners available today will read Code 128 barcodes. However, there are some pitfalls and caveats when scanning Code 128; see here if you have a Code 128 symbol that can not be scanned.

        With modern smartphones, dedicated apps can be used to scan barcodes like Code 128. Screenshot shows the CoScan app, a PDF and barcode scanner for iPhone that supports all common linear and 2D barcode types. 

      • The Code 128 barcode is a high-density linear symbology that encodes text, numbers, numerous functions and the entire 128 ASCII character set  It is commonly used for several implementations; and is also referred to as ISBT-128, GS1-128, UCC-128, EAN-128 and USS Code 128.

        Code 128 contains 106 different printed barcode patterns. Each printed barcode may have one of three different meanings depending upon which of the character sets are being used, with the availability of three different Code 128 start characters to program the initial character set. Functions are also provided in the barcode symbology to switch between character sets and encode Application Identifiers. The Code 128 barcode may be complex to use because of the different character sets, which is the primary reason IDAutomation provides the Code 128 auto function, “Code128( )”, in several of the Font ToolsComponents, and Applications.

      • IDAutomation provides several font tools, plug-ins, and source code samples that are free to use with IDAutomation barcode fonts, which will automatically format the start, stop and check characters to the barcode fonts. Therefore, the manual calculations described here are rarely necessary.

        The following examples create a barcode with the IDAutomation Code 128 Barcode Fonts in the Latin-1 codepage, which is the default setting in the USA. When the Latin-1 codepage is not being used, or when using a Mac, it is suggested to use the Universal Barcode Font Advantage™, which creates the Code 128 barcode as a font in any codepage and operating system.

      • Code 128 Auto can encode the complete ASCII-character set. This is done by switching between all 3 character sets of Code 128:
        Code 128A: Includes upper case letters and control characters.
        Code 128B: Includes upper and lower case letters.
        Code 128C: Specially optimized for numbers.

      • Code128 specifies a combination of 6 alternating bars and spaces (3 of each) for each symbol. Thus, each symbol begins with a bar and ends with a space. In barcode fonts, the final bar is generally combined with the stop symbol to make a wider stop pattern. The following table details the widths associated with each bar and space for each symbol. The width of each bar or space may be 1, 2, 3 or 4 units (modules). Using the example above, an 'A' would be depicted with the pattern 10100011000, or as widths 111323 in the tables below.

        The widths value is derived by counting the length of each run of 1's then 0's in the pattern, starting from the left. There will always be 6 runs and the lengths of these 6 runs form the Widths value. For example, using the pattern 10100011000, the run lengths are 1 (digit 1), 1 (digit 0), 1 (digit 1), 3 (digit 0), 2 (digit 1), 3 (digit 0). Reporting just the lengths of each run gives 1, 1, 1, 3, 2, 3, thereby producing a widths value of 111323.

      • Code 128 barcodes may be generated by either an outside application to create an image of the barcode, or by a font-based barcode solution. Either solution requires the use of an application or an application add in to calculate the check digit and create the barcode.

      • Code 128 includes 108 symbols: 103 data symbols, 3 start symbols, and 2 stop symbols. Each symbol consists of three black bars and three white spaces of varying widths. All widths are multiples of a basic "module". Each bar and space is 1 to 4 modules wide, and the symbols are fixed width: the sum of the widths of the three black bars and three white bars is 11 modules.

        The stop pattern is composed of two overlapped symbols and has four bars. The stop pattern permits bidirectional scanning. When the stop pattern is read left-to-right (the usual case), the stop symbol (followed by a 2-module bar) is recognized. When the stop pattern is read right-to-left, the reverse stop symbol (followed by a 2-module bar) is recognized. A scanner seeing the reverse stop symbol then knows it must skip the 2-module bar and read the rest of the barcode in reverse.

        Despite its name, Code 128 does not have 128 distinct symbols, so it cannot represent 128 code points directly. To represent all 128 ASCII values, it shifts among three code sets (A, B, C). Together, code sets A and B cover all 128 ASCII characters. Code set C is used to efficiently encode digit strings. The initial subset is selected by using the appropriate start symbol. Within each code set, some of the 103 data code points are reserved for shifting to one of the other two code sets.

        • 128A (Code Set A) – ASCII characters 00 to 95 (0–9, A–Z and control codes), special characters, and FNC 1–4
        • 128B (Code Set B) – ASCII characters 32 to 127 (0–9, A–Z, a–z), special characters, and FNC 1–4
        • 128C (Code Set C) – 00–99 (encodes two digits with a single code point) and FNC1

        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. It is mandatory at the left and right side of the barcode

      • Each symbol in the barcode is composed of three bars and three spaces. 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. 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. A single 1 would be the thinnest line in the bar code. Three 1's in sequence (111) indicates a bar three times as thick as a single 1 bar.






Comments

Popular posts from this blog

Identcode

ITF-14

ISSN