Adding QR Code Data Switches to the Data Stream

Adding QR Code Data Switches to the Data Stream

Article ID: 74231479



Topic or Information

QR Code Switches are required for proper QR Code encoding and requires special attention so it is included in the data stream

Applies To

ZPL compatible printers where download and recall format is used for printing QR Codes, which requires specific data switches for encoding. 


When using ZebraDesigner for XML, ZebraDesigner for SAP, KDU or any application where you download and recall a format, the required switches for a QR Code must be included in the data stream.  It is unique to QR Code that the required switches must come after the ^FD in ZPL.  However, we have also determined that when using code to recall and print ZPL stored in a Zebra printer, the switches must be included within the data stream.    

You may see that when executing a test print with the ZebraDesigner for XML or ZebraDesigner for mySAP software running at print-time the full data stream prints and scans successfully.  This is only because the complete ZPL code is sent to the printer that includes the required switches and is not recalled. 
However, when the software is NOT running at print-time a file is sent to the printer to recall and print the stored ZPL must include the required switches in the data stream.   
This sample XML recalls a stored QR.ZPL file:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE labels SYSTEM "label.dtd">
<labels _FORMAT="E:QR.ZPL" _QUANTITY="1" _PRINTERNAME="Printer 1" _JOBNAME="LBL101">
<variable name="Zebra">LA,Sample</variable>
Note: See the Switch Details information below that details the "LA" entry above.
NOTE:  If the required switches are not included in the data stream, a QR bar code will print but when scanned only part of the data will show.  In this example, sending the XML below with no switches to a printer with a QR.ZPL file stored for recall, prints a QR code that scans only 'ple.'
<!DOCTYPE labels SYSTEM "label.dtd">
<labels _FORMAT="E:QR.ZPL" _QUANTITY="1" _PRINTERNAME="Printer 1" _JOBNAME="LBL101">
<variable name="Zebra"> Sample</variable>
Switch Details Details from the ZPL Manual ^BQ command Read More>>

 Error correction level (Required)

= H, Q, M, or L

H = ultra-high reliability level
Q = high reliability level
M = standard level (default) 
L =high density level


Data input (Required)

= A or M followed by a comma

A = Automatic Input (default). Character Mode is not specified.

Data character string JIS8 unit, Shift JIS. When the input mode is Automatic Input, the binary codes of 0x80 to 0x9F and 0xE0 to 0xFF cannot be set.

M = Manual Input. Character Mode must be specified.

Two types of data input mode exist: Automatic (A) and Manual (M). If A is specified, the character mode does not need to be specified. If M is specified, the character mode must be specified.

Character Mode (Required when data input = M)

= N, A, Bxxxx, or K

N = numeric: digits 0 – 9

A = alphanumeric: digits 0 – 9, upper case letters A – Z, space, and $%*+-./:) (45 characters) Bxxxx = 8-bit byte mode. The ‘xxxx’ is the number of characters and must be exactly 4 decimal digits.

This handles the 8-bit Latin/Kana character set in accordance with JIS X 0201 (character values 0x00 to 0xFF).

K = Kanji — handles only Kanji characters in accordance with the Shift JIS 0208. This means that all parameters after the character mode K should be 16-bit characters. If there are any 8-bit characters (such as ASCII code), an error occurs.

The data to be encoded follows immediately after the last switch.


Considerations for ^FD When Using the QR Code:

 QR Switches (formatted into the ^FD field data)

        mixed mode <D>

D = allows mixing of different types of character modes in one code.

         code No. <01 16>

Value  = subtracted from the Nth number of the divided code (must be two digits).

        No. of divisions <02 16>

                Number of divisions (must be two digits).

         parity data <1 byte>

Parity data value is obtained by calculating at the input data (the original input data before divided byte-by-byte through the EX-OR operation). 


Steve S

+ Product Codes

  • 105SLPlus Industrial Printers
  • 105SLPlus Industrial Printers
  • 110PAX Print Engines (disc.)
  • 110Xi4 Industrial Printer
  • 140Xi4 Industrial Printer
  • 170PAX4
  • 170Xi4 Industrial Printer
  • 220Xi4 Industrial Printer
  • 2824 Plus Series
  • 2824-Z Series
  • All Surface RFID Label Solution
  • Desktop Printers
  • G-Series GC Desktop Printers
  • G-Series GK Desktop Printers
  • G-Series GX Desktop Printers
  • GC420d Desktop Printer
  • GC420t Desktop Printer
  • GK420d Desktop Printer
  • GK420d Healthcare Desktop Printer
  • GK420t Desktop Printer
  • GK420t Healthcare Desktop Printer
  • GT800 Desktop Printer
  • GX420Rx Desktop Printer
  • GX420d Desktop Printer
  • GX420t Desktop Printer
  • GX430d Desktop Printer
  • GX430t Desktop Printer
  • HC100 Wristband Printer
  • HC100 Wristband Printer
  • Industrial Printers
  • LP 2824 Plus Desktop Printer
  • MZ Series
  • MZ-220
  • MZ-320
  • Mobile Printers
  • P4T Mobile Printers
  • P4T Mobile Printers
  • Print Engines
  • QL Series Mobile Printers
  • QL320 Mobile Printer
  • QL420 Mobile Printer
  • QLn Series Healthcare Mobile Printers
  • QLn Series Mobile Printers
  • QLn220 Healthcare
  • QLn220 Mobile Printer
  • QLn320 Healthcare
  • QLn320 Mobile Printer
  • QLn420 Mobile Printer
  • R110Xi4 RFID Printer
  • RFID Printers
  • RP4T RFID Printers
  • RP4T RFID Printers
  • RW 220 Mobile Printer
  • RW 420 Mobile Printer
  • RW 420 Print Station
  • RW Series Mobile Printers
  • RZ400
  • RZ600
  • S4M
  • S4M Series
  • TLP 2824Plus Desktop Printer
  • Xi Series Industrial Printers
  • Z Series Industrial Printers
  • ZD410 Series
  • ZD410D
  • ZD420 Series
  • ZD420-HC
  • ZD420C
  • ZD500 Desktop Printer
  • ZD500 Desktop Printer
  • ZD500R RFID Printers
  • ZD500R RFID Printers
  • ZE500 Print Engines
  • ZE500 Print Engines
  • ZE500R RFID Print Engine
  • ZE500R RFID Print Engine
  • ZM400
  • ZM400
  • ZM600
  • ZM600
  • ZQ500 Series Mobile Printers
  • ZQ510 Mobile Printer
  • ZQ520 Mobile Printer
  • ZR300 Series Mobile Printers
  • ZR338 Mobile Printers
  • ZR600 Series Healthcare Mobile Printers
  • ZR600 Series Mobile Printers
  • ZT200 Series Industrial Printers
  • ZT210 Industrial Printer
  • ZT220 Industrial Printer
  • ZT230 Industrial Printer
  • ZT400 Series Industrial Printers
  • ZT400 Series RFID Printers
  • ZT410 Industrial Printer
  • ZT410 RFID Industrial Printer
  • ZT420 Industrial Printer
  • ZT420 RFID Industrial Printer
  • ZT510 Industrial Printer
  • ZT610 Industrial Printer
  • ZT610 RFID Industrial Printer
  • ZT620 Industrial Printer
  • ZT620 RFID Industrial Printer
  • iMZ Series Mobile Printers
  • iMZ220 Mobile Printer
  • iMZ320 Mobile Printer