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.
2 Replies
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
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?