ZPL II - Printing label automatically

Hello Everyone,

I am new to the ZPL II programming and I am trying to set a simple label setup that will print a simple line of text (Please see the code below).

I can print the label without any issues but what I really want is being able to make the printer print the label automatically.

So, I have created the label form and store it in the printer. When I go to the printer I can select the form and then I have to confirm the quantity and then select GO on the printer Menu so it will print.

I need to avoid this last steps. I want the quantity to come straight from the label (already done) and then I want it to enter the "GO" also from the label, I don't want to press any button so the label will print.

How can I achieve this goal?

Pinter: Zebra ZT410 203dpi ZPL
Firmware: V75.19.7Z

Your help will be very appreciated.

Thanks in advance,
-SC

----------------------------------CODE--------------------------------
^XA^LH30,30
^FO20,10^ADN,100,20^FDMyNameIS...^FS
^LH0,0
^PQ1 // Defining Quantity

//Missing command to order the print...//
^XZ
stawseAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hdhondtCommented:
I'm not really familiar with ZPL but, as everyone else seems to be ignoring this question, I'll see if I can contribute anything.

You seem to have done things correctly: your code starts with ^XA and ends with ^XZ. That should be all that's required to print a label. Except that in your case it doesn't.

You say you stored the label in the printer.  I'm guessing that, if you do that, the printer does want some front panel or other command action before it prints.

Try this instead: put all the commands in a file (use any text editor, including Notepad) and then send that file to the printer. That should then print. Sending it to the printer depends on how the printer is connected, but you should be able to use the same method you used before.
Gary PattersonVP Technology / Senior Consultant Commented:
Assuming you stored the form using the DFR command:

^XA                                                          (^XA - This is the Start Command)
^DFR:Format1.ZPL^FS                          
^FO50,50^A0,60,60^FDTest^FS       (FO is font location, A is Font, FD is Data used)
^XZ                                                           (^XZ - This is the End Command)

You can print the stored format by sending this command:

^XA^XFR:Format1.ZPL^FS^XZ

Here's a document that demonstrates how to work with stored formats:

https://km.zebra.com/kb/index?page=content&id=SO8476

You don't have to store a label format in order to use it.  You can just send the label to the printer each time you want to print it.

- Gary
stawseAuthor Commented:
Thanks for your comments, to both of you.

Actually I was taking this step by step but what I really want to achieve is to have a barcode scanner connected to the printer and then scan a barcode and having the printer printing the same barcode. This is my goal.

So, you're saying that I can send a txt file to the printer and then use commands from the scanner to print it, is that it?

I'll give a try by following the link and then I'll let you know.

Thanks again,
-SC
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Gary PattersonVP Technology / Senior Consultant Commented:
I'm saying that ZPL is ultimately just text.  If you can create a text document that contains the ZPL, you just send it to the printer using one of the protocols that particular printer supports.

Interfacing directly between a scanner and a printer is a more complex chore.  Best approach probably varies depending on the scanner and the printer.

Some Zebra printers have a programming language called ZBI built in.  You may be able to use ZBI to talk to a scanner.

Zebra has a manual that covers a lot of this:

https://www.zebra.com/content/dam/zebra/manuals/en-us/software/zpl-zbi2-pm-en.pdf

- Gary
stawseAuthor Commented:
So, it seems that to achieve the goal we need to use a RS232 scanner and not an USB one because it's not possible with an USB one.
We'll find a way. Thanks for all your comments.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
stawseAuthor Commented:
After some discussion with zebra as well I know it's possible but we need to use the RS232 cable instead of usb cable.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Printers and Scanners

From novice to tech pro — start learning today.