Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: How To (Forms, Reports, and more) > Reports and Labels > Technical Documents

Understanding Bar Codes

Scroll Prev Top Next More

A bar code is a series of lines and spaces which represent data. A special set of rules is used to convert data into the lines and spaces of a bar code. This set of rules is called a symbology. There are many different symbologies, some for general purpose use and some for very specific applications. See also Understanding 2D Barcodes.

 

R:BASE for Windows Report Designer includes the built-in component with valid bar codes for the most popular symbologies. They are:

 

Codabar

Code 128

Code 39

EAN-13

EAN-8

FIM A,B,C

IntelligentMail

Interleaved 2 of 5

MSI

PostNet

UPC-A

UPC-E

 

 

Codabar is a variable-length, self-checking (e.g. no check digit) symbology that is primarily used in libraries, blood banks, photo finishing, and overnight delivery air bills. It is sometimes referred to as "Code 2 of 7."

 

Codabar is basically a numeric code, although it also will encode the following symbols-$/.+

 

Codabar utilizes four different start and stop codes, namely A through D. These four characters cannot appear anywhere within the symbol, only at the beginning or end. Every Codabar code must start and end with one of them. Normally, these start and stop codes are used to identify a database that the numeric data is used with. If a given application does not need this granularity, it is common practice to use "A" as the start character and "B" as the stop character.

 

 

Code 128 is an extremely flexible symbology and can be used to create alphanumeric bar codes. It derives its name from the fact that it can represent all 128 ASCII symbols. You have the option to manually encode the data for a Code 128 Bar code. You only need to manually encode the data for a Code 128 Bar Code when you have special requirements. For most applications, you should use the "Auto Encode" feature - which creates the encoded version of the data automatically.

 

 

Code 39 was the first alphanumeric symbology to be developed. It is now in wide use and is the de facto standard for non-retail applications. It can encode the 26 letters of the alphabet (in upper case), the 10 digits, and the symbols "- . $ / + %" Code 39 gets its name because each character has five bars and four spaces (nine elements); of those nine, three are wide. Thus, "3 of 9." If you need to encode any non-numeric data, it's a choice between 3 of 9 and Code 128. In most cases, a proper implementation of Code 128 is more efficient. However, 3 of 9 is more universally accepted by bar code readers.

 

Code 39 Extended is not exactly a new symbology, more of a configuration setting for bar code readers. If you set your reader to Code 39 Extended mode, it will then interpret regular Code 39 character pairs as a single character (for example, '/A' would be 'a'). It basically allows you to encode all 128 standard ASCII characters, whereas regular Code 39 only does a subset of those. Bar Code supports Code 39 Extended, although enabling Human Readable text is not recommended for this type of data.

 

 

EAN-13 stands for the European Article Numbering. It is also compatible with JAN and IAN. EAN is the standard for retail applications in countries other than the United States. EAN-13 encodes 13 digits, but does so in the same amount of space that UPC encodes 12 digits. This is accomplished because the first digit is actually encoded in the parity of the left side bars, rather than by actual bars.

 

The makeup of an EAN code is similar to a UPC, except that it starts with a 1 to 3 digit code identifying the country of origin. The standard EAN country codes can be found in numerous places, including several Web sites. Note that an EAN code with a first digit of "0" is exactly the same as a UPC code encoding the same digits.

 

EAN codes are becoming widespread even in the U.S., especially on books. An ISBN number can be encoded in the EAN main code, then the price of the book can be encoded in the 5 digit add on. This is commonly called "Bookland EAN". Note that all Bookland EAN codes must start with "978".

 

 

EAN-8 also stands for the European Article Numbering. It is also compatible with JAN and IAN. EAN is the standard for retail applications in countries other than the United States. EAN-8 encodes 7 digits of data and a check digit.

 

The makeup of an EAN-8 code is similar to a UPC, except that it starts with a 1 to 3 digit code identifying the country of origin. The standard EAN country codes can be found in numerous places, including several Web sites.

 

It is important to note that this shorter version of EAN-13 is not a suppression code like UPC-E is. It simply is a way for manufacturers to utilize a shorter bar code if space is a consideration.

 

While EAN-13 is used to implement a Bookland code, EAN-8 cannot be used.

 

 

The Facing Identification Mark (FIM) bar code, like PostNet, is used exclusively by the United States Postal Service. There are no commercially available bar code scanners that support FIM, since it has no meaning outside of mail sorting. The FIM bar code, which appears in the upper right of an envelope or postcard next to the stamp, serves two purposes

 

1) To allow letter mail that does not contain luminescent stamps or meter imprints to be faced (oriented) and canceled (postmarked) by machine.

 

2) To allow business reply mail and courtesy reply mail to be separated from other letters and cards for direct processing by optical character readers (OCRs) or bar code sorters (BCSs).

 

The FIM symbology is perhaps the most simplistic bar code standard in the world. It is a series of nine bars or spaces. Each bar or space is immediately followed by a space equal to a bar width. Despite all of the possible combinations, there are exactly three FIM codes, appropriately named A, B, and C.

 

Each FIM pattern has a different use based on the situation. It is beyond the scope of this documentation to speak about those uses here. Interested parties should request the United States Postal Service Publication 25, dated August 1995. It describes the FIM standard in detail.

 

Please note that the default Bar Width for this code is 1/32" and the default height is 5/8". The Post Office does not allow for any modification of these dimensions. If you choose to modify them, there is no telling what the ramifications are.

 

 

The IntelligentMail Barcode (IM barcode) is a 65-bar code for use on mail in the United States. The term “Intelligent Mail” refers to services offered by the United States Postal Service for domestic mail delivery. The IM barcode is intended to provide greater information and functionality than its predecessors POSTNET and PLANET. An Intelligent Mail bar code has also been referred to as a One Code Solution and a 4-State Customer Bar code, abbreviated 4CB, 4-CB or USPS4CB. The Postal Service required use of the Intelligent Mail bar code to qualify for automation prices beginning January 28, 2013.

 

The Intelligent Mail bar code is a height-modulated bar code that encodes up to 31 decimal digits of mail-piece data into 65 vertical bars. The code is made up of four distinct symbols, which is why it was once referred to as the 4-State Customer Barcode. Each bar contains the central "tracker" portion, and may contain an ascender, descender, neither, or both (a "full bar"). The 65 bars represent 130 bits (or 39.13 decimal digits), grouped as ten 13-bit characters.

 

IntelligentMailBarCode

 

Interleaved 2 of 5 (sometimes abbreviated I2of5 or ITF) is a high-density, continuous numeric symbology mainly used in the distribution industry. Many packages you receive have ITF bar codes on them. ITF is a very efficient symbology because it encodes data both in the bars and spaces. Each digit is made up of five bars, of which two are wide; thus the name "2 of 5". Since data is encoded in both bars and spaces, all ITF bar codes must have an even number of digits! Many applications will add a trailing zero if the number to be encoded contains an odd number of digits. If you are encoding less than ten digits, ITF is the most efficient bar code.

 

One of the problems with ITF is that a partial scan has a high probability of decoding as a valid, but shorter, ITF symbol. To minimize this risk, ITF bar codes are often used with bearer bars (sometimes called protection stripes). Bearer bars are horizontal bars running along the top and bottom of the symbol. They decrease the probability that a partial scan will decode as valid.

 

 

PostNet symbology was developed by the United States Post Office for the purpose of marking postal items so that they could be sorted by automatic equipment. In the strictest sense, PostNet is not a bar code, since information is not encoded into the width of the bars. PostNet encodes using the height of the bars instead. PostNet codes generally match the length of a Zip code; that is, either 5 or 9 digits. Recently, the Post Office has accepted a PostNet code with 11 digits, the last two being used as the first two digits of a street address, PO Box, apartment number, etc. For more information about the proper use of PostNet codes, contact your local Post Office.

 

 

