# 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:** 22

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 21, 2018, 3:05am UTC](https://forum.inductiveautomation.com/t/send-zpl-command-to-zebra-170pax4-via-tcp-ip-socket/6003/22 "2018-09-21T03:05:18Z")

</div>

Put something like this in a project script:

```auto
import socket, sys
def sendToZebra(payload):
	zebraAddr = ('10.50.100.250', 6101)
	try:
		s = socket.connect(zebraAddr)
		s.sendAll(payload)
	finally:
		s.close()

```

Then call it from your button event like so:

```auto
project.zebra.sendToZebra("^XA^WD^XZ")

```

Not tested precisely as above, but I use this pattern at a customer site. NOTE: No driver required.

---

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