Zebra RS232 Label Printer ZM400

I have built a project for work that reads speaker lines and tests continuity. Once the test is complete I print the time, date, and part number on a thermal label that gets put on a wiring harness. I have tried using the common thermal printer for labels from Sparkfun. While it kind of works, the print starts dark on the left and the right side is completely light and unreadable. If I just print on thermal receipt paper it works fine. I'd like to be able to connect to our company's Zebra label printer. I have an RS232 shield and would like any help connect a MEGA to the Zebra via the RS232 shield.

Here is the Zebra info I have:

Requirements

9 pin Null Modem serial cable or standard 9 pin cable with a Null Modem Adaptor
Printer configurations matched to the host. ZM Serial Communication Information Read More>>
Note: The printer has a 9 pin female connector.

Overview

The Z -Series printer comes standard with a 9 pin DTE serial connector. To properly use a serial connection the following parameters must be matched between the host and printer.

Baud Rate
Data Bits
Parity
Host Handshake

A NULL Modem cable is required so signals are properly routed between the host and the printer.

Once properly configured the printer should function without problems as the ZPL (or EPL) data should be received without corruption and the handshaking will prevent buffer overrun.

Any help would be greatly appreciated!

What's the problem ? You seem to have all the hardware required.

Note that you will need to output ZPL (Zebra Programming Language) code to the printer as it will not accept and print normal ASCII text.

Honestly not a real issue as of yet. I'm waiting on the null cable. My plan is to send the string for baud/data/parity, and then send the ZPL codes as per the examples to the printer and see what the result is. We'll see what happens. Just not sure exactly HOW.

dbirky:
I have built a project for work that reads speaker lines and tests continuity. Once the test is complete I print the time, date, and part number on a thermal label that gets put on a wiring harness. I have tried using the common thermal printer for labels from Sparkfun. While it kind of works, the print starts dark on the left and the right side is completely light and unreadable. If I just print on thermal receipt paper it works fine. I'd like to be able to connect to our company's Zebra label printer. I have an RS232 shield and would like any help connect a MEGA to the Zebra via the RS232 shield.

The Arduino HardwareSerial does not handle Hardware Handshaking. You will have to implement it yourself. I have added an interrupt driven CTS/RTS handshaking feature to the HardwareSerial core. If you want it send me a private message.

Chuck

dbirky:
Honestly not a real issue as of yet. I'm waiting on the null cable. My plan is to send the string for baud/data/parity, and then send the ZPL codes as per the examples to the printer and see what the result is. We'll see what happens. Just not sure exactly HOW.

Does it worked??
I'm trying similar thing here.
I'm using ZT230 printer which have serial port. When i send the zpl commands using "Direct Communication - ZDesigner" software from zebra, it prints the text properly. But same line of code when I send to printer, it does nothing.
I tried setting the printer in diagnostic mode and it printed exactly matching code for zdesigner's software and the ascii lines which i send thro' Arduino mega's serial1. But when diagnostic is OFF, printer does nothing.

Here's the line of code I'm sending thro' zdesigner and arduino.

^XA
^FO50,50^ADN,36,20^FDtest
^FS
^XZ

Btw, I have used max232 for communicating on serial port and it works fine as when i connect barcode scanner, i'm getting proper content.

Here's my arduino code:

#include <SPI.h>

void setup()
{
 Serial.begin(9600);
 Serial1.begin(9600);
 delay(1000);
 prnn();
}

void prnn()
{
 Serial1.println("^XA");
 Serial1.println("^FO50,50^ADN,36,20^FDtest");
 Serial1.println("^FS");
 Serial1.println("^XZ");
 delay(100);
}

void loop()
{
}

rpatil5541:
Does it worked??
I'm trying similar thing here.
I'm using ZT230 printer which have serial port. When i send the zpl commands using "Direct Communication - ZDesigner" software from zebra, it prints the text properly. But same line of code when I send to printer, it does nothing.
I tried setting the printer in diagnostic mode and it printed exactly matching code for zdesigner's software and the ascii lines which i send thro' Arduino mega's serial1. But when diagnostic is OFF, printer does nothing.

Here's the line of code I'm sending thro' zdesigner and arduino.

^XA
^FO50,50^ADN,36,20^FDtest
^FS
^XZ

Btw, I have used max232 for communicating on serial port and it works fine as when i connect barcode scanner, i'm getting proper content.

Here's my arduino code:

#include <SPI.h>

void setup()
{
Serial.begin(9600);
Serial1.begin(9600);
delay(1000);
prnn();
}

void prnn()
{
Serial1.println("^XA");
Serial1.println("^FO50,50^ADN,36,20^FDtest");
Serial1.println("^FS");
Serial1.println("^XZ");
delay(100);
}

void loop()
{
}

can you upload the full code for arduino uno to label printer?

hello, I'm new to the arduino world, they could print on zebra printers
through the serial port using RS232 shield?

davchino:
hello, I'm new to the arduino world, they could print on zebra printers
through the serial port using RS232 shield?

Yes, you can print to a Zebra printer assuming that you interface it correctly as the Arduino uses TTL voltage levels and the printer uses RS232.

I assume that you realise that you will need to use the standard Arduino Serial print functions to output the control codes and data to the Zebra printer as it will not support the Zebra directly.

hello UKHeliBob,You know where I can find or if you have examples to print on the zebra. Thanks in advance

As I said in reply to your PM

Is your problem communicating with the Zebra or programming the Zebra ?

My only experience with Zebra printers is on much larger systems where they were used to print patient identification bands on hospital systems ?

Have you tried searching the forum ?

Note what I say at the end of each post here.

Please stop sending me PMs and ask your questions here.

I tried this code but 14.2 reports a Serial1 not declared.

vicrivas:
I tried this code but 14.2 reports a Serial1 not declared.

Which board type do you have selected in the IDE ?

Please, has anyone managed to communicate the arduino with the zebra printer? I'm trying to send data to the printer but I can not seem to print, on the serial monitor or the puty the string is received but the printer does not receive the command.

What hardware do you have between the Arduino (TTL level signals) and the printer (RS232 level signals) ?

What exactly are you sending to the printer ?
The Zebra printers that I have experience of, but not using an Arduino, have their own command language

Dear UKHeliBob, good morning

I already work with the zebra but with the use of CLP and I have no problems when I use a PLC, but I can not do anything using the Arduino, I believe it should be something with the serial and for this reason I ask you for help if you had any experience with communication arduino x zebra.

I use the MAX232 with arduino one

Here's my code for analysis.

#include <SPI.h>

void setup ()
{
Serial.begin (9600);
}

void loop ()
{
if (Serial.available ()> 0)
{
char c = Serial.read ();
if (c == 'a') {
Serial.print ("^ XA");
Serial.print ("^ MMT");
Serial.print ("^ PW280");
Serial.print ("^ LL0120");
Serial.print ("^ LS0");
Serial.print ("FT189.454 A0I, 28.28; FH ^ FDTESTE ^ FS");
Serial.print ("PQ1,0,1, Y ^ XZ");
delay (1000);
}
}
}

Dear UKHeliBob, good morning

I already work with the zebra but with the use of CLP and I have no problems when I use a PLC, but I can not do anything using the Arduino, I believe it should be something with the serial and for this reason I ask you for help if you had any experience with communication arduino x zebra.

I use the MAX232 with arduino one

Here's my code for analysis.

#include <SPI.h>

void setup ()
{
Serial.begin (9600);
}

void loop ()
{
if (Serial.available ()> 0)
{
char c = Serial.read ();
if (c == 'a') {
Serial.print ("^ XA");
Serial.print ("^ MMT");
Serial.print ("^ PW280");
Serial.print ("^ LL0120");
Serial.print ("^ LS0");
Serial.print ("FT189.454 A0I, 28.28; FH ^ FDTESTE ^ FS");
Serial.print ("PQ1,0,1, Y ^ XZ");
delay (1000);
}
}
}

It looks like are using pins 0 and 1 to communicate with the printer via the MAX232. As you are also using the Serial monitor to enter commands. This combination may cause problems because pins 0 and 1 on most Arduinos are used by the hardware Serial interface, ie the Serial monitor.

As an experiment try using SoftwareSerial on 2 other pins to communicate with the MAX232. There are examples of using SoftwareSerial included with the IDE

Sorry for the delay but I was testing the code, I changed the code to send it through a button, but it still did not work

I changed the code to send it through a button,

Sorry, but I don't understand that.

Please post your revised code