# Send ZPL command to Zebra 170PAX4 via TCP/IP Socket

**URL:** <https://forum.inductiveautomation.com/t/send-zpl-command-to-zebra-170pax4-via-tcp-ip-socket/6003>\
**Category:** Ignition\
**Created:** [March 10, 2013, 3:03am UTC](https://forum.inductiveautomation.com/t/send-zpl-command-to-zebra-170pax4-via-tcp-ip-socket/6003 "2013-03-10T03:03:02Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![jmonter](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@jmonter](https://forum.inductiveautomation.com/u/jmonter)\
**Post date:** [April 22, 2013, 9:08pm UTC](https://forum.inductiveautomation.com/t/send-zpl-command-to-zebra-170pax4-via-tcp-ip-socket/6003/7 "2013-04-22T21:08:08Z")

</div>

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”

---

_[View the full topic](https://forum.inductiveautomation.com/t/send-zpl-command-to-zebra-170pax4-via-tcp-ip-socket/6003)._
