LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

zebra serial question

While this isn't strictly a LabVIEW question I'll post it in the hopes that some of you have experience. I am trying to talk to a Zebra TLP3842 via a usb-serial adapter. I have successfully communicated with the printer through its own usb port, using the simple report vi's, but it seems very limited in what I can do that way, for instance sending a Zebra command string ends up just being printed as the string I sent, rather than sending it "raw". So, seeing some recommendations on here I got as usb-serial adapter. Unfortunately I seem to be missing something. When a send an example, copied from the programming manual, to the printer, all I get is a feed to the next label, ejecting the label without any printing. I know that the printer will print, both from the previous test with the USB connection and also from the self dump mode, but all I get through the USB-Serial path is a blank label.

 

The string, copied right from the ELP2 manual:

A50,150,0,4,1,1,N,"Example 4" <newline>    (the character for <newline> doesn't copy)

P1 <newline>

 

I've used both the simple serial example from the LabVIEW examples and have sent the string directly, via the VISA test panel in MAX. I did a loop back of my serial adapter to make sure it was sending. Both ends, computer and printer, are set to the same serial settings.

 

LabVIEW 2009

 

Thanks in advance

 

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 1 of 8
(5,345 Views)

Each com mandline must be terminated with a Line Feed (LF) character (Dec. 10). Most PC based systems send CR/LF when the Enter key is pressed. The Carriage Return (CR) character is ignored by the printer and can not be used in place of LF. The LF in \ codes display is equal to \n in Labview

Try this, set your send string to show`\`Codes display. Then paste in this string

 A50,150,0,4,1,1,N,"Example\s4"\nP1\n

It should do the trick

Message Edited by Coq Rouge on 09-25-2009 01:10 PM


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 8
(5,333 Views)
Thanks for the quick response, unfortunately that is what I meant by <newline>  the \n when in the "\ Codes display" mode.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 8
(5,326 Views)

Do you use the correct port, and serial settings? You can find the serial port in MAX. Then using USB to serial converters the port may get "any" number. It also change then you change USB port. Are you 100% sure the cable is correct? And also chEck once more that your control is in \ codes mode. I have wasted some time by assuming the setting(s) was correct.   

The default setting for your printer is this  (9600 baud, 8 bit word length, no parity, 1 stop bit, and

XON/XOFF).



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 4 of 8
(5,314 Views)

Thanks, I am sure that the comm port I'm using is the correct one. I also did a "dump" from the printer to confirm its port settings matched mine. Yes, Windows is annoying in assigning whatever port number it feels like, but I could ID the port in MAX, did a loopback by shorting pins 2 - 3, just don't know what I'm missing to actually get the printer to print rather than just feed a label out.

 

 

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 5 of 8
(5,306 Views)
Do you have some program from Zebra that you can use for testing. If you are able to use such a program with RS232 you know that the hardware is OK. It is a start. Perhaps use some RS232 spy program to have a look at the data going to the printer.


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 6 of 8
(5,300 Views)

Hi Putnam,

 

Try using portMon to see what is sent to the printer to help narrow this down. THe only thing I reameber about the Zebra printer was the right "font" was required to get the bar code code to print but I don't think that will help you at the moment.

 

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 8
(5,278 Views)

First this may seem like a silly question but have you verified that the printer you have uses EPL. That model printer comes in two flavors. One uses EPL for label formatting and the other uses ZPL. If it is an EPL printer as mentioned earlier all commands MUST be terminated with a carriage return ('\r') follwed by a line feed ('\n').

 

Try sending "UQ\r\n" to the printer. If it is an EPL printer it should return configuration data about the printer inclduing the model number and firmware version. If this fails then try sending "~hi" to the printer. If you get a reply to this it is a ZPL based printer.

 

You can download both the EPL and ZPL manuals at www.zebra.com.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 8 of 8
(5,274 Views)