^BC (Code 128)

^BC

Subsets

ZPL examples

Info about UCC/EAN

 

   

Description:
Code 128 is a high density, variable length, continuous, alphanumeric symbology. It was designed for complexly encoded product identification.
Each code 128 character consists of six elements: three bars and three spaces.

Parameters:

The format for the ^BC instruction is:

^BCo,h,f,g,e,m

where:

^BC = Code 128 Bar Code

 o= Orientation
Default value: Current ^FW setting
Other values:
N = Normal
R = Rotated, 90 degrees clockwise
I = Inverted, 180 degrees
B = Read from Bottom Up, 270 degrees

h = Bar Code Height
Default value: Value set by ^BY
Other values: 1 dot to 9999 dots

f = Print Interpretation Line
Default value: Y = Yes
Other value: N = No
NOTE: Intrepretation line can be printed in any available font by placing the instruction for the
font directly before the bar code instruction.

g = Print Interpretation Line Above Code
Default value: N = No
Other value: Y = Yes
NOTE: Default changes to Yes in UCC Case Mode

e = UCC Check Digit
Default value: N = No
Other value: Y = Yes

m = Mode         choices N, U, A, D

N   
Default value: N = No mode selected

U
    Other value: U = UCC Case Mode     (^FD or ^SN statement must contain 19 numeric digits it can also contain valid alpha characters). Subset C using FNC1 values is automatically selected.
Excess digits (above 19) in ^FD or ^SN will be eliminated.
Below 19 digits in ^FD or ^SN adds zeros to right to bring count to 19. (This produces an invalid interpretation line.)

A
    Other value: A = Automatic Mode   Effective for Version 16.3.0 The Automatic Mode analyzes the data sent and automatically determines the best packing method. Full ASCII Character Set can be used in the ^FD statement. Printer will determine when to shift subsets. A string of four or more numeric digits will cause automatic shift to subset C.

D
    Other value: D = New Mode   (x.11.x and newer f/w) This new mode:

Sample ZPL and printout in default Subset B

Subsets

Code 128 has three subsets of characters. There are 106 encoded printing characters in each set, and each character set can have up to three different meanings, depending on the character subset being used.
The three Code 128 character subsets are referred to as:

A subset may be selected in one of two ways.

1. A special Invocation Code can be included in the field data (^FD) string associated with that bar code.
2. Place the desired Start Code at the beginning of the field data. If no Start Code is entered, Subset B will be used.

To change subsets within a bar code, place the appropriate Invocation Code at the appropriate points within the field data string. The new subset will stay in effect until changed with appropriate Invocation Code. (For example, in Subset C, a ">7" in the field data changes the Subset to A.) The table below shows the Code 128 Invocation Codes and Start Characters for the three subsets.

The table below shows the Code 128 Invocation Codes and Start Characters for the three subsets.

Code 128 Invocation Characters

Sample ZPL and printout in Subset A

The >9 after the ^FD sets it to subset A

Sample ZPL and printout in Subset C

The >; after the ^FD sets it to subset C

Sample ZPL switching from Subset C to B to A

^XA
^FO50,50^BY3^BCN,100,Y,N,N^FD>;382436>6CODE128>752375152^FS
^XZ

The >; starts the code in subset C, the >6 switches to subset B, the >7 switches to subset A. Consult the Invocation character table to see what invocations are used to switch from one subset to another.

Rules for Subsets A and C

Code 128 subsets A and C are programmed as pairs of digits, 00-99, in the field data string. In subset A, each pair of digits results in a single character being encoded in the barcode; in subset C, they are printed as entered.
NOTE: Non-integers programmed as the first character of a digit pair (D2) are ignored. However, non-integers programmed as the second character of a digit pair (2D) invalidate the entire digit pair, and the pair is ignored. An extra, unpaired digit in the field data string just before a code shift is also ignored.

Rules for Subset B

Code 128 - subset B is programmed directly as ASCII text, except for values greater than 94 decimal and a few special characters:   ^     >         ~
These characters must be programmed by using the invocation codes.

Code 128 Character Sets

The UCC/EAN-128 Symbology

