# Printing barcode to Zebra printer SerialPort Com

**URL:** <https://forum.inductiveautomation.com/t/printing-barcode-to-zebra-printer-serialport-com/22742>\
**Category:** General Discussion\
**Tags:** ignition79\
**Created:** [February 20, 2019, 11:26pm UTC](https://forum.inductiveautomation.com/t/printing-barcode-to-zebra-printer-serialport-com/22742 "2019-02-20T23:26:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ernesto.espino](https://avatars.discourse-cdn.com/v4/letter/e/9de0a6/32.png) [@ernesto.espino](https://forum.inductiveautomation.com/u/ernesto.espino)\
**Post date:** [February 20, 2019, 11:26pm UTC](https://forum.inductiveautomation.com/t/printing-barcode-to-zebra-printer-serialport-com/22742/1 "2019-02-20T23:26:35Z")

</div>

can you help with an example I want to print barcode

---

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [February 20, 2019, 11:37pm UTC](https://forum.inductiveautomation.com/t/printing-barcode-to-zebra-printer-serialport-com/22742/2 "2019-02-20T23:37:15Z")

</div>

[https://docs.inductiveautomation.com/display/DOC79/Labels+with+Embedded+Barcodes](https://docs.inductiveautomation.com/display/DOC79/Labels+with+Embedded+Barcodes)

---

<div class="post-metadata">

**Author:** ![ernesto.espino](https://avatars.discourse-cdn.com/v4/letter/e/9de0a6/32.png) [@ernesto.espino](https://forum.inductiveautomation.com/u/ernesto.espino)\
**Post date:** [February 20, 2019, 11:51pm UTC](https://forum.inductiveautomation.com/t/printing-barcode-to-zebra-printer-serialport-com/22742/3 "2019-02-20T23:51:23Z")

</div>

Thanks and You will have an example with serial port and zpl language?

Regards

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 21, 2019, 2:08am UTC](https://forum.inductiveautomation.com/t/printing-barcode-to-zebra-printer-serialport-com/22742/4 "2019-02-21T02:08:11Z")

</div>

You will need the serial module installed for this.

```python
serialnum = '12345678'
partnum = '4CJ9876'

zpl = '~JA^XA^BY3,3,60^FT015,110,^BCN,N,N,N,N^FDP' + partnum + '^FS^FT120,030^A0N,40,45^FDP' + partnum + '^FS^FT015,250,^BCN,N,N,N,N^FDS' + serialnum + '^FS^FT120,180^A0N,40,45^FDS' + serialnum + '^FS^PQ1,0,0,N,^XZ'

# Configure serial port
system.serial.configureSerialPort(\
port="COM1",\
bitRate=system.serial.BIT_RATE_9600,\
dataBits=system.serial.DATA_BITS_8,\
handshake=system.serial.HANDSHAKE_NONE,\
hardwareFlowControl=False,\
parity=system.serial.PARITY_NONE,\
stopBits=system.serial.STOP_BITS_1)

# Open serial port
system.serial.openSerialPort('COM1')

# Write ZPL data to serial port
system.serial.write('COM1', zpl)

system.serial.closeSerialPort('COM1')
```

---

<div class="post-metadata">

**Author:** ![ernesto.espino](https://avatars.discourse-cdn.com/v4/letter/e/9de0a6/32.png) [@ernesto.espino](https://forum.inductiveautomation.com/u/ernesto.espino)\
**Post date:** [February 21, 2019, 3:14am UTC](https://forum.inductiveautomation.com/t/printing-barcode-to-zebra-printer-serialport-com/22742/5 "2019-02-21T03:14:55Z")

</div>

> [@JordanCClark](#):
>
> serial module

thank you very much, finally where I install the serial module?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 21, 2019, 3:44am UTC](https://forum.inductiveautomation.com/t/printing-barcode-to-zebra-printer-serialport-com/22742/6 "2019-02-21T03:44:57Z")

</div>

The serial module is a [separate purchase](https://inductiveautomation.com/pricing/ignition) from the standard Ignition package.

A walkthrough on how to install a module can be found at [Inductive University](https://www.inductiveuniversity.com/video/installing-or-upgrading-a-module/7.9?r=%2Fvideo%2Fsearch%2F%3Fq%3Dmodule%26checked_topics%3D).

I highly recommend that you go through the free courses available at Inductive University to familiarize yourself with the software. It seems like you are trying to dive into the deep end of the pool. 🙂

---

<div class="post-metadata">

**Author:** ![ernesto.espino](https://avatars.discourse-cdn.com/v4/letter/e/9de0a6/32.png) [@ernesto.espino](https://forum.inductiveautomation.com/u/ernesto.espino)\
**Post date:** [February 21, 2019, 4:14am UTC](https://forum.inductiveautomation.com/t/printing-barcode-to-zebra-printer-serialport-com/22742/7 "2019-02-21T04:14:35Z")

</div>

> [@JordanCClark](#):
>
> The serial module is a [separate purchase](https://inductiveautomation.com/pricing/ignition) from the standard Ignition package.
> 
> A walkthrough on how to install a module can be found at [Inductive University](https://www.inductiveuniversity.com/video/installing-or-upgrading-a-module/7.9?r=%2Fvideo%2Fsearch%2F%3Fq%3Dmodule%26checked_topics%3D).
> 
> I highly recommend that you go through the free courses available at Inductive University to familiarize yourself with the software. It seems like you are trying to dive into the deep end of the pool.

If I am new with this software, thank you for your help:smiley:😃😃
