Welcome! Log In Create A New Profile

Advanced

Printing labels on a Zebra LP 2844 using Zebra EPL

Posted by DarrenF 
It took a bit of thinking about as I've not used the fOpen etc. commands before, but here it is - a simple working Zebra LP 2844 example using the Zebra EPL language commands:

// EXAMPLE - Printing a product label (with barcode) on a Zebra LP 2844

// Device name
glocalsDevice is string = "LPT1"

// String to send to printer
sMyString is string

// Port no. returned from fOpen
glocaliPort is int

// Open the file
glocaliPort = fOpen(glocalsDevice, foCreateIfNotExist)

IF ErrorOccurred THEN
	Error("Unable to contact the printer! ", ErrorInfo())
ELSE
	// Init the label
	sMyString = Charact(10) + "N" + Charact(10)
	fWrite(glocaliPort, sMyString)
	
	// Send text - Business name
	sMyString = "A230,5,0,3,2,2,N," + Charact(34) + "XYZ Cycles" + Charact(34) + Charact(10)
	fWrite(glocaliPort, sMyString)
	
	// Send text - Manufacturer name
	sMyString = "A230,45,0,3,1,1,N," + Charact(34) + "Shimano" + Charact(34) + Charact(10)
	fWrite(glocaliPort, sMyString)
	
	// Send text - Price
	sMyString = "A480,45,0,3,1,1,N," + Charact(34) + "1234.99" + Charact(34) + Charact(10)
	fWrite(glocaliPort, sMyString)
	
	// Send text - Product name
	sMyString = "A230,65,0,3,1,1,N," + Charact(34) + "XT 32 hole hub" + Charact(34) + Charact(10)
	fWrite(glocaliPort, sMyString)
	
	// Send text - Product Barcode
	sMyString = "B245,90,0,E30,3,5,70,B," + Charact(34) + "123456789012" + Charact(34) + Charact(10)
	fWrite(glocaliPort, sMyString)
	
	// Send text - web address
	sMyString = "A250,185,0,3,1,1,R," + Charact(34) + "www.xyzcycles.co.uk" + Charact(34) + Charact(10)
	fWrite(glocaliPort, sMyString)
	
	// Send P1 print buffer contents
 	sMyString = "P1" + Charact(10)
	fWrite(glocaliPort, sMyString)

	// Close the file
	fClose(glocaliPort)
END
Marcelo Brazil
Re: Printing labels on a Zebra LP 2844 using Zebra EPL
May 12, 2012 06:16PM
Thanks, thanks, many thanks.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: