Author Topic: Print Code 128 barcodes on EM205 thermal printer  (Read 1379 times)

0 Members and 1 Guest are viewing this topic.

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
Print Code 128 barcodes on EM205 thermal printer
« on: March 07, 2018, 02:09:44 am »
1. Need to print Code 128 barcodes on EM205 thermal printers. I am using arduino library here: https://github.com/adafruit/Adafruit-Thermal-Printer-Library

2. printer is EM205 running at 9600 baud rate. I am able to print characters & barcodes as attached.

3. barcode in pic is 14 characters max as u can see & below is code for that:

  printer.print(F("CODE128:"));
  printer.printBarcode("12345678901234", CODE128);

4. Problem is when i increase the characters to 15 or more, nothing prints. How to solve this? I need to printer around 55 characters.   
 

Online eliocor

  • Supporter
  • ****
  • Posts: 519
  • Country: it
    • rhodiatoce
Re: Print Code 128 barcodes on EM205 thermal printer
« Reply #1 on: March 07, 2018, 07:49:34 am »
The resolution of your printer is too low for printing a such long (large?) barcode!
Maybe you can create your barcode in graphic mode and send it to the printer through longitudinal printing (no limits in length)
Please take care that it will be rather difficult reading your 75chars CODE128 code with a standard reader: your code will be about 4 times larger than the 14chars one!!!

Otherwise, study how 2D codes work and develop a routine to graphically create them and how to dump them on the printer.

You can also set the command 'GW w n' (https://cdn-shop.adafruit.com/datasheets/CSN-A2+User+Manual.pdf page 43) to '2' instead of '3' like in the library:
https://github.com/adafruit/Adafruit-Thermal-Printer-Library/blob/master/Adafruit_Thermal.cpp
at line 258
Maybe you have to modify also the constant 'CODE128', but it depends on the version of the printer firmware: maybe this is the reason you can't print more than 14 chars barcode. See the manual and the .h file.
« Last Edit: March 07, 2018, 08:00:55 am by eliocor »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf