5 Replies Latest reply on Jun 26, 2017 7:43 AM by Luis Martinez

    ZQ520 unable to determine printer status

    Luis Martinez

      I'm having several issues on the ZQ520 only.

       

      Whenever I checked the printer status I get an exception: Malformed status response - unable to determine printer status. My first thought was maybe my implementation is wrong so I downloaded the Xamarin Demo to see it works with the demo's implementation. Ran the demo and got the same exception.

       

      Found a work around to the exception error, which is to always return true when checking the status; however, in the demo and on my app using the demo's formatted string, the ZQ520 prints the incorrect format (correct format on ZD410). Using my formatted string it prints nothing to the ZQ520 (prints on ZD410) even though the following statement is run:

      Connection.Write(bytes[])
      

       

      Problem with ZQ520

      1) without the workaround I received "unable to determine printer status" exception

      2) with workaround it prints incorrect format

      3) using my formatted string it prints nothing.

       

      My sample formatted string:


                  "^XA^POI^LT0^LL250" +
                  "^XZ" +
                  "^FO" +
                  "435" +
                  ",8^AEN,26,13^Title^FS" +
                  "^FO" +
                  "435" +
                  ",45^ADN,18,10^FDSome Label: " + "AAA" + "^FS" ... "^XZ";

        • Re: ZQ520 unable to determine printer status
          Robin West

          Hi Luis, I think your issue is print control language.  Try setting the print language in the ZebraPrinter object when you are creating it:

          IZebraPrinter printer = ZebraPrinterFactory.Current.GetInstance(PrinterLinguage.ZPL, connection);

           

          You also want to make sure the printer is set up to take ZPL. BY DEFAULT THE ZQ520 IS NOT!  The demo should be setting the language properly, and once set, it should remain set correctly, but I recommend making sure in your code as well:

                  private bool SetPrintLanguage(IConnection connection)

                  {

                      string setLanguage = "! U1 setvar \"device.languages\" \"zpl\"\r\n\r\n! U1 getvar \"device.languages\"\r\n\r\n";

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

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

                      if (!s.Contains("zpl"))

                      {

                          ShowMessage("Not a ZPL printer.");

                          return false;

                      }

                      return true;

                  }

           

          Also, your ZPL is not right.  You want to make sure the entire label is within the start and stop commands:

          ^XA - start of format, ^XZ - end of format & print.

          "^XA^POI^LT0^LL250" +

                      "^FO" +

                      "435" +

                      ",8^AEN,26,13^Title^FS" +

                      "^FO" +

                      "435" +

                      ",45^ADN,18,10^FDSome Label: " + "AAA" + "^FS" +

                      "^XZ";

           

          Hope this helps!

          Robin

            • Re: ZQ520 unable to determine printer status
              Luis Martinez

              I have tried

              IZebraPrinter printer = ZebraPrinterFactory.Current.GetInstance(PrinterLinguage.ZPL, connection);

              and did not resolve the issues.

               

              How do I check if the printer is set up to take ZPL?

               

              As for the commands, I copy and paste a snippets of my commands and forgot to add the stop command to my post.

                • Re: ZQ520 unable to determine printer status
                  Robin West

                  Hi Luis,

                  There are a couple of ways.  The code snippet above should tell you, but if that is not working, you can use the Android or PC app called Printer Setup.  Printer Setup Utilities | Zebra It's also in the Google Play store. 

                  I would be curious what response you get to the snippet above.  Your ZQ520 may have an issue itself as it doesn't sound like it wants to really communicate at all. 

                    • Re: ZQ520 unable to determine printer status
                      Luis Martinez

                      The snippet to SetPrintLanguageLanguage returns true and the response string is "hybrid_xml_zpl".

                       

                      Edit: It seems bypassing the check status on the printer (ZQ520) works but I can't print anything besides the command input that is on the demo. A simple command such as:

                      "^XA" +

                      "^FO50,50^ADN,36,20^FDSOME NAME" +
                      "^FS" +
                      "^XZ";

                      does not print on the ZQ520 but does on ZD410. However, the post print check status returns "ready to print" when printing the demo's command input.