Best method to send ZPL to a zebra printer address on a network


sherman levine
 

I know I can send ZPL to a shared Zebra printer by sending text output to a file named \\servername\printername or \\localhost\printername, however I now need to send ZPL to a printer which simply has an IP address on a network.

What would be the best way to accomplish that from a Windows workstation?

Thank you

Sherm


Todd Baremore
 

Sherm,

Not sure if this applicable......

From https://forum.inductiveautomation.com/t/send-zpl-command-to-zebra-170pax4-via-tcp-ip-socket/6003/6
----------------------------------------------------------------------------------------------------------------------------------------------------------
Sorry for the Delay been busy, changing the script to utilize the Java socket work and now I’m able to print without issues.
Bellow if a snip of the code if anyone needs it.

strMessage = “^XA^LH10,10^LRY^F010,45^AFN,20,20^FDHELLO^FS^XZ”
#========================================================================================
Send Data to Printer

#========================================================================================
port=9100
try:
# Open Socket Connection
clientSocket=Socket(strIP,port)
#Open data output stream
outToPrinter=DataOutputStream(clientSocket.getOutputStream())
#Send Data to Printer
outToPrinter.write(strMessage)
#close data stream and socket
outToPrinter.close();
clientSocket.close();
except IOError:
print “Error”

Todd

On 1/25/2023 2:51 PM, sherman levine wrote:
I know I can send ZPL to a shared Zebra printer by sending text output to a file named \\servername\printername or \\localhost\printername, however I now need to send ZPL to a printer which simply has an IP address on a network.

What would be the best way to accomplish that from a Windows workstation?

Thank you

Sherm






sherman levine
 

Todd
Lots of interesting possibilities there
Thanks

Sherm

On Jan 25, 2023, at 22:12, Todd Baremore <tbaremor@...> wrote:

Sherm,

Not sure if this applicable......

From https://forum.inductiveautomation.com/t/send-zpl-command-to-zebra-170pax4-via-tcp-ip-socket/6003/6
----------------------------------------------------------------------------------------------------------------------------------------------------------
Sorry for the Delay been busy, changing the script to utilize the Java socket work and now I’m able to print without issues.
Bellow if a snip of the code if anyone needs it.

strMessage = “^XA^LH10,10^LRY^F010,45^AFN,20,20^FDHELLO^FS^XZ”
#========================================================================================
Send Data to Printer

#========================================================================================
port=9100
try:
# Open Socket Connection
clientSocket=Socket(strIP,port)
#Open data output stream
outToPrinter=DataOutputStream(clientSocket.getOutputStream())
#Send Data to Printer
outToPrinter.write(strMessage)
#close data stream and socket
outToPrinter.close();
clientSocket.close();
except IOError:
print “Error”

Todd

On 1/25/2023 2:51 PM, sherman levine wrote:
I know I can send ZPL to a shared Zebra printer by sending text output to a file named \\servername\printername or \\localhost\printername, however I now need to send ZPL to a printer which simply has an IP address on a network.

What would be the best way to accomplish that from a Windows workstation?

Thank you

Sherm










Steven Blank
 

Sherm,

Does the Zebra printer "listen" on a certain TCP/IP port? If so, you should be able to use Windows Sockets to send the packet, not at all unlike sending data to those cute little blinky lights.

Steven G. Blank
Ξ SGBlank Consulting

On 1/25/2023 7:52 PM, sherman levine wrote:
Todd
Lots of interesting possibilities there
Thanks

Sherm


On Jan 25, 2023, at 22:12, Todd Baremore <tbaremor@...> wrote:

Sherm,

Not sure if this applicable......

From https://forum.inductiveautomation.com/t/send-zpl-command-to-zebra-170pax4-via-tcp-ip-socket/6003/6
----------------------------------------------------------------------------------------------------------------------------------------------------------
Sorry for the Delay been busy, changing the script to utilize the Java socket work and now I’m able to print without issues.
Bellow if a snip of the code if anyone needs it.

strMessage = “^XA^LH10,10^LRY^F010,45^AFN,20,20^FDHELLO^FS^XZ”
#========================================================================================
Send Data to Printer

#========================================================================================
port=9100
try:
# Open Socket Connection
clientSocket=Socket(strIP,port)
#Open data output stream
outToPrinter=DataOutputStream(clientSocket.getOutputStream())
#Send Data to Printer
outToPrinter.write(strMessage)
#close data stream and socket
outToPrinter.close();
clientSocket.close();
except IOError:
print “Error”

Todd

On 1/25/2023 2:51 PM, sherman levine wrote:
I know I can send ZPL to a shared Zebra printer by sending text output to a file named \\servername\printername or \\localhost\printername, however I now need to send ZPL to a printer which simply has an IP address on a network.

What would be the best way to accomplish that from a Windows workstation?

Thank you

Sherm










sherman levine
 

Steve,
Thank you. That's what the ethernet version of the printer is supposed to do, and I'll try the Chlkatsoft product.  I'm hoping that I can use the Windows lpr command to accomplish the same thing.  It's available on my 64bit Win10 computer after I turn it on in Windows Features.

https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/lpr

Sherm

On 1/26/2023 2:12 PM, Steven Blank wrote:
Sherm,

Does the Zebra printer "listen" on a certain TCP/IP port? If so, you should be able to use Windows Sockets to send the packet, not at all unlike sending data to those cute little blinky lights.

Steven G. Blank
Ξ SGBlank Consulting


On 1/25/2023 7:52 PM, sherman levine wrote:
Todd
Lots of interesting possibilities there
Thanks

Sherm


On Jan 25, 2023, at 22:12, Todd Baremore <tbaremor@...> wrote:

Sherm,

Not sure if this applicable......

 From https://forum.inductiveautomation.com/t/send-zpl-command-to-zebra-170pax4-via-tcp-ip-socket/6003/6
----------------------------------------------------------------------------------------------------------------------------------------------------------

Sorry for the Delay been busy, changing the script to utilize the Java socket work and now I’m able to print without issues.
Bellow if a snip of the code if anyone needs it.

strMessage = “^XA^LH10,10^LRY^F010,45^AFN,20,20^FDHELLO^FS^XZ”
#========================================================================================
Send Data to Printer

#========================================================================================
port=9100
try:
# Open Socket Connection
clientSocket=Socket(strIP,port)
#Open data output stream
outToPrinter=DataOutputStream(clientSocket.getOutputStream())
#Send Data to Printer
outToPrinter.write(strMessage)
#close data stream and socket
outToPrinter.close();
clientSocket.close();
except IOError:
print “Error”

Todd

On 1/25/2023 2:51 PM, sherman levine wrote:
I know I can send ZPL to a shared Zebra printer by sending text output to a file named \\servername\printername or \\localhost\printername, however I now need to send ZPL to a printer which simply has an IP address on a network.

What would be the best way to accomplish that from a Windows workstation?

Thank you

Sherm