The symbology specified for the representation of Application Identifier data is UCC/EAN-128, a variant of Code 128, exclusively reserved to EAN International and the Uniform Code Council (UCC). It is not intended to be used for data to be scanned at the point of sales in retail outlets.

UCC/EAN-128 offers several advantages. It is one of the most complete, alphanumeric, one-dimensional symbologies available today. The use of three different character sets (A, B and C), facilitates the encoding of the full 128 ASCII character set. Code 128 is one of the most compact linear bar code symbologies. Character set C enables numeric data to be represented in a double density mode. In this mode, two digits are represented by only one symbol character saving valuable space. The code is concatenatable. That means that multiple AIs and their fields may be combined into a single bar code. The code is also very reliable. Code 128 symbols use two independent self-checking features which improves printing and scanning reliability.

UCC/EAN-128 bar codes always contain a special non-data character known as function 1 (FNC 1), which follows the start character of the bar code. It enables scanners and processing software to auto-discriminate between UCC/EAN-128 and other bar code symbologies, and subsequently only process relevant data.

The UCC/EAN-128 bar code is made up of a leading quiet zone, a Code 128 start character A, B, or C, a FNC 1 character, Data (Application Identifier plus data field), a symbol check character, a stop character, and a trailing quiet zone.

UCC/EAN, UCC/128 are a couple of ways you'll hear someone refer to the code. This just indicates that the code is structured as dictated by the application identifiers that are used.
The SSCC stands for Serial Shipping Container Code. It's formatted following the data structure layout for Application Identifier 00. See Application Identifier Table. It could be 00 which is the SSCC code. The customer needs to let us know what application identifiers are used for their barcode so we can help them.

There are several ways of writing the code to print the code to Application Identifier '00' structure.

Using 'N' for the mode (m) parameter                            ^BCo,h,f,g,e,m
Application Identifier 00 structure

^XA
^FO90,200^BY4^BCN,256,Y,N,Y,N^FD>;>80012345123451234512^FS
^XZ

Using 'U' for the mode (m) parameter                            ^BCo,h,f,g,e,m
Application Identifier 00 structure

^XA
^FO90,200^BY4^BC,256,Y,N,,U^FD0012345123451234512^FS
^XZ

Using 'D' for the mode (m) parameter       (x.11.x and newer /w)                     ^BCo,h,f,g,e,m
Application Identifier 00 structure

^XA
^FO50,200^BCN,150,Y,N,,D^FD(00) 1 0084423 7449200940^FS
^XZ

(0 at end of field data is a bogus character that is inserted as a place holder for the check digit the printer will automatically insert...by coincidence in this example the automatically calculated check digit was 0 also)

  • Subset C using FNC1 values are automatically selected.

  • parenthesis and spaces can be in the field data. '00' application identifier, followed by 17 characters, followed by bogus check digit place holder.

  • Check digit is automatically inserted. The printer will automatically calculate the check digit and put it into the barcode and interpretation line.

  • The interpretation line will also show the parenthesis and spaces but will strip them out from the actual barcode.

Printing the interpretation line in a different font  
With f/w version x.10.x or newer

^XA
^FO50,200^A0N,40,30^BCN,150,Y,N,Y^FD>;>80012345123451234512^FS
^XZ

The font command (^A0N,40,30) can be added and changed to alter the font and size of the interpretation line.

With f/w version older then x.10.x

^XA
^FO25,25^BCN,150,N,N,Y^FD>;>80012345123451234512^FS
^FO100,190^A0N,50,40^FD(00) 1 2345123 451234512 0^FS
^XZ

  • A separate text field needs to be written.

  • The interpretation line needs to be turned off.

  • ^A0N,50,40 is the font and size selection for the separate text field.

  • You have to make sure you enter the correct check digit in the text field.

  • Creating a separate text field allows you to format the interpretation line with parenthesis and spaces.

Typical shipping format some major retailers use: (4 x 6 label size)

In this ^BC example the format has the interpretation line turned off, the check digit parameter is not enabled, the programmer has calculated the check digit and has already added it as the 20th character in the field data. You can choose to put 'Y' for the check digit parameter and enter only 19 characters in the field data and allow the printer to automatically calculate and insert the check digit (20th character).

