LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Zebra printer - Printing from LabVIEW using ZPL commands....

Here is the PID and VID for the TLP2824: "USB\VID_0A5F&PID_00A1.DeviceDesc="ZTC TLP 2824 Plus". I would not use EPL as suggested above. That is not the issue that you are having. Prior to creating your own USB driver and using NI-VISA (which does work but can be a little harder to manage if you are using multiple printer types) you could try chaging the settings on your Zebra driver to make it a raw printer connection.  I have not tried this with the USB port but it generally works for a networked printer. The driver is changing the output of our data which results in the printer not seeing correctly formatted ZPL.

 

Also, the NI Report VIs do not play well with Zebra printers. They also modify the data which results in incorrectly formatted ZPL commands. Your best option is to send the data directly to the printer either confiuring the printer as a raw device or by using NI-VISA.



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
Message 11 of 163
(9,971 Views)

I have read several of your post about using VISA with a Zebra printer and I have not been able to make my application print. I have a LP2844 printer and have had success with using VISA on LPT1. I would like to use the USB to eliminate the bulky cable. When I substitute the VISA resource name with the USB printer name (ZDesigner LP 2844) I get an error -1073807343 VISA:  (Hex 0xBFFF0011) Insufficient location information or the device or resource is not present in the system. I don't know what more information I need to supply.

0 Kudos
Message 12 of 163
(9,944 Views)

You need to create a driver using the NI Driver Wixard in order to use USB. The vendor ID is 0x0A5F and the PID for the LP2844 is 0x0027. Using the driver wizard this driver will be installed for you. If you need to distribute this driver let me know. there is a second step you need to do in order to install the driver on other machines. Your VISA resourve name will be in the following format: "USB::0x%04x::0x%04x::%s::RAW" where the first argument is the VID, the second is the PID and the third is the device serial number.



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 13 of 163
(9,937 Views)

Thanks for your support but customer wants to use the com port for printer control.  Will try on next visit.

0 Kudos
Message 14 of 163
(9,934 Views)

Then that is even easier. Simply use the VISA open on the appropriate port and send the label format to the printer. You can both print and use the port to control the printer. Or are you saying that they will have two applications talking to the printer at the same time?

 

Regardless, LabVIEW is capable of directly communicating with any supported port of a Zebra printer. And given that most uses of the printer only use a hand full of unique labels it is very easy to define those using ZPL. (EPL if it is an older printer which does not support ZPL.) Communicating directly with the printer is more efficient and reliable in the end.



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 15 of 163
(9,931 Views)

Here is an example VI for opening the connection to the printer as well as a driver file which will work on Win XP systems and lower. The driver file is different for Win 7.

 

The ForceINF.zip file is the means to actually install the driver. I will have to package up the variant of this application if you need a better tool for adding the driver. Essentially when you plug the printer in you ignore the "New Hardware Detected" messgae you get from Windows. Run the ForceINF utility to call the dll with the appropriate USB information and you should be all set. The majority of Zebra printers install as unique instances so you would need to install the driver for each printer you have.

 

Note: Change the extension to "inf" for the Zebra_Printers file.



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
Message 16 of 163
(9,927 Views)

Can you save the vi in version 8.5?

0 Kudos
Message 17 of 163
(9,925 Views)

Here is the 8.5 version as well as the snippet.

 

PRINTING TO ZEBRA PRINTER.png

 

The %s in the resouce name needs to be replaced with the printer's serial number. You can find this on the printer's config label.

 

I should have also mentioned that you do need to install the inf file. Easiest way to do this is to simply right-click on it and select install. This only has to be done once but prior to using the ForceINF vi.



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 18 of 163
(9,922 Views)

I need more help. First, Windows detects the printer as soon as I turn it on and installs the drivers. Second, with the vis and inf files you sent me do I still need to create a VISA driver? Attached is a screen shot of the force inf.vi. Do I have the information correctly formatted? I don't get success when I run it. 

Maybe I need the installation process step by step.

0 Kudos
Message 19 of 163
(9,914 Views)

Here is the tool that I use to install our USB driver for Zebra printers. I would recommend that you remove any drivers currently installed (go to the device driver, selcet the printers and then select "uninstall drver"). After removing the driver unplug the printer's USB cable and plug it back in. When Windows pops up that it detected a new device cancel that dialog. Then run the utility I enclosed and select the appropriate printer model.



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 20 of 163
(9,901 Views)