How to validate if a client network printer online?

A Anfas Thowfeek 3 years 7 months ago
79 1 0

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!,

Please Register or Login to post a reply

1 Replies

D Dmitry Prokhorov

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/program…

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/program…

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/program…
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

CONTACT
Can’t find what you’re looking for?