^XA
^LH0,00^FS
^FO25,20^A0,52,40^FDFROM:^FS
^FO25,80^A0,25,25^FDZEBRA TECH. CORP.^FS
^FO25,110^A0,25,25^FD333 CORP. WOODS PLWY^FS
^FO25,140^A0,25,25^FDVERNON HILLS, IL 60061^FS
^FO75,190^A0,30,30^FD(EXHIBIT D) ^FS
^FO270,0^GB3,220,3^FS
^FO300,20^A0,52,40^FDCARRIER:^FS
^FO300,70^A0,48,40^FDBudget PACKAGE EXPRESS^FS
^FO300,110^A048,40^FDPRO NUMBER 123456789^FS
^FO300,150^A0,48,40^FDB/L NUMBER 987654321^FS
^FO01,220^GB816,3,3^FS
^FO25,240^A0,52,40^FDTO:^FS
^FO95,230^A0,50,30^FDAcme CORPORATION^FS
^FO95,275^A0,50,30^FDC/O^FS
^FO95,320^A0,34,30^FDN & M TRANSFER^FS
^FO95,350^A0,34,30^FD630 MUTTARD ROAD^FS
^FO95,380^A0,34,30^FDNEENAH, WI 54956^FS
^FO400,220^GB4,200,4^FS
^FO440,250^A0,50,30^FDFOR:^FS
^FO440,300^A0,40,35^FDAcme #4040^FS
^FO440,335^A0,40,35^FD4002 SOUTH DORT HWY^FS
^FO440,370^A0,40,35^FDFLINT, MI 48507^FS
^FO01,420^GB816,3,3^FS
^FO25,430^AD^FD(420) SHIP TO POSTAL CODE^FS
^FO100,455^A0,42,50^FD(420) 54956^FS
^FO55,500^BY4,3^BC,110,N^FD>;>842054956^FS
^FO446,422^GB3,202,3^FS
^FO470,450^A0,30,22^FDPO#:^FS
^FO470,500^A0,30,22^FDORDER TYPE:^FS
^FO470,550^A0,30,22^FDDEPT:^FS
^FO650,450^A0,60,35^FD2397767757^FS
^FO650,510^A0,60,35^FDRO^FD
^FO650,570^F0,60,35^FD60,35^FD092^FS
^FO01,622^GB816,3,3^FS
^FO01,830^GB816,3,3^FS
^FO25,840^AD^FD(00) SERIAL SHIPPING CONTAINER^FS
^FO100,925^BC,276,N,^FD>;>800000123455555555558^FS    
^FO100,865^A0,56,50^FD(00) 0 00 12345 555555555 8^FS
^PQ1
^XZ

Application Identifiers

UCC/EAN APPLICATION IDENTIFIER

An Application Identifier is a prefix code used to identify the meaning and the format of the data that follows it (data field).

There are AIs for identification, traceability, dates, quantity, measurements, locations, and many other types of information.

For example, the AI for batch number is 10, and the batch number AI is always followed by an alphanumeric batch code not to exceed 20-characters.

The UCC/EAN Application Identifiers provide an open standard which can be used and understood by all companies in the trading chain, regardless of the company that originally issued the codes.

UCC Application Identifier Table

Data Content AI Plus The Following Data Structure
Serial Shipping Container Code (SSCC) 00 exactly 18 digits
Shipping Container Code 01 exactly 14 digits
Batch NumberS 10 up to 20 alphanumerics
Production Date (YYMMDD) 11 exactly 6 digits
Packaging Date (YYMMDD) 13 exactly 6 digits
Sell By Date (YYMMDD) 15 exactly 6 digits
Expiration Date (YYMMDD) 17 exactly 6 digits
Product Variant 20 exactly 2 digits
Serial Number 21 up to 20 alphanumerics
HIBCC Quantity, Date, Batch and Link 22 up to 29 alphanumerics
Lot Number 23* up to 19 alphanumerics
Quantity Each 30  
Net Weight (Kilograms) 310** exactly 6 digits
Length, Meters 311** exactly 6 digits
Width or Diameter (Meters) 312** exactly 6 digits
Depths ( Meters) 313** exactly 6 digits
Area (Sq. Meters) 314** exactly 6 digits
Volume (Liters) 315** exactly 6 digits
Volume (Cubic Meters) 316** exactly 6 digits
Net Weight (Pounds) 320** exactly 6 digits
Customer PO Number 400 up to 29 alphanumerics
Ship To (Deliver To) Location Code
using EAN 13 or DUNS Number with leading zeros
410 exactly 13 digits
Bill To (Invoice To) Location Code
using EAN 13 or DUNS Number with leading zeros
411 exactly 13 digits
Purchase from 412 exactly 13 digits
Ship To (Deliver To) Postal Code
within single postal authority
420 up to 9 alphanumerics
Ship To (Deliver To) Postal Code
with 3-digit ISO Country Code Prefix
421 3 digits plus up to 9 alphanumerics
Roll Products - width, length,
core diameter, direction and splices
8001 exactly 14 digits
Electronic Serial number for
cellular mobile phone
8002 up ro 20 alphanumerics

For date fields that only need to indicate a year and month, the day field is set to "00".
* Plus one digit for length indication.
** Plus one digit for decimal point indication.

Chaining several application identifiers (x.11.x and later)

the FNC1 which is invoked by >8 is inserted just before the two digit AI's so that the scanners reading the code will see the FNC1 and know that an AI follows.

with mode parameter set to A (automatic):

^XA
^BY2,2.5,193^FO33,400^BCN,,N,N,N,A^FD>;>80204017773003486100008535>8910001>837252^FS
^FT33,625^AEN,0,0^FD(02)04017773003486(10)0008535(91)0001(37)252^FS
^XZ

with mode parameter set to U:

^XA
^BY3,2.5,193^FO33,200^BCN,,N,N,N,U^FD>;>80204017773003486>8100008535>8910001>837252^FS
^FT33,455^A0N,30,30^FD(02)04017773003486(10)0008535(91)0001(37)252^FS
^XZ

with mode parameter set to D*

^XA
^PON
^LH0,0
^BY2,2.5,145^FO218,343^BCB,,Y,N,N,D^FD(91)0005886>8(10)0000410549>8(99)05^FS
^XZ

D* : The following issue was corrected in 60.13.0.6 firmware - corrected problem printing EAN128 barcodes using Mode "D" when trying to print the last Application Identifier with an odd number of characters.  The fix - Added in the capability for Mode D to accept odd numbers of data characters rather than trying to force an even number.

EAN -14

Here are 2 ways to produce an EAN-14 Barcode using Code 128

1. You can use Zebra Designer and design the label and then print to file to view the code that is generated when you print an EAN14 Barcode.
2. You can print EAN14 using the ^BC command. Here is more information about the ZPL command.

Although it may not have a ZPL command specifically for EAN 14 the table above shows information about the 01 application identifier. It indicates that the data field must have exactly 14 characters, the first two will be 01 followed by 12 more characters.

The 01 identifies this as a EAN14 structure. The ZPL will look something like this: ^BCN,256,Y,N,^FD>;>801222222222222^FS

The >;>8 are needed to set the barcode to subset C, function 1 the 01 is the identifier for the 14 character code (EAN14, shipping container code) The example uses twelve 2's for the data ....this is where you would put your data in place of these 2's

More examples

Here are a couple of sample compliant labels that use ucc/ean (ucc/128) barcodes.
Subset C, Function 1 is invoked by >;>8

If you send ^BC,110,N,,,U then you have to use exactly 19 characters in the data filed and you don't need the >;>8 to invoke subset C, function 1.

In the samples the U is not present. The >;>8 is used to invoke subset C function 1 and that allows the user to enter in a number of characters that does not have to be exactly 19 characters.

These are just two samples of many compliant labels that are out in the real world. Use the samples as a model to help with ucc/ean (ucc/128) applications.

One sample is from JCPenney and the other from Kmart. These may not be current standards. They are for demonstration purposes only.

JCPenney

