条码规范——Code 93

CODE 93 BACKGROUND INFORMATION
Code 93 was designed to complement and improve upon  Code 39 . Code 93 is similar in that it, like Code 39, can represent the full ASCII character set by using combinations of 2 characters. It differs in that Code 93 is a continuous symbology and produces denser code. It also encodes 47 characters compared to Code 39's 43 characters.

A typical Code 93 bar code is:

Code 93 is a continous, variable-length symbology.

COMPUTING THE CHECKSUM DIGIT
Code 93 always includes two check characters which are referred to as "C" and "K". These two check characters immediately follow the encoded message itself and immediately precede the final stop character.

The "C" checksum character is the modulo 47 remainder of the sum of the weighted value of the data characters. The weighting value starts at "1" for the right-most data character, 2 for the second to last, 3 for the third-to-last, and so on up to 20. After 20, the sequence wraps around back to 1. In the above example (TEST93), the "C" checksum would be calculated as follows:

  • DATATEST93
    VALUE2914282993
    WEIGHT654321
    WEIGHTED SUM1747011287183

Thus the sum of the individual weighted sums is 174 + 70 + 112 + 87 + 18 + 3 = 464. Modulo 47 gives a value of 9 with remainder 41. The value 41 is associated with the plus (+) sign, so the "C" check character would be encoded using the plus symbol encodation from the table below.

The "K" checksum character is calculated in basically the same way except that the weighting goes from 1 to 15. Also, the right-most character is now the "C" checksum character which was calculated in the step above.

  • DATATEST93+
    VALUE291428299341
    WEIGHT7654321
    WEIGHTED SUM2038414011627641

Thus the sum of the individual weighted sums is 203 + 84 + 140 + 116 + 27 + 6 + 41 = 617. Modulo 47 gives us a value of 13 with a remainder of 6. The value 6 is associated with the ASCII character "6", so the "K" check character would be encoded using the "6" symbol encodation from the table below.

ENCODING THE SYMBOL
Once the checksum digit has been calculated we know the entire message which must be encoded in the bars and spaces. Continuing with our example, we will encode, from zero, the Code 93 bar code we used in our example above: HI345678with a checksum digit of 67.

In the following text, we will discuss the encoding of the bar code by considering that the number "1" represents a "dark" or "bar" section of the bar code whereas a "0" represents a "light" or "space" section of the bar code. Thus the numbers 1101 represents a double-wide bar (11), followed by a single-wide space (0), followed by a single-wide bar (1). This would be printed in the bar code as:


STRUCTURE OF A CODE 93 BARCODE
A Code 93 bar code has the following structure:

  1. A start character , represented below by the asterisk (*) character.
  2. Any number of characters encoded from the table below.
  3. The "C" and "K" checksum digits calculated as described above and encoded using the table below.
  4. A stop character, which is a second asterisk character.
CODE 93 ENCODING TABLE
VALUECHARACTERENCODINGVALUECHARACTERENCODING
0010001010024O100101100
1110100100025P100010110
2210100010026Q110110100
3310100001027R110110010
4410010100028S110101100
5510010010029T110100110
6610010001030U110010110
7710101000031V110011010
8810001001032W101101100
9910000101033X101100110
10A11010100034Y100110110
11B11010010035Z100111010
12C11010001036-100101110
13D11001010037.111010100
14E11001001038SPACE111010010
15F11000101039$111001010
16G10110100040/101101110
17H10110010041+101110110
18I10110001042%110101110
19J10011010043($)100100110
20K10001101044(%)111011010
21L10101100045(/)111010110
22M10100110046(+)100110010
23N101000110-* Start/Stop101011110

Note that the characters ($), (%), (/), and (+) are special characters that are used to encode all 128 ASCII characters using Code 93's Full ASCII mode.

In Code 39, four of the characters ($, %, /, and +) are used to optionally encode all 128 characters-but there is no way to know whether those characters are being used as shift characters in Full ASCII mode or whether they are being used to represent $, %, /, and +. In Code 93 this problem is solved by reserving these four special characters exclusively to "shift" into Full ASCII mode.

CODE 93 ENCODING EXAMPLE
We will now code the example we used above, TEST93, plus the two checksum digits we calculated above.

  1. The START character (*): 101011110.
  2. The digit "T": enocded as 110100110.
  3. The digit "E": enocded as 110010010.
  4. The digit "S": enocded as 110101100.
  5. The digit "T": enocded as 110100110.
  6. The digit "9": enocded as 100001010.
  7. The digit "3": enocded as 101000010.
  8. The "C" check digit "+": enocded as 101110110.
  9. The "K" check digit "6": enocded as 100100010.
  10. The STOP character (*): 101011110.
  11. Termination Bar: 1.
This is shown in the following graphical representation where the bar code has been sectioned-off into areas that reflect each of the 10 components just mentioned.

  • NOTE: In the above encoding example note that the last component, the termination bar (#11), follows the last character. This is because all characters, including the STOP character, end with a space-the final termination character is used to "terminate" the last character so that the width of the final space can be determined.

EXTENDED CODE 93 ENCODING TABLE
It is possible, using Code 93's "Full ASCII Mode" to encode all 128 ASCII characters. This is accomplished by using the ($), (/), (%), and (+) symbols as "shift" characters. Those characters combined with the single character that follows indicate which Full ASCII character is to be used.

The Extended Code 93 Encoding Table is identical to the Extended Code 39 Encoding Table except that Code 93 uses its four specialized shift characters ($), (/), (%), and (+) to shift to Full ASCII mode instead of Code 39 which isues the $, /, %, and + characters.

For example, to encode a lowercase B in Code 39, the sequence "+B" is used. In Code 93 the sequence would be encoded as "(+)B" where (+) refers to one of the four special characters that Code 93 can encode that Code 39 can't.

Use the Extended Code 39 Encoding Table for Extended Code 93 encoding, and just remember to use the special characters ($), (/), (%), and (+) whenever the Code 39 Encoding table refers to $, /, %, and +.

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值