ZPL code sent to printer prints 2 blank labels before printing the actual label - zpl

The following ZPL code when sent to a Zebra GX-420D printer with 2"x2" labeld loaded, does 2 very strange things:
Skips the first 2 labels and only prints on the 3rd one
Repeat this (2 blank labels + one with content) one more time, after a short delay.
So in total it uses 6 labels, and the content is only on the 3rd and 6th one.
Here's the code:
^XA
^FX Test for long barcode
^BY1,2,50
^FO20,10^BC^FD>6UIQ-2013P-MR-BU^FS
^XZ
Is there anything in the above code that would cause this phenomenon?

^FS at the end of a commented text is optional.
From ZPL II manual :
The ^FS command denotes the end of the field definition.
Alternatively, ^FS command can also be issued as a single ASCII control code SI (Control-O, hexadecimal 0F).

I eventually figured it out. I was trying to remotely fix this, not having a direct access to the printer and not seeing what it printed and how. But eventually I got access to a printer and then it didn't take long to fix.
It seems that there were some defaults or setting left over from the previous print jobs that cause the problem. I added some resetting of values in front of the printing and after that it properly printed out just one label.
And yes, the ^FS was not needed at the end of the comment with ^FX.
Here is the code that printed out the same thing correctly (there might be some unnecessary commands but this one worked so I left it at that):
^XA~TA000~JSN^MNW^PON^PMN^LH0,000~SD15^XZ
^XA^JUS^XZ
^XA
^MMT
^PW0355
^LL0305
^FX Test for long barcode
^BY1,2,50
^FO20,10^BC^FD>6UIQ-2013P-MR-BU^FS
^XZ

Related

What could cause a Zebra Printer to print "0/30" repeatedly instead of the image provided in a DG command?

I am sending images of the labels I want printed, one at a time, to a ZD421.
After around 100 were printed what was supposed to be a single label ended up being a stream of zeroes, with "30" under each, spread over several labels.
Print result
Close up
The image sent was of a barcode with various related info in text around it.
Expected result
The ZPL sent for the labels looks like the following and the socket is closed after each is sent.
~DGR:label,40804,101,000...000(81608 characters of data)
^XA
^PON
^LH0,0
^LS0
^LL404
^PW808
^FO0,0
^XGR:label,1,1
^FS
^XZ
Restarting the printer fixed the problem and repeating the request printed the expected label.
My assumption was that reusing the name, "label", would overwrite previously sent graphics and there would be no memory management required. Is there something I should be sending to clean up after recalling the graphic?

Text is printed incorrectly using ZPL

I print a text using ZPL but they are printed incorrectly. It has gaps in the middle. They are printed correctly to the real printer via the ZebraDesigner. But they are wrong when printing via ZPL:
^FT246,70^A0R,16,16
^FB900,2,,
^FDMaisstaerke, Austernuce, Cashewnuss,Pilz, Mais, Lattich, Pack Choi,Sojasprossen^FS
It is printed as 'Maisstaerke, Austernuce, Cashewnuss,Pilz, Mais, Lattich, Pack Choi, Sojasprossen'
(there is a big gap after 'Mais,').
http://screencast.com/t/sTiaxC3cMg
http://screencast.com/t/0QkypnsPyF89
Please help.
Thanks
I'm unable to reproduce the issue, but the field block width seems rather large; you didn't specify any label dimensions in the original post. If you use the following code--a combination from the original post and your comments:
^XA
^PW560
^LL560
^LS0
^FO246,70^GB28,300,,^FS
^FT246,70^A0R,16,16 ^FB300,2,, ^FDMaisstaerke, Austernuce, Cashewnuss,Pilz, Mais, Lattich, Pack Choi,Sojasprossen^FS
^PQ1,0,1,Y
^XZ
I can reproduce what is possibly the issue--the field block automatic word wrapping--by reducing the field block width to 300 dots.
I also drew a box around the block for visualization. You can test in on the Labelary Viewer.
Finally, if you're somehow composing the data make sure there are no special (non printable, such as tab, non-UTF-8 or accented) characters in it, and if so, you will have to pre-escape them.

ZPL Barcode Labels setting width of label/barcode

