Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zebra Printers and VB6 - Printer Object/ZPL

Status
Not open for further replies.

UncleCake

Technical User
Feb 4, 2002
355
US
HI, For the past 10 or 15 years we have used two Zebra label printers hooked up to a computer via serial port and have sent ZPL to it. We have now decided to upgrade to newer Zebra printers so we can print images on the labels, which have pretty much done what I planned, but I am running into some complications. The new printers are hooked up with a network card.

With the new printers I have just used VB6’s printer object and set X and Y coordinates to print my text and bar codes on the labels. I am not going to get into the issues that I am having, because I don't think it is relevant (but if you think so I will post it).

My main question is everything I read says to write the txt file and send ZPL to the printer. Why is this used instead of VB6's printer object? I have about 80 users that send print jobs to these printers and wondered if creating a ZPL file was a better way of printing.
 
Yes, ZPL is native to Zebra's.
You should find it prints much faster as well.
the easiest way to create ZPL is by using a label design program for your Zebra printer and then Print to a txt file. Design your label as normal. Use Native Zebra built in Fonts (not True Type Fonts) Print the label as normal to get it correct then when its all correct print to file.

then you use this FAQ for specific details faq694-2608

DougP, MCP, A+
 
I have just bought a Zebra TLP2844 Label printer, have had some experience programming serial label printers before using an vb6 stk supplied by the makers. However I am having a deal of problems getting my VB6 app printing to this device, UncleCake you seem to have it cracked can you throw me a bone in the form of some vb6 code I recon if I can jut get it to print a barcode and some text I can crack it.
 
Be careful!

As I understand it, the TLP2844 models only speak EPL while the TLP2844-Z models speak ZPL2. The languages are different. Verify your printer model and supported language in its firmware.

Jim Asman
 


I have been firing code at this TPL2844 all night and it just sits there, I called Zebra who told me to go back to the supplier who then direct me to the Zebra website. I know the printer works because I can print from the Zebra software so what am I doing wrong I can anone help?


This is my code


Text2.Text contains one line at a time of the following three lines

N
B100,100,0,RL,4,4,40,B,"1234567890"
P

Private Sub Command1_Click()
With MSComm1
'make sure the serial port is open
If .PortOpen = False Then .PortOpen = True
.CommPort = 1
'set the badurate,parity,databits,stopbits for the connection
.Settings = "1200,N,7,1" ‘same as Zebra use
'set the DRT and RTS flags
.DTREnable = True
.RTSEnable = True
'enable the oncomm event for every reveived character
.RThreshold = 1
'disable the oncomm event for send characters
.SThreshold = 0
'open the serial port
.PortOpen = True
'send the data (including a tailing carriage return as often needed)
.Output = Text2.Text & vbCr
End With 'MSComm1
Dim intoone As String
intoone = Text2.Text
With Text2
'place the focus back to the textbox
.SetFocus
'select the current text to be overwritten
.SelStart = 0
.SelLength = Len(.Text)
End With 'Text1
End Sub
 
Yes this is EPL and I have discovered that I may have been miss sold the product.

I baught this printer expressly on the advice of EPOS Logic I asked for a printe with an VB5 or 6 STK, I got the TPL 2844 after hours of messing about I installed the Zebra Pro software which installed a print driver the printer works fine! with it's own driver however I get error 8015 telling me a paramiter is incorrect from my v code opening com1. Great I recomend if you want to use this great little printer with VB forget it unless you want a good deal of messing about. if anone knows better please let me know before I strangle EL
 
Yes I tried many combinations from the programming manual

then tried copy barcode.txt com1 nothin happend untill i instal the zebra com port driver then it copy barcode.txt com1 works fine only problem my vb application cant talk to the com port error 8015 ouch.
 
EPL commands require a lf termination. cr is optional.
Also, it's good practice to send a cr/lf first.

Change the following line and see if it helps.
.Output = vbCrLf & Text2.Text & vbCrLf


Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top