SDG command to get printed tag count while printing not working.

Hello, I am using the java sdk to connect and send zpl commands to a R110Xi4 printer.

To get the printed tag count I used :

SGD.GET("odometer.rfid.valid_resettable", connection, 1000, 1000).toInt()

It works fine when I first connect to the printer, but after I send a zpl print job or while the printer is printing the functions returns an empty string or a "?".

To get the tag count again, I have to close the connection to the printer and reconnect.

Is there a solution for this problem?

I connect to the printer with the TcpConnection class. TcpConnection (Zebra API (build v2.11.2800))

Many thanks for your help in advance.

Best regards

Anonymous (not verified)
Please try to use the status

Please try to use the status connection for SGD, i.e. tcpStatusConnection.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Axel FOODLES
With the TcpStatusConnection

Capture.PNGCapture2.PNG

With the TcpStatusConnection (Zebra API (build v2.14.5097))  the code above returns empty strings for each value "appl.name" and "odometer.rfid.valid_resettable" but works fine with the TcpConnection class (results above).

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Axel,I think they made a

Hi Axel,

I think they made a change to the SDK recently that will make it problematic to use the SGD class with an Xi printer.  It will only work on Link-OS printers now.

Please switch your code to use something like the following instead:

connection.open();

string getFW = "\r\n! U1 getvar \"appl.name\"\r\n";

string getRFIDValid = "\r\n! U1 getvar \"odometer.rfid.valid_resettable\"\r\n";

byte[] fwResp = connection.sendAndWaitForResponse(getFW.getBytes("UTF-8"), 300,300, null);

val firmwareVercion = new String(fwResp, "UTF-8");

byte[] rvResp = connection.sendAndWaitForResponse(getRFIDValid.getBytes("UTF-8"), 300,300, null);

val count = new String(rvResp, "UTF-8");

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments