ZPL command barcode 3 zeros creates issues - printing

I am trying to print to a GT800 Zebra printer thru serial port.
I am using ZPL. I want to control the width which is fine in auto mode. To address that in the >^BC> command I am using Auto mode as no other size setting under ^BY works
Following is the code
^XA
^MMT
^PW831
^LL400
^LS0
^BY2,,76^FT225,141^BCN,76,Y,Y,N,A
^FD:RNIP29200082034^FS
^FO225,157^A#N,18,10,E:CAL002.FNT^FD26030-0892R^FS
^FO383,157^A#N,18,10,E:CAL002.FNT^FD08.01.20 12:00PM^FS
^FO225,187^A#N,18,10,E:CAL002.FNT^FDLAMP-DR RH^FS
^FO453,187^A#N,18,10,E:CAL002.FNT^FDXBA3^FS
^PQ1,0,0,Y
^XZ
There is a funny problem. If the ^BC mode = A then if three zeros come together gives issues for eg ABCD29200082034 it prints ABCD29200 and does not complete the barcode. But the other lines are getting printed. But if the data is ABCD29200182034 , there are no issues.
If BC mode = U then even if the code is ABCD29200182034 it prints 292001820347. Note 7 is added in the end.
I am clueless as to what is this issue. I remember facing this same issue in Honeywell printer too once.
Thanks
NOTE : I replaced the 000 with 111 and the problem persists.
ZPL Manual says the following
A= Automatic Mode :This analyzes the data sent and automatically determines the best packing method. The full ASCII character set can be used in the ^FD
statement — the printer determines when to shift subsets. A string of
four or more numeric digits causes an automatic shift to Subset C.
Note , it says a string of four or more numeric digits causes an automatic shift to subset C, but when the same string is 290010 it has no issues. I am really lost

Related

How do you define the length of a parameter in ESC/POS?

I need to be able to print Hebrew characters on my Epson TM-T20ii. I am trying to get my printer to switch to character code page 36(PC862) using
ESC t36
for some reason the printer is switching to code page 3 and then printing the number 6.
Is there a way to let the printer know that the 6 is part of my command?
If you know of a different workaround please comment below.
Thanks
You are making a mistake, you aren't meant to replace n with an actual number.
The proper syntax in your case would be ←t$
Explanation: the manual says "ESC t n", n referring to the page sheet, however you don't replace n with a number rather with the ASCII character n, so in your example 36 = $ because $ is the 36th character on the ASCII table.

Need Tips for RFID ZPL for Zebra ZD500R Printer

Working on printing and encoding RFID labels with the Zebra ZD500R Printer.
Here is my ZPL: The field data is F1001001, which i can encode and print on the label. However the EPC returned is F10010010000000000000000. How can i do one of 2 things. Either get the ZPL to 4 Bytes with no 0's or encode random hexadecimals at the front and my field data at the end?
My other question is how do make my field data increment and have both the RFID encoded tag and label match?
`^XA
^BCN,100,N,N
^FO30,50^FDF1001001^FS
^FO30,160^ADN,18,15^FDF1001001^FS
^FO30,220^ADN,10,20^^FD12/1/2024^FS
^FO30,260^ADN,10,20^^FDUYT 098^FS
^RFW,H^FDF1001001^FS
^RFR,H^FN11^FS
^FH^HV11,,EPC:[,]_0D_0A,L
^XZ`
I know I'm a bit late to the party but it might be useful if someone else stumbles over this post...
Try:
^RS8
^RFW,H,,,A^FD12345678^FS
When read with a RFID reader this will return the EPC code 12345678 without the trailing zeros (or encode random hexadecimals). For reference this was written to a tag using a Zebra ZQ511.
https://www.zebra.com/content/dam/zebra_new_ia/en-us/manuals/printers/common/programming/rfid3-pg-en.pdf
If you want to encode fixed EPC length, use the ^RF command with a length paramter :
Example 3: This example encodes 4 bytes of hexadecimal formatted data, starting in block 3
of Gen 2 EPC bank 1. (The ^RS command can be omitted for printers that use Gen 2 tag types
only.)
^XA
^RS8
^RFW,H,3,4,1^FD11112222^FS
^XZ
For incrementation, I suppose Zebra has a builtin variable management but I don't know how it works... But you are better calling the Zebra printer through an external program...

Zebra Label Feeds Blank after printing

I have a specific label that feeds a second, blank label after printing a good one. I'd imagine it's something about the ZPL code, but I cannot seem to isolate it. I've tried removing each formatting statement at the top, one at a time and trying different values for each one. I've also re-calibrated even though other labels print just fine. Any ideas?
~JO
^XA
^PMN
^MNY
^MMR
^MTT
^MD0
^LH0,0
^LL1219
^PR4
^JMA
^FO0,398^FR^GB811,2,2^FS
^FO406,0^FR^GB2,236,2^FS
^FO0,606^FR^GB811,2,2^FS
^FO455,234^FR^GB2,165,2^FS
^FO0,843^FR^GB811,2,2^FS
^FO2,232^FR^GB811,2,2^FS
^FO412,604^FR^GB2,240,2^FS
^FO41,41^CI0^ADN,18,20^FR^FDFrom:^FS
^FO427,41^CI0^ADN,18,20^FR^FDTo:^FS
^FO41,264^BY2,2.0,102^B3N,N,102,N,N^FR^FD^FS
^FO22,248^CI0^A0N,17,17^FR^FDOrder Number:^FS
^FO463,238^CI0^ADN,18,20^FR^FDCarrier:^FS
^FO488,264^CI0^A0N,23,23^FR^FD^FS
^FO22,412^CI0^ABN,22,14^FR^FDORDER#^FS
^FO49,443^CI0^A0N,28,56^FR^FD^FS
^FO41,61^CI0^A0N,23,23^FR^FDRandom Address^FS
^FO41,102^CI0^A0N,23,23^FR^FDOne Industrial Rd^FS
^FO41,122^CI0^A0N,23,23^FR^FDSuite 199^FS
^FO41,142^CI0^A0N,23,23^FR^FDThistown, PA 12345^FS
^FO20,508^CI0^ABN,11,14^FR^FDP.O.#^FS
^FO366,508^CI0^ABN,11,14^FR^FDSHIP DATE^FS
^FO20,526^CI0^ABN,11,14^FR^FD^FS
^FO370,524^CI0^ABN,11,14^FR^FD05/15/14^FS
^FO421,614^CI0^ADN,18,20^FR^FDFOR:^FS
^FO427,691^CI0^A0N,23,23^FR^FD^FS
^FO427,711^CI0^A0N,23,23^FR^FD^FS
^FO427,650^CI0^A0N,23,23^FR^FD^FS
^FO163,914^BY2,3.0,203^B3N,N,203,N,N^FR^FDRC051514E^FS
^FO45,862^CI0^ADN,18,20^FR^FDRC051514E^FS
^FO427,61^CI0^A0N,23,23^FR^FD^FS
^FO427,102^CI0^A0N,23,23^FR^FD^FS
^FO427,122^CI0^A0N,23,23^FR^FD^FS
^FO427,142^CI0^A0N,23,23^FR^FD^FS
^FO549,610^CI0^A0N,17,17^FR^FDCUST NO:^FS
^FO650,610^CI0^A0N,17,17^FR^FD^FS
^FO345,406^CI0^A0N,39,78^FR^FDPQ^FS
^FO447,406^CI0^A0N,39,78^FR^FD1^FS
^FO650,142^CI0^A0N,23,23^FR^FD,^FS
^FO671,142^CI0^A0N,23,23^FR^FD^FS
^FO711,142^CI0^A0N,23,23^FR^FD^FS
^FO427,732^CI0^A0N,23,23^FR^FD^FS
^FO650,732^CI0^A0N,23,23^FR^FD,^FS
^FO671,732^CI0^A0N,23,23^FR^FD^FS
^FO711,732^CI0^A0N,23,23^FR^FD^FS
^PQ1
^XZ
I ended up spending an hour and a half on the phone with Zebra and they determined that since my printer model was emulating ZPL support I had to be much more careful about the order of the statements by coordinates. In other words, Zebra models with ZPL emulation cannot deal with it when a statement has a x and y coordinates that would make it precede a line already done. It will print but cause weird things like page feeds to happen. So make sure to put all of your lines in order, even if you generate your code using software like LabelViewer.
What size media are you using? Is it gap or continuous? What settings are saved on the printer before this label is sent? You might be in a different print mode, and then when this label is sent it changes it to non-continuous gap mode (^MNY) and then it tries to find the gap by feeding a label.
Does it work if you only send this?
^XA
^FO0,398^FR^GB811,2,2^FS
^FO406,0^FR^GB2,236,2^FS
^FO0,606^FR^GB811,2,2^FS
^FO455,234^FR^GB2,165,2^FS
^FO0,843^FR^GB811,2,2^FS
^FO2,232^FR^GB811,2,2^FS
^FO412,604^FR^GB2,240,2^FS
^FO41,41^CI0^ADN,18,20^FR^FDFrom:^FS
^FO427,41^CI0^ADN,18,20^FR^FDTo:^FS
^FO41,264^BY2,2.0,102^B3N,N,102,N,N^FR^FD^FS
^FO22,248^CI0^A0N,17,17^FR^FDOrder Number:^FS
^FO463,238^CI0^ADN,18,20^FR^FDCarrier:^FS
^FO488,264^CI0^A0N,23,23^FR^FD^FS
^FO22,412^CI0^ABN,22,14^FR^FDORDER#^FS
^FO49,443^CI0^A0N,28,56^FR^FD^FS
^FO41,61^CI0^A0N,23,23^FR^FDRandom Address^FS
^FO41,102^CI0^A0N,23,23^FR^FDOne Industrial Rd^FS
^FO41,122^CI0^A0N,23,23^FR^FDSuite 199^FS
^FO41,142^CI0^A0N,23,23^FR^FDThistown, PA 12345^FS
^FO20,508^CI0^ABN,11,14^FR^FDP.O.#^FS
^FO366,508^CI0^ABN,11,14^FR^FDSHIP DATE^FS
^FO20,526^CI0^ABN,11,14^FR^FD^FS
^FO370,524^CI0^ABN,11,14^FR^FD05/15/14^FS
^FO421,614^CI0^ADN,18,20^FR^FDFOR:^FS
^FO427,691^CI0^A0N,23,23^FR^FD^FS
^FO427,711^CI0^A0N,23,23^FR^FD^FS
^FO427,650^CI0^A0N,23,23^FR^FD^FS
^FO163,914^BY2,3.0,203^B3N,N,203,N,N^FR^FDRC051514E^FS
^FO45,862^CI0^ADN,18,20^FR^FDRC051514E^FS
^FO427,61^CI0^A0N,23,23^FR^FD^FS
^FO427,102^CI0^A0N,23,23^FR^FD^FS
^FO427,122^CI0^A0N,23,23^FR^FD^FS
^FO427,142^CI0^A0N,23,23^FR^FD^FS
^FO549,610^CI0^A0N,17,17^FR^FDCUST NO:^FS
^FO650,610^CI0^A0N,17,17^FR^FD^FS
^FO345,406^CI0^A0N,39,78^FR^FDPQ^FS
^FO447,406^CI0^A0N,39,78^FR^FD1^FS
^FO650,142^CI0^A0N,23,23^FR^FD,^FS
^FO671,142^CI0^A0N,23,23^FR^FD^FS
^FO711,142^CI0^A0N,23,23^FR^FD^FS
^FO427,732^CI0^A0N,23,23^FR^FD^FS
^FO650,732^CI0^A0N,23,23^FR^FD,^FS
^FO671,732^CI0^A0N,23,23^FR^FD^FS
^FO711,732^CI0^A0N,23,23^FR^FD^FS
^PQ1
^XZ
Since you haven't told us the height of the label you are using, and we can only imply you're using a 203dpi printer from
^FO163,914^BY2,3.0,203^B3N,N,203,N,N^FR^FDRC051514E^FS
I suspect that this particular line is your trigger. The resultant label height is 914+203=1117 dots; at 203.2 dpi=5.497", if calculated at 203dpi is a little over 5.5". Now assuming you are using 5.5" labels with a 1/16" gap, this is probably a smidgin too big. Try reducing the 203s to 190 or the 914 a little. In fact, if you temporarily remove this line and the resultant label prints OK, then that's a quick-and-dirty test that should prove the point.

