c++ kr403 usb / serial port model

Hi,

 

  i have a zebra KR403 printer ( the model with usb/serial port) connections.

 

  I am building a Qt/c++ application which needs to print receipts. Additionally for mantainance purposes, i need check if the printer is out of paper or has a papper jam.  I canno't figure out how to query the printer  status. Any ideias on how to accomplish this ?

 

 

 

Best regards,

  Luis G.

Gregory Pawlik
Hi Luis,You can send the

Hi Luis,

You can send the ~HQES command to the printer and it will return flags for various status for the printer including paper out and paper jam.

More information about  ~HQES error flags can be found on page 221 of the ZPL programming guide:

https://www.zebra.com/content/dam/zebra/manuals/en-us/software/zpl-zbi2-pm-en.pdf

Greg

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Luis Goncalves
Hi Greg, thanks for the

Hi Greg,

thanks for the quick reply. 

That is exactly what i need to get. 

I tested that command with Zebra Setup Utilities:

  when connecting over USB it works ( usb mini - usb cable). Sample Output:

     PRINTER STATUS                       

        ERRORS:         1 00000000 00010000 

        WARNINGS:       1 00000000 00000030 

 

when connecting over SerialPort it doesn't work:

    i get an error on the software status bar: "Unable to open port!"

    Nothing works. I canno´t print sample page either.

 

These are my Serial port settings:

Note: For the Serial port connection i am using a RS232 to usb cable like this one:

CHEAP-SERIAL12.jpg

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Gregory Pawlik
Hi Luis,The serial to usb

Hi Luis,

The serial to usb cable that you are using isn't a supported method for communicating with a the printer.

If you are going to communicate to the printer via serial connection, you'll want to standard null modem serial cable that connects via RS232 to both the printer and PC.

Greg

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Luis Goncalves
Hi Greg,    i posted the

Hi Greg,

 

  i posted the wrong cable... Sorry, This is the cable i am using:

CABLE-146_2_MR.JPG

By reading your answer, i can only use the following cable. Right ?

cab232.jpg

Is it possible to programmatically read  the printer status using usb mini -> usb  cable ?   ( in any language, c++, c#, whatever...). Maybe from Windows logs ?

Best regards,

  Luis

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Gregory Pawlik
Hi Luis,Yes, the white cable

Hi Luis,

Yes, the white cable in your previous post is what you should be using.

To programmatically read the status from via USB cable, you should just call up the printer driver and send and receive data that way.

Greg

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments