How to do media setup on ZQ510 in Xamarin.iOS

I've got a ZQ510 printer that I'm starting to use for QR codes on labels. I've figured out how to print the QR code to the printer using ZPL, but I cannot figure out how to get the printer to correctly paper feed for the labels we're using.

We're using 50.8 x 50.8 labels using a black bar separator, but by default the printer does not seem to detect this and the paper feed is random.

I believe from the Zebra support docs that we're supposed to use the following commands to configure the printer

! U1 setvar "media.type" "label"

! U1 setvar "media.sense_mode"; "bar"

~jc^xa^jus^xz

but I can't see how this should be done in Xamarin iOS. I've tried combining them into a string and sending that but with no success.

Any suggestions?

Anonymous (not verified)
Hi Philip,You only need to

Hi Philip,

You only need to "calibrate" each printer once for the labels, so hopefully you have a setup page in your app you can put this function in.

Some of the commands you were given are more applicable for CPCL, not ZPL.  Add the following to your Xamarin app:

    string calibrate = "\r\n{}{\"ezpl.media_type\":\"mark\"}\r\n";

    calibrate += "^XA^MNM^XZ~JC^XA^JUS^XZ\r\n";

    connection.Write(Encoding.ASCII.GetBytes(calibrate));

This should set up your label detection correctly. You can verify by adding:

    string getLabelLength = "{}{\"zpl.label_length\":\null}\r\n";

    byte[] response = connection.SendAndWaitForResponse(Encoding.ASCII.GetBytes(setLanguage), 500, 500); 

    string labelLength = Encoding.ASCII.GetString(response);

The labelLength should be: {"zpl.label_length":"406"}

because the ZQ510 print head is 8 dots per mm.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments