How to validate if a client network printer online?

Hello,

I'm working on a ZPL application for one of my client.

My application requirement is running ZPL application in one printer and get the output label in another printer.

Both printers are on same network.

My application is working fine, so far if both printers connected and live on the network.

But if either one disconnected from network, the application freezes or sometime the Main printer sends the job and it will be in the queue until client printer comes online.

I'm using CLIENSOCKET to perform this task.

My requirement is if anyone could share and help me with ZPL code on how to validate the client printer if it is online or not before I send print job from master printer?

Thanks in advance!,

Dmitry Prokhorov
Hello Anfas,Seems there is no

Hello Anfas,

Seems there is no any reliable way for client printer to check if remote printer connected. However you can check if client printer connected to a network. You can call SGD commands from ZBI program in a way as it shown on page 557:

https://www.zebra.com/content/dam/zebra/manuals/printers/common/programming/zpl-zbi2-pm-en.pdf#page=557

You need to execute following SGD command to obtain printer connectivity status:

! U1 getvar "ip.active_network"

https://www.zebra.com/content/dam/zebra/manuals/printers/common/programming/zpl-zbi2-pm-en.pdf#page=1077

Also,  you may need to use ON ERROR handler in a way as it shown on page 485:

https://www.zebra.com/content/dam/zebra/manuals/printers/common/programming/zpl-zbi2-pm-en.pdf#page=485

It will prevent your program from freezing forever in case of connectivity problems.

Dmitry Prokhorov

Software Engineer, Kutir Mobility

Posted on behalf of Zebra Technologies

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments