ZebraPrinter.getCurrentStatus taking 9-10 seconds to return.

S Steven Lange 3 years 6 months ago
51 3 0

I'm trying to get the status of a zd410 prior to sending the print data however it seems to be taking anywhere from 5 seconds to 10 seconds to return.  When using the serial port this normally takes about 200ms.    We are trying to move from the com/serial to usb but when using Connection.sendAndWaitForValidReponse() returns in about 5 seconds.  If I use ZebraPrinter.getCurrentStatus() that takes about 10 seconds.   I'm using a usb connection not tcp or bluetooth so using a status channel I don't think is an option.

Please Register or Login to post a reply

3 Replies

P Paul OBrien

I tried a new approach based on another posting I found - see below.  This works great - instantaneous response however, if I run this code a second time, the call to ConnectionBuilder.Build hangs up and never returns. 

    Private Sub btnGetPrinterStatus2_Click(sender As Object, e As EventArgs) Handles btnGetPrinterStatus2.Click
        Dim connection As DriverPrinterConnection = Nothing
        Dim byteArray As Byte()
        Dim result As List(Of String)

        Try
            connection = ConnectionBuilder.Build(_currentUsbPrinterName)    *** Hangs up if I run this code again
            connection.Open()
            Dim getstatus As String = "~HQES"
            byteArray = Encoding.ASCII.GetBytes(getstatus)
            Dim response As Byte() = New Byte(149) {}
            connection.Write(byteArray)
            connection.WaitForData(3000)
            response = connection.Read()
            result = ParseResponse(response)
            If result.Count > 0 Then
                lblMessage.Text = result.Item(0)
            Else
                lblMessage.Text = "No result returned."
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        Finally
            If connection IsNot Nothing Then
                connection.Close()
                connection.Dispose()
            End If
        End Try

    End Sub

Y Yanis Dalabiras

Hi Steven, We don't think we're aware of this issue, so can you share some details? 
What OS?  Driver (version?) or direct USB? What platform (Android/Windows Java/Windows C#/etc.)?  What version of the library? What firmware version?

Thanks,
Robin

A Antoine Veldhoven

Hi Robin,

I'm facing the same issue; we have several dozens of (old) GK420 printers, this usaually takes about 1 or 2 second, but on the (new) ZD420, it takes more than 10 seconds; on a mac is takes about 1 or 2 seconds.

Please advise since printing during waiting for the status reply is not possible; this causes huge deplay for large volume printing.

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