Zebra KR403 - How to retrieve paper sensor related data?

Hi all,

Currently I am working on extracting Zebra KR403 paper sensor related data. Currently i am getting some byte related data via the following code. I Just wanted to know is there a built in way to translate this byte data to meaning/readable format?

// Sample code

  Connection thePrinterConn = new TcpConnection(this.getIpAddress(), getPort());

        try {

             byte[] msg;

            thePrinterConn.open();

             for(int i=0;i<20;i++) {

          System.out.println("STATUS  "+thePrinterConn.sendAndWaitForResponse("~HQES".getBytes(), 2000, 1000,null));

          }

        } catch (ConnectionException e) {

            e.printStackTrace();

        } finally {

            try {

          thePrinterConn.close();

          } catch (ConnectionException e) {

          e.printStackTrace();

     }

}

Result :-

STATUS  [B@24d46ca6

STATUS  [B@4517d9a3

STATUS  [B@372f7a8d

STATUS  [B@2f92e0f4

STATUS  [B@28a418fc

STATUS  [B@5305068a

STATUS  [B@1f32e575

STATUS  [B@279f2327

STATUS  [B@2ff4acd0

STATUS  [B@54bedef2

STATUS  [B@5caf905d

STATUS  [B@27716f4

STATUS  [B@8efb846

STATUS  [B@2a84aee7

STATUS  [B@a09ee92

STATUS  [B@30f39991

STATUS  [B@452b3a41

STATUS  [B@4a574795

STATUS  [B@f6f4d33

STATUS  [B@23fc625e

Selaka Nanayakkara
Hi all, After some research i

Hi all,

After some research i finally managed to find a way to translate the byte codes to have meaningful code combination according to the

Documentation manual of Zebra KR403 under ZPL commands (~HQES).

Code =

String value = new String(thePrinterConn.sendAndWaitForResponse("~HQES".getBytes(), 2000, 1000,null));

System.out.println(""+value);

result =

  PRINTER STATUS                       

   ERRORS:         0 00000000 00000000 

   WARNINGS:       1 00000000 00000030 

You can get whatever the statuses relevant to the above code in the manual. of Zebra KR403.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments