07-02-2014 06:14 PM
ZEBRA LP 2844 EPL VISA RAW USB
Hello My name is Joe. This is my first Post ever. Don’t blow me up.
I have a Zebra LP 2844 Label printer that connects to some very old scales. The scales need to be setup in Line Mode (EPL I) and have a one time only EPL Setup string that is sent to them. The vendor who installed the system jumpered out the power switch, removed the power connection from the inside of the printer, and soldered the power supply output directly to the printer. They followed up by connecting the Power Supply to a UPS. We have about 50 of these printers. When they lose power you have to remove the serial cable, plug in a XP PC, and Hyper Terminal in to send the following one time only commands (OR ON POWER LOSS).
OEPL1
(ALT CODE 027)N5
(ALT CODE 027)M30
To make a long story short I spent two days reading through several threads about using Libusb-win32 and Labview to communicate raw to the printer as well as a VISA method. I wanted a way to Program these printers without having to use the Serial Port. After two days of reading I learned a lot, but no solution. I came up with the attached program. It will allow you to send raw setup commands to the printer, It also allows you to send raw EPLII code through the Test Text Box. I noticed alot of people used these printer or the LP 2844Z and thought I would post the program. If this was the incorrect way to go about this I apologize, Please don’t blow me up.
Here is brief description of the steps involved.
NI VISA Driver Wizard will not create a driver for this particular printer because it uses USB 1.0 and not USB 1.1 or higher.
In the wizard Device List find the printer. Copy the Vendor ID and Product ID. You can try click next but if it does not work choose other.
Under the Device List Select Other . Type in the Vendor and Product ID's and then click next to generate the drivers.
Install the drivers by selecting your device in the Device Manager, Righ Click Properties > Driver Tab > Update Driver > Browse > Let Me Pick > Have Disk > Browse to your driver. I tested the program in both XP and WIN7 That’s about it.
Check out the program it is basically VISA OPEN --> VISA WRITE --> VISA CLOSE
Some of the commands I could not get to work so I used the Zebra setup utility to send them to the printer while the printer was installed using the certified Zebra drivers.
I went into printer properties Devices and Printers --> Zebra Printer ---> Right Click ---> Printer Properties > Advanced Tab > Check Keep Printed Documents
then I went to C:\Windows\System32\Spool\Printers and copied the SPL file. I used VISA Write From File Block to Raw write the SPL file and it worked well I didn't change the extension or anything. Anyways hope this helps any LP 2844 \ Labview Users.
Written in LABVIEW 2013
Solved! Go to Solution.
10-01-2014 10:57 AM - edited 10-01-2014 10:58 AM
Can you please post your project for labview 2010 ? Thank you very much.
11-07-2014 11:05 AM - edited 11-07-2014 11:05 AM
This is very helpful information, thanks Joe. I had a similar problem with a Zebra TLP 2824 and I was having no luck figuring it out until I saw this. Thank you so much!
I went about it a little bit differently, but some of the steps are the same. I am posting here so in the future when someone does a google search for Zebra TLP 2824 LabVIEW they will find this thread and maybe it'll help them like yours helped me.
First, I created a .prn file by using Zebra Designer (free), setting up the correct label dimensions, and printing to file.
This saves a text file with the commands you can send directly to the printer to generate the label. I used dummy text as a placeholder so I could figure out how to build the string later in LabVIEW. I don't know how this would work with barcodes, for my purpose I am only using text so I didn't bother experimenting with it. It might be fun, so maybe I'll try that next. I opened the .prn file in a text editor and copied the commands into a LabVIEW string constant (you can also read the text from the file, but I want to be able to dynamically change text values and number of lines, etc.)
To communicate with the printer, I went into the NI-VISA Driver Wizard, took note of the PID and VID
You'll get a warning about adding a device that isn't plugged in, click OK to continue. Add the Vendor ID and Product ID from the device, enter the manufacturer name and model name, and click Next.
You'll then choose a save location, and NI will generate the driver files. On the next screen, you will be given some options for installation. Since I was having no luck adding the drivers through Windows, I let NI install them for me.
Let it do its thing and when it finishes, open up MAX and you'll see your device listed under Devices and Interfaces.
Then I ran a simple VISA Open-Write-Close with the string generated from my .prn file, and I got my label! The text you see in the snippet below will print a label that looks like the one from the first picture. Make sure you have a new line after the "P1" command at the end, otherwise it won't work.
I didn't need to do anything with the printer spooling, and I didn't need to uninstall the official Zebra drivers. But be aware, once you install the NI drivers for the device, you won't be able to print from the Zebra utility anymore unless you reinstall the Windows drivers. Your mileage may vary.
I hope this helps someone.
Thanks again SimonTheFurious!
12-22-2014 08:10 AM
How did you develop that string command(program)?
12-22-2014 10:21 AM
I used Zebra Designer (See the link in my post above) and set up the label as I wanted it (margins, size, layout, etc) and then clicked File>Print... and checked the "Print to File" option, which lets you save a *.prn file to your computer. You can open it in a text editor.
12-23-2014 01:33 AM
ok thank very much
03-15-2016 08:10 AM
Hello this is my second post ever.
I had to revisit my original project at work. The LP2844 is no longer manufactured, The GC420d is the replacement. I updated the program to work with that printer.
I added some bells and whistles for maintenance.
I also had alot of trouble getting the driver to install once the Zebra driver had been installed. No matter what I did windows would always install it as a printer with the Zebra certified drivers. There are many reasons why this happens which I will not discuss. However, I did notice that the NI-Visa Driver Wizard had no problem removing the certified drivers and foring the generated files to install.
After digging into some log files I found that the exact same functions that the NI-VISA Driver Wizard is performing can be replicated using Devcon.exe. Device Console. You will have to google how to get Devcon for yourself. It is included in the program as well.
I added a button that replicates this functionality of installing the printer for you.
I will attach a LV13 and a LV8.5 version However I have no way of testing the LV8.5 Version. I hope this helps people needing to work with Line Mode EPL LP2844 and GC420d over USB.
By the way the code is easily adaptable to working over the serial port as well.
03-15-2016 08:41 AM
Ok here are the attachments.
A few warnings
Devcon is being called through System Exec. If the folder you locate the progam in has a path with a name that is too long or has too many spaces devcon will fail when it is called.For instance if you rename the folder from Zprogrammer to Zprogrammer Folder this will cause it to fail because the command cant find the path to the inf. I didn't look into this I just discovered it because the exe would fail but the development version was fine. So I shortened the folder names to the executable and everything worked.
When you click add printer devcon does the following
Remove all devices with the current PID of the printer you have chosen
Rescan for devices
Update driver
Obviously the driver is not signed so it will warn you the first time you do this.
Other than that it should work fine.