03-09-2011 09:18 AM
This is the VI I created to print a barcode. I set up the font type and size and then sent to the printer. But LV does not print the right font. When I did the same format in WORD and print, WORD can print correctly.
The barcode font I used is not installed on the local PC, but it is available within the printer driver. I guess that's the reason why WORD can print all fine. WHY CANNOT LV?
Solved! Go to Solution.
03-09-2011 02:38 PM
What do you want your label to look like? Have you considered sending native ZPL to the printer. The printer will generate the appropriate barcode. In addition, this has the benefit of sending much less data to the printer itself. I suspect that you are not sending the correct data to the printer even though you are going through the printer's driver. From what I know about Word and Zebra printers is that there is an interface between Word and the print driver which exposes things like the available fonts on the printer as well as printer specific items such as cutter control. I don't think the report generation toolkit is robust enough to do this.
You may want to experiment though and change your report type to Word and create a Word template and use that. That may give you access to what you want.
The most reliable way though would be to use native ZPL and send that to the printer.
What model printer are you using?
03-09-2011 02:57 PM
I am using Zebra ZM400 model. It prints at 203dpi.
I dont' really know how to use native ZPL. I noticed that Zebra got a programming guild on their website, but it is like a huge book. I don't want to spend all that much time to learn another language. All I need is to print one of the fonts named 'ZB 128B 15mil' on the printer.
I tried to print from WORD template. But the trouble was the label size 2.5'' X 0.44'', every time printing from WORD template, it reports a margin error and that is just frustrating for other users.
Do you happen to have a LV implementation of native ZPL? Thanks any way for the help.
03-09-2011 03:44 PM - edited 03-09-2011 03:49 PM
I don't have a LabVIEW library to generate ZPL. However, if you could provide an example of what you want your label to look like I could probably create the ZPL format for you. Did you load a font on the printer or is this a built in font. (I confess that I don't know all the names of the built in fonts.) Or are you simply trying to generate a specific barcode type? If so, which barcode?
Are you simply trying to print a CODE 128 barcode?
03-09-2011 04:04 PM
The label size is 2.75''X0..44'', unprintable area is 0.06'' from each side.
I want to print 2 lines on the label: Line 1: the hunman-readable barcode and line 2 the barcode itself. The barcode font is a built-in font. When I printed from WORD, I refer to this font as 'ZB 128B* 15mil' and it prints.
I would appreciate it so much if you could come up a ZPL format for this.
03-09-2011 04:29 PM
Here is a format that should do what you want:
^XA
^COY,300
^LL90
^PW507
^LH0,0
^PR4
^LT0
^FO12,35^BCN,50,Y,Y^FD>:1234^FS
^PQ1
^XZ
In this format things you can adjust if this is not exactly what you want:
^FOx,y positions the barcode on the label. The units are dots.
The 50 in the ^BCN,50... is the height of the barcode in dots. Your total height is only 90 dots. Your label width is 507 dots.
The "1234" is your actual barcode data. Replace this with your data.
03-10-2011 09:13 AM
Mark,
I have a network printer. How do I send this string to the printer? I remember seeing someone post a vi about how to send command to Zebra printer, but having trouble to find the post now.
03-10-2011 11:00 AM
You can simply use TCP to establish a connection to the printer on port 9100. The printer is configured to automatically close connections that are idle after 5 minutes. If you are only sending the label occassionally then you should close the connection and reopen it when you send the next label. If you are sending a fairly steady stream of labels you can leave the connection open.
03-10-2011 12:11 PM
Mark,
That's incredible. It works perfect. Once you know it, it is so simple
Thanks so much.
P.S. I noticed you have been helping people here with the Zebra printing issues for years already. And that is incredible too. Thanks so much.
03-10-2011 01:57 PM
@MengHuiHanTang wrote:
Mark,
That's incredible. It works perfect. Once you know it, it is so simple
Thanks so much.
P.S. I noticed you have been helping people here with the Zebra printing issues for years already. And that is incredible too. Thanks so much.
Glad I could help out. Also, as a Zebra employee I feel I have an obligation to help people interface with our printers using LabVIEW.