Search code examples
zebra-printerszpl

ZPL ^HS command gives incorrect value for number of formats in receive buffer


I am trying to get the number of label formats remaining in the print buffer of a Zebra printer. The printer is being accessed using the Zatar cloud service. To achieve this I am:

  1. putting the printer in a paused state
  2. calling the ^HS command
  3. looking at the 5th field in string 1 of the response

According to the ZPL documentation this field is the

number of formats in receive buffer

However, this value does not appear to be correct. Each subsequent time we call it whilst the printer is paused the value in the field increases. No other jobs are being sent to the printer.

Here is same output of the response:

DEVICE_COMPLETED_SUCCESSFULLY - 030,0,1,0834,003,0,0,0,000,0,0,0
000,0,0,0,0,2,6,0,00000001,1,001
1234,0

Then this after a short interval:

DEVICE_COMPLETED_SUCCESSFULLY - 030,0,1,0834,026,0,0,0,000,0,0,0
000,0,0,0,0,2,6,0,00000001,1,001
1234,0 

And so on:

DEVICE_COMPLETED_SUCCESSFULLY - 030,0,1,0834,028,0,0,0,000,0,0,0
000,0,0,0,0,2,6,0,00000001,1,001
1234,0

The initial response of 003 is correct. However I do not understand why it is then incrementing to 26 and then to 28.

Why is the response not providing the correct value for the formats remaining in the receive buffer?


Solution

  • The reason for the discrepancy in the number of formats in the receive buffer was due to how the printer was being accessed. The Zatar cloud service was used rather than any direct method such as USB.

    The Zatar cloud service uses a device called an Edgebox to communicate with the printer. The Edgebox was periodically sending commands to the printer and it was these commands that were accumulating in the receive buffer.