Search code examples
printingsdkzebra-printers

Zebra needs recalibration after being powered off while printing


I created a label program using C# and the Zebra SDK. It works great except when a user desides that they printed the wrong labels and they power off the printer. When the printer comes back on, it goes through a quick calibration (I believe that's what it's doing) and then the light changes to a solid green. When they try to print again, one label prints correctly and then two blank labels "print" and the status light changes to a blinking red light. In order to get the printer back into a working condition, it needs to be recalibrated and I use the ZPL command ~JC.

We were using ZebraDesigner software to print labels and the printer never had issues with being powered off, back on and then printing as normal. I captured the data that is printed from that software and added the ZPL to my code but it doesn't help the printer recover when the printer is powered off. I don't know if the ZebraDesigner software is actually sending multiple sets of commands and I'm only capturing the last set or not.

It was suggested to me on another forum that the printer might still have some of the old ZPL data from the last print job and it would need to be cleared. The last thing I tried was adding the soft reset command ~JR to my code but it didn't help. I also tried to clear anything in the buffer using ~JA with no different results.

Here is is my original ZPL code and it does not include the ZPL that I captured from ZebraDesigner becuase it didn't help. I've gone through the ZPL guide multiple times and I'm just not having any luck figuring out what I'm missing that isn't allowing the printer to recover without being calibrated.

All words in {} are replaced by the actual values when imported into my program.

^XA

^PW330

^FO 0,65
^FB 350,1,0,C,0
^A0N 25, 25
^FD{COMPANYNAME}^FS

^FO 0,90
^FB 350,0,0,C,0
^A0N 28, 28
^FD {PRICE} {COLOR} ^FS 

^FO 0,120
^FB 350,1,0,C,0
^A0N 25, 25
^FD {TYPE} ^FS

^FX FO 0,215
^BY2
^FT85, 215
^BCN,60,Y,N,N
^FD>9{BARCODE}^FS

^PQ{QTY}

^XZ

Solution

  • After more testing, I found the command. It's ^MNY

    I found it by running through the file generated by Configure Printer Settings in Zebra Setup Utilities. I ran that ZPL with my ZPL and it fixed the issue. I then narrowed down the code until I found the command that allowed the printer to contiue to function after being turned off. I did see this command in the ZPL guide and thought I tried it but maybe I messed something up.