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...
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.
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]