^XA
^LH20,10^FS
^FO01,145^GB816,3,3^FS
^FO5,20^A0,52,50^FDFROM:^FS
^FO155,20^A0,34,31^FDZEBRA TECH. CORP.^FS
^FO155,52^A0,34,31^FD333 CORP. WOODS PKWY.^FS
^FO155,84^A0,34,31^FDVERNON HILLS, IL 60061^FS
^FO570,20^A0,69,48^FD#67890-0^FS
^FO5,163^A0,52,50^FDTO:^FS
^FO110,158^A0N,65,50^FDJ.C.PENNEY^FS
^FO528,159^A0N,87,62^FD#2473-7^FS
^FO120,217^A0N,36,32^FD1201 WEST OAKS MALL^FS
^FO120,252^A0N,36,32^FDHOUSTON, TX 77082^FS
^FO227,314^BY4^BC,104,N^FD>;>842077082^FS
^FO307,282^A0N,36,32^FD420 77082^FS
^FO01,424^GB816,3,3^FS
^FO01,642^GB816,3,3^FS
^FO01,642^GB816,3,3^FS
^FO25,662^A0,87,65^FDPO#:^FS
^FO160,662^A0N,90,70^FD35976757^FS
^FO510,662^A0N,87,65^FDSUB:^FS
^FO650,662^A0N,90,70^FD092^FS
^FO130,760^A0N,50,63^FDCARTON 07 OF 12^FS
^FO01,820^GB816,3,3^FS
^FO90,941^BC,256,N^FD>;>800000280280000000680^FS
^FO88,890^A0N,50,57^FD00 00 28028 000000068 0^FS
^PQ0,1,,N
^XZ



Kmart

^XA
^LH0,00^FS
^FO25,20^A0,52,40^FDFROM:^FS
^FO25,80^A0,25,25^FDZEBRA TECH. CORP.^FS
^FO25,110^A0,25,25^FD333 CORP. WOODS PLWY^FS
^FO25,140^A0,25,25^FDVERNON HILLS, IL 60061^FS
^FO75,190^A0,30,30^FD(EXHIBIT D) ^FS
^FO270,0^GB3,220,3^FS
^FO300,20^A0,52,40^FDCARRIER:^FS
^FO300,70^A0,48,40^FDROADWAY PACKAGE EXPRESS^FS
^FO300,110^A048,40^FDPRO NUMBER 123456789^FS
^FO300,150^A0,48,40^FDB/L NUMBER 987654321^FS
^FO01,220^GB816,3,3^FS
^FO25,240^A0,52,40^FDTO:^FS
^FO95,230^A0,50,30^FDKMART CORPORATION^FS
^FO95,275^A0,50,30^FDC/O^FS
^FO95,320^A0,34,30^FDN & M TRANSFER^FS
^FO95,350^A0,34,30^FD630 MUTTARD ROAD^FS
^FO95,380^A0,34,30^FDNEENAH, WI 54956^FS
^FO400,220^GB4,200,4^FS
^FO440,250^A0,50,30^FDFOR:^FS
^FO440,300^A0,40,35^FDKMART STORE #4040^FS
^FO440,335^A0,40,35^FD4002 SOUTH DORT HWY^FS
^FO440,370^A0,40,35^FDFLINT, MI 48507^FS
^FO01,420^GB816,3,3^FS
^FO25,430^AD^FD(420) SHIP TO POSTAL CODE^FS
^FO100,455^A0,42,50^FD(420) 54956^FS
^FO55,500^BY4,3^BC,110,N^FD>;>842054956^FS
^FO446,422^GB3,202,3^FS
^FO470,450^A0,30,22^FDPO#:^FS
^FO470,500^A0,30,22^FDORDER TYPE:^FS
^FO470,550^A0,30,22^FDDEPT:^FS
^FO650,450^A0,60,35^FD2397767757^FS
^FO650,510^A0,60,35^FDRO^FD
^FO650,570^F0,60,35^FD60,35^FD092^FS
^FO01,622^GB816,3,3^FS
^FO01,830^GB816,3,3^FS
^FO25,840^AD^FD(00) SERIAL SHIPPING CONTAINER^FS
^FO100,925^BC,276,N,^FD>;>800000123455555555558^FS
^FO100,865^A0,56,50^FD(00) 0 00 12345 555555555 8^FS
^PQ1,1,,N
^XZ