Zebra ZQ520 connected via Bluetooth, but cannot print

I am using a Zebra ZQ520 printer and using a Zebra Printer demo (click here to see it on Github) using Swift 4.2 on Xcode. The demo, running on an iPad that connects to the printer via bluetooth, checks the printer connection using "printerConnection?.open( )" and the app confirms that the connection has succeeded (printManager.isConnected = true). However, when I send a command, like

! 0 200 200 150 1 \nT 7 0 50 0 Aztec Code - Label Spec 5-1 EC=47 \nBARCODE AZTEC 30 50 \n72819381828 \nENDAZTEC \nPRINT

The printer does not respond despite the "printerConnection?.write" function successfully running. There are no errors displayed, so I am not sure what is wrong. I have tried other commands, like simple text:

! 0 200 200 210 1 \nTEXT 4 0 30 40 TestText \nFORM\nPRINT

I've followed the commands in the Mobile Printing Manual, so I'm thinking the commands aren't the problem. Should I try to query the connection's status (I'm not quite sure how to do that) or is there some sort of error or misstep I've taken? Any help would be appreciated.

Anonymous (not verified)
It looks like that a carriage

It looks like that a carriage return is missing at the end of the CPCL script. Please try to add "\n" to the end as shown below.

! 0 200 200 150 1 \nT 7 0 50 0 Aztec Code - Label Spec 5-1 EC=47 \nBARCODE AZTEC 30 50 \n72819381828 \nENDAZTEC \nPRINT\n

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Daniel Beich
Thanks for the response, I

Thanks for the response, I did find that the missing carriage return did make the "TestText" work, but I still had problems with the Aztec barcode generating text. I tried pasting the command for that text and it failed to print, but it didn't throw an error.  I tried out some other prints, like PATTERN and QR codes, and neither of those two would work either. Might you have an idea of what's going on?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Since it prints after

Since it prints after appending the "\n" to the end of the script, it means the Bluetooth connection works, which means you can send whatever ASCII text over the Bluetoot to the printer. Whether it prints or not, it depends on what's been sent. Now, you can focus on the Aztec barcode command text. I would suggest that you download the Zebra Printer Setup Utilities and connect the printer to the PC via USB. Then you can test out the Zetac barcode command. If the command works and prints, the ASCII text of the command should work too over the Bluetooth. Hope this helps.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Daniel Beich
Steven,I was able to test out

Steven,

I was able to test out the Aztec commands from the USB connection and it was successful. However, no matter how many times I try Aztec from my app, it fails. I've ensured that the text is being taken in ASCII format with no unnecessary characters or spaces. I've tried several formats from my code now and here's what I've figured out:

Worked: Text commands, Barcode 128, Maxicode

Did not work: Aztec, QR Code, Pattern, PDF417

Is there something up with Aztec/QR Code/PDF417 that I'm missing?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
There should be no difference

There should be no difference whether you send text commands or Aztec barcode, because they are all represented in text format in ZPL. There are a few ways to debug your issue. You can try to let the app send the exact text string that you sent from Setup Utilitye, to see if the printer prints the same label. If the printer doesn't, then you can try to set up the printer to input.capture mode and check what's been received by the printer through the file dump.

! U1 do "file.dir" "E:"

! U1 do "file.type" "IN001.DMP" // This is just an example. Your dump filename might be IN003.DMP.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Daniel Beich
Here two dumps, one of a

Here two dumps, one of a barcode that works:

IMG_3219.JPG

And one of a barcode that does not work:

IMG_6535.JPG

I'm not spotting any key differences between the two... the formatting seems to be on point for both.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Daniel Beich
Alright, I've figured out the

Alright, I've figured out the problem, at least somewhat. My problem was that before certain barcodes were to be generated, the printer's language inexplicably changed. From what I can understand, when printing text or something that was on the "Working" list like the MAXICODE command, the language would be in "line_print" (which is CPCL, right?). However, when something like AZTEC would be attempted, the language would suddenly change to "hybrid_xml_zpl". The solution seems to be to set the language in the code before attempting to print it. I was able to print this after changing the language to ZPL:^XA ^B0R,7,N,0,N,1,0 ^FD 7. This is testing label 7^FS ^XZ

^XA ^B0R,7,N,0,N,1,0 ^FD 7. This is testing label 7^FS ^XZ

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
I'm glad that you've found

I'm glad that you've found the solution. Please note the Device Languages (a.k.a. Printer's Language) on the printer does not change by itself. It can be changed through the SGD command (for example, ! U1 setvar "device.languages" "zpl" or ! U1 setvar "device.languages" "line_print" ). Once the device languages is set, it will stay in that language till the next SGD command to change it. It's always a good practice to check the device languages first in the application before printing.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments