Programmatically calibrate with LinkOS

// Expert user has replied.
S Stacie Sulak 2 years 9 months ago
59 4 0

I created an iOS app that prints labels to a QLn320 and ZQ620 mobile printer.  If the printer is not calibrated, it rolls out 3 labels for every one I try to print.

This app will be in 100 different locations that already have uncalibrated printers; obviously I can't drive to 100 locations to plug them into the Zebra Setup Utility. 

If I programmatically send ~jc^xa^jus^xz to the printer, it prints out about 8 completely black labels plus a few more.  If I continue to send the calibration command, it will send 3 labels for every 1 I intend to print.  If I remove the calibration command, it will subsequently print properly.  In other words, it seems if I send the calibration command just once, it will actually work.  The question is, is there a way for the app to know when to send the calibration command?  Is there a way to query the device to see if it's calibrated?

I notice if I send this in the Zebra Setup Utility:
! U1 getvar "media.type"
! U1 getvar "media.sense_mode"
I already get a return of "label" and "bar" even though it's not truly calibrated to my needs.  It seems to require the ~jc^xa^jus^xz command.

Any advice would be appreciated. I prefer to not confuse the users and require some sort of one time "Calibrate" button.  Thanks!

Please register or login to post a reply

4 Replies

S Sal Quintanilla

I'm programmatically setting media tracking to MARK and the sensor to TRANSMISSIVE, and then use ^XA^HH^XZ in a loop to make sure they're set. I did that because I found that if I immediately followed up those settings with a calibration using "~jc^xa^jus^xz", it was perhaps too soon, and I'd still be in CONTINUOUS mode during calibration... and of course it wouldn't rotate to define my label. With the wait, it works great.
My current problem: I'm doing this in the context of a mechanical feed that's outside of the printer. Without getting into too much detail, I can't depend on sending a print command and knowing that when calibration eventually completes, my command will be next. I need to know when calibration is complete so I can clear the calibration label.
I've already tried using printer status, which returns isReady while calibration is going, and nothing new later, which makes sense since it's ready to take commands. Is there something I can query on the printer to know that calibration is complete?
Thanks.
Sal

D Dmitry Prokhorov

Hello,
It would be helpful to see a photo of both sides of paper media used to print your labels. There some type of media may that may produce issues.
Also you may need to check a label length and max label length setting values with a following commands:
! U1 getvar "zpl.label_length"
! U1 getvar "ezpl.label_length_max"
Dmitry Prokhorov
Software Engineer, Kutir Mobility
Posted on behalf of Zebra Technologies

S Steven Si

Usually, the label calibration takes 2-3 labels at most, even when calibrating from an app. Looks like there might be something else going on when the calibration command is sent from your app. Make sure that your app only sends the calibration commend once.

Once the calibration is done, the zpl.label_length will be set to whatever the label length detected by the calibration. If you know the label length beforehand, then you can use the following command to check if the printer has been calibrated or not from your app.
! U1 getvar “zpl.label_length”

S Steven Si

Usually, the label calibration takes 2-3 labels at most, even when calibrating from an app. Looks like there might be something else going on when the calibration command is sent from your app. Make sure that your app only sends the calibration commend once.

Once the calibration is done, the zpl.label_length will be set to whatever the label length detected by the calibration. If you know the label length beforehand, then you can use the following command to check if the printer has been calibrated or not from your app.
! U1 getvar “zpl.label_length”

CONTACT
Can’t find what you’re looking for?