Solved

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

Posted on 2013-10-30
8
3,495 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
  • 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
 

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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now