I'm printing to a zebra thermal printer from 2 different systems, a windows environment using BarTender to print labels with a text file as the data source, and an older system (green screen) which prints using command files like below.
My problem is when I print from the windows printer, the printers settings change, so when I then print from the other system, it loses the width and runs off the edge.
I tried to add a print width setting to the code below which didn't work ,^PW700 and could do with some advice! this isn't a language I know much about. I don't know if I used the code in the right way/place or if im using the right code at all? could it be that I need to use BYw?
^XA^LL456,^PW700^LH0,0^FS
^FO21,196^B3N,N,66,N^FDWU000208375^FS
^FO18,18^A0N,24,24^FDPrd Code : 84100705 ^FS
^FO18,48^A0N,24,24^FDDANDY GREY ^FS
^FO18,78^A0N,24,24^FDQuantity Remaining : 4.00^FS
^FO18,108^A0N,24,24^FDAmended : 01/07/15 Received : 01/07/15^FS
^FO18,138^A0N,24,24^FDBATCH : 241071 ^FS
^FO18,168^A0N,24,24^FD^FS
^FO129,276^A0N,24,24^FDW U 2 0 8 3 7 5
^XZ
Thanks in advance
It might be too late to answer this question, but it might help others.
The reason your code doesn't work might cause by comma before ^PW
^LL456,^PW700
So removing it should work on any system:
^LL456^PW700
The usual command code for zpl is
^(command)(parameter),(parameter)...

Zebra RW 420 not printing last or first inch using ZPL

Zebra RW 420 not printing last or first inch(depending on rotation) using ZPL.
this link was suppose to give a solution since it is the same symptom; but I've try all combinations of "Back Feed" (~JSN, ~JSA, ~JSB) with no results.
here is my ZPL code(generated from ZebraDesigner print to file command) It doesn't print "Hello 22" completely:
^XA~TA000~JSN^LT0^MNM^MTT^POI^PMN^LH0,0^JMA^PR2,2~SD10^JUS^LRN^CI0^XZ
^XA
^MMT
^PW812
^LL2233
^LS0
^FO272,76^A0N,56,55^FH\^FDHello 11^FS
^FO320,2000^A0N,56,55^FH\^FDHello 22^FS
^PQ1,0,1,Y^XZ
I had the same problems with print output. I ended up abandoning use of ^FO and went with ^FT, and everything has been perfect since. I don't know why ^FO is so temperamental, but ^FT is very straightforward. You get what you expect.
I'd suggest getting rid of that entire first row that ZebraDesigner made. You don't need it.
I've solved the problem with the help of Zebra support.
The actual problem was the var "zpl.label_length" that was set to 2014 instead of 2233; the ^LL command is ignored in this printer and the label length is controlled only by "zpl.label_length".
It printed the whole label(11")after sending the command:
! U1 setvar "zpl.label_length" "2233"

ZPL, Zebra OPOS, POS for .NET

I have ZPL code as follows:
^XA^CI27^LH0,0^BY2^FO250,50^B3N,N,25,N,N^FDU0772287 ^FS
^FO30,50^A0N,35,35^FD$9.99 ^FS
^FO200,80^A0N,25,25^FH^FDBatch 14657, Item 772287K, 2013-May-29 ^FS
^FO30,115^A0N,25,25^FH^FDAccessories for stroller/carseat, Acton ^FS
^FO550,145^A0N,25,25^FH^FDSize: Preschool ^FS
^FO30,145^A0N,25,25^FH^FDDenim, Maternity ^FS^XZ
When sending it to my Zebra GK420d via POS for .NET & Zebra OPOS, this label ends up taking two 4 inch x 1 inch labels instead of just one. Only one line prints on the second label. There is more than enough room on the label to print this text.
Remove the ^CI27 and the ^FH and you will not see this behaviour.
Remove almost any one of the individual pieces of text and you will not see this behaviour.
Change the label at 200,80 to start at 30,80 and you won't see this behaviour.
Change Acton to say Act and you won't see this behaviour.
However, in some of the above scenarios, although it prints on one label, you'll sometimes discover a ^FS appear somewhere, in the standard font (smaller than ^A0N,25,25). In the last variant (and a bunch of others), you'll end up with the end of one of the lines of text written, in the default font, overwriting the start of another line. You'll also sometimes see a ^FS appear in the middle of nowhere.
Because I see this bug with only some textual strings and not others, I suspected some kind of layout bug due to font size calculations, so I tried changing all the text on the label to a W or an I and it does not make any difference.
I'm stumped; this makes no sense to me and it doesn't follow the documentation I have seen online. Furthermore, everything explodes (fonts are ignored, text is overwritten, prints on four stickers, etc.) when:
a linebreak (Windows) is not put after every ^FS
a linebreak is put anywhere else
a space is not put before every ^FS
Do I have a bug in my ZPL? Am I finding a weird bug in the Zebra OPOS library or POS for .NET? Is it just my printer?

Resources