gnuplot: How to enable thousand separators (digit grouping)?

I'm on German Windows 8.1 64Bit with gnuplot 4.6.5, using the svg terminal. If I plot datafiles that have big numbers, like "one million", gnuplot does not print a digit grouping sign.
For example, if my datafile has values in the order of one million, I want the numbers at the y-axis be displayed as 1.000.000 (with . being the group sign, not the decimal sign!), but gnuplot gives me just 1000000.
The option set decimalsign locale just changes the decimal sign (separator between whole number and fractional part, like 1+1/2 = 1,5 with , being the decimal sign). But neither setting decimalsign nor not calling this command at all shows digit grouping signs in the plot. I only get ugly 1000000 or 1500000 instead of 1.000.000 or 1.500.000.
I also tried
set decimal locale
set format y "%'f"
which just gives me at all tics the label "%'f", instead of the numbers! Each tic has just "%'f", again and again. It just prints the format string as is into the plot and no numbers at all. The console output is decimal_sign in locale is , which is correct for german locale, so gnuplot recognizes it correctly. In my control panel of Windows the thousand separator is set correctly to . and the decimal sign to , too.
Setting tic by tic by hand is no option. I.e. set ytics add ('1.000.000' 1e6) for dozenz of dozenz tics is no option for me.
How do I automatically get thousand separators in gnuplot?
That seems not to work on Windows. From the gnuplot documentation
Internationalization (locale settings): Gnuplot uses the C runtime library routine setlocale() to control locale-specific formatting of input and output number, times, and date strings. The locales available, and the level of support for locale features such as "thousands’ grouping separator", depend on the internationalization support provided by your individual machine.
And judging from questions like How can I add a thousands separator to a double in C on Windows? Printing integers with thousands separators in Windows using C it is not possible since the apostrophe in the format string is a Unix specialty and not a C standard.
I think there is no workaround to get this working on Windows with autoscaling.
For the records: The following script works fine on Linux:
set format "%'.0f"
set xrange [0:1e6]
plot x
Only ., , and are possible as separator (at least Linux). E.g. "french" gives a space:
set decimalsign locale "french" # thousand separator becomes ` `
set decimalsign "."
set format "%'.2f"; # `'` activates the thousand separator
pl [0:1e5] x
Not the most glamorous of solutions, especially if you've got a lot of tics but you could do something like
set ytics ("1.000.000" 1e6, "1.500.000" 1.5e6, etc.)
I'd be interested to hear of anything nicer!
Just for fun and feasibilty... If you absolutely need thousand separators, you can construct a workaround for Windows (with some complexity and limitations). Tested with gnuplot 5.2.6.
Basic recipe:
define a function which converts numbers into text with thousand separators.
set the tic labels yourself using text with thousand separators
place the tic labels by trying to "mimic" gnuplot's setting of tic labels. For this, use gnuplot's suggestions about the scaling by plotting to a dummy terminal first. For this, this post of #Christoph is very helpful.
Code:
### add thousand separators to tic labels for Windows
reset session
# settings for thousand separator
ts = "'" # thousand separator
ThousandSeparator(a,ts) = abs(a)>=1000 ? (TS_a=sprintf("%.0f",a), TS_b=strlen(TS_a), \
TS_c=strstrt(TS_a,'-')+1, TS_d=TS_c>1?'-':'', (sum[TS_i=TS_c:TS_b] \
(TS_d=((TS_b-TS_i)%3==0&&(TS_i<TS_b)?TS_d.TS_a[TS_i:TS_i].ts:TS_d.TS_a[TS_i:TS_i]),\
0), TS_d)) : sprintf("%g",a)
# settings for (auto-)tics
range(axis) = axis eq "y" ? abs(GPVAL_Y_MAX-GPVAL_Y_MIN) : abs(GPVAL_X_MAX-GPVAL_X_MIN)
power(axis) = 10.**int(sprintf("%.15e",range(axis))[strstrt(sprintf("%.15e",range(axis)),"e")+1:])
rangenorm(axis) =range(axis)/power(axis)
posns(axis) = 20.0 / rangenorm(axis)
tics(axis) = \
posns(axis)>40?0.05:posns(axis)>20?0.1:posns(axis)>10?0.2:posns(axis)>4? \
0.5:posns(axis)>2?1:posns(axis)>0.5?2:ceil(range(axis))
ticstep(axis) = tics(axis) * power(axis)
set xrange[0:1e6]
set terminal push # save current terminal
set terminal unknown
plot x lc rgb "web-green"
set terminal pop # restore terminal
# set xtics
do for [i=0:ceil(range("x")/ticstep("x"))+1] {
set xtics add (ThousandSeparator(GPVAL_X_MIN+i*ticstep("x"),"'") GPVAL_X_MIN+i*ticstep("x"))
}
# set ytics
do for [i=0:ceil(range("y")/ticstep("y"))+1] {
set ytics add (ThousandSeparator(GPVAL_Y_MIN+i*ticstep("y"),"'") GPVAL_Y_MIN+i*ticstep("y"))
}
replot
### end of code
Limitations:
if the begin of the axis (e.g. GPVAL_X_MIN) is not identical with the first tic label, the above procedure doesn't work (yet).
However, I haven't yet found the value which gnuplot sets as first tic value. There seems to be no GPVAL_... variable for this. Maybe it can be extracted somehow?
Example 1: (works ok)
set xrange[0:1e6]
Example 2: (doesn't work, because GPVAL_X_MIN=-50000 but first tic should be at 0)
set xrange[-50000:1e6]

ESC/P programming!

Why i need to use it is because for some printers using TPrinter prints some weird hieroglyph at the beginning of the printable area.
My problem is that if i send some commands, nothing happens.
ESC E (#27 #69) - Sending this escape sequence didn't work as i expected. It removed first letter and rest of the string made bold. eg. Hello -> ello. After i changed it to ESC E ESC (#27 #69 #27), it worked fine. This example i managed to figure out, but...
trying to select character table "ESC t n" (#27 #116 n), to make "õäöü" work. This command just doesn't work. Nothing happens! And this command is supported by esc/p, esc/p 2 and 9-pin esc/p, so it should work just fine.
Manual can be found here.
If anyone has ever needed to use esc/p commands then maybe one can shed some light how to work with them!
Thanks in advance!
EDIT:
In my previous post i asked more or less the same question though answers were about how did i send commands to the printer. (I'll change my question there according to what was the answers!)
I accepted Ken's answer, because he claimed that the way i transferred the commands wasn't the best and i got it to work with Escape command.
The problem was that after trying to use my program with another printer, it didn't work as expected, because it uses TPrinter.Begindoc and EndDoc.
So actually i must use the other solution that Rob Kennedy helped me with!
EDIT 2:
As it turned out, i used wrong manual, where commands are little different (though still supporting esc/p as it proclaims). Thank you all for your help!
PS!
I still have a question: I need a character table where
245 = õ
228 = ä
246 = ö
252 = ü
which is iso 8859. But in manual there is no such character table or any similar to it. Should i do some string manipulation and replace eg 228 to 132 or does anyone know any better approuch?
I keep it unanswered for a while, and then accept stukelly's answer.
Based on your previous question, I think you are using the wrong commands to control the EPSON TM-T70 receipt printer. After some research I found the product brochure and POSMicro both mention ESC/POS.
The ESC/POS command for turning bold on and off requires has a third value, as follows.
ASCII ESC E n
Hex 1B 45 n
Decimal 27 69 n
Where n is 0 or 1, turning bold off or on.
Here is a detailed ESC/POS reference.

Resources