Code 128 - Biblioteka.sk

Upozornenie: Prezeranie týchto stránok je určené len pre návštevníkov nad 18 rokov!
Zásady ochrany osobných údajov.
Používaním tohto webu súhlasíte s uchovávaním cookies, ktoré slúžia na poskytovanie služieb, nastavenie reklám a analýzu návštevnosti. OK, súhlasím


Panta Rhei Doprava Zadarmo
...
...


A | B | C | D | E | F | G | H | CH | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

Code 128
 ...
A Swiss postal barcode encoding "RI 476 394 652 CH" in Code 128 (B & C)

Code 128 is a high-density linear barcode symbology defined in ISO/IEC 15417:2007.[1] 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.[citation needed] It generally results in more compact barcodes compared to other methods like Code 39, especially when the texts contain mostly digits. Code 128 was developed by the Computer Identics Corporation in 1981.[2]

A GS1-128 barcode encoding GTIN, best before date and batch number

GS1-128 (formerly known as UCC/EAN-128) is a subset of Code 128 and is used extensively worldwide in shipping and packaging industries as a product identification code for the container and pallet levels in the supply chain.

Specification

"Code 459
Schematic of a barcode (Code 128B).
1:quiet zone, 2:Start Code B, 3:data, 4:checksum, 5:stop

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

The check symbol is calculated from a weighted sum (modulo 103) of all the symbols.

Subtypes

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. The shifts are done using code points 98 and 99 in code sets A and B, 100 in code sets A and C and 101 in code sets B and C to switch between them):

  • 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.

Start/stop and bar widths

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.

There are 108 possible 11-unit wide symbols, and the code uses all possible symbols. Two of the symbols are used for stop (end-of-barcode) indication, stop and reverse stop. The two stop symbols are special because they are always followed by a 2-unit bar, forming a 13-unit long stop pattern. 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).

Check digit calculation

The check digit is a weighted modulo-103 checksum. It is calculated by summing the start code 'value' to the products of each symbol's 'value' multiplied by its position's weight in the barcode string. The start symbol and first encoded symbol are in position 1. The sum of the products is then reduced modulo 103. 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.

For example, in the following table, the code 128 variant A checksum value is calculated for the alphanumeric string PJJ123C:

Code Value Weight Value × Weight
Start Code A 103 (1) 103
P 48 1 48
J 42 2 84
J 42 3 126
1 17 4 68
2 18 5 90
3 19 6 114
C 35 7 245
Sum 878
Remainder mod 103 54

So the value 54, which equals a V, is appended, then followed by the Stop code.

For 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.

Using FNC4 to encode high (160–255) characters

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.[3]

When a single 'FNC4' is present in a string, the following symbol is read like ASCII, but the value is incremented by +128, thus taking the higher range of the ISO-8859-1 table. If the following symbol is a 'SHIFT', then a second symbol will be used to obtain the character.

If two consecutive 'FNC4' characters are used, all following data characters are extended ASCII characters until two further consecutive 'FNC4' characters are encountered or the end of the symbol is reached. If during this sequence of extended encodation a single 'FNC4' character is encountered it is used to revert to standard ASCII encodation for the next data character only. 'SHIFT' and character subset characters shall have their normal effect during such a sequence.[4]

From Code 128A you can reach Latin-1 special characters from 160 (hex A0, non breaking space) up to 223 (hex DF, ß) via FNC4. The lower case characters from 224 (hex E0, à) to 254 (hex FE, þ) are available by FNC4+SHIFT B. The characters ÷ (247, hex F7) and ÿ (255, hex FF) are not available.

The feature is not available for GS1-128.[5][6] Since the support of Code 128 Type B (and C) is not very common, it might be easier to use a QR Code instead for characters from the ISO-8859-1 code range.

Bar code widths

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
Value Hex value 128A 128B 128C Font position
(Common/Uncommon/Barcodesoft)
Bar/Space
Code Latin-1 Pattern Widths
0 00 space space 00 32 or 194 or 207 / 212 / 252 or  or Ï / Ô / ü 11011001100 212222
1 01 ! ! 01 33 ! 11001101100 222122
2 02 " " 02 34 " 11001100110 222221
3 03 # # 03 35 # 10010011000 121223
4 04 $ $ 04 36 $ 10010001100 121322
5 05 % % 05 37 % 10001001100 131222
6 06 & & 06 38 & 10011001000 122213
7 07 ' ' 07 39 ' 10011000100 122312
8 08 ( ( 08 40 ( 10001100100 132212
9 09 ) ) 09 41 ) 11001001000 221213
10 0a * * 10 42 * 11001000100 221312
11 0b + + 11 43 + 11000100100 231212
12 0c , , 12 44 , 10110011100 112232
13 0d - - 13 45 - 10011011100 122132
14 0e . . 14 46 . 10011001110 122231
15 0f / / 15 47 / 10111001100 113222
16 10 0 0 16 48 0 10011101100 123122
17 11 1 1 17 49 1 10011100110 123221
18 12 2 2 18 50 2 11001110010 223211
19 13 3 3 19 51 3 11001011100 221132
20 14 4 4 20 52 4 11001001110 221231
21 15 5 5 21 53 5 11011100100 213212
22 16 6 6 22 54 6 11001110100 223112
23 17 7 7 23 55 7 11101101110 312131
24 18 8 8 24 56 8 11101001100 311222
25 19 9 9 25 57 9 11100101100 321122
26 1a : : 26 58 : 11100100110 321221
27 1b ; ; 27 59 ; 11101100100 312212
28 1c < < 28 60 < 11100110100 322112
29 1d = = 29 Zdroj:https://en.wikipedia.org?pojem=Code_128
Text je dostupný za podmienok Creative Commons Attribution/Share-Alike License 3.0 Unported; prípadne za ďalších podmienok. Podrobnejšie informácie nájdete na stránke Podmienky použitia.






Text je dostupný za podmienok Creative Commons Attribution/Share-Alike License 3.0 Unported; prípadne za ďalších podmienok.
Podrobnejšie informácie nájdete na stránke Podmienky použitia.

Your browser doesn’t support the object tag.

www.astronomia.sk | www.biologia.sk | www.botanika.sk | www.dejiny.sk | www.economy.sk | www.elektrotechnika.sk | www.estetika.sk | www.farmakologia.sk | www.filozofia.sk | Fyzika | www.futurologia.sk | www.genetika.sk | www.chemia.sk | www.lingvistika.sk | www.politologia.sk | www.psychologia.sk | www.sexuologia.sk | www.sociologia.sk | www.veda.sk I www.zoologia.sk