1、BRITISH STANDARD BS ISO/IEC 15417:2007 Information technology Automatic identification and data capture techniques Code 128 bar code symbology specification ICS 01.080.50; 35.040 BS ISO/IEC 15417:2007 This British Standard was published under the authority of the Standards Policy and Strategy Commit
2、tee on 29 June 2007 BSI 2007 ISBN 978 0 580 56258 7 National foreword This British Standard was published by BSI. It is the UK implementation of ISO/IEC 15417:2007. It supersedes BS ISO/IEC 15417:2000 which is withdrawn. The UK participation in its preparation was entrusted to Technical Committee IS
3、T/34, Automatic identification and data capture techniques. A list of organizations represented on this committee can be obtained on request to its secretary. This publication does not purport to include all the necessary provisions of a contract. Users are responsible for its correct application. C
4、ompliance with a British Standard cannot confer immunity from legal obligations. Amendments issued since publication Amd. No. Date Comments Reference number ISO/IEC 15417:2007(E)INTERNATIONAL STANDARD ISO/IEC 15417 Second edition 2007-06-01 Information technology Automatic identification and data ca
5、pture techniques Code 128 bar code symbology specification Technologies de linformation Techniques didentification automatique et de capture des donnes Spcifications des symbologies des codes barres, code 128 BS ISO/IEC 15417:2007ii iii Contents Page Foreword iv Introduction v 1 Scope . 1 2 Normativ
6、e references . 1 3 Terms and definitions. 1 4 Requirements 2 Annex A (normative) Additional features of Code 128. 15 Annex B (normative) Special considerations relating to Function Code 1 (FNC1). 16 Annex C (normative) Symbology identifiers . 18 Annex D (informative) Relationship of symbol character
7、 value to ASCII value. 19 Annex E (informative) Use of Start, Code Set and Shift characters to minimize symbol width. 20 Annex F (informative) ISO/IEC 8859-1 (Latin Alphabet no. 1) character set. 21 Annex G (informative) User-defined application parameters 22 Annex H (informative) Guidelines for the
8、 use of Code 128 23 Bibliography . 25 BS ISO/IEC 15417:2007iv Foreword ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwide standardization. National bodies that are members of ISO or IEC participat
9、e in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technical activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations, governmental and
10、 non-governmental, in liaison with ISO and IEC, also take part in the work. In the field of information technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1. International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2. The m
11、ain task of the joint technical committee is to prepare International Standards. Draft International Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an International Standard requires approval by at least 75 % of the national bodies cas
12、ting a vote. Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. ISO/IEC 15417 was prepared by Joint Technical Committee ISO/IEC JTC 1, Informati
13、on technology, Subcommittee SC 31, Automatic identification and data capture techniques. This second edition cancels and replaces the first edition (ISO/IEC 15417:2000), which has been technically revised. BS ISO/IEC 15417:2007v Introduction The technology of bar coding is based on the recognition o
14、f patterns encoded in bars and spaces of defined dimensions. There are numerous methods of encoding information in bar code form, known as symbologies. Code 128 is one such symbology. The rules defining the translation of characters into bar and space patterns, and other essential features of each s
15、ymbology, are known as the symbology specification. In the past, symbology specifications were developed and published by a number of organizations, resulting in certain instances in conflicting requirements for certain symbologies. Manufacturers of bar code equipment and users of bar code technolog
16、y require publicly available standard symbology specifications to which they can refer when developing equipment and software. BS ISO/IEC 15417:2007 blank1 Information technology Automatic identification and data capture techniques Code 128 bar code symbology specification 1 Scope This International
17、 Standard specifies the requirements for the bar code symbology known as Code 128. It specifies Code 128 symbology characteristics, data character encodation, dimensions, decoding algorithms and the parameters to be defined by applications. It specifies the symbology identifier prefix strings for Co
18、de 128 symbols. 2 Normative references The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies. ISO/IEC 64
19、6:1991, Information technology ISO 7-bit coded character set for information interchange ISO/IEC 8859-1, Information technology 8-bit single-byte coded graphic character sets Part 1: Latin alphabet No. 1 ISO/IEC 15416, Information technology Automatic identification and data capture techniques Bar c
20、ode print quality test specification Linear symbols ISO/IEC 15424, Information technology Automatic identification and data capture techniques Data Carrier Identifiers (including Symbology Identifiers) ISO/IEC 19762-1, Information technology Automatic identification and data capture (AIDC) technique
21、s Harmonized vocabulary Part 1: General terms relating to AIDC ISO/IEC 19762-2, Information technology Automatic identification and data capture (AIDC) techniques Harmonized vocabulary Part 2: Optically readable media (ORM) 3 Terms and definitions For the purposes of this document, the terms and def
22、initions given in ISO/IEC 19762-1 and ISO/IEC 19762-2 apply. BS ISO/IEC 15417:20072 4 Requirements 4.1 Symbology characteristics The characteristics of Code 128 are as follows. a) Encodable character set: 1) All 128 ISO/IEC 646 characters, i.e. characters 0 to 127 inclusive, in accordance with ISO/I
23、EC 646. NOTE This version consists of the G0 set of ISO/IEC 646 and the C0 set of ISO/IEC 6429 with values 28 31 modified to FS, GS, RS and US respectively. 2) Characters with byte values 128 to 255 may also be encoded. 3) 4 non-data function characters. 4) 4 code set selection characters. 5) 3 Star
24、t characters. 6) 1 Stop character. b) Code type: Continuous. c) Elements per symbol character: 6, comprising 3 bars and 3 spaces, each of 1, 2, 3 or 4 modules in width (Stop character: 7 elements comprising 4 bars and 3 spaces). d) Character self-checking: Yes. e) Symbol length: Variable. f) Bidirec
25、tionally decodable: Yes. g) Symbol check character: One, mandatory (see A.1). h) Data character density: 11 modules per symbol character (5,5 modules per numeric character). i) Non-data overhead: Equivalent to 35 modules. 4.2 Symbol structure Code 128 symbols shall comprise a) a leading quiet zone,
26、b) a Start character, c) one or more characters representing data and special characters, d) a symbol check character, e) a Stop character, f) a trailing quiet zone. Figure 1 illustrates a Code 128 symbol encoding the text “AIM”. BS ISO/IEC 15417:20073 Quiet zone Start char. Data characters Symbol S
27、top char. Quiet Zone check char. AIMFigure 1 Code 128 symbol 4.3 Character encodation 4.3.1 Symbol character structure Each symbol character comprises six elements (three bars and three spaces arranged alternately from left to right, commencing with a bar), each of which is 1, 2, 3 or 4 modules wide
28、, with a total width of 11 modules. The sum of the bar modules in any symbol character is always even (even parity) and that of the space modules is therefore always odd. This parity feature enables character self-checking to be carried out. The Stop character comprises an additional bar element two
29、 modules wide making its total width 13 modules. Each symbol character is assigned a numeric value listed in Table 1. This value is used in calculating the symbol check character value. It may also be used to provide a conversion to and from ISO/IEC 646 values (see Annex D). Table 1 defines all the
30、Code 128 character assignments. In the column headed Element Widths the numeric values represent the widths of the elements in modules or multiples of the X dimension. Figure 2 below illustrates Start character A. 1 2 3 4 5 6 7 8 9 10 11 2 1 1 4 1 2 Figure 2 Code 128 Start character A Figure 3 below
31、 illustrates the encodation of the symbol character value 35, which represents data character C in Code Sets A or B or the two digits 35 in Code Set C. 1 2 3 4 5 6 7 8 9 10 11 1 3 1 3 2 1 Figure 3 Code 128 symbol character value 35 BS ISO/IEC 15417:20074 Figure 4 below illustrates the Stop character
32、. 1 2 3 4 5 6 7 8 9 10 11 12 13 2 3 3 111 2 Figure 4 Code 128 Stop character 4.3.2 Data character encodation Code 128 has three unique data character code sets shown in Table 1 as Code Sets A, B, and C, each comprising a subset of the ISO/IEC 646 IRV character set together with various auxiliary cha
33、racters. The symbol character bar and space patterns shown represent the data characters listed in the columns for Code Set A, B, or C. The choice of code set depends on the Start character or, within the symbol, on the use of Code A, Code B or Code C characters or the Shift character. If the symbol
34、 begins with Start character A, then Code Set A is defined initially. Code Set B and Code Set C are similarly defined by beginning the symbol with Start character B or C respectively. The code set can be redefined within the symbol by the use of Code A, Code B, and Code C characters or the Shift cha
35、racter (see 4.3.4.1 for the use of these special characters). The same data may be represented by different Code 128 symbols, through the use of different combinations of Start, Code Set, and Shift characters. An application should not specify the code set to be used. Annex E contains rules to minim
36、ize the length of the symbol for any given data. A decoder shall in addition decode symbols which use valid combinations of Start, Code Set, and Shift characters and data other than that derived from the application of the algorithm in Annex E, such as a symbol with a code set or Shift character at
37、the end of the data. Table 1 Code 128 character encodation SYMBOL CHAR. VALUE CODE SET A ISO/IEC 646 VALUE for Set A CODE SET B ISO/IEC 646 VALUE for Set B CODE SET C ELEMENT WIDTHS (modules) ELEMENT PATTERN B S B S B S 1 2 3 4 5 6 7 8 9 10 11 0 space 32 space 32 00 212222 1 ! 33 ! 33 01 222122 2 “
38、34 “ 34 02 222221 3 # 35 # 35 03 121223 4 $ 36 $ 36 04 121322 5 % 37 % 37 05 131222 6 & 38 & 38 06 122213 7 apos- trophe 39 apos- trophe 39 07 122312 8 ( 40 ( 40 08 132212 9 ) 41 ) 41 09 221213 10 * 42 * 42 10 221312 11 + 43 + 43 11 231212 12 comma 44 comma 44 12 112232 13 - 45 - 45 13 122132 14 ful
39、l stop 46 full stop 46 14 122231 15 / 47 / 47 15 113222 BS ISO/IEC 15417:20075 SYMBOL CHAR. VALUE CODE SET A ISO/IEC 646 VALUE for Set A CODE SET B ISO/IEC 646 VALUE for Set B CODE SET C ELEMENT WIDTHS (modules) ELEMENT PATTERN B S B S B S 1 2 3 4 5 6 7 8 9 10 11 16 0 48 0 48 16 123122 17 1 49 1 49
40、17 123221 18 2 50 2 50 18 223211 19 3 51 3 51 19 221132 20 4 52 4 52 20 221231 21 5 53 5 53 21 213212 22 6 54 6 54 22 223112 23 7 55 7 55 23 312131 24 8 56 8 56 24 311222 25 9 57 9 57 25 321122 26 colon 58 colon 58 26 321221 27 semi- colon 59 semi- colon 59 27 312212 28 62 62 30 212123 31 ? 63 ? 63
41、31 212321 32 64 64 32 232121 33 A 65 A 65 33 111323 34 B 66 B 66 34 131123 35 C 67 C 67 35 131321 36 D 68 D 68 36 112313 37 E 69 E 69 37 132113 38 F 70 F 70 38 132311 39 G 71 G 71 39 211313 40 H 72 H 72 40 231113 41 I 73 I 73 41 231311 42 J 74 J 74 42 112133 43 K 75 K 75 43 112331 44 L 76 L 76 44 13
42、2131 45 M 77 M 77 45 113123 46 N 78 N 78 46 113321 47 O 79 O 79 47 133121 48 P 80 P 80 48 313121 49 Q 81 Q 81 49 211331 50 R 82 R 82 50 231131 51 S 83 S 83 51 213113 52 T 84 T 84 52 213311 53 U 85 U 85 53 213131 54 V 86 V 86 54 311123 55 W 87 W 87 55 311321 56 X 88 X 88 56 331121 57 Y 89 Y 89 57 312
43、113 58 Z 90 Z 90 58 312311 59 91 91 59 332111 BS ISO/IEC 15417:20076 SYMBOL CHAR. VALUE CODE SET A ISO/IEC 646 VALUE for Set A CODE SET B ISO/IEC 646 VALUE for Set B CODE SET C ELEMENT WIDTHS (modules) ELEMENT PATTERN B S B S B S 1 2 3 4 5 6 7 8 9 10 11 60 92 92 60 314111 61 93 93 61 221411 62 94 94
44、 62 431111 63 _ 95 _ 95 63 111224 64 NUL 00 grave accent 96 64 111422 65 SOH 01 a 97 65 121124 66 STX 02 b 98 66 121421 67 ETX 03 c 99 67 141122 68 EOT 04 d 100 68 141221 69 ENQ 05 e 101 69 112214 70 ACK 06 f 102 70 112412 71 BEL 07 g 103 71 122114 72 BS 08 h 104 72 122411 73 HT 09 i 105 73 142112 7
45、4 LF 10 j 106 74 142211 75 VT 11 k 107 75 241211 76 FF 12 l 108 76 221114 77 CR 13 m 109 77 413111 78 SO 14 n 110 78 241112 79 SI 15 o 111 79 134111 80 DLE 16 p 112 80 111242 81 DC1 17 q 113 81 121142 82 DC2 18 r 114 82 121241 83 DC3 19 s 115 83 114212 84 DC4 20 t 116 84 124112 85 NAK 21 u 117 85 12
46、4211 86 SYN 22 v 118 86 411212 87 ETB 23 w 119 87 421112 88 CAN 24 x 120 88 421211 89 EM 25 y 121 89 212141 90 SUB 26 z 122 90 214121 91 ESC 27 123 91 412121 92 FS 28 | 124 92 111143 93 GS 29 125 93 111341 94 RS 30 126 94 131141 95 US 31 DEL 127 95 114113 96 FNC3 FNC3 96 114311 97 FNC2 FNC2 97 41111
47、3 98 SHIFT SHIFT 98 411311 99 CODE C CODE C 99 113141 100 CODE B FNC4 CODE B 114131 BS ISO/IEC 15417:20077 SYMBOL CHAR. VALUE CODE SET A ISO/IEC 646 VALUE for Set A CODE SET B ISO/IEC 646 VALUE for Set B CODE SET C ELEMENT WIDTHS (modules) ELEMENT PATTERN B S B S B S 1 2 3 4 5 6 7 8 9 10 11 101 FNC4
48、 CODE A CODE A 311141 102 FNC1 FNC1 FNC1 411131 103 Start A 211412 104 Start B 211214 105 Start C 211232 SYMBOL CHAR. VALUE CODE SET A CODE SET B CODE SET C ELEMENT WIDTHS (modules) ELEMENT PATTERN B S B S B S B 1 2 3 4 5 6 7 8 9 10 11 12 13 - Stop 2 3 3 1 1 1 2 NOTE The Stop character comprises 13 modules in four bars and three spaces. Every other character is 11 modules wide, starts with a bar and ends with a space and comprises six elements, each of which varies fro