We are in the midst of an Oracle ERP implementation and I have been tasked with redesigning our labels to work with the new system. Our product labeling needs to contain a QR code encoded with the Item and Lot number separated by a [TAB] character. Oracle will be sending XML files containing variable data to the printers for use with formats stored on the printers.
Hard coding works fine, I get a QR coded with 'FOO[TAB]BAR':
^XA
^FO50,50
^BQN,2,10^FH^FDQA,FOO_09BAR^FS
^PQ1,0,1,Y
^XZ
Strange things happen when I create a stored format on the printer:
^XA
^DFE:QR_TEST.ZPL
^MCY
^FO50,50
^BQN,2,10^FN1^FH^FDQA,$$QR_CODE$$^FS
^FO50,350
^AON,30,30^FN1^FD$$QR_CODE$$^FS
^XZ
And send the following XML file:
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE labels SYSTEM "label.dtd">
<labels _FORMAT="QR_TEST.ZPL" _QUANTITY="1" _PRINTERNAME="" _JOBNAME="TEST">
<label>
<variable name="$$QR_CODE$$">FOO_09BAR</variable>
</label>
</labels>
Interestingly without the text field definition the label does not print. After adding the text field the label prints but the QR code produced drops 'FOO' and scans as only '_09BAR' while the text field prints 'FOO_09BAR'.
Confusing matters further, if I drop the '_09' out of the $$QR_CODE$$ variable definition, the text field prints 'FOOBAR' as expected but the QR code scans as 'BAR', so for whatever reason the QR is dropping the first three characters of data.
I've been chasing my tail for a day on this with no progress so am wondering if anybody here with more experience than I can shed some light on the problem.
My two questions are:
For the benefit of anyone else trying to solve the same problem here's the solution that I arrived at. Unfortunately Zebra support was of no help as all they could do was to keep sending me pages from the manual I already had. They were unable to send me a working example.
The solution involved two things:
The format stored on the printer looks like this:
^XA
^DFE:QR_TEST.ZPL
^MCY
^FO50,50
^BQN,2,10^FN1^FH^FD$$QR_CODE$$^FS
^XZ
Send the following XML file to the printer:
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE labels SYSTEM "label.dtd">
<labels _FORMAT="QR_TEST.ZPL" _QUANTITY="1" _PRINTERNAME="" _JOBNAME="TEST">
<label>
<variable name="$$QR_CODE$$">QM,B0007FOO[TAB]BAR</variable>
</label>
</labels>
The variable $$QR_CODE$$ breaks down as:
The SQL that provides the variable value has to provide all of the above, but that is pretty straightforward. So far this has worked flawlessly with the combinations of item and lot numbers that I've tested so far ranging in length from 10 to 25 characters in length. I'll update this post if I run into any difficulty or learn anything new.