条码规范——Code 39
来源:互联网 发布:威露士滴露哪个好 知乎 编辑:程序博客网 时间:2024/06/07 18:15
CODE 39 BACKGROUND INFORMATION
Code 39, the first alpha-numeric symbology to be developed, is still widely used-especially in non-retail environments. It is the standard bar code used by the United States Department of Defense, and is also used by the Health Industry Bar Code Council (HIBCC). Code 39 is also known as "3 of 9 Code" and "USD-3".A typical Code 39 bar code is:
Code 39 is a discrete, variable-length symbology. It is self-checking in that a single print defect cannot transpose one character into another valid character.
COMPUTING THE CHECKSUM DIGIT
Since Code 39 is self-checking, a check digit normally isn't necessary. However, in applications that require an extremely high level of accuracy a modulo 43 checksum digit may be added.To calculate the optional checksum digit, follow the following steps.
- Take the value (0 through 42) of each character in the bar code. The start and stop characters are not included in the checksum calculation.
- Sum the value of each of the values of each of the characters described in step 1.
- Divide the result from step 2 by 43.
- The remainder from the division in step 3 is the checksum character that will be appended to the data message before the stop character.
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 39 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 39 BARCODE
A Code 39 bar code has the following structure:- A start character - the asterisk (*) character.
- Any number of characters encoded from the table below.
- An optional checksum digit calculated as described above and encoded from the table below.
- A stop character, which is a second asterisk character.
CODE 39 ENCODING TABLE
This table indicates how to encode each digit of a Code 39 bar code. Note that the "Width Encoding" column is expressed as "N" for narrow and "W" for wide while the "Barcode Encoding" column represents how the bar code will actually be encoded as described above in "Encoding the Symbol."Keep in mind that each character begins and ends with a bar, thus the "bar code encoding" always starts and ends with a "1".
VALUEASCII
CHARWIDTH
ENCODINGBARCODE
ENCODINGCHECK
VALUEASCII
CHARWIDTH
ENCODINGBARCODE
ENCODING00NNNWWNWNN10100110110122MWNWNNNNWN11011010100111WNNWNNNNW11010010101123NNNNNWNNWW10101101001122NNWWNNNNW10110010101124OWNNNWNNWN11010110100133WNWWNNNNN11011001010125PNNWNWNNWN10110110100144NNNWWNNNW10100110101126QNNNNNNWWW10101011001155WNNWWNNNN11010011010127RWNNNNNWWN11010101100166NNWWWNNNN10110011010128SNNWNNNWWN10110101100177NNNWNNWNW10100101101129TNNNNWNWWN10101101100188WNNWNNWNN11010010110130UWWNNNNNNW11001010101199NNWWNNWNN10110010110131VNWWNNNNNW10011010101110ANNWWNNWNN11010100101132WWWWNNNNNN11001101010111BNNWNNWNNW10110100101133XNWNNWNNNW10010110101112CWNWNNWNNN11011010010134YWWNNWNNNN11001011010113DNNNNWWNNW10101100101135ZNWWNWNNNN10011011010114EWNNNWWNNN11010110010136-NWNNNNWNW10010101101115FNNWNWWNNN10110110010137.WWNNNNWNN11001010110116GNNNNNWWNW10101001101138SPACENWWNNNWNN10011010110117HWNNNNWWNN11010100110139$NWNWNWNNN10010010010118INNWNNWWNN10110100110140/NWNWNNNWN10010010100119JNNNNWWWNN10101100110141+NWNNNWNWN10010100100120KWNNNNNNWW11010101001142%NNNWNWNWN10100100100121LNNWNNNNWW101101010011n/a*NWNNWNWNN100101101101
If a Code 39 bar code starts with a space, that bar code will be appended to any previous code 39 bar code in the buffer and the system will wait for additional bar code(s). If a Code 39 bar code doesn't start with a space, the bar code will be appended to any previous code 39 bar codes and the entire message will be delivered to the application.
In other words, if a code 39 bar code has additional bar codes to follow, it must start with a space-if the bar code is the last bar code in the message it must not start with a space.
CODE 39 ENCODING EXAMPLE
We will now code the example we used above, TEST8052. In this case we will not use a check digit.- The START character (*): 100101101101.
- The digit "T": enocded as 101011011001.
- The digit "E": enocded as 110101100101.
- The digit "S": enocded as 101101011001.
- The digit "T": enocded as 101011011001.
- The digit "8": enocded as 110100101101.
- The digit "0": enocded as 101001101101.
- The digit "5": enocded as 110100110101.
- The digit "2": enocded as 101100101011.
- The STOP character (*): 100101101101.
- NOTE: In the above encoding example note that there is an inter-character space between each character. This is not listed in the list of 10 components, but there is an inter-character space between each character. This inter-character space is represented in the graphic by the white space separating the grey areas.
EXTENDED CODE 39 ENCODING TABLE
It is possible, using Code 39'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.- 条码规范——Code 39
- 条码规范——Code 93
- 条码规范——Code 128
- 条码规范——EAN13
- CODE 39 条码生成
- 条码技术(CODE 39编码)
- 二维条码 QR Code
- HTML5+规范:barcode(条码扫描)
- HTML5+规范:barcode(条码扫描)
- CODE 128 条码生成方法
- 条码编码方式-----Code 39与code 128条形码的区别
- QR code(Quick Response Code)二维条码
- CODE 128 条码打印类 实现条码打印、显示
- 以 .NET 创建 Code 39 条码图片 供水晶报表打印
- 以 .NET 创建 Code 39 条码图片 供水晶报表打印
- (转)以 .NET 创建 Code 39 条码图片 供水晶报表打印
- 二维条码 QR code 的解码
- 写code的规范
- Ubuntu安装Protocol Buffer
- Tomcat设置Sqlserver连接池
- 鼠标右键添加快捷方式
- 一个简单的异步操作
- Ubuntu安装FlatBuffers
- 条码规范——Code 39
- ML for trading -cs7646-02
- exit和return
- Struts2拦截器精解
- 转载的开源干货
- 设计模式-观察者模式
- 【怎样写代码】函数式编程 -- Lambda表达式(二):C#常用委托
- top命令详解
- Android 7.1 源码编译