8 Replies Latest reply on Sep 21, 2017 7:35 PM 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.

                • Re: ZQ520 unable to determine printer status
                  Luis Martinez

                  I would like to add that their might be a bug with the LinkOS Zebra Forms API. I use my own implementation of the LinkOS Zebra Forms API and the implementation found in the demo sample found here Getting Started with Link-OS Multiplatform SDK both throw the same exception. This is only for the ZQ520 and tried on two different ZQ520 and both did not print. The ZD410 prints perfectly. Exception is thrown when trying to check the printer status.

                   

                  Is it possible if ya can try printing to a ZQ520 using the demo sample found in Xamarin component store: Getting Started with Link-OS Multiplatform SDK with out any errors?

                   

                  Stack Trace

                  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <3fd174ff54b146228c505f23cf75ce71>:0

                    at Java.Interop.JniEnvironment+InstanceMethods.CallObjectMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method) [0x00068] in <bd30a18775d94dc8b6263aecd1ca9077>:0

                    at Android.Runtime.JNIEnv.CallObjectMethod (System.IntPtr jobject, System.IntPtr jmethod) [0x0000e] in <d855bac285f44dda8a0d8510b679b1e2>:0

                    at Zebra.Sdk.Printer.Internal.ZebraPrinterZpl.get_CurrentStatus () [0x0003d] in C:\repos\xamarin-sdk\Binding Libraries\ZSDK_ANDROIDX\ZSDK_ANDROIDX\obj\Release\generated\src\Zebra.Sdk.Printer.Internal.ZebraPrinterZpl.cs:152

                    at LinkOS.Plugin.ZebraPrinterImplementation.get_CurrentStatus () [0x00005] in C:\repos\xamarin-sdk\Link_OS_SDK_for_Xamarin_Portable\LinkOS\LinkOS.Plugin.Android\ZebraPrinterImplementation.cs:29

                    at MyProject.PreCheckPrinterStatus (LinkOS.Plugin.Abstractions.IConnection connection) [0x0000e] in /MyProject/ZebraPrinter.cs:153

                    --- End of managed Zebra.Sdk.Comm.ConnectionException stack trace ---

                  com.zebra.sdk.comm.ConnectionException: Malformed status response - unable to determine printer status

                  at com.zebra.sdk.printer.internal.PrinterStatusZpl.getPrinterStatus(Unknown Source)

                  at com.zebra.sdk.printer.internal.PrinterStatusZpl.updateStatus(Unknown Source)

                  at com.zebra.sdk.printer.PrinterStatus.getStatusFromPrinter(Unknown Source)

                  at com.zebra.sdk.printer.PrinterStatus.<init>(Unknown Source)

                  at com.zebra.sdk.printer.internal.PrinterStatusZpl.<init>(Unknown Source)

                  at com.zebra.sdk.printer.internal.ZebraPrinterZpl.getCurrentStatus(Unknown Source)

                  at mono.java.lang.RunnableImplementor.n_run(Native Method)

                  at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)

                  at android.os.Handler.handleCallback(Handler.java:733)

                  at android.os.Handler.dispatchMessage(Handler.java:95)

                  at android.os.Looper.loop(Looper.java:136)

                  at android.app.ActivityThread.main(ActivityThread.java:5034)

                  at java.lang.reflect.Method.invokeNative(Native Method)

                  at java.lang.reflect.Method.invoke(Method.java:515)

                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)

                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)

                  at dalvik.system.NativeStart.main(Native Method)

                    • Re: ZQ520 unable to determine printer status
                      Robin West

                      Hi Luis, Which version of Android and firmware version of the printer?  I tried it with Android v7.0 (Samsung Galaxy S8) and ZQ520 running v76.20.01Z over Bluetooth Classic.  It worked fine.  Did you try the basic Status demo?

                        • Re: ZQ520 unable to determine printer status
                          Luis Martinez

                          Android 4.4.4

                          ZQ520 firmware: v76.19.13z

                          Bluetooth Classic

                          Tried the basic status demo threw error when trying to check status. Error: Malformed status response - unable to determine printer status.

                           

                          Edit: Updated the firmware to v76.20.01Z and checked that status using the basic status demo on a android V7.0 and got the same error.

                           

                          Edit 2: Using the Zebra Utilities app in the Google Play Store I am able to print the test file to the ZQ520. Yet the demo does not.