UPC-A (Universal Product Code) is the bar code of choice for the retail industry in the United States. UPC is a coding system as well as a symbology; it is designed to uniquely identify a product and its manufacturer. The actual UPC code is a 10-digit code the first five digits represent the manufacturer, the next five as a unique product identifier code assigned by the manufacturer. This 10-digit code is preceded with a "number system" digit and followed by a check digit. Thus the UPC-A bar code encodes 12 digits of data.

 

When you apply for a UPC manufacturer number, the UCC (Uniform Code Council) assigns you a six digit number; the first digit is a "Number System" digit from 0 to 9. The meanings of each of these digits is listed below. The next five digits is your actual manufacturer number.

 

The Number System assignments are as follows:

 

0 - 92,000 manufacturer identification numbers; 8,000 locally assigned numbers

1 - Reserved

2 - Random weight consumer packages

3 - Drug products

4 - In-store marking without format

5 - UPC coupons

6 - 100,000 manufacturer identification numbers

7 - 100,000 manufacturer identification numbers

8 - Reserved

9 - Reserved

 

Since all UPC-A codes encoded 12 digits of data, UPC-A is a fixed-width symbology.

 

 

UPC-E is a shortened version of UPC-A. It encodes 6 digits of data and a check digit versus the 11 digits of data for UPC-A. UPC-E is normally utilized in applications where space is at a premium. Some examples include soda bottles, candy bars, and magazines.

 

UPC-E is known as the "zero suppression" version of UPC-A. Essentially, every UPC-E 6 digit code can be expanded to be an 11 digit code. The converse is also true UPC-A codes can be shrunk down to a 6 digit zero-suppressed code. However, there are many rules governing how this suppression takes place. Only manufacturers with specific manufacturer codes can take advantage of UPC-E. It is outside the scope of this help file to describe all of these rules and exceptions. After you've applied for a UPC manufacturer's number, you will receive documentation that describes this process in detail.

 

It is important to note that the Bar Code component's implementation of UPC-E is expecting only 6 digits of data. Automatic zero-suppression is not supported. Also note that most bar code readers have two modes of operation for reading UPC-E codes one where the data scanned is only 6 digits, the other where the zero-expansion is automatically done to return 11 digits. Please check the documentation of your scanner for information regarding these modes.

 

UPC-E, like UPC-A, can be combined with either a 2 or 5 digit add-on code. For example, most magazine covers utilize UPC-E with a 2 digit add-on.

 

Since all UPC-E codes encode 7 digits of data, UPC-E is a fixed-width symbology.

 

MSI is (also known as Modified Plessey) is a continuous symbology that is not self-checking. MSI is used primarily for inventory control, marking storage containers and shelves in warehouse environments. The MSI character set consist of the numbers 0..9 as well as two "guard" characters (representing the beginning and end of the bar code). The symbology does not support alphabetic characters. Each digit and guard character is represented by a binary number, as shown in the table below.

 

Character Map

Start

110

0

100100100100

1

100100100110

2

100100110100

3

100100110110

4

100110100100

5

100110100110

6

100110110100

7

100110110110

8

110100100100

9

110100100110

Stop

1001

 

 

More About R:BASE Bar Codes

 

When creating a Barcode for manually entered text or DB Barcode for column data field in R:BASE for Windows Report Designer, use the Configure option to specify the symbology which should be used to encode the data.

 

The "Orientation" property of Barcode configuration is used to rotate the bar code in 90 degree increments. You would never want to have a bar code that is not rotated in an increment of 90 degrees. The human readable text is also rotated. These are the possible values:

 

Left to Right                The bar code is created from Left to Right (this is the default.)

Right to Left                The bar code is created from Right to Left.

Top to Bottom                The bar code is created from Top to Bottom.

Bottom to Top                The bar code is created from Bottom to Top.

 

