Printing barcode to Zebra printer SerialPort Com

can you help with an example I want to print barcode

https://docs.inductiveautomation.com/display/DOC79/Labels+with+Embedded+Barcodes

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

Regards

You will need the serial module installed for this.

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')
1 Like

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

The serial module is a separate purchase from the standard Ignition package.

A walkthrough on how to install a module can be found at Inductive University.

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. :slight_smile:

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