Solved

Zebra ZPL-II Code 128 barcode with 3 Application Identifiers, including Serial Number

Posted on 2013-10-30
8
3,854 Views
Last Modified: 2013-12-11
Hello,

I'm working on a label that goes on cases of our product, and the barcode needs to be Code 128 and have 3 elements:

  - GTIN (Application Identifier 01)
  - Batch Number (Application Identifier 10)
  - Serial Number (Application Identifier 21)

In particular, I'm having trouble with the Serial Number. We print thousands of these labels at a time, and the .prn files our software is generating are huge because it transmits multiple lines of code for each label.

I know the Zebra printers we use (140XiIII Plus) are capable of incrementing serial fields internally, which means that the software could send a tiny file with one copy of the label plus a quantity to print, and just let the printer increment the serial numbers. However, I can't figure out the correct syntax to make that work.

Here is a sample line in ZPL-II code that our software currently generates for the barcode:

  ^BY2^BCB,160,N,N^FD>;>80140012345012349101328>69C>5>82115300000>61^FS

I'm thinking that what I want is something like this (but this doesn't work):

  ^BY2^BCB,160,N,N^SN>;>80140012345012349101328>69C>5>82115300000>61,1,Y^FS

Can anyone provide the correct syntax?
0
Comment
Question by:spice_guy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 1

Expert Comment

by:alexziv
ID: 39674483
maybe zint can help
0
 
LVL 19

Expert Comment

by:Thommy
ID: 39697735
To initiate automatic serialization use combination of ^FD (Field Data) and ^SF (Serialization Field) commands and define fixed and variable parts of your serial number.

Referring to this please see page 250 in
ZPL II Programming Guide Volume One

Exercise 2. shows how to use ^FD and ^SF commands to define part of your barcode content which needs to be incremented...
0
 
LVL 19

Expert Comment

by:Thommy
ID: 39697747
Which part of your barcode data ">;>80140012345012349101328>69C>5>82115300000>61" is the variable part that needs to be incremented?

To make this clear please break down your serial data string into its elements...
0
Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

 

Author Comment

by:spice_guy
ID: 39699006
Thanks for the responses! The last 5 digits are what need to be incremented, starting with "00001" and increasing by 1 on every label.

Later today I will try the commands you mention in your first post and let you know the results.

Here's the breakdown you requested of all the different parts in my command string:

^BY                        Bar Code Field Default Instruction
2                            (Parameter) Narrow Bar width = 2 dots
^BC                        Bar Code 128
B,                           (Parameter)  Orientation = rotated 270 degrees
160,                       (Parameter) Height = 160 dots
N,                           (Parameter) Print Interpretation Line = no
N                            (Parameter) Inverted = no
^FD                        Field Data
>;                           Start Code 128 Subset C
>8                          FNC1
01                          Function Code 01 (Global Trade Item Number or GTIN)
40012345012349 Value for GTIN
10                          Function Code 10 (Lot ID)
1328>69C             Lot ID (note that only "13289C" prints - the ">6" changes to Subset B
                                    in order to handle the alpha character.)
>8                          FNC1
21                          Function Code 21 (Serial Number)
115300000>61    Serial number (the "115300" is static and "00001" is the part that
                                    increments. The ">6" changes to Subset B for the last digit
                                    because Subset C requires pairs of digits)
^FS                        Field Separator
0
 
LVL 19

Expert Comment

by:Thommy
ID: 39700306
Is it a four-digit or five-digit counter????

Something seems to be wrong with your above serial number description!

According to your description the serial number should be 1153000000>61, but your serial number example preceded by FNC1 and function code 21 says ">82115300000>1" with one missing digit for the static part and one for the variable part...

And what about the >5 in your example preceding the second FNC1?
0
 
LVL 19

Accepted Solution

by:
Thommy earned 500 total points
ID: 39700409
According to your serial number data breakdown with a five-digit counter, your ^FD/^SF  commands should look like that...

^FD>;>80140012345012349101328>69C>821115300000>61
^SF%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%dddd%%d,1
1
 

Author Comment

by:spice_guy
ID: 39702517
@Thommy

I apologise for multiple errors that I made in my example, and I want to thank you for all the time you are taking to look at this in great detail.

  - The serial number should really have 4 static digits ("1153") and 5 variable digits ("00001").
     I'm afraid I got that wrong everywhere (and in different ways in different places).

  - The ">5" that I accidentally excluded from my breakdown would have forced a change to Subset C.

I still have not had time to try the commands you have provided, but I will get to them as quickly as I can and post the results.

Thanks again for all your time!
0
 

Author Comment

by:spice_guy
ID: 39713020
@Thommy

Your final suggestion worked! I had to tweak it a little bit for a couple of reasons.

First, my printer would not accept the lower-case "d" but was willing to accept the mask when I changed those to the upper-case "D".

Second, apparently it is important to make sure the length of the mask you provide in the ^SF string is EXACTLY the same length as your ^FD string. Your example had one extra "%". Note that you do need to include mask characters for the non-printable information such as the ">8" FNC1 characters.

Third, you need to put the ^FS (Field Separator) command at the end of the "^SF" string.

Here are my final strings (the ^SF one is so long it may wrap to another line):
^FD>;>80140012345012349101328>69C>5>82115300000>61
^SF%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%DDDD%%D,1^FS

Thanks, and I will award full points to your final answer!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
This is about my first experience with programming Arduino.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question