The "Bar Width" property of Barcode configuration allows you to change the width of each bar. For bar codes that have a narrow to wide bar ratio, the wide "Bar Width" is calculated based on the "Wide Bar Ratio" property. If you have the "Auto Size" property set to True, the Barcode object will resize when this property is changed.

 

The "Bar Width Ratio" property affects the narrow-to-wide bar ratio for symbologies that have such elements. The value you give this property will be multiplied by the value of "Bar Width" to get the wide bar width. Most symbologies dictate a wide bar ratio in the 2.0 to 3.0 range. You will want a higher "Wide Bar Ratio" if your "Bar Width" is very small. Most applications call for this ratio to be 3.0.

 

The "Add On Code" option of Barcode configuration allows you to implement either 2 or 5 digit add on codes for UPC or EAN. If you try to enter an Add On Code and the Bar Code Type is not set to either UPC-A or EAN-13, an exception will be raised. The Add On Code is used for a few rather specific purposes. The 2 digit add on code is used to track the serial number of periodicals, mainly magazines. The 5 digit add on code has several purposes, but mainly it is used in conjunction with EAN-13 for bar coding books. A books ISBN number can be encoded in the actual EAN code. Then the add on code is used to indicate the price of the book and the currency. This form of EAN is commonly known as "Bookland EAN."

 

The "Bearer Bars" option of Barcode configuration will print horizontal lines that run along the top and bottom of the code. When Bearer Bars are not present, a partial scan can sometimes be interpreted as a complete scan. Bearer Bars greatly reduce the chance of this happening.

 

Note:

 

Only Interleaved 2 of 5 bar codes can have bearer bars. The other symbologies do not need them. If you try to set Bearer Bars equal to True for any other symbology, an exception will be raised.

 

When "Calculate Check Digit" property of Barcode configuration is set to True, a check digit is automatically generated for UPC-A and EAN-13 bar codes. If Calculate Check Digit is set to False, then you must provide all 12 digits of the UPC code in the Data property, or an exception will be raised.

 

The "Auto Encode" option of Barcode configuration is used in conjunction with the Code 128 symbology. Code 128 can be difficult to work with because there are actually three code sets within it, each used for a different purpose. Added to this complexity is the capability to switch between code sets within the same symbol. You can even switch to another code set for a single character only.

 

The Auto Encode property alleviates the difficulty of implementing Code 128 symbols. You no longer need to be concerned with any of the special control codes for set switching. Instead, set Auto Encode to True to invoke a proprietary algorithm which will automatically encode data as efficiently as possible. You simply set the Data property to the actual data you want to encode and the Barcode object will generate the most compact code possible.

 

Notes:

 

For Code 128 symbols, Auto Encode defaults to True. (e.g. when you select Code 128 as the bar code Type, Auto Encode will be set to True). You should only set this property to False if you have some special requirement and need to encode the symbol yourself.

When "Auto Size" property is set to True, the report object will resize to the width and length of the current string in the Caption property. When Auto Size is False, the size of the report object is not affected by the length of the string in its Caption property. If you type text for a Barcode object while Auto Size is True, the object grows for each character you type. If you change the font size of the text, the Barcode object resizes to the new font size. The value of Auto Size should be set to True for Barcode objects and False for DB Barcode objects.

By default, the human readable text is set to a standard accepted font size based on the size of the Barcode Type. In order to take manual control of the font size, set "Auto Size Font" to False. The human readable text will then be sized based on the value of the Font Size property.

 

And finally, the "Alignment" property of Barcode determines the position of any human-readable text which is part of the bar code. There are three possible values

 

Left Justify        Align text to the left side of the control
Center                Center text horizontally in the control
Right Justify        Align text to the right side of the control

 

Note:

 

The Alignment setting is ignored for EAN-13 and UPC-A bar codes. These two symbologies have special text placement requirements, which must be supported in order to create valid bar codes.